重庆大学学报2026,Vol.49Issue(4):98-106,9.DOI:10.11835/j.issn.1000-582X.2026.02.009
一种改进YOLOv5s的金属表面缺陷检测算法研究
A detection algorithm based on YOLOv5s for metal surface defects
摘要
Abstract
Metal parts are widely used in various fields,and their surface defects usually distribute unevenly and some characteristics are weak,which often causes missing and false detection.To solve this problem,a YOLOv5s-MD algorithm is proposed.Aiming at the problem of complex features of metal surface defects,an improved spatial pyramid pooling module is introduced to improve the deep feature extraction for small targets of different sizes.To address the problem of feature dispersion and calculation increase,a lightweight attention mechanism and the GSConv module are added to improve the model's ability to effectively extract defect features at different sizes.For the boundary regression mismatch caused by irregular size information of metal surface defects,a loss function considering vector angle is adopted.The results show that the YOLOv5s-MD algorithm has an average accuracy of 75.3%in metal surface defect detection,which can effectively increase the detection accuracy and reduce the false detection rate for metal surface defects.关键词
金属表面缺陷/检测算法/YOLOv5s/深度学习Key words
metal surface defect/detection algorithm/YOLOv5s/deep learning分类
信息技术与安全科学引用本文复制引用
安治国,鲜青霖,许亮..一种改进YOLOv5s的金属表面缺陷检测算法研究[J].重庆大学学报,2026,49(4):98-106,9.基金项目
重庆市自然科学基金(cstc2021jcyj-msxmX1047). Supported by Chongqing Natural Science Foundation(cstc2021jcyj-msxmX1047). (cstc2021jcyj-msxmX1047)