Please wait a minute...
Chinese Journal of Engineering Design  2026, Vol. 33 Issue (1): 44-55    DOI: 10.3785/j.issn.1006-754X.2026.05.134
Theory and Method of Mechanical Design     
TOFD weld defect identification method integrating CNN and high-low frequency focused attention
Junhui ZHANG1(),Donglin TANG1(),Pingjie WANG2,Yuanyao HU1,Yuanbo LI1
1.School of Mechanical and Electrical Engineering, Southwest Petroleum University, Chengdu 610500, China
2.Sichuan Special Equipment Inspection Institute, Chengdu 610000, China
Download: HTML     PDF(6094KB)
Export: BibTeX | EndNote (RIS)      

Abstract  

Aiming at the problem of weld defect images affected by high noise and interference fringes in TOFD (time of flight diffraction) ultrasonic detection technology, as well as the challenge of feature information loss and computational efficiency imbalance faced by current deep learning models in processing such images, an innovative defect identification model integrating convolutional neural network (CNN) and Transformer architecture is proposed, named MHLFNet (multi-scale high-low focused network). By introducing a multi-scale feature fusion (MSFF) module, this model significantly enhanced the ability of capturing local information. At the same time, a high-low focused linear (HLFL) module was designed, which used the adjustable allocation ratio to dynamically allocate the attention for the high and low frequency information of feature images, and adopted focused linear attention instead of traditional multi-head self-attention, effectively reducing the computational complexity while enhancing the diversity of attention mechanisms and the feature expression ability. In order to verify the performance of MHLFNet, a TOFD weld defect image dataset was constructed, and a systematic experimental evaluation was conducted. The results showed that MHLFNet achieved an accuracy of 98.6% in the weld defect identification task, and performed excellently in terms of model parameters, floating-point operations, and inference time. In visual analysis and identification validation, MHLFNet demonstrates excellent identification capabilities for high-risk defects (such as lack of fusion and cracks), proving its reliability and engineering value in industrial inspection.



Key wordstime of flight diffraction (TOFD)      weld defect identification      convolutional neural network      Transformer architecture      multi-scale feature fusion     
Received: 20 May 2025      Published: 01 March 2026
CLC:  TG 441.7  
Corresponding Authors: Donglin TANG     E-mail: zhangjh26100800@163.com;tdl840451816@163.com
Cite this article:

Junhui ZHANG,Donglin TANG,Pingjie WANG,Yuanyao HU,Yuanbo LI. TOFD weld defect identification method integrating CNN and high-low frequency focused attention. Chinese Journal of Engineering Design, 2026, 33(1): 44-55.

URL:

https://www.zjujournals.com/gcsjxb/10.3785/j.issn.1006-754X.2026.05.134     OR     https://www.zjujournals.com/gcsjxb/Y2026/V33/I1/44


融合CNN与高低频聚焦注意力的TOFD焊缝缺陷识别方法

针对TOFD(time of flight diffraction,衍射时差法)超声检测技术中焊缝缺陷图像受高噪声和干扰条纹影响的问题,以及当前深度学习模型在处理此类图像时面临的特征信息丢失与计算效率失衡的挑战,创新性地提出了一种融合卷积神经网络(convolutional neural network, CNN)与Transformer架构的缺陷识别模型,命名为MHLFNet(multi-scale high-low focused network,多尺度高低聚焦网络)。该模型通过引入多尺度特征融合(multi-scale feature fusion, MSFF)模块,显著增强了捕捉局部信息的能力;同时,设计了一种高低频聚焦线性(high-low focused linear, HLFL)模块,利用可调分配比对特征图的高低频信息进行动态注意力分配,并采用聚焦线性注意力代替传统多头自注意力,在有效降低计算复杂度的同时,增强了注意力机制的多样性与特征表达能力。为验证MHLFNet的性能,构建了TOFD焊缝缺陷图像数据集,并进行了系统的实验评估。结果表明,MHLFNet在焊缝缺陷识别任务中实现了98.6%的准确率,同时在模型参数量、浮点运算量以及推理时间方面表现优异。在可视化分析与识别验证中,MHLFNet对高危缺陷(如未熔合和裂纹)展现出卓越的识别能力,证明了其在工业检测中的可靠性与工程价值。


关键词: 衍射时差法,  焊缝缺陷识别,  卷积神经网络,  Transformer架构,  多尺度特征融合 
Fig.1 Overall architecture of MHLFNet and its key modules
Fig.2 TOFD detection principle and imaging process
试块厚度/mm频率/MHz声束角度α/(°)晶片尺寸/mm
>15~355~1060~702~6
>35~503~560~703~6
Table 1 Selection of TOFD detection probe parameters
Fig.3 TOFD weld defect images
Fig.4 TOFD weld defect image acquisition process
数据集缺陷图像/张
裂纹未熔合气孔夹渣表面开口
训练集1 2001 2001 2001 2001 200
测试集300300300300300
Table 2 Division of TOFD weld defect image dataset
参数类型参数设置
优化算法AdamW
损失函数交叉熵函数
初始学习率0.000 1
学习率调整策略余弦退火,周期为30
批大小32
迭代数/次150
激活函数ReLU
Table 3 Hyperparameter setting of MHLFNet model
Fig.5 Validation of classification performance of MHLFNet model
Fig.6 t-SNE cluster analysis result
基线网络MSFF模块HLFL模块准确率/%损失值参数量/106 浮点运算量/109
96.10.37528.003.7
97.60.21728.845.3
97.20.27425.623.1
98.60.13328.114.2
Table 4 Ablation experiment results of different modules
Fig.7 Effect of allocation ratio on MHLFNet model performance
Fig.8 Comparison of classification accuracy and computational performance parameters of different models
Fig.9 Comparison of confusion matrices of different models
Fig.10 Visualization results of feature maps of MHLFNet model
Fig.11 Class activation heat maps of different models
 
[[1]]   LIU T Y, ZHENG P, BAO J S. Deep learning-based welding image recognition: a comprehensive review[J]. Journal of Manufacturing Systems, 2023, 68: 601-625.
[[2]]   纪晓东, 程天宇, 华亮, 等. 基于声信号识别的水下焊接质量检测方法研究[J]. 工程设计学报, 2023, 30(5): 562-570. doi:10.3785/j.issn.1006-754X.2023.00.066
JI X D, CHENG T Y, HUA L, et al. Research on detection method of underwater welding quality based on acoustic signal recognition[J]. Chinese Journal of Engineering Design, 2023, 30(5): 562-570.
doi: 10.3785/j.issn.1006-754X.2023.00.066
[[3]]   ZHANG X B, FENG J, LU S X, et al. FMD-framework: a size estimation method for pipeline defects in weld-affected zones[J]. IEEE Transactions on Instrumentation and Measurement, 2023, 72: 3508711.
[[4]]   YANG L, SONG S A, FAN J F, et al. An automatic deep segmentation network for pixel-level welding defect detection[J]. IEEE Transactions on Instrumentation and Measurement, 2022, 71: 5003510.
[[5]]   陈涛, 董袁航, 张赛, 等. 高压电缆铝护套焊缝缺陷ACFM检测方法及检测系统的研究[J]. 工程设计学报, 2022, 29(3): 394-400.
CHEN T, DONG Y H, ZHANG S, et al. Research on ACFM detection method and detection system for weld defects of aluminum sheath of high voltage cable[J]. Chinese Journal of Engineering Design, 2022, 29(3): 394-400.
[[6]]   LIU T Y, ZHENG P, BAO J S, et al. A state-of-the-art survey of welding radiographic image analysis: challenges, technologies and applications[J]. Measurement, 2023, 214: 112821.
[[7]]   陈振华, 郑志远, 卢超. 不锈钢焊缝中超声传播特性及TOFD检测方法研究[J]. 电子测量与仪器学报, 2017, 31(7): 1129-1136.
CHEN Z H, ZHENG Z Y, LU C. Research on wave propagation characteristics in austenite stainless steel weld andultrasonic TOFD testing technique[J]. Journal of Electronic Measurement and Instrumentation, 2017, 31(7): 1129-1136.
[[8]]   HABIBPOUR-LEDARI A, HONARVAR F. Three dimensional characterization of defects by ultrasonic time-of-flight diffraction (ToFD) technique[J]. Journal of Nondestructive Evaluation, 2018, 37(1): 14.
[[9]]   TANG D L, ZHANG J H, WANG P J, et al. Weld TOFD defect classification method based on multi-scale CNN and cascaded focused attention[J]. Journal of Manufacturing Processes, 2025, 138: 157-168.
[[10]]   AL-ATABY A, AL-NUAIMY W, BRETT C R, et al. Automatic detection and classification of weld flaws in TOFD data using wavelet transform and support vector machines[J]. Insight: Non-Destructive Testing and Condition Monitoring, 2010, 52(11): 597-602.
[[11]]   林乃昌, 杨晓翔, 林文剑, 等. 基于改进的KPCA的TOFD图像缺陷识别方法[J]. 福州大学学报(自然科学版), 2014, 42(2): 277-281.
LIN N C, YANG X X, LIN W J, et al. Research on defect recognition of TOFD image based on improved KPCA[J]. Journal of Fuzhou University (Natural Science Edition), 2014, 42(2): 277-281.
[[12]]   THERESA CENATE C F, SHEELA RANI B, RAMADEVI R, et al. Optimization of the cascade feed forward back propagation network for defect classification in ultrasonic images[J]. Russian Journal of Nondestructive Testing, 2016, 52(10): 557-568.
[[13]]   NI X F, LIU H L, MA Z J, et al. Detection for rail surface defects via partitioned edge feature[J]. IEEE Transactions on Intelligent Transportation Systems, 2022, 23(6): 5806-5822.
[[14]]   GONG X Y, SU H, XU D, et al. Contour extraction and quality inspection for inner structure of deep hole components[J]. IEEE Transactions on Components, Packaging and Manufacturing Technology, 2019, 9(3): 575-585.
[[15]]   LIANG Y, XU K, ZHOU P, et al. Automatic defect detection of texture surface with an efficient texture removal network[J]. Advanced Engineering Informatics, 2022, 53: 101672.
[[16]]   JHA S B, BABICEANU R F. Deep CNN-based visual defect detection: survey of current literature[J]. Computers in Industry, 2023, 148: 103911.
[[17]]   ROCA BARCELÓ F, JAÉN DEL HIERRO P, RIBES LLARIO F, et al. Development of an ultrasonic weld inspection system based on image processing and neural networks[J]. Nondestructive Testing and Evaluation, 2018, 33(2): 229-236.
[[18]]   黄焕东, 胡利晨, 李斌彬, 等. 基于区域的快速卷积神经网络的焊缝TOFD检测缺陷识别[J]. 无损检测, 2019, 41(7): 12-18.
HUANG H D, HU L C, LI B B, et al. Recognition of defect in TOFD image based on faster region convolutional neural networks[J]. Nondestructive Testing, 2019, 41(7): 12-18.
[[19]]   支泽林, 姜洪权, 杨得焱, 等. 图谱数据深度学习融合模型及焊缝缺陷识别方法[J]. 西安交通大学学报, 2021, 55(5): 73-82.
ZHI Z L, JIANG H Q, YANG D Y, et al. A deep learning fusion model of wave and image data for weld defect recognition[J]. Journal of Xi’an Jiaotong University, 2021, 55(5): 73-82.
[[20]]   ZHI Z L, JIANG H Q, YANG D Y, et al. An end-to-end welding defect detection approach based on titanium alloy time-of-flight diffraction images[J]. Journal of Intelligent Manufacturing, 2023, 34(4): 1895-1909.
[[21]]   LIU Z, LIN Y T, CAO Y, et al. Swin Transformer: hierarchical vision Transformer using shifted windows[EB/OL]. (2021-08-17) [2025-03-20]. .
[[22]]   ZHU L, WANG X J, KE Z H, et al. BiFormer: vision Transformer with bi-level routing attention[EB/OL]. (2023-03-15) [2025-03-20]. .
[[23]]   TAY Y, DEHGHANI M, BAHRI D, et al. Efficient Transformers: a survey[J]. ACM Computing Surveys, 2022, 55(6): 1-28.
[[24]]   ALI A M, BENJDIRA B, KOUBAA A, et al. Vision Transformers in image restoration: a survey[J]. Sensors, 2023, 23(5): 2385.
[[25]]   REN H Y, DAI H J, DAI Z H, et al. Combiner: full attention Transformer with sparse computation cost[EB/OL]. (2021-10-28) [2025-03-20]. .
[[26]]   YU T, KHALITOV R, CHENG L, et al. Paramixer: parameterizing mixing links in sparse factors works better than dot-product self-attention[EB/OL]. (2022-04-22) [2025-03-20]. .
[[27]]   全国锅炉压力容器标准化技术委员会. 承压设备无损检测 第10部分: 衍射时差法超声检测: NB/T 47013.10—2015 [S]. 北京: 新华出版社, 2015.
National Standardization Technical Committee for Boilers and Pressure Vessels. Nondestructive testing of pressure equipments: Part 10: ultrasonic time of flight diffraction technique: NB/T 47013.10—2015 [S]. Beijing: Xinhua Publishing House, 2015.
[1] Kaisong WANG,Yiming WEI,Wei TANG,Xuhua GUO,Zhaoyang LI,Jun ZOU. Fault prediction method of pipeline blockage in wet spray trolley pumping system based on CNN-LSTM-Attention model[J]. Chinese Journal of Engineering Design, 2025, 32(6): 759-768.
[2] Ni ZENG,Zongfang MA,Lin SONG,Ming DUAN. Research on intelligent detection method of 3D printed concrete interface pore[J]. Chinese Journal of Engineering Design, 2025, 32(1): 11-22.
[3] Miao XIE,Qingshuang MENG,Bo LI,Jinnan LU,Yuqi LI,Zhiyong YANG. Idler fault diagnosis method fusing short-time Fourier transform and convolutional neural network[J]. Chinese Journal of Engineering Design, 2024, 31(5): 565-574.
[4] Jianxiong SHEN,Yingyuan LIU,Leqin WANG. Deep learning-based method for parametrized modeling of airfoil[J]. Chinese Journal of Engineering Design, 2024, 31(3): 292-300.