A method for weld surface defect detection based on an improved YOLOv5s algorithm
-
-
Abstract
To address the problems of small weld defects, low target detection accuracy, and the difficulty in deploying algorithms with massive parameters, a lightweight weld defect detection algorithm based on the improved YOLOv5s was proposed. The lightweight ShuffleNetv2 network was adopted as the backbone network to reduce the number of parameters and calculation amount of the model. The CBAM was improved and embedded into the backbone network to enhance the feature extraction ability of the network and improve the detection performance. A small target detection layer was added to the Head detection layer to improve the detection sensitivity of the algorithm to small target defects. Finally, the Focal EIoU loss function was introduced to enhance the accurate positioning ability of the model and improve the regression accuracy. The results indicate that compared with those of the baseline YOLOv5s model, the precision P value, recall R value, and mean average precision PmAP value of the improved model are increased by 1.9%, 2.4%, and 1.1%, respectively; the number of model parameters, calculation amount, and model volume are reduced by 53.9%, 44.9%, and 47.9%, respectively; the requirements of model lightweighting are effectively realized while ensuring high detection accuracy. The improved algorithm exhibits a high detection rate and detection accuracy for pore, pit, and blowhole defects on the weld surface.
-
-