摘要
目前已报道的针对焊缝缺陷检测方法存在小目标缺陷易漏检以及多尺度特征表达不足等问题.于是,提出一种基于 YOLOv-RPW的焊缝缺陷检测方法.首先,该方法是在YOLOv11n模型主干网络中引入基于感受野注意力机制的 C3K2-RAFConv 模块,通过增强局部感受野特征表达能力,提高模型对裂纹、气孔等细粒度缺陷特征的提取效果;其次,针对焊缝缺陷中小尺度目标占比较高的特点,在检测头中设计轻量化 P2-Lite 小目标检测分支,充分利用浅层高分辨率特征,在提升小缺陷检测能力的同时控制模型复杂度;最后,引入 WIoU 损失函数优化边界框回归过程,增强模型对缺陷目标的定位精度.实验结果表明,本文提出的YOLOv-RPW 模型在焊缝缺陷检测任务中取得了较优性能,其P、R、mAP@0.5 和 mAP@0.5:0.95 分别达到 91.26%、83.58%、90.31%和 67.24%,相比基线模型 YOLOv11n 分别提升了 4.31%.、4.31%、4.35%和 3.27%.总之,所提出的方法能够有效降低焊缝缺陷误检和漏检现象,大幅提升模型对小尺度焊缝缺陷的检测精度与定位能力,为工业场景下焊缝缺陷的自动化检测提供了一种有效方法.
Currently reported weld defect detection methods suffer from issues such as missed detection of small-scale object defects and insufficient multi-scale feature representation.So,this paper proposes a YOLOv-RPW-based weld defect detection method.First,the method introduces a C3K2-RAFConv module based on receptive field attention mechanism into the backbone network of the YOLOv11 model,enhancing local receptive field fea-ture representation to improve the extraction of fine-grained defect features like cracks and pores.Second,consid-ering the high proportion of small-scale objects in weld defects,a lightweight P2-Lite small-object detection branch is designed in the detection head to fully utilize shallow high-resolution features,boosting small defect detection capability while controlling model complexity.Finally,the WIoU loss function is introduced to optimize the bounding box regression process,enhancing the model's localization accuracy for defect objects.Experimental results demonstrate that the proposed YOLOv-RPW model achieves superior performance in weld defect detection tasks,with P,R,mAP@0.5,and mAP@0.5:0.95 reaching 91.26%,83.58%,90.31%,and 67.24%,respec-tively,showing improvements of 4.31%,4.31%,4.35%,and 3.27%compared with the baseline YOLOv11 model.In summary,the proposed method effectively reduces false and missed detections of weld defects,signifi-cantly improves the model's detection accuracy and localization capability for small-scale weld defects,and pro-vides an effective solution for automated weld defect inspection in industrial scenarios.