摘要
针对YOLO模型在铝合金焊缝DR(digital radiography)图像上检测精度不足、模型参数量大的问题,同时为了进一步提升YOLO模型的检测效率,本课题组提出了基于YOLOv7Tiny的改进模型——YOLOv7TS.首先,添加TSCODE解耦头,以提高模型对小目标的检测能力;针对未焊透缺陷长宽比过高导致召回率低的问题,同时也为了增加网络的感受野,将上采样算子改为CARAFE.其次,针对部分像素较低的气孔和夹渣缺陷,添加SPD-Conv卷积层,以提升模型对小目标的检测能力.最后,减小模型的深度和宽度,并通过添加SimAM注意力机制来改进ELAN层,以提高模型的整体性能.实验结果表明:与原模型相比,YOLOv7TS模型对气孔、夹渣和未焊透缺陷检测的精度分别提升了 8.2、3.7、2.2个百分点,mAP@0.5提高了 4.6个百分点,模型参数量下降了 5%.
Abstract
Objective Due to factors involved in the manufacturing process,aluminum alloy materials are prone to various internal welding defects,such as pores,slag inclusion,and incomplete penetration.However,in the DR(digital radiography)image defect detection of aluminum alloy welds,detection accuracy of the model remains insufficient.Thus far,defect detection in DR images is generally determined and located manually.However,manual film evaluation involves a high workload,with low efficiency and other issues such as false and missed detection.With the rapid development of digital image processing technology,deep learning has been widely applied for object recognition.This study proposes a lightweight YOLOv7Tiny based weld defect detection model,YOLOv7TS,to realize DR image defects detection of aluminum alloy welds.Methods First,a TSCODE decoupling head was added to improve the algorithm's ability to detect small targets.To address the high aspect ratio of incomplete penetration defects and low recall rate,the Upsampling operator was changed to CARAFE to improve the receptive field.Second,for small pixel defects such as pores and slag inclusion,an SPD-Conv convolutional layer was added to enhance the small target detection ability of the model.Finally,a SimAM attention mechanism was added to reduce the depth and width of the model and to improve the overall model performance and ELAN layer.Results and Discussions For pore,slag inclusion,and incomplete penetration,the average precision(AP)of the YOLOv7TS model reached 89.9%,94.2%,and 96.3%,respectively.Compared with the original YOLOv7Tiny model,average accuracy increased by 8.2,3.7,and 2.2 percentage points,and the overall accuracy was compared to the original model,mAP@0.5,improved by 4.6 percentage points(Table 1).Meanwhile,the model parameter quantity decreased by 5%compared to the original model.Although the FPS index decreased from 222 to 208,it still meets the target detection speed requirements(Table 2).Conclusions This study focuses on key challenges including low accuracy and large model parameters for incomplete penetration defect detection in aluminum alloy weld DR images using the YOLO model.To address these challenges,we improved the YOLOv7Tiny model and proposed a new model:YOLOv7TS.The proposed model effectively improves weld defect detection accuracy.First,the addition of a TSCODE decoupling head increases the average accuracy,however,this increases the number of parameters.Second,by replacing the Upsampling operator with CARAFE and increasing the model receptive field,the average accuracy is improved.Subsequently,the first-layer convolution module is replaced with the SPD-Conv module,and a SimAM attention mechanism is included in the ELAN module.The depth and width of the model were reduced to one-third and half that of the original model,resulting in an average accuracy improvement of 4.6 percentage points and 5%decrease in parameter quantity compared to the original model.Furthermore,the proposed YOLOv7TS model demonstrates higher detection accuracy and smaller parameter size,making it more straightforward to deploy to other terminal devices.