Welcome to Journal of Graphics share: 

Journal of Graphics ›› 2023, Vol. 44 ›› Issue (3): 427-437.DOI: 10.11996/JG.j.2095-302X.2023030427

Previous Articles     Next Articles

Surface defect detection of threaded steel based on improved YOLOv5

HU Xin1(), ZHOU Yun-qiang1, XIAO Jian2(), YANG Jie2   

  1. 1. School of Energy and Electrical Engineering, Chang′an University, Xi′an Shaanxi 710064, China
    2. School of Electronic and Control Engineering, Chang′an University, Xi′an Shaanxi 710064, China
  • Received:2022-11-02 Accepted:2023-01-02 Online:2023-06-30 Published:2023-07-03
  • Contact: XIAO Jian (1975-), associate professor, Ph.D. His main research interests cover signal processing, artificial intelligence applications, pattern recognition and computer vision, etc. E-mail:xiaojian@chd.edu.cn
  • About author:

    HU Xin (1975-), associate professor, Ph.D. Her main research interests cover energy management, computer vision and machine learning, etc. E-mail:huxin@chd.edu.cn

  • Supported by:
    Key R&D Project of Shaanxi Province(2021GY-054);Key R&D Project of Shaanxi Province(2023-YBGY-094);Key R&D Project of Ningxia Hui Autonomous Region(2022BEG03072)

Abstract:

An improved YOLOv5 algorithm for surface defect detection was proposed to solve the problems of low detection accuracy, high missed detection, and false detection rate in industrial scenarios. The improved YOLOv5 algorithm incorporated the multi-space pyramid pooling module (M-SPP) to optimize the network and the detection accuracy could be improved to a certain extent by increasing the depth of the network for better feature extraction. The improved spatial and coordinate attention module (SCA) was introduced to further distinguish the weight relationship between different pixels in the spatial domain, put more emphasis on the region of interest. This algorithm reduced the unnecessary regional weight and enhanced the model’s attention to small target defects. The double sampling transition module (TB) was utilized for downsampling to reduce the loss of important features and obtain more feature information. The k-means ++ algorithm was also employed to reunite the class anchor frame, and the generated preset anchor frame was more suitable for different sizes of defects, thereby improving the detection accuracy of the algorithm. The experimental results on the surface defect dataset of spiral steel showed that the improved YOLOv5 algorithm achieved good detection performance for the surface defect detection of spiral steel, superior to other compared algorithms. The improved YOLOv5 algorithm achieved an AP50 of 97.6%, 3.2% higher than the YOLOv5 algorithm, and all other indexes showed an increase. While maintaining the original detection speed, the algorithm could accurately detect the surface defects of steel rebar.

Key words: YOLOv5, defect detection, multi-spatial pyramid pooling, attention mechanism, double sampling transition, k-means++

CLC Number: