SFW-YOLO: A lightweight multi-scale dynamic attention network for weld defect detection in steel bridge inspection
Yuan Luo, Juan Ling, Jiangwei Wang, Haiping Zhang, Fanghuai Chen, Xinhui Xiao, Naiwei Lu
Abstract
Automated detection of surface defects in steel bridge welds using computer vision is challenge due to complex weld textures, multi-scale defects, and small-size, low contrast defects. To address these challenges, this study proposes a lightweight and efficient detection algorithm , Small Feature-aware Welding YOLO (SFW-YOLO), based on the YOLOv8s model. The model improves small-size defects recognition by integrating the high-resolution P2 layer from the backbone into the neck, reducing false detection rates. It also incorporates a Dynamic Convolution Detection Head (DyHead) that utilizes scale, spatial, and task-aware attention mechanisms to optimize processing, improving defect detection accuracy in multi-scale defects and complex backgrounds. Additionally, the bounding box loss function is replaced with Extended Intersection over Union (EIOU) to improve defects localization, while pruning techniques optimize the framework to balance accuracy and efficiency. Experiments evaluations on weld defect datasets demonstrate that the superior performance of SFW-YOLO, achieving a mean average precision (mAP) of 90.0 %, outperforming the existing SOTA detectors and exceeding the YOLOv8s by 8 %. The framework exhibits particularly pronounced improvement in small-size porosity defects recognition, achieving a 23.8 % higher mAP than YOLOv8s. Additionally, the model improves efficiency while ensuring detection accuracy, with a parameter size of 2.056 M and achieving real-time processing at 361 fps.