| In the manufacturing and production process of welded parts,due to the complexity of the production environment and the nature of high-temperature processing equipment,the surface of welded parts products will inevitably produce a variety of defects.As an important material in industrial manufacturing,the surface quality of welded parts not only affects the aesthetics of the product,but also,and more importantly,the reliability and service life of the product.Currently,digital image processing-based detection methods have limitations in terms of robustness and generalization,while deep learning-based detection methods have relatively good robustness,but model training takes up more computational resources and has limited detection speed.Therefore,it is challenging to design a superior performance weld surface defect detection model for industrial scenarios.In this paper,we propose a lightweight model based on convolutional neural network for surface defect detection of welded parts in real complex industrial scenarios with low accuracy,slow speed and sample noise interference.The model is based on the YOLOv4 algorithm,and the main research work is as follows.(1)In order to meet the training requirements of the model,the weld part image dataset was successfully built after a series of operations such as sample selection and data enhancement,and all the image data were manually labeled.The weld surface defect dataset consists of 5080 images,including four types of defects,such as weld seam,punching hole,crescent bend and water spot.(2)In response to the low detection accuracy of the YOLOv4 algorithm for surface defects of welded parts,the K-means++ clustering algorithm was introduced to cluster the width and height of the labeled frames to be detected in the welded parts surface defects dataset,making it easier for the network model to detect the defects in the samples.(3)Considering the limitation of storage and computational resources,a lightweight network GhostNet is used to replace the backbone feature extraction network CSPDarkNet53 of YOLOv4,and an improved channel attention module(SENet)is embedded in the GhostNet network structure to improve the learning capability of the model and reduce the number of parameters.(4)Based on the modified lightweight network YOLOv4-GhostNet,an Adaptively Spatial Feature Fusion(ASFF)feature pyramid structure is used to replace the PANet of the original path aggregation network to improve the model detection speed while maintaining high detection accuracy.Training on the same weld surface defect dataset,experimental results show that the average precision(mean Average Precision,mAP)of the ASFF-YOLOv4-GhostNet model proposed in this paper is 91.35%,the detection speed reaches 57.81 frames/s,the model size is 43.6 MB,compared to the original YOLOv4 algorithm accuracy The detection speed is 57.81 frames/s and the model size is 43.6 MB,which is 4.89% higher than the original YOLOv4 algorithm,and the detection speed is 36.29 frames/s and the model size is 82.18% smaller.Compared with classical models such as Faster R-CNN and SSD,the comprehensive performance of this model is optimal.Compared with lightweight networks such as YOLOv3-Tiny and YOLOv4-Tiny,this model improves the detection accuracy while meeting the real-time detection requirements,which provides a new idea for practical industrial applications. |