GED-YOLOv5: an improved YOLOv5 model for weld defect detection via gather-and-distribute mechanism and transfer learning
Abstract
Small-sample visible-light weld inspection is difficult because circular metal surfaces introduce specular reflection, low local contrast, weld-like background texture, and elongated defects that may occupy only a small region after image resizing. This paper proposes GED-YOLOv5, a task-adapted YOLOv5 detector for circular pipe weld defect detection. The model combines an improved Gather-and-Distribute (GD) neck for cross-scale feature propagation, a C3_DSC backbone block for elongated defect boundaries, and Efficient Channel Attention (ECA) for defect-related channel selection. Source-domain pre-training is further used to reduce overfitting under limited target-domain samples. On the source-domain weld dataset, GED-YOLOv5 increases mAP@0.5 from 88.6% to 91.3% over YOLOv5s. On the corrected target-domain split, three repeated runs with source-domain initialization achieve 53.15±3.20\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$53.15 \pm 3.20$$\end{document}% F1, 51.17±2.97\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$51.17 \pm 2.97$$\end{document}% mAP@0.5, and 19.07±0.68\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$19.07 \pm 0.68$$\end{document}% mAP@0.5:0.95. These results are higher than the corresponding YOLOv5s, YOLO11s, and Faster R-CNN reference settings in F1 and the two mAP metrics, while the unified GTX 1080 benchmark shows 88.8 FPS at batch size 1 for GED-YOLOv5. The results indicate that GED-YOLOv5 provides an accuracy–efficiency trade-off for small-sample pipe-weld inspection, although its high-IoU localization and robustness to reflection remain limited.