Research on Weld Defect Detection Method Based on Improved DETR
-
摘要: 焊接技术在工业制造中占据着举足轻重的作用,而X射线图像评定是保障焊缝内部质量的关键检测方式。鉴于焊缝X射线图像评定环节中存在工作量大、效率难以提升等问题,该文提出一种基于DETR网络改进的CADETR焊缝缺陷检测模型。此模型以DETR网络为基础,设计了CEC网络结构,拓宽了卷积核的感受野,增强了模型对于不同尺度缺陷的特征提取性能;同时设计了AFPN网络,该结构能够有效融合高分辨率与低分辨率的多尺度特征图;设计了PCE-Loss损失函数,增大了模型对缺陷图像预测错误的损失惩罚。构建了大型结构件焊缝X射线图像数据集,经过测试CADETR模型展现出良好的缺陷检测性能,其平均精度达到了91.6%,可作为后续焊缝缺陷智能检测系统的算法基础。Abstract:
Objective Welding technology plays a pivotal role in industrial manufacturing, where X-ray image evaluation serves as a critical inspection method for assessing the internal quality of weld seams. X-ray inspection is effective in identifying defects such as slag inclusions, incomplete penetration, and porosity, which helps prevent structural failures and ensures the reliability and durability of welded components. This process is a fundamental quality control measure in industrial manufacturing. However, challenges persist in the assessment of weld seam X-ray images, particularly in relation to high workloads and inefficiencies. Conventional models often experience multi-scale feature information loss during feature extraction due to the significant variation in the size and morphology of defects, such as porosity, slag inclusions, and incomplete penetration, found in large structural weld seams. To address these limitations, the Detection Transformer with Concatenated Expand Convolutions and Augmented Feature Pyramid Networks (CADETR) model is proposed to improve detection performance for weld defects in large structural components. Methods The CADETR model is proposed for detecting weld defects in large structural components. The model comprises three core components: the DETR network, concatenated expand convolution (CEC) network, and Augmented Feature Pyramid Network (AFPN). The DETR network applies multi-head self-attention mechanisms to effectively capture global contextual relationships among feature map positions, enhancing perceptual capability and detection accuracy for weld defects. The CEC module adopts a composite expanded convolution structure, widening convolutional kernel receptive fields and significantly improving feature extraction for defects across various scales. The AFPN module reinforces multi-scale defect feature extraction by integrating hierarchical feature maps and employing a feature batch elimination mechanism, reducing overfitting and enhancing generalization performance in multi-scale defect detection. Additionally, a Penalized Cross Entropy Loss (PCE-Loss) function is proposed, which applies increased penalties to incorrect defect predictions, further improving model robustness and precision. Results and Discussions The performance of the CADETR defect detection model is evaluated through a comparative analysis with multiple models, including Faster RCNN, ECASNet, GeRCNN, DETR, MDCBNet, HPRT-DETR, and YOLOV11. Weld seam X-ray image data are input into each model, with variations in loss values recorded during the training process. Model performance in defect detection is assessed using Precision, Recall, and mAP metrics. Experimental results show that the CADETR model exhibits slightly higher loss values compared to HPRT-DETR and YOLOV11 but lower than other benchmark models ( Fig. 7 ). The CADETR model demonstrates superior performance in mAP, achieving 91.6%, exceeding all comparative models (Table 3 ). The CADETR model proves particularly effective in detecting defects characterized by a high proportion of small targets and significant shape variations (Fig. 8 ).Conclusions This study addresses the challenges of detecting weld defects with significant variations in size and morphology in large structural components through the CADETR weld defect detection model. Evaluation using a welded seam X-ray image dataset revealed the following key findings: (1) The sequential integration of the CEC module, AFPN module, and PCE-Loss function into the baseline DETR framework improved mAP by 4.6%, 4.5%, and 3.4%, respectively, validating the contribution of each component. (2) The CADETR model achieved a 91.6% mAP for weld defect detection, with a single-image inference time of 0.036 s. (3) Compared to the original DETR, CADETR demonstrated a 8.9% improvement in mAP. For future implementation, the CADETR model will be deployed in a Browser/Server (B/S) architecture-based weld defect detection system, where both software algorithms and computational hardware resources will be hosted on cloud servers. This design ensures stable operational workflows and facilitates cross-platform data resource sharing. -
Key words:
- Weld Seam /
- Defect detection /
- Multi-scale /
- mean Average Precision(mAP)
-
表 1 Resnet101网络
Layer name Resnet101 Conv1 conv,7×7,64,stride 2 Conv2 maxpool,3×3, stride 2
$ \left[ {\begin{array}{*{20}{l}} {{\text{conv}},1 \times 1,64} \\ {{\text{conv}},3 \times 3,64} \\ {{\text{conv}},1 \times 1,256} \end{array}} \right] \times 3 $Conv3 $ \left[ {\begin{array}{*{20}{l}} {{\text{conv}},1 \times 1,128} \\ {{\text{conv}},3 \times 3,128} \\ {{\text{conv}},1 \times 1,512} \end{array}} \right] \times 4 $ Conv4 $ \left[ {\begin{array}{*{20}{l}} {{\text{conv}},1 \times 1,256} \\ {{\text{conv}},3 \times 3,256} \\ {{\text{conv}},1 \times 1,1024} \end{array}} \right] \times 23 $ Conv5 $ \left[ {\begin{array}{*{20}{l}} {{\text{conv}},1 \times 1,512} \\ {{\text{conv}},3 \times 3,512} \\ {{\text{conv}},1 \times 1,2048} \end{array}} \right] \times 3 $ 表 2 模型运行环境配置
软硬件名称 具体配置 CPU Intel-6248R GPU RTXA6000 内存大小 128 GB 系统 Centos7.5 深度学习框架 pytorch1.9.0 编程语言 Python3.9 表 3 各模型缺陷检测结果
算法名称 P R mAP FPS Faster RCNN 81.6 85.6 78.9 31 ECASNet 79.8 83.5 77.4 49 GeRcnn 82.6 85.1 81.3 39 DETR 83.9 87.5 82.7 38 MDCBNet 85.6 92.4 84.7 33 HPRT-DETR 87.6 93.6 87.9 36 YOLOV11 88.9 94.1 88.1 59 CADETR 92.7 98.3 91.6 28 表 4 消融实验
CEC AFPN PCE-Loss P R mAP fps 83.9 87.5 82.7 38 √ 88.9 90.6 87.3 34 √ 88.1 88.3 87.2 33 √ 86.8 89.5 86.1 38 √ √ 89.8 94.1 88.4 34 √ √ 89.2 93.4 88.9 33 √ √ 90.3 96.1 89.8 28 √ √ √ 92.7 98.3 91.6 28 -
[1] SONAR T, BALASUBRAMANIAN V, MALARVIZHI S, et al. Maximizing strength and corrosion resistance of InterPulsed TIG welded Superalloy 718 joints by RSM for aerospace applications[J]. CIRP Journal of Manufacturing Science and Technology, 2021, 35: 474–493. doi: 10.1016/j.cirpj.2021.07.013. [2] LIU Zhao, LI Xiaoqiang, PAN Lihua, et al. Effects of weld penetration modes on laser welding characteristics of a novel ultra-high strength steel for aerospace application[J]. Journal of Manufacturing Processes, 2023, 90: 111–124. doi: 10.1016/j.jmapro.2023.02.003. [3] AGIWAL H, ALI ANSARI M, FRANKE D, et al. Material flow visualization during friction stir welding using high-speed X-ray imaging[J]. Manufacturing Letters, 2022, 34: 62–66. doi: 10.1016/j.mfglet.2022.08.016. [4] SCHRICKER K, HELLWIG P, SCHMIDT L, et al. Insight into keyhole and melt pool dynamics in laser welding of zinc-coated steels by means of high-speed synchrotron X-ray imaging[J]. Procedia CIRP, 2024, 124: 454–459. doi: 10.1016/j.procir.2024.08.152. [5] GEORGE G S, RAJ MISHRA P, SINHA P, et al. COVID-19 detection on chest X-ray images using Homomorphic Transformation and VGG inspired deep convolutional neural network[J]. Biocybernetics and Biomedical Engineering, 2023, 43(1): 1–16. doi: 10.1016/J.BBE.2022.11.003. [6] UPARKAR O, BHARTI J, PATERIYA R K, et al. Vision transformer outperforms deep convolutional neural network-based model in classifying X-ray images[J]. Procedia Computer Science, 2023, 218: 2338–2349. doi: 10.1016/J.PROCS.2023.01.209. [7] YUAN Gaojing, CHEN Linshu, CAI Jiahong, et al. A comprehensive overview of object detection based on deep learning[C]. Proceedings of 2024 10th IEEE International Conference on Intelligent Data and Security, New York, America, 2024: 80–85. doi: 10.1109/IDS62739.2024.00023. [8] KARBOUJ B, TOPALIAN-RIVAS G A, and KRÜGER J. Comparative performance evaluation of one-stage and two-stage object detectors for screw head detection and classification in disassembly processes[J]. Procedia CIRP, 2024, 122: 527–532. doi: 10.1016/J.PROCIR.2024.01.077. [9] REN Shaoqing, HE Kaiming, GIRSHICK R, et al. Faster R-CNN: Towards real-time object detection with region proposal networks[J]. IEEE Transactions on Pattern Analysis and Machine Intelligence, 2017, 39(6): 1137–1149. doi: 10.1109/TPAMI.2016.2577031. [10] CAI Zhaowei and VASCONCELOS N. Cascade R-CNN: Delving into high quality object detection[C]. Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake, USA, 2018: 6154–6162. doi: 10.1109/CVPR.2018.00644. [11] LIU Ze, LIN Yutong, CAO Yue, et al. Swin transformer: Hierarchical vision transformer using shifted windows[C]. Proceedings of the 2021 IEEE/CVF International Conference on Computer Vision, Montreal, Canada, 2021: 9992–10002. doi: 10.1109/ICCV48922.2021.00986. [12] GHEORGHE C, DUGULEANA M, BOBOC R G, et al. Analyzing real-time object detection with YOLO algorithm in automotive applications: A review[J]. Computer Modeling in Engineering & Sciences, 2024, 141(3): 1939–1981. doi: 10.32604/CMES.2024.054735. [13] CARION N, MASSA F, SYNNAEVE G, et al. End-to-end object detection with transformers[C]. Proceedings of the 16th European Conference on Computer Vision-ECCV 2020, Glasgow, UK, 2020: 213–229. doi: 10.1007/978-3-030-58452-8_13. [14] NING Pin, JIN Jin, XU Yuanping, et al. Enhanced detection of glass insulator defects using improved generative modeling and faster RCNN[J]. Procedia CIRP, 2024, 129: 31–36. doi: 10.1016/j.procir.2024.10.007. [15] SONWANE S and CHIDDARWAR S. Enhancing weld defect detection and classification with MDCBNet: A multi-scale dense cross block network for improved explainability[J]. NDT & E International, 2024, 142: 103029. doi: 10.1016/j.ndteint.2023.103029. [16] ZHAO Wenjie, LI Dan, and XU Feihu. A lightweight weld defect recognition algorithm based on convolutional neural networks[J]. Pattern Analysis and Applications, 2024, 27(3): 94. doi: 10.1007/S10044-024-01315-7. [17] GE Qianfeng, YUAN Hao, ZHANG Qinglin, et al. Hyper-Progressive Real-Time Detection Transformer (HPRT-DETR) algorithm for defect detection on metal bipolar plates[J]. International Journal of Hydrogen Energy, 2024, 74: 49–55. doi: 10.1016/J.IJHYDENE.2024.06.028. [18] WEI Wanmian, YAN Huang, ZHENG Junchi, et al. YOLOv11-based multi-task learning for enhanced bone fracture detection and classification in X-ray images[J]. Journal of Radiation Research and Applied Sciences, 2025, 18(1): 101309. doi: 10.1016/J.JRRAS.2025.101309. [19] 郭柏麟, 黄立威, 路遥, 等. 基于脉冲神经网络微调方法的遥感图像目标检测[J]. 遥感学报, 2024, 28(7): 1702–1712. doi: 10.11834/jrs.20243272.GUO Bailin, HUANG Liwei, LU Yao, et al. Research on Spiking Neural Network fine-tuning method for object detection in remote sensing images[J]. National Remote Sensing Bulletin, 2024, 28(7): 1702–1712. doi: 10.11834/jrs.20243272. [20] SOARES R A A, DE OLIVEIRA A C M, DE ALMEIDA RIBEIRO P R, et al. Firearm detection using DETR with multiple self-coordinated neural networks[J]. Neural Computing and Applications, 2024, 36(35): 22013–22022. doi: 10.1007/s00521-024-10373-1. [21] 赵楚, 段先华, 苏俊楷. 改进Faster RCNN的瓷砖表面瑕疵检测研究[J]. 计算机工程与应用, 2023, 59(14): 201–208. doi: 10.3778/j.issn.1002-8331.2203-0414.ZHAO Chu, DUAN Xianhua, and SU Junkai. Research on ceramic tile surface defect detection by improved Faster RCNN[J]. Computer Engineering and Applications, 2023, 59(14): 201–208. doi: 10.3778/j.issn.1002-8331.2203-0414. [22] YANG Xiaohui, ZHANG Haoran, QU Zhe, et al. Video frame interpolation via residual blocks and feature pyramid networks[J]. IET Image Processing, 2023, 17(4): 1060–1070. doi: 10.1049/ipr2.12695. -