Workpiece recognition and detection algorithm based on improved YOLOv5s
Aiming at the low accuracy of workpiece recognition caused by the change of light intensity,the complexity of image environment and the movement of shooting equipment,an improved YOLOv5s workpiece recognition and detection algorithm was proposed.Firstly,the data set is expanded by data enhancement and preprocessed.Secondly,the improved k-means clustering algorithm is used to re-generate a more effective pre-set anchor frame and shorten the convergence path.Then,CBAM attention mechanism is added to the feature fusion network to effectively suppress background information interference and improve feature extraction speed.In addition,the original feature pyramid structure of the feature fusion module is replaced by the weighted bidirectional feature pyramid Bi-FPN structure to achieve efficient weighted feature fusion and bidirectional cross-scale connection,and improve the fusion efficiency of different scale features.Finally,the positioning effect of the model is improved by using α-IoU as the bounding box regression loss function.The results show that the improved YOLOv5s algorithm improves the mAP value of workpiece detection by 6.03%and the detection speed by 13.7 fps,which verifies the effectiveness of the improved algorithm.