• Chinese Journal of Lasers
  • Vol. 49, Issue 21, 2104005 (2022)
Song Cheng1, Honggang Yang1, Xueqian Xu1, Min Li2, and Yunxia Chen1、*
Author Affiliations
  • 1School of Mechanical Engineering, Shanghai Dianji University, Shanghai 201306, China
  • 2Shanghai University of Electric Power, Shanghai 201306, China
  • show less
    DOI: 10.3788/CJL202249.2104005 Cite this Article Set citation alerts
    Song Cheng, Honggang Yang, Xueqian Xu, Min Li, Yunxia Chen. Improved Lightweight X-Ray Aluminum Alloy Weld Defects Detection Algorithm Based on YOLOv5[J]. Chinese Journal of Lasers, 2022, 49(21): 2104005 Copy Citation Text show less

    Abstract

    Objective

    Industrial equipment is prone to various internal welding defects during the process owing to factors such as the manufacturing process and welding environments, such as pores, slag inclusion, and incomplete penetration. However, the problem of small defects in radiographic inspection of weld defects is challenging as well. The most serious problem is the lack of detailed features visible to the naked eye, making it difficult to distinguish between the foreground and background during the inspection process. Therefore, it is essential to detect the internal defects of the weld in real-time. In industrial inspection, the type of X-ray flaw detection images is generally determined and located manually. Manual film evaluation has a high workload and low efficiency, as well as false and missed detection. Deep learning is now widely used in target recognition, thanks to the rapid development of computer and digital image processing technology. In this paper, a weld defect detection algorithm based on lightweight YOLOv5-Tiny is proposed, which is combined with the characteristics of weld internal defects in X-ray images.

    Methods

    First, the edges of pores and incomplete penetration are blurred, making it difficult for the model to extract the edge information of defects, resulting in a low model recall rate. Therefore, an attention mechanism SELayer is added to the Backbone part. This mechanism can use limited attention resources to quickly filter out high-value information from a large amount of information, allowing the model to pay more attention to the edge information of defects, retains more edge information, and improve the model’s performance continuously. Second, replace all C3 modules with the GhostBottleneck module in the Head section. The GhostBottleneck module is composed of two GhostConv modules and a residual edge. The function of the GhostConv_1 module is to process the input feature map by convolution, normalization, and activation function; the GhostConv_2 module removes the activation function and processes the feature map using convolution and normalization to connect the context information. Therefore, after nonlinear convolution, the model is convolved and normalized again on the feature map, allowing it to capture more feature maps and eliminate redundant features, resulting in a more lightweight model. Finally, the 13×13 feature layer used to detect large objects is removed, and the 26×26 and 52×52 feature layers are reserved for predicting pores, slag inclusion, and incomplete penetration, thereby speeding up the training and prediction of the model.

    Results and Discussions

    When compared to the original YOLOv5 model, the improved model changes more gently in accuracy and recall without large fluctuations during the training process (Fig. 8). The attention mechanism and GhostBottleneck module enable the model to learn more defect features, and various detection indicators such as accuracy, recall, AP (average precision), and mAP (mean average precision) values have significantly improved (Table 5 and Table 7). The 13×13 feature layer is removed and combined with depth separable convolution, so that the model reduces the number of parameters by 33.6%, the processing time of each frame by 14.9% ( shortens from 0.0175 s to 0.0149 s), and the size of the prediction weight by 32.8% (Table 6).

    Conclusions

    An improved lightweight YOLOv5-Tiny weld internal defect detection algorithm is proposed to address the problem of difficult detection of small target defects in X-ray weld images. The algorithm adds an attention mechanism, replaces the C3 module in the enhanced feature extraction network with the GhostBottleneck module, deletes the 13×13 feature layer used to detect large targets, and replaces part of ordinary convolution with depthwise separable convolution when compared to the original YOLOv5 model. Therefore, while the number of model parameters is reduced, the edge information of three defects, such as pore, slag inclusion, and incomplete penetration, is more accurately preserved. Finally, the improved model is trained using the CIoU and DIoU loss functions, respectively. The training results show that the improved model can improve the detection indicators of F1, AP, and mAP of the three defects, and its processing velocity has been significantly improved. The processing time of a single frame of images is reduced from 0.0175 s of the YOLOv5 model to 0.0149 s. When compared to the original YOLOv5s algorithm, the YOLOv5-Tiny algorithm has a faster detection speed and higher recall rate, and its smaller prediction weight is more convenient for embedded use. The proposed algorithm is of great significance for the rapid and accurate defect detection of aluminum alloy weld radiographic images.

    Song Cheng, Honggang Yang, Xueqian Xu, Min Li, Yunxia Chen. Improved Lightweight X-Ray Aluminum Alloy Weld Defects Detection Algorithm Based on YOLOv5[J]. Chinese Journal of Lasers, 2022, 49(21): 2104005
    Download Citation