## 3 Glass Surface Defect Dataset (GSDD)  
The image processing is the most important and challenging part of surface defect inspection. The defects are usually darker or brighter than the surrounding background. There can be faker defects like dusts and the image quality can also be affected by non-uniform illumination and a complex texture. The defect detection goal is finding an accurate, efficient, and flexible detection method to meet the production requirements.  
Traditional defect detection steps include background correction, contrast enhancement, imaging filtering, morphological operation, segmentation, feature extraction, and classification. All the features and thresholds must be hand-crafted by an experienced engineer. Learning-based classifiers, such as decision tree, SVM, or random forest, are always utilized for defect classification. It is not flexible and versatile enough when the inspection system must be adapted to some different products. The development cycles can also be very long. The classic machine-vision methods are sufficient for some less complicated task, but it is a big challenge for images with an unevenly distributed texture and non-defective random speckles on transition zones, which can essentially increase the misrecognition rate. Deep-learning methods are more powerful than classical defect detection techniques. The image dataset is essentially important for the deep-learning method.  
The target of the segmentation task is computing the pixel-wise labels of target images. The original raw image size is 16,000*8092 and the resolution of the image containing glass information is 13,567*6548. It is not practical to directly annotate and train the images with such high resolution. Therefore, 276 images with the size of 600*600 were extracted from the glass image as the training samples, as shown in Figure 6. The neighboring sub-images are cut with a certain overlapping area, and the border region of the original image is extended by mirroring. Sometimes, the size of the defect can be  
Figure 5: Typical defect samples and corresponding ground truth defect images: (**a**,**b**) are respectively scratch defects and the corresponding ground truth annotations; (**c**,**d**) are respectively dent defects and the corresponding ground truth annotations; (**e**,**f**) are respectively discoloration defects and the corresponding ground truth annotations.  
even bigger than that of the overlapping region. When the defects of every sub-image are obtained, the coordinate distribution of the defects on the original image can be easily obtained. The neighboring defects will be merged according to the coordinate distribution, which would reduce the error caused by image cutting. In the practical production, the number of defects in a single raw image is always very small. In order to obtain enough defect images, more than 10,000 glass samples were captured by the CBF system and LABF system. The glass surface defect dataset (GSDD) consists of 34,550 images with 6742 positive samples and 27,808 negative samples, where every positive sample contains at least one defect, and the types of defects mainly consist of a scratch, dent, and discoloration. For every image, a pixel-wise annotation mask is provided by using the LabelMe annotation tool.