一种改进YOLOv5s的金属表面缺陷检测算法研究OA
A detection algorithm based on YOLOv5s for metal surface defects
金属零部件大量应用于生产生活的等各个领域,但其表面缺陷分布不均匀且部分特征微弱,常常造成金属零件表面缺陷检测的漏检和误检.针对这一问题,研究提出一种YOLOv5s-MD(you only look once-modified detection)算法.针对金属表面缺陷特征成分复杂的问题,引入改进的空间金字塔池化模块以提高算法对不同尺度微小目标的深度特征提取能力.针对金属表面缺陷特征分散及计算量增大问题,加入轻量化注意力机制及GSConv模块,提高模型对不同尺度缺陷特征的有效获取.考虑到金属表面缺陷尺寸信息无规律导致边界回归不匹配问题,采用考虑向量角度的损失函数.结果表明,提出的YOLOv5s-MD算法在对金属表面缺陷检测时,检测平均精度mAP@0.5达到75.3%,能够有效提升检测精度,降低误检率.
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.
安治国;鲜青霖;许亮
重庆交通大学 机电与车辆工程学院,重庆 400074重庆交通大学 机电与车辆工程学院,重庆 400074重庆交通大学 机电与车辆工程学院,重庆 400074
信息技术与安全科学
金属表面缺陷检测算法YOLOv5s深度学习
metal surface defectdetection algorithmYOLOv5sdeep learning
《重庆大学学报》 2026 (4)
98-106,9
重庆市自然科学基金(cstc2021jcyj-msxmX1047). Supported by Chongqing Natural Science Foundation(cstc2021jcyj-msxmX1047).
评论