# DEU-Net: A Multi-Scale Fusion Staged Network for Magnetic Tile Defect Detection
## 1 Introduction  
Surface defect detection plays a crucial role in assessing product quality in the manufacturing industry. With the development of computer vision, automated computer vision detection has become a significant form of improving industrial automation. However, most state-of-the-art defect detection algorithms based on computer vision rely on knowledge-based approaches [1, 2], involving feature extraction and classification. Traditional image processing algorithms for detection are inaccurate and inflexible. Therefore, a new approach is needed for surface defect detection. In the context of magnetic tiles, defect detection is particularly important due to the critical role these components play in the performance and safety of electric motors. Defects such as blowholes, breaks, cracks, frays, and uneven surfaces can severely compromise the lifespan of the motor and pose significant safety risks. Consequently, it is essential to thoroughly inspect magnetic tiles for defects before they are used in motors. In recent years, with the advancement of deep learning, deep learning models represented by convolutional neural networks (CNNs) [3] have demonstrated success across a range of computer vision domains, including face recognition and scene text detection. Surface defect detection based on deep learning has been able to fulfill many industrial requirements through classification, object detection, and semantic segmentation. Classification algorithms such as Visual Geometry Group (VGG) [4] can differentiate whether defects are present but cannot locate the defect's position. Object detection algorithms like Region-CNN (RCNN) [5] can locate defects and acquire their positions but cannot provide geometric information about the defects. Semantic segmentation algorithms likefully convolutional networks (FCNs) [6] can provide detailed segmentation information. Over the years, numerous deep learning algorithms, including DeepLab v3+, U-Net, U-Net++, Attention U-Net, Trans U-Net, and others, have been proposed to address semantic segmentation challenges [7; 8; 9; 10; 11; 12; 13]. In practical scenarios, pixel-level defect detection differs significantly from the semantic segmentation of natural images, mainly due to three reasons: (1) defects do not have a fixed shape and often exhibit extreme aspect ratios compared to common semantic segmentation images. (2) The pixel ratio between foreground and background images is extremely imbalanced. (3) Currently available datasets are relatively small, limiting the number of trainable annotated images. Therefore, a semantic segmentation model that performs well in natural image applications may not necessarily excel in defect detection scenarios. The challenge of obtaining industrial data adds complexity to the application of semantic segmentation in surface defect detection. While U-Net requires relatively few samples for network training to achieve high performance, its inefficient encoder cannot meet real-time requirements in industrial settings. To balance efficiency and accuracy, the proposed approach adopts the MBConv [14] block as the backbone for the encoder and decoder of the semantic segmentation model. In the decoder, a multi-layer output fusion technique is applied to better learn convolutional feature information from different levels. Pixel-level defect detection involves classifying each individual pixel in an image as defective or non-defective, allowing for the precise identification of anomalies at the most granular level. This method is crucial for applications requiring detailed inspection, such as identifying micro-cracks in materials. Semantic segmentation, on the other hand, assigns each pixel in an image to a specific category based on the object it belongs to. This technique is vital for tasks where understanding the context of each pixel contributes to overall image analysis, such as distinguishing between different types of defects.