高级检索

一种轻量级高效X射线焊缝图像缺陷检测方法

王睿, 高少泽, 刘卫朋, 王刚

王睿, 高少泽, 刘卫朋, 王刚. 一种轻量级高效X射线焊缝图像缺陷检测方法[J]. 焊接学报, 2024, 45(7): 41-49. DOI: 10.12073/j.hjxb.20230630003
引用本文: 王睿, 高少泽, 刘卫朋, 王刚. 一种轻量级高效X射线焊缝图像缺陷检测方法[J]. 焊接学报, 2024, 45(7): 41-49. DOI: 10.12073/j.hjxb.20230630003
WANG Rui, GAO Shaoze, LIU Weipeng, WANG Gang. A lightweight and efficient X-ray weld image defect detection method[J]. TRANSACTIONS OF THE CHINA WELDING INSTITUTION, 2024, 45(7): 41-49. DOI: 10.12073/j.hjxb.20230630003
Citation: WANG Rui, GAO Shaoze, LIU Weipeng, WANG Gang. A lightweight and efficient X-ray weld image defect detection method[J]. TRANSACTIONS OF THE CHINA WELDING INSTITUTION, 2024, 45(7): 41-49. DOI: 10.12073/j.hjxb.20230630003

一种轻量级高效X射线焊缝图像缺陷检测方法

基金项目: 国家自然科学基金资助项目(62073118)
详细信息
    作者简介:

    王睿,讲师;主要从事焊接过程控制和焊缝缺陷检测等研究;Email: wangrui@hebut.edu.cn

  • 中图分类号: TG 441

A lightweight and efficient X-ray weld image defect detection method

  • 摘要:

    针对当前深度学习模型在焊缝缺陷检测工作中成本高、速度慢、不易在终端部署应用等问题,提出一种效果良好的轻量级高效模型(lightweight and high-precision optimized detection model,LHODM). 首先,搭建新型主干网络并设计超轻量卷积ULConv作为网络基础卷积,降低模型深度,用Depthwise操作生成更多有效冗余特征映射,减少参数与运算量. 其次,设计高效轻量级专注模块ELCC,在响应模型轻量化前提下,考虑焊缝缺陷分布特性与成像规律,从水平和垂直两个方向捕获孤立区域关系,结合轻量级上采样算子CARAFE,使模型特征重组时具有更大的感受野,更有效地利用环境周围信息,弥补轻量化造成的精度损失. 最后,为提高收敛速度和损失函数效率,设计OS-IoU损失函数,考虑期望回归向量之间的夹角,重新定义惩罚项及相关性,强化距离损失和形状损失关注程度. 结果表明,LHODM模型检测准确率和检测速度达到91.62%和63.47帧/s,参数量仅为3.99 M,有效解决了焊缝缺陷检测工作中成本高和速度慢的问题.

    Abstract:

    In response to the high cost, slow speed, and difficulty in deploying deep learning models in weld defect detection, this paper proposes a lightweight and high precision optimized detection model (LHODM) with good performance. Firstly, a new backbone network is built and an ultra lightweight convolutional ULConv is designed as the network foundation convolution to reduce model depth, and Depthwise operation was used to generate more effective redundant feature mappings, reducing the amount of parameters and computation. Secondly, an efficient and lightweight dedicated module ELCC is designed. Under the premise of lightweight response model, the distribution characteristics of weld defects and imaging rules are considered, and the relationship between isolated areas is captured from both horizontal and vertical directions.Combined with the lightweight up-sampling operator CARAFE, the model has a larger receptive field during feature recombination, makes more effective use of ambient information, and makes up for the loss of lightweight accuracy. Finally, in order to improve convergence speed and loss function efficiency, an OS-IoU loss function is designed, taking into account the angle between the expected regression vectors, redefining the penalty term and correlation, and strengthening the attention to distance loss and shape loss. The results showed that the LHODM model achieved detection accuracy and speed of 91.62% and 63.47 frames per second, with a model memory cost of only 3.99 million, effectively solving the problems of high cost and slow speed in weld defect detection work.

  • 焊接过程中工件受热不均匀引起焊接残余应力[1]. 铝合金热膨胀系数大,在焊接时容易形成较大的残余应力. 残余应力影响产品的承载性能和使用寿命[2-5],准确测试焊接残余应力具有重要的工程意义. 在残余应力测试方法中,X射线法因测试成本适中、设备便携、对产品无损伤等优点而得到较为广泛的应用[6-9].

    材料的均匀性假设是X射线法应力测试的基本假设之一,但是材料中晶粒的择优取向破坏了材料的均匀性,使材料呈现出微观应变不均匀的特点[10-11],进而降低X射线应力测试的精度.

    国内外学者对多晶体材料微观应变不均匀现象做了大量研究[12],Withers等人[13]指出微观应变与宏观弹性应变不同,它只在几个晶粒尺寸范围内平衡,即使卸载宏观应力,这种微观应变也依然存在. Stukowski等人[14]采用试验研究与数值计算相结合的方法证明了多晶体材料普遍存在着微观应变导致的X射线宽化现象. Wilkens[15]采用理论推演的方法证明了小角度晶界处微观应变导致X射线宽化. 现有关于铝合金X射线衍射的研究表明,当晶粒尺寸大于100 nm时,X射线衍射峰半高宽能够反应材料微观应变的大小[16-17]. 虽然以上研究揭示了微观应变对X射线衍射的影响,但关于微观应变对X射线衍射应力测试的影响及其解决办法却少有报道. 文中以6061-T6铝合金为研究对象,基于对X射线衍射峰半高宽的分析,研究在不同准直器直径及摇摆角条件下X射线衍射晶粒群的微观应变的均匀性,进而探究合理的X射线应力测试工艺参数,并对6061-T6铝合金MIG焊接接头残余应力进行测试.

    图1为等强梁尺寸及其预置应力方案图. 对3 mm厚6061-T6铝合金板用电火花加工方法按图1a所示加工2个等强梁1,2,并按图1b所示令等强梁一端固定,另一端悬挂3 kg配重块. 对1号等强梁采用单向应变片测试P点预置应力大小,对2号等强梁上P点应力采用加拿大Proto-MG40P X射线应力分析仪测试.对2号等强梁上P点采用X射线应力测试时,测试方法为同倾${\sin ^2}\psi $[18],入射X射线为Cr-Kα射线,测试晶面选取Al(311)晶面,衍射晶面的法线方向取向范围为${\sin ^2}\psi \in [0,0.6]$,并在此范围内等差值地选取30个$\psi $角进行衍射角测试,为研究不同准直器直径和摇摆角条件下X射线衍射晶粒群微观应变的均匀性,按表1设计对比试验.

    图  1  等强梁尺寸及其预置应力示意图 (mm)
    Figure  1.  Schematic diagram of equal-strength beam size and its pre-stress. (a) shape and size of equal-strength beam; (b) method of pre-stressing on equal-strength beam
    表  1  对比试验方案
    Table  1.  Comparative test plan
    组号准直器直径d/mm摇摆角$\;\beta$/(°)
    A-1 2 0
    A-2 3 0
    A-3 4 0
    B-1 4 0
    B-2 4 1
    B-3 4 2
    下载: 导出CSV 
    | 显示表格

    对2号等强梁应力测试完成后,采用电火花线切割机以P点为中心沿其四周切取8 mm × 6 mm × 3 mm试样,依次经机械磨抛和电解抛光后,采用FEI Quanta 650场发射电镜进行EBSD数据采集,并使用CHANNEL 5软件进行数据后处理.

    选取与等强梁相同批次的3 mm厚6061-T6铝合金板,采用全自动MIG焊机,以对接接头形式焊接铝合金试板,焊接电流76 A,焊接电压24 V,送丝速度3.6 mm/s,焊枪行走速度10 mm/s,气体(99.99% Ar)流量15 L/min. 焊后对焊接接头进行X射线衍射应力测试,应力测试点分布如图2所示.

    图  2  残余应力测试点分布(mm)
    Figure  2.  Distribution of the points for residual stress test (mm)

    在X射线衍射应力测试过程中,从靶材激发出的X射线通过准直器后,输出平行X射线束照射在待测材料表面,准直器直径的大小决定了被X射线照射区域的面积,进而决定了能够发生衍射的晶粒数目,对不同$\psi $角处衍射X射线的强度和半高宽(full width at half maximum,FWHM)进行统计,结果如图3所示.

    图  3  不同直径的准直器下衍射线强度及半高宽分布
    Figure  3.  Intensity and FWHM of diffraction profile under aperture with different diameters. (a) distribution of diffraction intensity; (b) distribution of FWHM

    图3表明随着准直器直径的增加,在各$\psi $角处X射线衍射强度增大,在$0< {\sin ^2}\psi < 0.3$范围内,衍射X射线的半高宽随着${\sin ^2}\psi $的增大而快速减小,而在$0.3<{\sin ^2}\psi < 0.6$范围内,衍射线半高宽随着${\sin ^2}\psi $的变化而小幅震荡,这表明随着准直器直径的增加,参与衍射的晶粒数目增加. 但是,当晶粒的择优取向较弱时,衍射晶粒群的平均微观应变依然不均匀. 而当晶粒的择优取向较强时,衍射晶粒群的平均微观应变的不均匀程度降低.

    对1号等强梁的P点采用应变片测试应力的结果为79.2 MPa. 对2号等强梁的P点采用X射线测试以后,采用公式(1)计算P点处的应力值.

    $$\sigma = \left[ { - \frac{1}{2} \cdot \frac{{\text{π}} }{{180}} \cdot {\rm{cot}}{\theta _0}\frac{E}{{\left( {1 + \varepsilon } \right)}}} \right]\frac{{\partial 2{\theta _\psi }}}{{\partial {\rm{si}}{{\rm{n}}^2}\psi }}$$ (1)

    式中:2θ0为Al(311)晶面无应力时的衍射角;2θψ为衍射晶面的法线位于ψ角处时测得的衍射角[18].Eε为其弹性模量和泊松比,取值分别为2θ0 = 139.31°,E = 69 GPa,ε = 0.35. 由于测试应力值仅与不同ψ角处测得的2θΨ相对于sin2ψ的变化率有关,与sin2ψ的具体值无关. 而在$0 < {\sin ^2}\psi < 0.3$$0.3 < {\sin ^2}\psi < 0.6$两个区间内参与X射线衍射的晶粒数目和平均微观应变的均匀性差异较大,因此分别采用这两个区间内测试得到的衍射角计算应力,结果如图4所示.

    图  4  准直器直径对应力测试结果的影响
    Figure  4.  Influence of aperture diameter on stress measurement results

    随着准直器直径的增加,X射线应力测试的精度提高. 在$0 <{\sin ^2}\psi < 0.3$范围内,由于晶体择优取向较弱,参与X射线衍射的晶粒数目较少,尽管增加准直器直径,其应力测试的精度依然较低.

    通过增加准直器直径可增加参与衍射的晶粒数目,但是若过分增加准直器直径,则测试区域内应力梯度的影响将增大,同时X射线束的发散度也增大,这些都将增加测试误差. 因此B组试验考虑在不改变准直器直径的条件下增加摇摆角. 随着摇摆角的增大,各ψ角处衍射峰半高宽的变化如图5所示.

    图  5  不同摇摆角下衍射线半高宽
    Figure  5.  FWHM of diffraction profile under different oscillation angles

    $0 < {\sin ^2}\psi < 0.3$范围内,衍射峰半高宽随着sin2ψ的增大而快速减小,并且摇摆角的增大并没有明显改变半高宽随sin2ψ的变化趋势,这表明当晶体择优取向较弱时,参与X射线衍射的晶粒数目少,增加摇摆角并不会明显改善各$\psi $角处衍射晶粒群微观应变的均匀性. 而在$0.3 < {\sin ^2}\psi < 0.6$范围内,晶体的择优取向较强,随着摇摆角的增加,各$\psi $角处衍射晶粒群的微观应变趋于均匀化.

    为分析增大摇摆角时衍射晶粒群变化的本质,对材料晶粒群亚晶之间的取向差进行统计分析,分别标记出晶粒内部大于0.5°,1°,2°的小角度晶界,结果如图6所示.

    图  6  晶界分布图
    Figure  6.  Grain boundary distribution map. (a) grain boundaries with misorientation greater than 0.5°; (b) grain boundaries with misorientation greater than 1°; (c) grain boundaries with misorientation greater than 2°

    图6中黑色线条表示的晶界为大于10°的晶界,晶粒内部白色线条分别表示大于0.5°,1°,2°的小角度晶界. 对比三幅图可知晶粒内部大部分亚晶之间的取向差值小于1°,在一个晶粒内部,不同亚晶所受的应力不均匀,而在多个晶粒尺度范围内,晶粒内部所有的亚晶所受应力的总和趋于平衡[4, 6]. 因此当入射X射线摇摆角从0°增加到1°时,参与衍射的亚晶数目明显增加,使衍射晶粒群的微观应变趋于均匀化. 而当摇摆角从1°继续增加到2°时,参与衍射的亚晶数目已不再明显增加,因此这两种条件下衍射晶粒群微观应变的均匀性差异较小.

    $0 < {\sin ^2}\psi < 0.3$$0.3 < {\sin ^2}\psi < 0.6$两个区间内,随着摇摆角的增加,应力测试结果如图7所示. 结果表明当摇摆角从0°增加到1°时,X射线应力测试精度明显提高,且在晶粒择优取向较强的取向范围内应力测试精度较高.

    图  7  摇摆角对应力测试结果的影响
    Figure  7.  Influence of oscillation angles on stress measurement results

    以上测试结果表明,增加摇摆角能够使各$\psi $角处衍射晶粒群的微观应变趋于均匀化,这有利于提高X射线法应力测试的精度.

    由以上分析,使用4 mm准直器、1°摇摆角,在$0.3 < {\sin ^2}\psi < 0.6$测试区间内对焊接接头残余应力进行测试,测试结果如图8所示.

    图  8  焊接残余应力分布
    Figure  8.  Distribution of welding residual stress. (a) distribution of σx along the x direction; (b) distribution of σy along the x direction; (c) distribution of σx along the y direction; (d) distribution of σy along the y direction

    (1) 增加准直器直径可以增加各个$\psi $角处衍射晶粒的数目,提高X射线衍射强度,但对各个$\psi $角处衍射晶粒群微观应变的均匀性影响较小,因此不能明显提高应力测试精度.

    (2) 在0° ~ 1°范围内增加摇摆角可使小角度晶界附近的亚晶都参与衍射,使各个$\psi $角处衍射晶粒群微观应变趋于均匀,应力测试精度明显提高.

    (3) 衍射晶粒群微观应变的均匀性与晶粒择优取向的强弱有关,晶粒择优取向越强,衍射晶粒群微观应变越均匀,应力测试精度越高.

  • 图  1   LHODM模型结构图

    Figure  1.   Model structure diagram of LHODM

    图  2   ELCC模块原理图

    Figure  2.   Schematic diagram of ELCC module

    图  3   CARAFE原理图

    Figure  3.   Schematic diagram of CARAFE

    图  4   OS-IoU损失

    Figure  4.   OS-IoU loss .(a) angle loss; (b) distance loss; (c) IoU loss

    图  5   训练结果收敛曲线

    Figure  5.   Convergence curve of model results. (a) F1-C curve; (b) P-C curve; (c) R-C curve; (d) P-R curve

    图  6   模型检测结果对比

    Figure  6.   Comparison of model detection results. (a) YOLOv5s; (b) CentripetalNet; (c) Faster-RCNN; (d) Cascade-RCNN; (e) YOLOv3; (f) LHODM

    表  1   模型性能对比

    Table  1   Model performance comparison

    模型均值平均精度
    PA0.5
    参数量
    PM/M
    测试时间
    t/ms
    每秒传输帧数FPS/
    (帧·s−1)
    YOLOv5s92.047.0323.4742.61
    YOLOv391.3361.54190.485.25
    Faster-RCNN89.6741.14158.736.30
    Cascade-RCNN90.4668.94126.907.88
    CentripetalNet88.19205.68127.067.87
    LHODM91.623.9915.7663.47
    下载: 导出CSV

    表  2   LHODM模块消融结果

    Table  2   Module ablation results of LHODM

    模型准确率P(%)召回率R(%)均值平均精度PA0.5参数量PM/M测试时间t/ms每秒传输帧数FPS/(帧·s−1)
    YOLOv5s90.1787.3692.047.0323.4742.61
    YOLOv5s + ULConv85.5283.1588.463.6915.3165.33
    YOLOv5s + CARAFE91.3988.4492.337.2025.5839.09
    YOLOv5s + L-ELCC89.7788.0192.417.2125.5439.16
    YOLOv5s + OS-IoU89.2187.5892.197.0323.4742.61
    YOLOv5s + ULConv + CARAFE85.7683.2088.733.8617.9455.74
    YOLOv5s + ULConv + CARAFE + ELCC86.3284.6789.703.9915.7663.47
    LHODM89.9887.7991.623.9915.7663.47
    下载: 导出CSV
  • [1] 樊丁, 胡桉得, 黄健康, 等. 基于改进卷积神经网络的管焊缝 X 射线图像缺陷识别方法[J]. 焊接学报, 2020, 41(1): 7 − 11.

    Fan Ding, Hu Ande, Hang Jiankang, et al. X-rayimage defect recognition method of pipe weld based on improved convolution alneural network[J]. Transactions of the China Welding Institution, 2020, 41(1): 7 − 11.

    [2]

    Huang X, Wang P, Zhang S, et al. Structural health monitoring and material safety with multispectral technique: A review[J]. Journal of Safety Science and Resilience, 2022, 3(1): 48 − 60. doi: 10.1016/j.jnlssr.2021.09.004

    [3] 徐建军, 石巍. 金属管道对接焊缝超声检测缺陷类型识别研究[J]. 世界有色金属, 2022(5): 226 − 228. doi: 10.3969/j.issn.1002-5065.2022.05.076

    Xu jianjun, Shi Wei. Research on identification of defect types in ultrasonic testing of metal pipeline butt welds[J]. World Nonferrous Metals, 2022(5): 226 − 228. doi: 10.3969/j.issn.1002-5065.2022.05.076

    [4]

    Xu X, Zhang X, Zhang T. Lite-yolov5: A lightweight deep learning detector for on-board ship detection in large-scene sentinel-1 sar images[J]. Remote Sensing, 2022, 14(4): 10 − 18. doi: 10.3390/rs14041018

    [5]

    Liang H, Seo S. Lightweight deep learning for road environment recognition[J]. Applied Sciences, 2022, 12(6): 31 − 68. doi: 10.3390/app12063168

    [6]

    Razfar N, True J, Bassiouny R, et al. Weed detection in soybean crops using custom lightweight deep learning models[J]. Journal of Agriculture and Food Research, 2022, 8: 100308. doi: 10.1016/j.jafr.2022.100308

    [7]

    Liu M, Chen Y, Xie J, et al. LF-YOLO: A lighter and faster yolo for weld defect detection of X-ray image[J]. IEEE Sensors Journal, 2023, 23(7): 7430 − 7439. doi: 10.1109/JSEN.2023.3247006

    [8]

    Zhu Y, Yang R, He Y, et al. A Lightweight multiscale attention semantic segmentation algorithm for detecting laser welding defects on safety vent of power battery[J]. IEEE Access, 2021, 9: 39245. doi: 10.1109/ACCESS.2021.3064180

    [9]

    Yang Y, Yang R, Pan L, et al. A lightweight deep learning algorithm for inspection of laser welding defects on safety vent of power battery[J]. Computers in Industry, 2020, 123: 1 − 8.

    [10]

    Guo K, He C, Yang M, et al. A pavement distresses identification method optimized for YOLOv5s[J]. Scientific Reports, 2022, 12(1): 35 − 42. doi: 10.1038/s41598-022-07527-3

    [11]

    Cao J, Li Y, Sun M, et al. Do-conv: Depthwise over-parameterized convolutional layer[J]. IEEE, 2006, 20: 3726 − 3736.

    [12]

    Mazzini D. Guided upsampling network for real-time semantic segmentation[J]. Springer Berlin Heidelbery, 2018(6): 19 − 26.

    [13]

    Frajka T, Zeger K. Downsampling dependent upsampling of images[J]. Signal Processing: Image Communication, 2004, 19(3): 257 − 265. doi: 10.1016/j.image.2003.10.003

    [14]

    Kundu S, Mostafa H, Sridhar S N, et al. Attention-based Image Upsampling[D]. New York: Cornell University, 2020.

    [15]

    Wang Jiaqi, Chen Kai, Xu Rui, et al. Carafe: Content-aware reassembly of features[C]//Proceedings of the IEEE/CVF International Conference on Computer Vision, Arxiv. 2019: 3007 − 3016.

    [16]

    Zhou M, Li B, Wang Jue. Optimization of hyperparameters in object detection models based on fractal loss function[J]. Fractal and Fractional, 2022, 6(12): 120706. doi: 10.3390/fractalfract6120706

    [17]

    Mery D, Riffo V, Zscherpel U, et al. GDXray: The database of X-ray images for nondestructive testing[J]. Journal of Nondestructive Evaluation, 2015, 34(4): 1 − 12.

    [18]

    Chen L, Tian X, Chai G, et al. A new CBAM-P-Net model for few-shot forest species classification using airborne hyperspectral images[J]. Remote Sensing, 2021, 13(7): 1269. doi: 10.3390/rs13071269

    [19]

    Dong Z, Li G, Liao Y, et al. Centripetalnet: Pursuing high-quality keypoint pairs for object detection[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Arxiv. 2020: 10519 − 10528.

    [20]

    Ren S, He K, Girshick R, et al. Faster R-CNN: Towards real-time object detection with region proposal networks[J]. Institute of Electrical and Electronics Engineers, 2017, 39(6): 1137 − 1149.

    [21]

    Cai Z, Vasconcelos N. Cascade: Delving into high quality object detection[C]//Proceedings of the IEEE Conference on Computer vision and Pattern Recognition, Arxiv. 2018: 6154 − 6162.

    [22]

    Redmon J, Farhadi A. Yolov3: An incremental improvement[J]. Astrophysicd Journal, 2018(7): 1804.

  • 期刊类型引用(0)

    其他类型引用(2)

图(6)  /  表(2)
计量
  • 文章访问数:  195
  • HTML全文浏览量:  35
  • PDF下载量:  43
  • 被引次数: 2
出版历程
  • 收稿日期:  2023-06-29
  • 网络出版日期:  2024-05-23
  • 刊出日期:  2024-07-24

目录

/

返回文章
返回