MR-YOLO: An Improved YOLOv5 Network for Detecting Magnetic Ring Surface Defects

Magnetic rings are widely used in automotive, home appliances, and consumer electronics. Due to the materials used, processing techniques, and other factors, there will be top cracks, internal cracks, adhesion, and other defects on individual magnetic rings during the manufacturing process. To find such defects, the most sophisticated YOLOv5 target identification algorithm is frequently utilized. However, it has problems such as high computation, sluggish detection, and a large model size. This work suggests an enhanced lightweight YOLOv5 (MR-YOLO) approach for the identification of magnetic ring surface defects to address these issues. To decrease the floating-point operation (FLOP) in the feature channel fusion process and enhance the performance of feature expression, the YOLOv5 neck network was added to the Mobilenetv3 module. To improve the robustness of the algorithm, a Mosaic data enhancement technique was applied. Moreover, in order to increase the network’s interest in minor defects, the SE attention module is inserted into the backbone network to replace the SPPF module with substantially more calculations. Finally, to further increase the new network’s accuracy and training speed, we substituted the original CIoU-Ioss for SIoU-Loss. According to the test, the FLOP and Params of the modified network model decreased by 59.4% and 47.9%, respectively; the reasoning speed increased by 16.6%, the model’s size decreased by 48.1%, and the mAP only lost by 0.3%. The effectiveness and superiority of this method are proved by an analysis and comparison of examples.