EMA-YOLO: An Efficient, Lightweight Network for Surface Defect Detection on Metal Substrates
Abstract
To address the challenges of false positives caused by background interference and missed detections of minute defects in current metal substrate surface inspection, as well as the efficiency requirements of edge-oriented industrial inspection systems, this paper proposes an efficient and lightweight deep learning network named EMA-YOLO. To enhance the spatial resolution for detecting tiny defects while maintaining computational efficiency, the proposed network is built upon the YOLOv8m baseline architecture and is enhanced in four complementary aspects. Firstly, to suppress background noise such as water stains and oil residues and improve the discriminability of feature extraction, a C2f_EMA module is designed within the backbone network, which utilizes the Efficient Multi-Scale Attention (EMA) mechanism to aggregate cross-spatial information effectively. Secondly, to leverage shallow geometric details and mitigate the feature loss of early-stage pitting and micro-cracks in deep networks, a high-resolution P2 detection head for tiny objects is constructed, extending the feature pyramid to the $4\times $ downsampling layer. Simultaneously, to resolve the computational and memory-access overhead caused by high-resolution feature maps, a heterogeneous lightweight strategy based on Partial Convolution (PConv) and Depthwise Separable Convolution (DSConv) is proposed, which substantially reduces parameter redundancy while maintaining multi-scale feature representation capabilities. Finally, to improve localization accuracy for cracks with extreme aspect ratios and irregular spalling defects, the Shape-IoU loss function is adopted, optimizing bounding box regression by incorporating both shape and scale factors. The EMA-YOLO network was trained and evaluated using the SAFE-NET dataset. Experimental results demonstrate that the proposed EMA-YOLO achieves 77.2% Precision, 55.6% Recall, and 66.3% mAP@0.5, improving Precision, Recall, and mAP@0.5 by 4.9, 1.3, and 2.6 percentage points over the YOLOv8m baseline, respectively. While enhancing accuracy, the lightweight design reduces parameters and computational load by 7.2M and 13.0 GFLOPs, respectively, with an end-to-end single-frame inference time of only 9.25 ms. This network alleviates the trade-off between detection accuracy and computational efficiency, enabling efficient and robust detection of multi-scale defects on metal substrates. The measured latency indicates real-time potential under the current experimental platform, while future edge-oriented deployment still requires hardware-specific validation on embedded industrial devices.