Research on Steel Surface Defect Detection Based on YOLOv5 with Attention Mechanism
Abstract
:1. Introduction
2. Methods
2.1. Dataset Analysis
2.2. YOLOv5
2.3. Evaluating Indicator
3. Steel Defect Detection Algorithm Based on Improved YOLOv5
3.1. SENet
3.2. CBAM
3.3. ECANet
3.4. Experimental Results and Analysis
4. Conclusions
- The images of steel surface defects used in this paper are carefully selected and differ from those in the real production process. The algorithm needs to be further tested and adjusted in real-world scenes with real results.
- In the defect detection tasks, avoiding missed detection is more important than avoiding false detection. Therefore, during the training of the algorithm, it is important to pay attention not only to the average precisions of all types of defects and the mean average precision but also to the recalls of all types of defects, to improve the algorithm according to the changes of the recalls.
- The number of parameters of the algorithm is increased due to the addition of one attention mechanism to the algorithm. The follow-up work focuses on the research and implementation of the lightweight algorithm.
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Jeon, Y.J.; Choi, D.C.; Lee, S.J.; Yun, J.P.; Kim, S.W. Steel-surface defect detection using a switching-lighting scheme. Appl. Opt. 2016, 55, 47–57. [Google Scholar] [CrossRef] [PubMed]
- Wang, C.; Yu, Y.; Yu, J.; Zhang, Y.; Zhao, Y.; Yuan, Q. Microstructure evolution and corrosion behavior of dissimilar 304/430 stainless steel welded joints. J. Manuf. Process. 2020, 50, 183–191. [Google Scholar] [CrossRef]
- Takino, H.; Hosaka, T. Shaping of steel mold surface of lens array by electrical discharge machining with single rod electrode. Appl. Opt. 2014, 53, 8002–8005. [Google Scholar] [CrossRef] [PubMed]
- He, Y.; Song, K.; Meng, Q.; Yan, Y. An end-to-end steel surface defect detection approach via fusing multiple hierarchical features. IEEE Trans. Instrum. Meas. 2019, 69, 1493–1504. [Google Scholar] [CrossRef]
- Qing, Y.A.O.; Jin, F.E.N.G.; Jian, T.A.N.G.; Xu, W.G.; Zhu, X.H.; Yang, B.J.; Wang, L.J. Development of an automatic monitoring system for rice light-trap pests based on machine vision. J. Integr. Agric. 2020, 19, 2500–2513. [Google Scholar]
- Xi, J.; Shentu, L.; Hu, J.; Li, M. Automated surface inspection for steel products using computer vision approach. Appl. Opt. 2017, 56, 184–192. [Google Scholar] [CrossRef]
- Suvdaa, B.; Ahn, J.; Ko, J. Steel surface defects detection and classification using SIFT and voting strategy. Int. J. Softw. Eng. Its Appl. 2012, 6, 161–166. [Google Scholar]
- Song, K.; Yan, Y. A noise robust method based on completed local binary patterns for hot-rolled steel strip surface defects. Appl. Surf. Sci. 2013, 285, 858–864. [Google Scholar] [CrossRef]
- Jeon, Y.J.; Choi, D.C.; Yun, J.P.; Kim, S.W. Detection of periodic defects using dual-light switching lighting method on the surface of thick plates. ISIJ Int. 2015, 55, 1942–1949. [Google Scholar] [CrossRef] [Green Version]
- Gyimah, N.K.; Girma, A.; Mahmoud, M.N.; Nateghi, S.; Homaifar, A.; Opoku, D. A Robust Completed Local Binary Pattern (RCLBP) for Surface Defect Detection. In Proceedings of the 2021 IEEE International Conference on Systems, Man, and Cybernetics (SMC), Melbourne, Australia, 17–20 October 2021; pp. 1927–1934. [Google Scholar]
- Dong, H.; Song, K.; He, Y.; Xu, J.; Yan, Y.; Meng, Q. PGA-Net: Pyramid feature fusion and global context attention network for automated surface defect detection. IEEE Trans. Ind. Inform. 2019, 16, 7448–7458. [Google Scholar] [CrossRef]
- Luo, Q.; Fang, X.; Su, J.; Zhou, J.; Zhou, B.; Yang, C.; Liu, L.; Gui, W.; Tian, L. Automated visual defect classification for flat steel surface: A survey. IEEE Trans. Instrum. Meas. 2020, 69, 9329–9349. [Google Scholar] [CrossRef]
- Liang, F.; Zhou, Y.; Chen, X.; Liu, F.; Zhang, C.; Wu, X. Review of target detection technology based on deep learning. In Proceedings of the 5th International Conference on Control Engineering and Artificial Intelligence, Sanya, China, 14–16 January 2021; pp. 132–135. [Google Scholar]
- Ren, S.; He, K.; Girshick, R.; Sun, J. Faster r-cnn: Towards real-time object detection with region proposal networks. Adv. Neural Inf. Process. Syst. 2015, 28, 91–99. [Google Scholar] [CrossRef] [PubMed]
- Hatab, M.; Malekmohamadi, H.; Amira, A. Surface defect detection using YOLO network. In Proceedings of the SAI Intelligent Systems Conference, London, UK, 3–4 September 2020; Springer: Cham, Switzerland, 2020; pp. 505–515. [Google Scholar]
- Kou, X.; Liu, S.; Cheng, K.; Qian, Y. Development of a YOLO-V3-based model for detecting defects on steel strip surface. Measurement 2021, 182, 109454. [Google Scholar] [CrossRef]
- Zhang, S.; Chi, C.; Yao, Y.; Lei, Z.; Li, S.Z. Bridging the gap between anchor-based and anchor-free detection via adaptive training sample selection. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, Seattle, WA, USA, 13–19 June 2020; pp. 9759–9768. [Google Scholar]
- Wei, R.; Song, Y.; Zhang, Y. Enhanced faster region convolutional neural networks for steel surface defect detection. ISIJ Int. 2020, 60, 539–545. [Google Scholar] [CrossRef] [Green Version]
- Dai, J.; Qi, H.; Xiong, Y.; Li, Y.; Zhang, G.; Hu, H.; Wei, Y. Deformable convolutional networks. In Proceedings of the IEEE International Conference on Computer Vision, Venice, Italy, 22–29 October 2017; pp. 764–773. [Google Scholar]
- Ning, Z.; Mi, Z. Research on surface defect detection algorithm of strip steel based on improved YOLOV3. In Journal of Physics: Conference Series; IOP Publishing: Bristol, UK, 2021; Volume 1907, No. 1; p. 012015. [Google Scholar]
- Li, M.; Wang, H.; Wan, Z. Surface defect detection of steel strips based on improved YOLOv4. Comput. Electr. Eng. 2022, 102, 108208. [Google Scholar] [CrossRef]
- Zeqiang, S.; Bingcai, C. Improved Yolov5 Algorithm for Surface Defect Detection of Strip Steel. In Artificial Intelligence in China; Springer: Singapore, 2022; pp. 448–456. [Google Scholar]
- Redmon, J.; Farhadi, A. YOLO9000: Better, faster, stronger. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 7263–7271. [Google Scholar]
- Redmon, J.; Farhadi, A. Yolov3: An incremental improvement. arXiv 2018, arXiv:1804.02767. [Google Scholar]
- Bochkovskiy, A.; Wang, C.Y.; Liao, H.Y.M. Yolov4: Optimal speed and accuracy of object detection. arXiv 2020, arXiv:2004.10934. [Google Scholar]
- Xu, H.; Li, B.; Zhong, F. Light-YOLOv5: A Lightweight Algorithm for Improved YOLOv5 in Complex Fire Scenarios. arXiv 2022, arXiv:2208.13422. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Deep residual learning for image recognition. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Las Vegas, NV, USA, 27–30 June 2016; pp. 770–778. [Google Scholar]
- Wang, C.Y.; Liao, H.Y.M.; Wu, Y.H.; Chen, P.Y.; Hsieh, J.W.; Yeh, I.H. CSPNet: A new backbone that can enhance learning capability of CNN. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops, Seattle, WA, USA, 14–19 June 2020; pp. 390–391. [Google Scholar]
- He, K.; Zhang, X.; Ren, S.; Sun, J. Spatial pyramid pooling in deep convolutional networks for visual recognition. IEEE Trans. Pattern Anal. Mach. Intell. 2015, 37, 1904–1916. [Google Scholar] [CrossRef] [Green Version]
- Lin, T.Y.; Dollár, P.; Girshick, R.; He, K.; Hariharan, B.; Belongie, S. Feature pyramid networks for object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Honolulu, HI, USA, 21–26 July 2017; pp. 2117–2125. [Google Scholar]
- Liu, S.; Qi, L.; Qin, H.; Shi, J.; Jia, J. Path aggregation network for instance segmentation. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 8759–8768. [Google Scholar]
- Niu, Z.; Zhong, G.; Yu, H. A review on the attention mechanism of deep learning. Neurocomputing 2021, 452, 48–62. [Google Scholar] [CrossRef]
- Hu, J.; Shen, L.; Sun, G. Squeeze-and-excitation networks. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, Salt Lake City, UT, USA, 18–23 June 2018; pp. 7132–7141. [Google Scholar]
- Woo, S.; Park, J.; Lee, J.Y.; Kweon, I.S. Cbam: Convolutional block attention module. In Proceedings of the European Conference on Computer Vision (ECCV), Munich, Germany, 8–14 September 2018; pp. 3–19. [Google Scholar]
- Wang, Q.; Wu, B.; Zhu, P.; Li, P.; Zuo, W.; Hu, Q. Supplementary material for ‘ECA-Net: Efficient channel attention for deep convolutional neural networks. In Proceedings of the 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition, IEEE, Seattle, WA, USA, 13–19 June 2020; pp. 13–19. [Google Scholar]
- Likas, A.; Vlassis, N.; Verbeek, J.J. The global k-means clustering algorithm. Pattern Recognit. 2003, 36, 451–461. [Google Scholar] [CrossRef]
Feature Map | Anchor Box Size |
---|---|
28 × 28 | (20 × 40); (25 × 80); (49 × 44) |
14 × 14 | (16 × 198); (60 × 79); (166 × 30) |
7 × 7 | (39 × 201); (85 × 148); (184 × 216) |
Algorithm | Type | P | R | F1-Score | AP | mAP |
---|---|---|---|---|---|---|
YOLOv5 | RS | 80.95% | 36.17% | 0.5 | 62.09% | 81.78% |
PS | 83.87% | 63.41% | 0.72 | 81.27% | ||
IN | 92.31% | 58.82% | 0.72 | 79.65% | ||
PA | 93.18% | 82% | 0.87 | 93.23% | ||
SC | 88.57% | 79.49% | 0.84 | 92.65% | ||
YOLOv5+SENet | RS | 83.87% | 55.32% | 0.67 | 71.7% | 85.83% |
PS | 93.55% | 70.73% | 0.81 | 87.68% | ||
IN | 90.41% | 64.71% | 0.75 | 82.76% | ||
PA | 91.3% | 84% | 0.87 | 92.24% | ||
SC | 94.12% | 82.05% | 0.88 | 94.76% | ||
YOLOv5+CBAM | RS | 73.53% | 53.19% | 0.62 | 70.19% | 86.35% |
PS | 96.55% | 68.29% | 0.8 | 87.85% | ||
IN | 91.43% | 62.75% | 0.74 | 83.66% | ||
PA | 97.67% | 84% | 0.9 | 94.16% | ||
SC | 92.31% | 92.31% | 0.92 | 95.91% | ||
YOLOv5+ECANet | RS | 79.41% | 57.45% | 0.67 | 71.01% | 84.61% |
PS | 90.91% | 73.17% | 0.81 | 84.17% | ||
IN | 89.86% | 60.78% | 0.73 | 81.26% | ||
PA | 95.56% | 86% | 0.91 | 92.64% | ||
SC | 92.31% | 92.31% | 0.92 | 93.95% | ||
YOLOv4 | RS | 0% | 0% | 0 | 15.62% | 59.46% |
PS | 82.61% | 46.34% | 0.59 | 70.63% | ||
IN | 90.48% | 18.63% | 0.31 | 52.49% | ||
PA | 97.14% | 68% | 0.8 | 85.34% | ||
SC | 89.47% | 43.59% | 0.59 | 73.24% | ||
Faster R-CNN | RS | 19.33% | 90.62% | 0.32 | 45.46% | 74.85% |
PS | 47.37% | 79.41% | 0.59 | 79.98% | ||
IN | 35.35% | 89.41% | 0.51 | 70.76% | ||
PA | 52.42% | 94.2% | 0.67 | 87.98% | ||
SC | 57.97% | 90.91% | 0.71 | 90.09% |
YOLOv3 | YOLOv4 | YOLOv5 | Faster R-CNN | YOLOv5+CBAM |
---|---|---|---|---|
34 | 40 | 52 | 12 | 45 |
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
Shi, J.; Yang, J.; Zhang, Y. Research on Steel Surface Defect Detection Based on YOLOv5 with Attention Mechanism. Electronics 2022, 11, 3735. https://doi.org/10.3390/electronics11223735
Shi J, Yang J, Zhang Y. Research on Steel Surface Defect Detection Based on YOLOv5 with Attention Mechanism. Electronics. 2022; 11(22):3735. https://doi.org/10.3390/electronics11223735
Chicago/Turabian StyleShi, Jianting, Jian Yang, and Yingtao Zhang. 2022. "Research on Steel Surface Defect Detection Based on YOLOv5 with Attention Mechanism" Electronics 11, no. 22: 3735. https://doi.org/10.3390/electronics11223735