Optimized YOLOv8 for Lightweight and High-Precision Metal Surface Defect Detection in Industrial Applications
Abstract
In the metal industrial manufacturing process, surface defect detection is critical because these defects can seriously affect material quality and production efficiency. In recent years, although deep learning technology has made significant advances in the field of surface defect detection for images, it still faces many challenges in metal surface defect detection, such as high variability and sample imbalance. To address these challenges, this paper proposes an improved algorithm based on YOLOv8. First, this paper designs the C2f_GhostDynamic module, which reduces model size and computational overhead, lowering hardware requirements and energy consumption, making the model more suitable for deployment on embedded devices. Secondly, the CARAFE algorithm replaces the traditional upsampling method, expanding the model’s receptive field and enhancing feature extraction and fusion capabilities. Additionally, the RFAHead module was designed as the detection head, with RFAConv improving the model’s detection accuracy. At the same time, the SPPELAN pyramid pooling structure was introduced, combining multi-scale pooling and local attention mechanisms to generate more expressive feature maps. Finally, AKConv replaces traditional convolution operations, enabling adaptive adjustment of kernel size based on defect features and shapes, further reducing model size and improving performance. Experiments on the public NEU-DET dataset show that the improved model, compared to the baseline, reduces parameters by 9.2% , FLOPs by 31.7%, and increases mAP50 by 1.7 to 79.3%. Additionally, the model’s detection speed reaches 38 frames per second, meeting the requirements for real-time detection. Code is available at https://github.com/IamSunday/YOLOv8-Steel-Detection .
Cite
Text
Li et al. "Optimized YOLOv8 for Lightweight and High-Precision Metal Surface Defect Detection in Industrial Applications." Machine Learning, 2025. doi:10.1007/S10994-025-06857-3Markdown
[Li et al. "Optimized YOLOv8 for Lightweight and High-Precision Metal Surface Defect Detection in Industrial Applications." Machine Learning, 2025.](https://mlanthology.org/mlj/2025/li2025mlj-optimized/) doi:10.1007/S10994-025-06857-3BibTeX
@article{li2025mlj-optimized,
title = {{Optimized YOLOv8 for Lightweight and High-Precision Metal Surface Defect Detection in Industrial Applications}},
author = {Li, Ruiping and Zhao, Linchang and Wei, Hao and OuYang, Bocheng and Zhang, Mu and Fang, Bing and Hu, Guoqing and Tan, Jin},
journal = {Machine Learning},
year = {2025},
pages = {226},
doi = {10.1007/S10994-025-06857-3},
volume = {114},
url = {https://mlanthology.org/mlj/2025/li2025mlj-optimized/}
}