| Stamping parts rely on presses and molds to apply external forces to plates,strips,pipes,etc.to cause plastic deformation or separation,so as to obtain workpieces(stamping parts)of required shape and size.Currently,many production workshops still use manual inspection to detect the appearance defects of stamping parts,such as touch inspection,oil inspection,visual inspection,etc.However,due to the complex industrial environment and human factors,manual detection has problems such as easy missed detection and low efficiency.With the popularity of deep learning,object detection methods based on deep learning have gradually appeared in some industrial scenarios and achieved good results.Therefore,it is of great significance to study the surface defect detection algorithm of stamping parts to improve the detection efficiency of stamping parts and reduce false detection and missed detection.Based on the YOLOv5 deep learning target detection algorithm,this paper selects the self-made stamping parts data set as the research object,and studies the defects existing on its surface.The main work is as follows:(1)Construction and preprocessing of stamping parts defect detection data set.After consulting the information,no suitable public data set was found,so a defect data set was made based on the defect samples provided by the manufacturer.First of all,considering the reflective problem of stamping parts,we took pictures of defects by lighting in a dark environment,and took pictures from different angles and different light intensities to increase the diversity of samples.Finally,Labelimg software was used to mark the defect pictures of stamping parts.(2)Introduce attention mechanism.In order to improve the attention to the defect part,aiming at the stamping part defect of the research object in this paper,the YOLOv5 target detection algorithm was improved by adding the attention mechanism,and the CA attention mechanism was used to improve the attention of the defect part,reduced the interference of background factors,and improved the detection accuracy.(3)Improve the convergence effect of the model.The GIo U-based loss function is used instead of the positioning loss function in the original model to solve the problem of poor convergence of stamping parts on the defect dataset.The detection accuracy of the model was improved by experimental comparison.In summary,the YOLOv5 target detection algorithm based on the CA attention mechanism and the GIOU loss function in this paper realizes the detection of stamping parts defects,improves the accuracy of detection,and reduces the false detection rate and missed detection rate.It has important theoretical and practical significance for promoting the intelligentization of stamping defect detection and improving the detection efficiency on the production line.and missed detection rate.It has important theoretical and practical significance for promoting the intelligentization of stamping defect detection and improving the detection efficiency on the production line. |