MR-YOLO: An Improved YOLOv5 Network for Detecting Magnetic Ring Surface Defects
Abstract
:1. Introduction
- The paper proposes a lightweight detection algorithm named MR-YOLO (YOLOv5 for Magnetic Ring) by replacing the backbone of the original YOLOv5 with the backbone of the lightweight MobileNetV3.
- We add the SE attention mechanism and introduce the updated SIOU-loss function into the model to improve the detection effect and expression effect of the model.
- The training dataset is enhanced with Mosaic data, and a GPU can generate more significant results, lowering the need for large mini-batch sizes.
2. Related Work
2.1. Traditional Defect Detection Methods
2.2. Deep Learning Methods
- Most researchers use traditional algorithms to detect magnetic ring defects, which have problems such as long project cycles, complex deployment, poor algorithm robustness, and insufficient generalization.
- Some researchers use deep learning to detect magnetic ring defects online. Still, the number of model parameters and the amount of calculation is too large for real-time inspection requirements.
- A small number of researchers streamlined the model, but the pruning strategy will reduce the accuracy and generalization of the model and fail to achieve a good trade-off between detection speed, accuracy, and the number of model parameters.
- The original CIOU loss function of YOLOv5 is complicated and requires a long period of time to train.
3. Proposed Method
3.1. Original YOLOv5 Network
3.2. YOLOv5-MV3 Network Structure
3.3. Extended SE Attention Module
3.4. Data Enhancement
3.5. Loss Function Design
4. Experimental Setup and Method Validation
4.1. Data Preparation
4.2. Experimental Platform
4.3. Network Parameter Settings
4.4. Evaluation Index
5. Experimental Results and Analysis
6. Conclusions
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Conflicts of Interest
References
- Li, J.; Zhang, Z.; Shen, J. Study on surface defect extraction of magnetic ring based on masking technology. J. Optoelectron. 2017, 28, 732–741. [Google Scholar] [CrossRef]
- Posilovic, L.; Medak, D.; Subasic, M.; Petkovic, T.; Budimir, M.; Loncaric, S. Flaw Detection from Ultrasonic Images Using YOLO and SSD. In Proceedings of the 2019 11th International Symposium on Image and Signal Processing and Analysis (ISPA), Dubrovnik, Croatia, 23–25 September 2019; pp. 163–168. [Google Scholar] [CrossRef]
- Suszyński, Z.; Bednarek, M.; Kosikowski, M. Method and Measurement Setup for Detection of the Shape of Optical Power Pulse in Active Thermography. In Proceedings of the 2010 16th International Workshop on Thermal Investigations of ICs and Systems (THERMINIC), Barcelona, Spain, 6–8 October 2010; pp. 1–4. [Google Scholar]
- Caggiano, A.; Zhang, J.; Alfieri, V.; Caiazzo, F.; Gao, R.; Teti, R. Machine Learning-Based Image Processing for on-Line Defect Recognition in Additive Manufacturing. Cirp Ann. -Manuf. Technol. 2019, 68, 451–454. [Google Scholar] [CrossRef]
- Hou, W.; Wei, Y.; Jin, Y.; Zhu, C. Deep Features Based on a DCNN Model for Classifying Imbalanced Weld Flaw Types. Measurement 2019, 131, 482–489. [Google Scholar] [CrossRef]
- Tao, H.; Jinshan, Z.; Na, D.; Zhihui, C.; Li, D. The Defects Identify Algorithm and the Automated Detecting System for the Screw Thread. In Proceedings of the 2010 International Conference on Electrical and Control Engineering, Wuhan, China, 25–27 June 2010; pp. 2292–2294. [Google Scholar] [CrossRef]
- Yi, G.; Liting, M.; Chong, S. The Method of Thread Defect Detection Based on Machine Vision. In Proceedings of the 2019 2nd International Conference on Information Systems and Computer Aided Education (ICISCAE), Dalian, China, 28–30 September 2019; pp. 579–582. [Google Scholar] [CrossRef]
- Ke, X.; Chaolin, Y. On-Line Defect Detection Algorithms for Surface Inspection of Hot Rolled Strips. In Proceedings of the 2010 International Conference on Mechanic Automation and Control Engineering, Wuhan, China, 26–28 June 2010; pp. 2350–2353. [Google Scholar] [CrossRef]
- Yapi, D.; Allili, M.S.; Baaziz, N. Automatic Fabric Defect Detection Using Learning-Based Local Textural Distributions in the Contourlet Domain. IEEE Trans. Autom. Sci. Eng. 2018, 15, 1014–1026. [Google Scholar] [CrossRef]
- Cheng, K.C.C.; Chen, L.L.Y.; Li, J.W.; Li, K.S.M.; Tsai, N.C.Y.; Wang, S.J.; Huang, A.Y.A.; Chou, L.; Lee, C.S.; Chen, J.E.; et al. Machine Learning-Based Detection Method for Wafer Test Induced Defects. IEEE Trans. Semicond. Manuf. 2021, 34, 161–167. [Google Scholar] [CrossRef]
- Sassi, P.; Tripicchio, P.; Avizzano, C.A. A Smart Monitoring System for Automatic Welding Defect Detection. IEEE Trans. Ind. Electron. 2019, 66, 9641–9650. [Google Scholar] [CrossRef]
- Hou, H. Study and D evelopment on Size and Surface Defect Inspection System of Magnetic Ring Based on Machine Vision. Master’s Thesis, Zhejiang Sci-Tech University, Hangzhou, China, 2017. [Google Scholar]
- Cui, J.; Ge, M.; Huang, X.; Ma, X. Research and Real-Time Application of Small Magnetic Ring Surface Defect Detection Method. Comput. Simul. 2009, 37, 191–195. [Google Scholar]
- Wang, S. Research and Development on the Defecting Surface Detections of Magnetic Ring Based on Machine Vision. Master’s Thesis, Hunan Normal University, Shenzhen, China, 2019. [Google Scholar]
- Li, J.; Su, Z.; Geng, J.; Yin, Y. Real-Time Detection of Steel Strip Surface Defects Based on Improved YOLO Detection Network. IFAC-PapersOnLine 2018, 51, 76–81. [Google Scholar] [CrossRef]
- Zhang, C.; Chang, C.; Jamshidi, M. Concrete Bridge Surface Damage Detection Using a Single-stage Detector. Comput.-Aided Civ. Infrastruct. Eng. 2020, 35, 389–409. [Google Scholar] [CrossRef]
- Chen, S.H.; Tsai, C.C. SMD LED Chips Defect Detection Using a YOLOv3-Dense Model. Adv. Eng. Inform. 2021, 47, 101255. [Google Scholar] [CrossRef]
- Guo, Z.; Wang, C.; Yang, G.; Huang, Z.; Li, G. MSFT-YOLO: Improved YOLOv5 Based on Transformer for Detecting Defects of Steel Surface. Sensors 2022, 22, 3467. [Google Scholar] [CrossRef] [PubMed]
- Wang, T.; Su, J.; Xu, C.; Zhang, Y. An Intelligent Method for Detecting Surface Defects in Aluminium Profiles Based on the Improved YOLOv5 Algorithm. Electronics 2022, 11, 2304. [Google Scholar] [CrossRef]
- Liao, D.; Cui, Z.; Zhang, X.; Li, J.; Li, W.; Zhu, Z.; Wu, N. Surface Defect Detection and Classification of Si3N4 Turbine Blades Based on Convolutional Neural Network and YOLOv5. Adv. Mech. Eng. 2022, 14, 16878132221081580. [Google Scholar] [CrossRef]
- Medina, R.; Llamas, J.; Gómez-García-Bermejo, J.; Zalama, E.; Segarra, M.J. Crack Detection in Concrete Tunnels Using a Gabor Filter Invariant to Rotation. Sensors 2017, 17, 1670. [Google Scholar] [CrossRef] [PubMed]
- Ma, G.; Liao, P.; Li, Z.; Liu, G.; Chen, H. Internal defect detection method for integrated circuit based on Wavelet transform. J. Guangzhou Univ. Nat. Sci. Ed. 2018, 17, 35–40. [Google Scholar]
- Xue-wu, Z.; Yan-qiong, D.; Yan-yun, L.; Ai-ye, S.; Rui-yu, L. A Vision Inspection System for the Surface Defects of Strongly Reflected Metal Based on Multi-Class SVM. Expert Syst. Appl. 2011, 38, 5930–5939. [Google Scholar] [CrossRef]
- Xiang, X.; Wang, Z.; Qiao, Y. An Improved YOLOv5 Crack Detection Method Combined With Transformer. IEEE Sens. J. 2022, 22, 14328–14335. [Google Scholar] [CrossRef]
- Li, S.; Li, Y.; Li, Y.; Li, M.; Xu, X. YOLO-FIRI: Improved YOLOv5 for Infrared Image Object Detection. IEEE Access 2021, 9, 141861–141875. [Google Scholar] [CrossRef]
- Wang, H.; Xu, Y.; He, Y.; Cai, Y.; Chen, L.; Li, Y.; Sotelo, M.A.; Li, Z. YOLOv5-Fog: A Multiobjective Visual Detection Algorithm for Fog Driving Scenes Based on Improved YOLOv5. IEEE Trans. Instrum. Meas. 2022, 71, 1–12. [Google Scholar] [CrossRef]
- Wang, J.; Xiao, T.; Gu, Q.; Chen, Q. YOLOv5_CSL_F: YOLOv5’s Loss Improvement and Attention Mechanism Application for Remote Sensing Image Object Detection. In Proceedings of the 2021 International Conference on Wireless Communications and Smart Grid (ICWCSG), Hangzhou, China, 13–15 August 2021; pp. 197–203. [Google Scholar] [CrossRef]
- Chen, K.; Li, H.; Li, C.; Zhao, X.; Wu, S.; Duan, Y.; Wang, J. An Automatic Defect Detection System for Petrochemical Pipeline Based on Cycle-GAN and YOLO V5. Sensors 2022, 22, 7907. [Google Scholar] [CrossRef]
- Redmon, J.; Farhadi, A. YOLO9000: Better, Faster, Stronger. In Proceedings of the 2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR), Honolulu, HI, USA, 21–26 July 2017; pp. 6517–6525. [Google Scholar] [CrossRef] [Green Version]
- Joseph, R.; Ali, F. YOLOv3: An Incremental Improvement. arXiv 2018, arXiv:abs/1804.02767. [Google Scholar]
- Bochkovskiy, A.; Wang, C.Y.; Liao, H.y. YOLOv4: Optimal Speed and Accuracy of Object Detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
- Zhu, X.; Lyu, S.; Wang, X.; Zhao, Q. TPH-YOLOv5: Improved YOLOv5 Based on Transformer Prediction Head for Object Detection on Drone-Captured Scenarios. arXiv 2021, arXiv:2108.11539. [Google Scholar] [CrossRef]
- Zhang, Q. A Research and Application of Magnetic Ring Appearance Defect Detection Method based on Deep Learning. Master’s Thesis, University of Electronic Science and Technology of China, Chengdu, China, 2020. [Google Scholar] [CrossRef]
- Wang, R. Research on Surface Defect Detection System of Magnetic Ring Based on Deep Learning. Master’s Thesis, Tiangong University, Tianjin, China, 2021. [Google Scholar] [CrossRef]
- Ying, Z.; Lin, Z.; Wu, Z.; Liang, K.; Hu, X. A Modified-YOLOv5s Model for Detection of Wire Braided Hose Defects. Measurement 2022, 190, 110683. [Google Scholar] [CrossRef]
- Howard, A.G.; Zhu, M.; Chen, B.; Kalenichenko, D.; Wang, W.; Weyand, T.; Andreetto, M.; Adam, H. MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications. arXiv 2017, arXiv:1704.04861. [Google Scholar] [CrossRef]
- Sandler, M.; Howard, A.; Zhu, M.; Zhmoginov, A.; Chen, L.C. MobileNetV2: Inverted Residuals and Linear Bottlenecks. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 4510–4520. [Google Scholar] [CrossRef]
- Howard, A.; Sandler, M.; Chen, B.; Wang, W.; Chen, L.C.; Tan, M.; Chu, G.; Vasudevan, V.; Zhu, Y.; Pang, R.; et al. Searching for MobileNetV3. In Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision (ICCV), Seoul, Republic of Korea, 27 October–2 November 2019; pp. 1314–1324. [Google Scholar] [CrossRef]
- Xia, B.; Cao, J.; Wang, C. SSIM-NET: Real-Time PCB Defect Detection Based on SSIM and MobileNet-V3. In Proceedings of the 2019 2nd World Conference on Mechanical Engineering and Intelligent Manufacturing (WCMEIM), Shanghai, China, 22–24 November 2019; pp. 756–759. [Google Scholar] [CrossRef]
- Shao, G.; Zheng, Y.; Li, T.; Wu, J.; Luo, J.; Gao, F.; Ma, J.; Liu, T. An Improved YOLOv3 Network for PCB Defect Detection. In Proceedings of the 2021 China Automation Congress (CAC), Beijing, China, 22–24 October 2021; pp. 1819–1823. [Google Scholar] [CrossRef]
- Xikun, X.; Changjiang, L.; Meng, X. Application of Attention YOLOV 4 Algorithm in Metal Defect Detection. In Proceedings of the 2021 IEEE International Conference on Emergency Science and Information Technology (ICESIT), Chongqing, China, 22–24 November 2021; pp. 465–468. [Google Scholar] [CrossRef]
- Guo, G.; Zhang, Z. Road Damage Detection Algorithm for Improved YOLOv5. Sci. Rep. 2022, 12, 15523. [Google Scholar] [CrossRef]
- Tang, J.; Liu, M.; Jiang, N.; Yu, W.; Yang, C. Spatial and Channel Dimensions Attention Feature Transfer for Better Convolutional Neural Networks. In Proceedings of the 2021 IEEE International Symposium on Circuits and Systems (ISCAS), Daegu, Republic of Korea, 22–28 May 2021; pp. 1–5. [Google Scholar] [CrossRef]
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-Excitation Networks. In Proceedings of the 2018 IEEE/CVF Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 7132–7141. [Google Scholar] [CrossRef] [Green Version]
- Yun, S.; Han, D.; Chun, S.; Oh, S.J.; Yoo, Y.; Choe, J. CutMix: Regularization Strategy to Train Strong Classifiers With Localizable Features. In Proceedings of the 2019 IEEE/CVF International Conference on Computer Vision (ICCV), Seoul, Republic of Korea, 27 October–2 November 2019; pp. 6022–6031. [Google Scholar] [CrossRef]
Hardware and Software Platform | Name |
---|---|
CPU | Intel I9-12900K 24 |
GPU | NVIDIA GeForce RTX 3090 |
CUDA | 11.0 |
CUDNN | 8.0 |
Python | 3.8 |
Operating System | Windows 10 |
Deep learning Framework | Pytorch 1.8 |
Network Parameter | Value |
---|---|
Training Step | 800 |
Batch Size | 64 |
Input Size | 640 × 640 |
Initial Learning Rate | 0.01 |
Momentum Decay | 0.937 |
Weight Decay | 0.0005 |
Training Threshold Of Confifidence | 0.2 |
Model | mAP | mAP | FLOPs | Speed- | Weight | |
---|---|---|---|---|---|---|
YOLOv5s | 58.1% | 98.3% | 16.0 | 24.1 | 7.0 | 13.75 |
YOLOv5s-MV3 | 54.4% | 96.6% | 6.4 | 19.8 | 3.6 | 7.35 |
YOLOv5s-MV3+SE | 56.4% | 97.3% | 6.5 | 19.9 | 3.6 | 7.13 |
YOLOv5-MV3+SIoU+SE | 55.2% | 97.7% | 6.5 | 19.9 | 3.6 | 7.13 |
Model | mAP | mAP | FLOPs | Speed- | Weight | |
---|---|---|---|---|---|---|
YOLOv5s | 58.1% | 98.3% | 16.0 | 24.1 | 7.0 | 13.75 |
YOLOv5s+ Mosaic | 58.3% | 98.4% | 16.0 | 24.1 | 7.0 | 13.75 |
YOLOv5s-MV3 | 54.4% | 96.6% | 6.4 | 19.8 | 3.6 | 7.35 |
YOLOv5s-MV3+ Mosaic | 54.7% | 96.8% | 6.4 | 19.8 | 3.6 | 7.35 |
YOLOv5-MV3+SIoU+SE | 55.2% | 97.7% | 6.5 | 19.9 | 3.6 | 7.13 |
YOLOv5-MV3+SIoU+SE+ Mosaic | 57.1% | 98.0% | 6.5 | 19.9 | 3.6 | 7.13 |
Model | mAP | mAP | FLOPs | Speed- | Weight | |
---|---|---|---|---|---|---|
YOLOv5-MV3+CIoU | 3.5 | |||||
YOLOv5-MV3+EIoU | 3.6 | |||||
YOLOv5-MV3+SIoU | 3.6 |
Model | mAP | mAP | FLOPs | Speed- | Weight | |
---|---|---|---|---|---|---|
Faster-rcnn | 8.6 | |||||
YOLOv3 | 6.1 | 470 | ||||
YOLOv3-tiny | 8.6 | |||||
YOLOv5s-MV3+SIOU +SE +Mosaic | 3.6 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Lang, X.; Ren, Z.; Wan, D.; Zhang, Y.; Shu, S. MR-YOLO: An Improved YOLOv5 Network for Detecting Magnetic Ring Surface Defects. Sensors 2022, 22, 9897. https://doi.org/10.3390/s22249897
Lang X, Ren Z, Wan D, Zhang Y, Shu S. MR-YOLO: An Improved YOLOv5 Network for Detecting Magnetic Ring Surface Defects. Sensors. 2022; 22(24):9897. https://doi.org/10.3390/s22249897
Chicago/Turabian StyleLang, Xianli, Zhijie Ren, Dahang Wan, Yuzhong Zhang, and Shuangbao Shu. 2022. "MR-YOLO: An Improved YOLOv5 Network for Detecting Magnetic Ring Surface Defects" Sensors 22, no. 24: 9897. https://doi.org/10.3390/s22249897
APA StyleLang, X., Ren, Z., Wan, D., Zhang, Y., & Shu, S. (2022). MR-YOLO: An Improved YOLOv5 Network for Detecting Magnetic Ring Surface Defects. Sensors, 22(24), 9897. https://doi.org/10.3390/s22249897