Chinese Journal of Lasers, Volume. 52, Issue 8, 0802105(2025)

Real‑Time Weld Defect Detection Algorithm Based on YOLO‐DEFW

Jianfeng Yue1, Weiming Li1、*, Lihua Ning2、**, Xingyu Gao3, Yu Li1, Wenlong Wang1, Baiqing Yang1, and Yani Liu1
Author Affiliations
  • 1School of Mechanical and Electrical Engineering, Guilin University of Electronic Technology, Guilin 541004, Guangxi , China
  • 2School of Mathematics and Computing Science, Guilin University of Electronic Technology, Guilin 541004, Guangxi , China
  • 3School of Artificial Intelligence, Guangxi University for Nationalities, Nanning 530006, Guangxi , China
  • show less
    Figures & Tables(15)
    Diagram of YOLOv8 model
    Diagram of YOLO-DEFW model
    Diagram of DSConv structure
    Structure of EMA module
    Weld defect sampling system
    Image enhancement. (a) Elastic transform; (b) flip; (c) histogram equalization; (d) perspective transformation; (e) rotation; (f) sharpening; (g) affine transformation; (h) angular distortion; (i) color space transformation
    Comparison of confidence in detecting small cracks. (a) YOLOv8; (b) YOLOv8-DSConv-EMA
    Comparison of confidence in detecting porosities and spatters. (a) YOLOv8; (b) YOLO-DEFW
    Comparison in precision, recall, and mean average precision for different models
    • Table 1. Structure of YOLO-DEFW model

      View table

      Table 1. Structure of YOLO-DEFW model

      Layer No.FromnParametersModuleArguments
      0-11464DSConv2D[3, 16, 3, 2]
      1-114672DSConv2D[16, 32, 3, 2]
      2-115312C2f_DSConv[32, 32, 1, True]
      3-1118560DSConv2D[32, 64, 3, 2]
      4-1233280C2f_DSConv[64, 64, 2, True]
      5-1173984DSConv2D[64, 128, 3, 2]
      6-12132096C2f_DSConv[128, 128, 2, True]
      7-11295424DSConv2D[128, 256, 3, 2]
      8-11329216C2f_DSConv[256, 256, 1, True]
      9-11164608SPPF[256, 256, 5]
      10-110Upsample[None, 2, 'nearest']
      111610Concat1
      12-11115456C2f_DSConv[384, 128, 1]
      13-110Upsample[None, 2, 'nearest']
      141410Concat1
      15-1129056C2f_DSConv[192, 64, 1]
      16-11672EMA[64, 8]
      17-1136992DSConv2D[64, 64, 3, 2]
      1811210Concat1
      19-1190880C2f_DSConv[192, 128, 1]
      20-112624EMA[128, 8]
      21-11147712DSConv2D[128, 128, 3, 2]
      221910Concat1
      23-11361984C2f_DSConv[384, 256, 1]
      24-1110368EMA[256, 8]
      251620241752482Detect6, 64, 128, 256]
    • Table 2. Experimental parameter settings

      View table

      Table 2. Experimental parameter settings

      Parameter nameDefinitionValue
      batchNumber of images per batch48
      workersNumber of worker threads8
      lrfFinal learning rate0.01
      boxBox loss gain8.0
      clsClass loss gain0.7
      IoUIntersection over union (IoU) threshold0.65
      epochsTotal number of training epochs400
      batchNumber of images per batch48
    • Table 3. Convolution performance experimental results

      View table

      Table 3. Convolution performance experimental results

      Convolution nameOutput sizeParametersGFLOPs
      Conv2Dsize ([1, 16, 64, 64])4800.0020
      Depth-Conv2Dsize ([1, 16, 64, 64])2880.0013
      Ghost-Conv2Dsize ([1, 16, 64, 64])3360.0014
      GSConv2Dsize ([1, 16, 64, 64])4640.0020
      DSConv2Dsize ([1, 16, 64, 64])320.0003
      DCNv3size ([1, 8, 64, 64])3680.0015
    • Table 4. Attention mechanism performance experimental results

      View table

      Table 4. Attention mechanism performance experimental results

      ModelPrecisionRecallmAP
      YOLOv80.5240.5390.368
      YOLOv8-GAM0.5070.5480.391
      YOLOv8-CBAM0.5150.5870.394
      YOLOv8-EMA0.5010.5440.413
    • Table 5. Ablation experimental results of improved YOLOv8 models

      View table

      Table 5. Ablation experimental results of improved YOLOv8 models

      ModelParametersPrecisionRecallmAPEpochsGFLOPs
      Faster R-CNN256000000.4150.6490.55940045.5
      YOLOv522220640.5300.5750.4234006.1
      YOLOv830068180.5310.6040.4684008.1
      YOLOv8-DSConv26006420.5180.6100.4404007.0
      YOLOv8-DSConv-EMA26006420.6140.6950.5624007.3
      YOLOv8-DSConv-EMA-FWCE Loss-WCE (YOLO-DEFW)26006420.6020.7070.5844007.3
    • Table 6. Comparison of experimental results between YOLOv8 and YOLO- DEFW for detecting various types of defects

      View table

      Table 6. Comparison of experimental results between YOLOv8 and YOLO- DEFW for detecting various types of defects

      DefectYOLOv8YOLO- DEFW
      PRmAPPGrowth ratio of PRGrowth ratio of RmAPGrowth ratio of mAP
      All0.5310.6040.4680.60213%0.70717%0.58425%
      Bad welding0.6520.5820.4830.73513%0.69820%0.60124%
      Crack0.2840.5830.2820.33117%0.70621%0.38436%
      Incomplete fusion0.6440.5880.4420.71511%0.65011%0.59434%
      Good welding0.6660.5900.4940.74512%0.75027%0.63629%
      Porosity0.3150.7500.6780.37017%0.85714%0.76212%
      Spatters0.6050.4800.3500.72019%0.58321%0.52450%
    Tools

    Get Citation

    Copy Citation Text

    Jianfeng Yue, Weiming Li, Lihua Ning, Xingyu Gao, Yu Li, Wenlong Wang, Baiqing Yang, Yani Liu. Real‑Time Weld Defect Detection Algorithm Based on YOLO‐DEFW[J]. Chinese Journal of Lasers, 2025, 52(8): 0802105

    Download Citation

    EndNote(RIS)BibTexPlain Text
    Save article for my favorites
    Paper Information

    Category: Laser Forming Manufacturing

    Received: Sep. 20, 2024

    Accepted: Nov. 25, 2024

    Published Online: Mar. 17, 2025

    The Author Email: Weiming Li (liaifan@buaa.edu.cn), Lihua Ning (nlhua123@sina.com.cn)

    DOI:10.3788/CJL241223

    CSTR:32183.14.CJL241223

    Topics