# McAW-YOLO: An Efficient Detection Model for Ceramic Tile Surface Defects
## 4 Experimental Results and Analyses  
### Dataset  
The dataset used in this study was sourced from the public datasets on the PaddlePaddle platform, maintained initially by the Tianchi Data Science Team [24]. This dataset comprised 3613 images stored in JPG format and was in standard RGB format. These images were captured under two different lighting conditions and encompassed eight distinct types of defects within the dataset. These defects included white-dot defects, light-block defects, dark-block defects, angle defects, edge defects, aperture defects, marker-pen defects, and scratch defects. White-dot defects referred to small, localized, and typically white-colored spots on the surfaces of ceramic tiles. Light-block defects involved irregular, light-colored patterns or blocks on the surfaces of ceramic tiles. Like light-block defects, dark-block defects featured irregular patterns or blocks on the tile's surface. However, in this case, the patterns were dark. Angle defects pertained to issues related to the corner of ceramic tiles. These defects may involve chipping, cracking, or irregularities at the tile's edges. Edge defects referred to irregularities or issues along the edges of ceramic tiles. These defects included chipping, cracking, or abnormalities along the tile's perimeter. Aperture defects involved irregularly-shaped or -sized openings or holes in the ceramic tiles. Marker-pen defects typically consisted of marks or stains made by marker pens on the surfaces of ceramic tiles. Scratch defects encompassed scratches or abrasions on the surfaces of ceramic tiles. White-dot defects were the most prevalent among these, totaling 1868 instances, whereas angle defects were less frequent, with only 410 instances.  
In the YOLOv5 model, the input image size was 640 pixels \(\times\) 640 pixels. However, most of the images in the dataset used for this study had dimensions of 2000 pixels \(\times\) 2000 pixels. Simply resizing the original images to a fixed dimension could lead to the loss of information, especially in detecting minor defects. Feeding the original images directly into the detection model could easily trigger memory overflow issues, hindering the model's normal training. Therefore, inspired by the approach used in YOLT [25], this paper adopted an offline sliding window cropping method. Images were divided from left to right and from top to bottom with a stride of 640 pixels. An overlap region with a 0.2 overlap ratio was established to ensure complete defect detection, resulting in a final dataset of 6712 images.  
Given the imbalance in the types of ceramic-tile defects, data-augmentation techniques such as horizontal flipping and mirror flipping were applied to images with fewer instances of defect types. Additionally, the copy-paste technique [26] was employed to expand the dataset due to minimal defects. This involved duplicating small ceramic-tile defect samples and pasting them into non-defective areas to increase the count of minor ceramic-tile defects. However, since the copy-paste method primarily catered to segmentation tasks requiring pixel-level annotation, this paper directly overlaid defect regions onto non-defective areas for defect-detection tasks. Random outward expansion was applied to the cropped areas to prevent the model from merely learning the boundaries of defect pasting. Finally, the average size and standard deviation of each defect type in the dataset were statistically computed, as presented in Table 1.  
This paper segregates the processed images based on defect types and lighting conditions to better assess the model's robustness and generalization capabilities. The division was carried out in a ratio of 8:2, randomly extracting images for the training and validation sets. The training set comprised 6674 images, while the validation set encompassed 1680 images.