## 5 Experiments
### The Defection Detection Results  
An illustration of the segmentation results based on the classical machine vision method and proposed deep-learning method is presented in Figure 8. The acquired defect images of the dent, discoloration, and scratch in the green dashed boxes shown in (a), (b), and (c) are respectively the segmentation result samples based on the classical machine vision method and proposed method, and the non-defective speckle misjudged as the defect is shown in the red box. The deep-learning segmentation results are heat maps that denote the probabilities of pixels belonging to defects and the classical segmentation results are the binary images. For the dent defect image of Figure 8(a1) with an evenly distributed background and high variance, the classical method achieved a good performance. There are two scratches in Figure 8(a2), where one scratch is very obvious while the other shallow scratch looks very weak. It is very difficult to detect such a low-contrast defect because the lower threshold may increase the misjudgment in the classical method. Non-defective random speckle can be misjudged as flaws, as shown in Figure 8(a3). The MPBG contains 2.5D arc edges, which would cause an unevenly distributed texture and result in misjudgment in the classical method. For the discoloration defect in Figure 8(a4), only a small part of the defect is detected because the remaining region of the defect has a low variance value. The detection results show that the deep learning method can extract defects in the unevenly distributed texture. The proposed approach outperformed the classical method. The detection results of the three types of defects and background based on the proposed method are shown in Figures 9 and 10. The segmentation results of the scratch defects are shown in Figure 9, where scratches could appear on any part of the glass with different lengths and grayscale, and the weak shallow defects can be easily detected. Dent defect detection is the most challenging task for the classical machine vision method because of the tiny size, as shown in Figure 9, and another reason is the presence of tiny dust particles, which are point-like in shape just as some dent defects. The proposed method could essentially reduce the misjudgment rate of the dust particles. The characteristic of discoloration is that it shows various shapes and patterns, including a point shape, curve shape, or irregular shape, as shown in Figure 10. The experimental results show the proposed method can automatically extract higher-level features to detect such defects. The results of the background in  
Figure 8: Results of the defect detection: (**a**) acquired defect images of the dent, discoloration, and scratch in the green dashed boxes; (**b,c**) are respectively segmentation result samples based on the classical machine vision method and proposed method; the non-defective speckle misjudged as the defect is shown in the red box. Figure 10 demonstrate that even though different parts of the glass have different backgrounds and structures, the false positive number can be small. The images containing defects are defined as positive samples and the non-defective images are the negative images. The precision rate and recall rate are the most important evaluation criterions. They can represent the performance more accurately than the area under the curve (AUC) because of the large number of non-defective samples in GSDD. The precision P is defined as:  
\[\text{P}=\frac{\text{TP}}{\text{TP}+\text{FP}}, \tag{6}\]  
where the true positive (TP) means the number of correctly detected defect regions, and the false positive (FP) means the number of the background regions that are wrongly detected as defects. Recall is defined as:  
Figure 10: Segmentation results of discoloration defects and negative samples: (**a**,**b**) are the respectively acquired defect images and segmentation results of discoloration; (**c**,**d**) are the respectively acquired defect images and segmentation results of negative samples.