• Chinese Journal of Lasers
  • Vol. 52, Issue 12, 1202105 (2025)
Yunhao Li*, Chengtie Li, and Qiuming Li**
Author Affiliations
  • School of Control Engineering, Northeastern University at Qinhuangdao Campus, Qinhuangdao 066004, Hebei , China
  • show less
    DOI: 10.3788/CJL241390 Cite this Article Set citation alerts
    Yunhao Li, Chengtie Li, Qiuming Li. A Lightweight Real‐Time Weld Defect Classification Model[J]. Chinese Journal of Lasers, 2025, 52(12): 1202105 Copy Citation Text show less

    Abstract

    Objective

    The presence of welding defects in the weld seam significantly impacts the strength and service life of structural components. Traditional detection methods often suffer from limitations such as high computational costs, slow inference speed, and large model sizes, which restrict their practical applications. This paper aims to address these challenges by proposing a lightweight real-time weld defect classification model ,TDRE-YOLO-cls, that achieves high accuracy while maintaining a small model size and fast inference speed.

    Carbon steel is widely used in construction, bridges, shipbuilding, and automobile manufacturing due to its excellent mechanical properties, ease of processing, and relatively low cost. Selecting appropriate welding methods is crucial for ensuring the safety and reliability of carbon steel structures. However, in practical operations, defects such as dents and holes cannot be completely avoided. These defects can not only weaken the load-bearing capacity of weld joints but also lead to failures or accidents. Therefore, timely and accurate detection of weld defects is essential for ensuring the safe and reliable operation of welded structures.

    With the development of artificial intelligence, non-destructive testing has shown significant improvements in precision and efficiency. However, traditional methods like magnetic particle inspection are limited to ferromagnetic materials and require cumbersome preparation, radiographic testing poses potential health risks and is costly, and ultrasonic testing is slow and complex in data processing. In contrast, laser-based non-destructive testing, despite its inability to detect internal defects, is widely used for surface defect detection due to its high precision, high sampling rate, and compact hardware.

    Methods

    We modified the YOLOv8n-cls architecture by introducing the Re-Parameterized Reshaping Convolutional Representation (RCR) module into shallow layers and the Spatial Pyramid Pooling (SPP) and Downsampling Position-Specific Attention (DPSA) modules into deep layers. The RCR module leverages RepConv blocks to efficiently extract multi-scale features. Meanwhile, the DPSA module employs special downsampling and compression mechanisms to reduce model parameters. Additionally, we proposed a Compressed Squeeze and Excitation (CSE) attention mechanism tailored for DPSA to enhance the extraction of critical information.

    Specifically, we replaced the shallower C2f modules in the YOLOv8n-cls architecture with the RCR modules containing RepConv to obtain multi-scale features while controlling inference time . We introduced a DPSA module with special downsampling and compression mechanisms to effectively reduce the model parameter size. Finally, to further enhance the model ability to extract key information, we developed a dedicated attention mechanism for the DPSA module.

    Results and Discussions

    Experimental results showed that TDRE-YOLO-cls outperforms YOLOv8n-cls in several key metrics of Top-1 accuracy increased by 2.4%, weighted precision increased by 2.3%, and weighted recall increased by 2.4%. Notably, our model achieved these improvements while reducing the model parameter count by 52.1% and maintaining an inference time of 0.9 ms per frame (Table 2). To comprehensively evaluate the performance and generalization ability of TDRE-YOLO-cls, we conducted extensive experiments on an expanded dataset consisting of burrs, dents, holes, and no obvious defects, totaling 3792 samples. Training involved 200 epochs, with validation and test sets used for performance assessment.

    Further comparison with various existing models, including YOLOv8n-cls, YOLOv11n-cls, YOLOv8s-cls, YOLOv11s-cls, MobileNetV3, and ShuffleNetV2, demonstrated the superiority of TDRE-YOLO-cls in terms of accuracy, inference time , and model size. On the test set, TDRE-YOLO-cls showed a Top-1 accuracy improvement of 2.4%, a weighted precision increase of 2.3%, and a weighted recall enhancement of 2.4%, while maintaining an inference time of 0.9 ms per frame and reducing the model size by 52.1% (Table 2). Ablation studies confirmed the effectiveness of each component in our proposed model, demonstrating its robustness and generalizability (Table 3).

    Additionally, we performed a detailed analysis on the performance of TDRE-YOLO-cls across different types of weld defects, including burrs, dents, holes, and no defects. Our results indicated that TDRE-YOLO-cls achieves balanced performance across all categories, although there is still room for improvement, particularly in detecting dents. Future work will focus on optimizing the model to better handle specific types of defects, thereby enhancing overall accuracy and reliability.

    Conclusions

    The TDRE-YOLO-cls model effectively balances real-time performance, accuracy, and model size, making it suitable for industrial applications where hardware resources are limited. The proposed modifications, including the introduction of RCR, SPP, and DPSA modules, have been shown to significantly improve the model performance without compromising inference time . Future research will continue to refine the model, particularly focusing on improving its performance for challenging defect types such as dents, to achieve even higher overall accuracy. Moreover, we plan to explore the integration of advanced techniques such as semi-supervised learning and transfer learning to further enhance the model capabilities.

    Yunhao Li, Chengtie Li, Qiuming Li. A Lightweight Real‐Time Weld Defect Classification Model[J]. Chinese Journal of Lasers, 2025, 52(12): 1202105
    Download Citation