An Improved YOLOv8-Based Algorithm for Industrial Metal Surface Defect Detection
Download PDF

Keywords

Deep learning
Defect detection
YOLOv8
Feature extraction
Multi-scale feature fusion

DOI

10.26689/jera.v10i4.14893

Submitted : 2026-04-22
Accepted : 2026-05-07
Published : 2026-05-22

Abstract

To address challenges in industrial metal surface defect detection, including tiny defects, significant scale variation, and complex backgrounds, this study proposes an enhanced YOLOv8s-based model, termed MEAF-YOLOv8s. Based on the original YOLOv8s architecture, the model introduces several improvements to enhance feature extraction and multi-scale representation. First, a CSP-MSEE module is incorporated in the feature extraction stage to strengthen the capture of edge and detail information of tiny defects, thereby effectively alleviating the problem of insufficient feature representation for small targets. Second, an AFRBN module is introduced to establish long-range spatial dependencies. By leveraging global contextual information, the module suppresses texture background interference, while a re-parameterization strategy is adopted to maintain the lightweight nature of the model and ensure that inference efficiency is not compromised. In addition, a CA-HFPN feature fusion structure is employed, which incorporates a direction-aware coordinate attention mechanism and a hierarchical pyramid architecture to promote precise cross-scale feature alignment and adaptive fusion, thereby improving the model’s adaptability and localization accuracy for defects of different sizes. To evaluate the proposed method, experiments are carried out on seven common defect types collected from real industrial environments. The results indicate that MEAF-YOLOv8s improves mAP50 by 4.72% and mAP50-95 by 1.28%, while decreasing the number of parameters by approximately 5M. These findings confirm that the proposed model can effectively enhance defect detection performance under complex background conditions.

References

Li Z, Gao C, Lv X, et al., 2023, A Review of Metal Material Surface Defect Detection based on Deep Learning. Manufacturing Technology & Machine Tool, 2023(6): 61–67.

Wang H, Yang C, Lv Q, 2022, A Review of Metal Surface Defect Detection Methods based on Machine Vision. Micro/Nano Electronics and Intelligent Manufacturing, 4(4): 71–81.

Sun M, Cheng X, Wang Y, et al., 2016, Surface Defect Detection Method for High-Speed Railway Rails based on Photoacoustic Signals. Acta Physica Sinica, 65(3): 351–360.

Chen Y, Xin Y, 2016, An Efficient Infrared Small Target Detection Method based on Visual Contrast Mechanism. IEEE Geoscience and Remote Sensing Letters, 13(7): 962–966.

Girshick R, Donahue J, Darrell T, et al., 2014, Rich Feature Hierarchies for Accurate Object Detection and Semantic Segmentation, 2014 IEEE Conference on Computer Vision and Pattern Recognition, 580–587.

Ren S, He K, Girshick R, et al., 2017, Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks. IEEE Transactions on Pattern Analysis and Machine Intelligence, 39(6): 1137–1149.

He K, Gkioxari G, Dollár P, et al., 2017, Mask R-CNN, 2017 IEEE International Conference on Computer Vision (ICCV), 2980–2988.

Redmon J, Divvala S, Girshick R, et al., 2016, You Only Look Once: Unified, Real-Time Object Detection, 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 779–788.

Liu W, Anguelov D, Erhan D, et al., 2016, SSD: Single Shot MultiBox Detector, Lecture Notes in Computer Science, 21–37.

Yang L, Zhang Y, Wang T, et al., 2021, Steel Surface Defect Detection Method based on Improved Faster R-CNN. Journal of Jilin University (Information Science Edition), 39(4): 409–415.

Huang F, Li Y, Guo L, et al., 2020, Surface Defect Detection Algorithm for Parts based on Faster R-CNN. Journal of Computer-Aided Design & Computer Graphics, 2020(6): 883–893.

Cheng J, Duan X, Zhu W, 2021, Metal Surface Defect Detection based on Improved YOLOv3. Computer Engineering and Applications, 57(19): 252–258.

Cao Y, Wu M, Xu L, 2023, Steel Surface Defect Detection based on Improved YOLOv5 Algorithm. Journal of Graphics, 44(2): 335–345.

Zhang T, Pan P, Zhang J, et al., 2024, Steel Surface Defect Detection Algorithm based on Improved YOLOv8n. Applied Sciences, 14(12): 5325.

Vaswani A, Shazeer N, Parmar N, et al., 2017, Attention is all you Need, 31st International Conference on Neural Information Processing Systems (NIPS’17), 6000–6010.

Jocher G, Chaurasia A, Qiu J, 2023, Ultralytics YOLO (Version 8.0.0).

Guo J, Chen X, Tang Y, et al., 2024, SLAB: Efficient Transformers with Simplified Linear Attention and Progressive Re-Parameterized Batch Normalization, International Conference on Machine Learning.

Hou Q, Zhou D, Feng J, 2021, Coordinate Attention for Efficient Mobile Network Design, 2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), 13708–13717.

Chen Y, Zhang C, Chen B, et al., 2021, Accurate Leukocyte Detection based on Deformable-DETR and Multi-Level Feature Fusion for Aiding Diagnosis of Blood Diseases. Computers in Biology and Medicine, 2024(170): 107917.