# McAW-YOLO: An Efficient Detection Model for Ceramic Tile Surface Defects
## 3 MCAW-YOLO Network Model
### MobileViTv3 Block  
In tile-defect detection, the model needed to analyze and process the surfaces of the tiles to identify defect structures. In order to extract global information on defects during the detection process, researchers had proposed the vision transformer. However, the vision transformer required self-attention calculations between each pixel, which had limitations in capturing location and spatial structures, and the vision transformer had many parameters. Therefore, this paper introduced the lightweight MobileViTv3 block [18] to alleviate the drawbacks. The structure of the MobileViTv3 block is shown in Figure 2, and mainly included the local representation module, global representation module, and fusion module.  
The shape of the input feature map was \(C_{in}\times W\times H\), where \(C_{in}\) represented the number of input channels, and W and H represented the height and width of the feature map, respectively. Firstly, the local representation module processed the input feature map to extract features. This module comprised two sub-modules: depth-wise separable convolution (DWConv) and standard convolution (Conv). Depth-wise separable convolution could independently perform convolution calculations on input channels, reducing the computational cost of the model. Convolution integrated channel information while changing the dimensions of the features. Secondly, the global representation module was used to extract the global information of the defects. This module consisted of a transformer mod  
Figure 1: MCAW-YOLO architecture.  
ule and a convolution module. The transformer component performed global self-attention calculations on the input feature map to capture the global information of the input. Convolution was used to change the feature dimension, preparing for concatenation in the fusion module. The fusion module concatenated the outputs of the local representation module and the global representation module to fuse their information, capturing both the overall characteristics of the defects and compensating for the shortcomings of the transformer in capturing location and spatial information. Convolution was used to perform convolution operations on the concatenated feature map, improving the expressive power of the model. Finally, the output of the fusion module was added to the original input feature map to obtain the final output feature map, which had the shape of \(C_{out}\times W\times H\).  
Compared to the traditional direct use of the transformer module, the MobileViTv3 block embedded the transformer module into the convolution operation, which could significantly reduce the number of parameters. At the same time, the MobileViTv3 block used the transformer to replace local modeling with global modeling in convolution, combining the advantages of spatial induction bias in convolution and global processing in ViT. As a result, the MobileViTv3 block possessed the properties of both CNN and ViT, alleviating the disadvantages of convolution's inability to capture long-range information and the shortcomings of ViT in capturing location and spatial structure. By introducing the MobileViTv3 block, the network could consider global information such as the shape, size, and position of tile defects, enabling better capture of the image's positional and spatial structural information. This helped the model better understand the tiles' overall shape and surface features, improving the accuracy, robustness, and classification accuracy of tile-defect detection.