Real-time Detection Method of Surface Defects of Hot-rolled Strip via Improved YOLOv4-tiny Model
-
摘要: 带钢表面缺陷检测是生产过程智能检测的重要任务。针对目前带钢表面缺陷检测算法效率低、实时性差的问题,本文提出了基于卷积神经网络的轻量级目标检测器。该方法以YOLOv4-tiny 模型为框架,针对带钢表面缺陷检测任务的特殊性,结合了多尺度检测与空间注意力机制的优化策略,在保证检测效率的同时提高了轻量级目标检测器的精度。实验证明,所提出的改进的YOLOv4-tiny模型能够精确地检测带钢表面缺陷,平均均值精度mAP(mean Average precision)为73.29%,并且每秒帧数FPS (Frames per second) 达到163,满足实际工业落地的实时性要求。
-
关键词:
- 带钢表面缺陷 /
- 卷积神经网络 /
- YOLOv4-tiny /
- 多尺度检测 /
- 空间注意力机制
Abstract: Hot-rolled strip surface defect detection is an important task of intelligent detection in production process. Aiming at the low efficiency and poor real-time performance of the current hot-rolled strip surface defect detection algorithm, a lightweight object detector based on convolutional neural network is proposed. Based on the YOLOv4-tiny model, the present method combines the optimization strategy of multi-scale detection and spatial attention mechanism for the particularity of the surface defect detection of strip steel, which maintains the detection efficiency while improving the precision of lightweight object detectors. Experiments show that the improved YOLOv4-tiny model can accurately detect the surface defects of strip steel, the mAP (mean Average precision)value is of 73.29%, and the FPS (Frames per second) value reaches 163, which meets the real-time requirements of engineering application. -
表 1 YOLOv4-tiny 和 YOLOv4 的性能对比
模型 输入图片
尺寸mAP FPS BFlops 预训练权
重尺寸/MBYOLOv4-tiny 512*512 40.2% 371 6.9 23.1 YOLOv4 512*512 64.9% 45 91.1 245 表 2 消融实验结果
网络 图片分辨率 mAP/% 模型尺寸/m YOLOv4-tiny 192*192 62.91 22.4 YOLOv4-tiny-SAM 192*192 64.74 23 YOLOv4-tiny-multi 192*192 72.18 23.4 表 3 不同算法性能对比
表面缺陷 Mobile-Net YOLOv3-tiny YOLOv4-tiny YOLOv5s 改进的YOLOv4-tiny 裂纹 10.09% 32.44% 34.34% 40.8% 41.51% 夹杂 34.06% 45.22% 48.11% 77.1% 76.81% 凹坑 63.28% 79.32% 80.61% 89.3% 88.30% 麻点 26.79% 75.55% 77.65% 74.8% 82.44% 辊印 28.77% 51.74% 52.52% 65.9% 59.67% 划伤 23.52% 81.80% 84.21% 86.9% 90.98% mAP 31.09% 61.01% 62.91 % 72.47% 73.29% FPS 156 133 165 161 163 -
[1] GHORAI S, MUKHERJEE A, GANGADARAN M, et al. Automatic defect detection on hot-rolled flat steel products[J]. IEEE Transactions on Instrumentation and Measurement, 2013, 62(3): 612-621. doi: 10.1109/TIM.2012.2218677 [2] 米春风, 卢琨, 汪文艳, 等. 基于机器视觉的带钢表面缺陷检测研究进展[J]. 安徽工业大学学报(自然科学版), 2022, 39(2): 180-188.MI C F, LU K, WANG W Y, et al. Research progress on hot-rolled strip surface defect detection based on machine vision[J]. Journal of Anhui University of Technology (Natural Science), 2022, 39(2): 180-188. (in Chinese) [3] CALEB-SOLLY P, SMITH J E. Adaptive surface inspection via interactive evolution[J]. Image and Vision Computing, 2007, 25(7): 1058-1072. doi: 10.1016/j.imavis.2006.04.023 [4] YU Y W, YIN G F, DU L Q. Image classification for steel strip surface defects based on support vector machines[J]. Advanced Materials Research, 2011, 217-218: 336-340. doi: 10.4028/www.scientific.net/AMR.217-218.336 [5] 韩英莉, 颜云辉. 基于BP神经网络的带钢表面缺陷的识别与分类[J]. 仪器仪表学报, 2006, 27(12): 1692-1694. doi: 10.3321/j.issn:0254-3087.2006.12.029HAN Y L, YAN Y H. Discernment and classification of banding strip surface defect based on BP neural network[J]. Chinese Journal of Scientific Instrument, 2006, 27(12): 1692-1694. (in Chinese) doi: 10.3321/j.issn:0254-3087.2006.12.029 [6] 吴彰良, 孙长库, 刘洁. 基于图像处理的油封缺陷自动检测与分类识别方法[J]. 仪器仪表学报, 2013, 34(5): 1093-1099. doi: 10.3969/j.issn.0254-3087.2013.05.020WU Z L, SUN C K, LIU J. Oil-seal surface defect automatic detection and recognition method based on image processing[J]. Chinese Journal of Scientific Instrument, 2013, 34(5): 1093-1099. (in Chinese) doi: 10.3969/j.issn.0254-3087.2013.05.020 [7] MAKAREMI M, RAZMJOOY N, RAMEZANI M. A new method for detecting texture defects based on modified local binary pattern[J]. Signal, Image and Video Processing, 2018, 12(7): 1395-1401. doi: 10.1007/s11760-018-1294-9 [8] SONG K C, YAN Y H. A noise robust method based on completed local binary patterns for hot-rolled steel strip surface defects[J]. Applied Surface Science, 2013, 285: 858-864. doi: 10.1016/j.apsusc.2013.09.002 [9] LIU Y, XU K, WANG D D. Online surface defect identification of cold rolled strips based on local binary pattern and extreme learning machine[J]. Metals, 2018, 8(3): 197. doi: 10.3390/met8030197 [10] 布申申, 田怀文. 基于卷积神经网络的带钢表面缺陷检测算法[J]. 机械设计与制造, 2022(7): 29-33. doi: 10.3969/j.issn.1001-3997.2022.07.007BU S S, TIAN H W. Strip surface defect detection algorithm based on convolutional neural network[J]. Machinery Design & Manufacture, 2022(7): 29-33. (in Chinese) doi: 10.3969/j.issn.1001-3997.2022.07.007 [11] HUANG G, LIU Z, VAN DER MAATEN L, et al. Densely connected convolutional networks[C]//Proceedings of 2017 IEEE Conference on Computer Vision and Pattern Recognition. Honolulu: IEEE, 2017: 4700-4708. [12] 杨延西, 赵梦. 基于CNN的带钢表面缺陷检测[J]. 重型机械, 2019(2): 25-29. doi: 10.3969/j.issn.1001-196X.2019.02.006YANG Y X, ZHAO M. CNN-based strip steel surface defect detection[J]. Heavy Machinery, 2019(2): 25-29. (in Chinese) doi: 10.3969/j.issn.1001-196X.2019.02.006 [13] 李维刚, 叶欣, 赵云涛, 等. 基于改进YOLOv3算法的带钢表面缺陷检测[J]. 电子学报, 2020, 48(7): 1284-1292. doi: 10.3969/j.issn.0372-2112.2020.07.006LI W G, YE X, ZHAO Y T, et al. Strip steel surface defect detection based on improved YOLOv3 algorithm[J]. Acta Electronica Sinica, 2020, 48(7): 1284-1292. (in Chinese) doi: 10.3969/j.issn.0372-2112.2020.07.006 [14] REDMON J, FARHADI A. YOLOv3: an incremental improvement[J]. arXiv preprint arXiv: 1804.02767, 2018. [15] BOCHKOVSKIY A, WANG C Y, LIAO H Y M. YOLOv4: optimal speed and accuracy of object detection[J]. arXiv preprint arXiv: 2004.10934, 2020. [16] WANG C Y, LIAO H Y M, WU Y H, et al. CSPNet: a new backbone that can enhance learning capability of CNN[C]//Proceedings of 2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition Workshops (CVPRW). Seattle: IEEE, 2020. [17] WOO S, PARK J, LEE J Y, et al. CBAM: convolutional block attention module[C]//Proceedings of the 15th European Conference on Computer Vision. Munich: Springer, 2018: 3-19. [18] BAO Y Q, SONG K C, LIU J, et al. Triplet-graph reasoning network for few-shot metal generic surface defect segmentation[J]. IEEE Transactions on Instrumentation and Measurement, 2021, 70: 5011111.