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.
-
Keywords:
- defect detection /
- weld /
- deep learning /
- object detection /
- lightweight
-
0. 序言
近年来铝及铝合金在航空航天领域得到广泛应用[1-3]. 氩弧焊由于其焊后接头质量好、工艺稳定性强、焊接可达性好,广泛用于焊接易氧化、化学性质活泼的铝合金[4-5]. 而在实际应用中,由于铝合金焊接过程中工件表面氧化膜受到阻热作用,严重影响铝合金焊接效率. 利用铝合金氩弧焊交流反接时的“阴极雾化”作用虽然可以保证焊接质量,但是铝合金氩弧焊反接时钨电极烧损严重,并且电弧产热主要集中在阳极,这导致电弧能量的利用效率降低,从而降低了熔深. 通过电源正负半波比例的优化也不能完全消除这一局限,而氦弧焊不仅出现了氧化膜撕裂的现象,使氧化膜破碎、汽化,同时还增加了阳极热功率[6],为彻底突破这一限制提供了可能性. 文中以实际焊接过程中热量传输效率为切入点,阐明了氦弧焊特有氧化膜撕裂现象的产生机理,分析了气体流量对氧化膜撕裂程度及电弧能量利用效率的影响,建立了熔池液面微分方程,为铝合金非熔化极直流正接氦弧焊的推广奠定了理论基础.
1. 试验方法
试验选用的5083铝合金板材规格为720 mm × 190 mm × 12 mm,母材的化学成分如表1所示.
表 1 母材化学成分及含量(质量分数,%)Table 1. Chemical composition of base metalMg Mn Cr Cu Zn Fe Al 4.0 ~ 4.9 0.4 ~ 1.0 0.05 ~ 0.25 0 ~ 0.1 0 ~ 0.25 0 ~ 0.4 余量 试验采用直流正接的极性接法进行平板堆焊,同时通过CP80-3-M-540高速相机观察焊接过程中的电弧形态及熔池氧化膜撕裂过程,相机的频率设定为1 000 Hz,拍摄熔池氧化膜撕裂时加装808 nm波长滤光片以滤除弧光,并搭配808 nm的激光背景光源,保护气体为99.995%的纯氦气,焊接工艺试验主要参数如表2所示.
表 2 试验主要工艺参数Table 2. Processing parameters of experiment焊接速度v/(mm·min−1) 钨针直径
d/mm气体流量
Q/(L·min−1)针尖到工件
距离S/mm焊接电流
I/A300 3.0 10 ~ 20 3 180 2. 试验结果及分析
2.1 试验结果及初步分析
与氩弧形貌不同的是氦弧的形貌呈倒扣碗状,这是由于氦原子分子量较小,更容易受电弧粒子热运动的干扰. 试验过程中得到的电弧及熔池氧化膜撕裂分别如图1、图2所示. 高速摄影观测到铝合金氧化膜首先在熔池前端中心尖角撕裂,然后整个熔池表面氧化膜被缓慢推向熔池边缘,直至氧化膜堆叠至达到新的平衡状态并出现新的尖角撕裂,如此在整个焊接过程中循环往复,且随着气体流量的增加,氧化膜撕裂程度减小.
氦弧焊氧化膜撕裂现象降低了电弧与熔池之间的热阻,假设电弧周围达到了局部热力学平衡状态以简化讨论. 氦弧至熔池的热阻
$\mathop R\nolimits_{{\rm{int}}}$ 包括氧化膜热阻以及弧液界面两部分,氧化膜热阻${R_{{\rm{oxi}}}}$ 由辐射热阻$\mathop R\nolimits_{{\rm{oxi}}}^{{\rm{rad}}}$ 和传导热阻$R_{{\rm{oxi}}}^ {\rm{c}}$ 共同确定. 影响氧化膜热阻的因素较多,主要包括氧化膜的类别、特性和厚度、界面冷却速率等,且由于研究条件和方法不尽相同,所得的结论也略有差异[7-8]. 对于最终的电弧能量利用效率,选用单位时间内用来熔化被焊金属的有效热量与设备输出功率之比来表征,即$$ E_{{\rm{f}}} = \frac{{c\Delta T\displaystyle\iint\limits_\varOmega {v{\rm{d}}x{\rm{d}}y}}}{{UI}} $$ (1) 式中:Ω为焊缝闭合轮廓线;
$ v $ 为焊接速度;c为材料热容; ΔT为材料熔点与环境温度的差值;U为电弧电压.焊缝横截面结果如图3所示,利用Image-Pro Plus软件对焊缝横截面外轮廓进行特征提取并代入式(1)进一步计算,测量及计算结果如图4所示,其中相对能量效率于20 L/min时最大.
熔池深度、深宽比、电弧能量效率均随气体流量增加而增大. 氦弧与熔池间强制对流换热系数Nux会随着气流速度增大而增大,故随着气体流量增加氧化膜撕裂程度虽然减小,电弧相对能量利用效率却提高.
$$ N{u_{{x}}} = 0.338\,\,7{{\mathop{R}\nolimits} _{\rm{e}}}^{1/2}{{\mathop{P}\nolimits} _{\rm{r}}}^{1/3}\bigg/{\left[ {1 - {{\left( {\frac{{0.046\,\,8}}{{{{\mathop{\rm P}\nolimits} _{\rm{r}}}}}} \right)}^{2/3}}} \right]^{1/4}} $$ (2) 式中:普朗克数Pr对于气体约等于1;雷诺数Re会随着气流速度增大而增大.
2.2 氧化膜撕裂机理分析
能够影响电弧的基本作用力有电弧压力
$ P $ 、电弧剪切力$ \tau $ 、电磁力T、表面张力$ \sigma $ 、重力G、浮力N、气体压力$ f $ 等[9-10],此处电弧压力是等离子体在工件表面被俘的粘滞压力,与气体压力相区别. 氦弧焊阳极区热功率比氩弧焊提高了一倍[1],电弧温度尤其是阳极区温度对比氩弧有极大提高. 从公式(3)可知,对于剪切力,氦弧为牛顿流体,则氦气的动力粘度$ \mu $ 随温度升高而增加,故而在相同电流及气体流量情况下电弧剪切力比氩弧明显提升. 此外随着气体流量增加导致强制对流换热系数增大,熔池整体温度提高,熔池中心指向熔池边缘的表面张力随着电弧温度由边缘向中心的升高而下降,因此熔池中心的氧化膜化学键结合强度较低,更容易被撕裂. 也就是说,由熔池中心向熔池边缘会形成由易到难的不同程度的氧化膜撕裂,导致氧化膜破碎,最终在电弧高温下不断汽化.$$ \tau {\text{ = }}\mu \frac{{\partial v}}{{\partial y}}{|_{y = 0}} $$ (3) 无脉冲直流正接氦弧焊熔池震荡并不明显,对于液面的确定文中主要采用静力学平衡方程. 对于氦弧焊熔池液面的确定,取液面与垂直面的交线,令液面与水平方向夹角为
$ \alpha $ ,电弧粒子速度与水平方向夹角$ \alpha ' $ ,则对于液面与垂直面的交线有静力学平衡方程,即$$ \left\{ \begin{gathered} {{N}}\cos \alpha + \sigma \sin \alpha + P\cos \alpha + f\cos \alpha ' - T\sin \alpha = 0 \hfill \\ N\cos \alpha + \sigma \cos \alpha + P\sin \alpha + f\sin \alpha ' - T\cos \alpha = 0 \hfill \\ \end{gathered} \right. $$ (4) Mendez等人[11]用数量级缩放法对TIG电弧等离子体速度及电弧压强分布函数做了定量刻画,有
$$ \left\{ \begin{array}{l} {Z_{\rm{S}}} = 0.88{R_{\rm{e}}}^{0.058}{\left( {h/{R_{\rm{c}}}} \right)^{0.34}}{{\hat Z}_{\rm{S}}}\\ {V_{\rm{RS}}} = 0.88{R_{\rm{e}}}^{ - 0.026}{\left( {h/{R_{\rm{c}}}} \right)^{0.086}}{{\hat V}_{{\rm{RS}}}}\\ {V_{{\rm{ZS}}}} = 0.88{R_{\rm{e}}}^{0.026}{\left( {h/{R_{\rm{c}}}} \right)^{0.008\,\,6}}{{\hat V}_{{\rm{RS}}}}\\ {P_{\rm{S}}} = 0.88{R_{\rm{e}}}^{0.017}{\left( {h/{R_{\rm{c}}}} \right)^{ - 0.057}}{{\hat V}_{{\rm{RS}}}} \end{array} \right. $$ (5) 且
$$ \left\{ \begin{array}{l} {{\hat Z}_{\rm{S}}} = \dfrac{1}{2}{R_{\rm{c}}}\\ {{\hat V}_{{\rm{RS}}}} = {{\hat V}_{{\rm{ZS}}}} = \dfrac{1}{2}\dfrac{{{\mu _0}^{1/2}{R_{\rm{C}}}^2{J_{\rm{C}}}^2}}{{{\rho ^{1/2}}}}\\ {{\hat P}_{\rm{S}}} = \dfrac{1}{2}{\mu _0}{R_{\rm{C}}}^2{J_{\rm{C}}}^2 \end{array} \right. $$ (6) 式中:
$ {\mu _0} $ 为保护气体的真空磁导率;${R_{\rm{C}}}$ 为钨针端头直径;${J_{\rm{C}}}$ 为钨针端头电流密度;h为熔池液面下凹高度.${Z_{\rm{S}}}$ 为钨针轴坐标修正值;${\hat Z_{\rm{S}}} $ 为钨针轴坐标理论估计值;${V_{{\rm{RS}}}}$ 为电弧等离子体径向速度修正值;${{\hat V}_{{\rm{RS}}}}$ 为电弧等离子体径向速度理论估计值;$V_{\rm{ZS}} $ 为电弧等离子体轴向速度修正值;${{\hat V}_{{\rm{ZS}}}} $ 为电弧等离子体轴向速度理论估计值;PS为压强. 又单位面积内$f = 2/3 n\overline E$ ,$ \overline E $ 为粒子平均动能. 电弧气氛与大气联通,粒子密度近似为定值,代入联立式(4)~式(6),可得熔池液面与垂直面交线微分方程为$$ \frac{{{\rm{d}}y}}{{{\rm{d}}x}} = {{R_{\rm{e}}} ^{0.198}}{(h/{R_{\rm{c}}})^{ - 0.154}} $$ (7) 从公式(7)可知,在距离熔池中心相同距离处,气体流量的增加导致雷诺数
${R_{\rm{e}}}$ 的增加,要使熔池达到新的平衡,只能使h降低,即熔池液面继续下凹取得更大斜率. 也就是说,液面随气体流量增大下凹程度增加,氧化膜撕裂程度随气体流量增加而减小.有研究[12]发现氧化物在熔池表面电弧高温情况下存在解离现象,熔池液面表面张力温度系数实际为正. 气体流量增加增大了电弧与熔池之间强制对流换热系数,在熔池中心温度升高,由熔池边缘指向熔池中心的表面张力增强,导致氧化膜的撕裂程度的减小.
3. 结论
(1) 氦弧焊阳极热功率的增加削弱了氧化膜之间化学键强度,相对于氩弧焊提高了动力粘度进而增大了电弧剪切力,产生了氧化膜撕裂现象.
(2) 在试验参数范围内随着气体流量增加氧化膜撕裂程度减小,但焊缝深宽比以及电弧能量效率提高.
(3) 熔池液面下凹程度增大及熔池中心至边缘表面张力减小,使得氧化膜撕裂程度随氦气流量增加而减弱.
-
表 1 模型性能对比
Table 1 Model performance comparison
模型 均值平均精度
PA0.5参数量
PM/M测试时间
t/ms每秒传输帧数FPS/
(帧·s−1)YOLOv5s 92.04 7.03 23.47 42.61 YOLOv3 91.33 61.54 190.48 5.25 Faster-RCNN 89.67 41.14 158.73 6.30 Cascade-RCNN 90.46 68.94 126.90 7.88 CentripetalNet 88.19 205.68 127.06 7.87 LHODM 91.62 3.99 15.76 63.47 表 2 LHODM模块消融结果
Table 2 Module ablation results of LHODM
模型 准确率P(%) 召回率R(%) 均值平均精度PA0.5 参数量PM/M 测试时间t/ms 每秒传输帧数FPS/(帧·s−1) YOLOv5s 90.17 87.36 92.04 7.03 23.47 42.61 YOLOv5s + ULConv 85.52 83.15 88.46 3.69 15.31 65.33 YOLOv5s + CARAFE 91.39 88.44 92.33 7.20 25.58 39.09 YOLOv5s + L-ELCC 89.77 88.01 92.41 7.21 25.54 39.16 YOLOv5s + OS-IoU 89.21 87.58 92.19 7.03 23.47 42.61 YOLOv5s + ULConv + CARAFE 85.76 83.20 88.73 3.86 17.94 55.74 YOLOv5s + ULConv + CARAFE + ELCC 86.32 84.67 89.70 3.99 15.76 63.47 LHODM 89.98 87.79 91.62 3.99 15.76 63.47 -
[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.