[关键词]
[摘要]
金属零部件大量应用于生产生活的等各个领域,其表面缺陷分布不均匀且部分特征微弱,常常造成漏检和误检。针对这一问题,提出了一种YOLOv5s-MD算法。在该算法中,改进了XSPPF模块,并融合了GSConv模块,加入了轻量化注意力机制,提高了模型对不同尺度缺陷特征有效获取能力;考虑到金属表面缺陷尺寸信息无规律并且差异较大而导致的预测框与真实框间方向不一致问题,采用了SIoU损失函数。将该检测算法在增强后金属表面缺陷数据集中进行了训练和验证。结果表明:缺陷检测的平均精度mAP@0.5达到了75.3%,所提出的检测算法在对金属表面缺陷检测任务中能够有效提升检测精度,降低误检率。
[Key word]
[Abstract]
Metal parts are widely used in various fields such as production and life, and their surface defects are not evenly distributed and some characteristics are weak, which often causes missing and false detection. To solve this problem, the YOLOv5s-MD algorithm is proposed. In this algorithm, the XSPPF module is improved, the GSConv module is integrated, and the lightweight attention mechanism is added to improve the model"s ability to effectively acquire defect features at different scales. The SIoU loss function is adopted to consider the inconsistency between the predicted frame and the anchor frame due to the irregular and large difference in the size information of metal surface defects. The detection algorithm was trained and validated in the augumented metal surface defect dataset. The results show that the average precision of defect detection mAP@0.5 reaches 75.3%. The proposed detection algorithm can effectively improve the detection precision and reduce the false detection in the detection of metal surface defects.
[中图分类号]
TP391.4 ?????????????????????????
[基金项目]
重庆市科技局项目(cstc2021jcyj-msxmX1047)