Improved YOLOv3 Algorithm For Detection of Metal Surface Defect
-
摘要: 针对现有的金属表面缺陷检测方法存在着检测效率低、适用范围受限、处理步骤繁琐等缺陷,提出了基于改进型YOLOv3算法的实时缺陷检测方法。该方法将采集到的图片分为N×N个格子,每个格子用来检测缺陷的中心点是否在格子中,利用特征金字塔与残差层融合特征的方式对图片中的缺陷进行定位,得到多个缺陷的边界框,使用非极大抑制的方法筛选出得分最高的边界框。为了提高检测效果,在输入端对图像进行直方图均衡化,并基于缺陷权重优化了算法中的损失函数以提高缺陷分类的准确性。最后,利用改进型YOLOv3算法对钢板表面的压痕与划痕进行了实验检测,结果显示该方法可以快速、准确检测出钢材表面的压痕与划痕,精度分别为92%和90%。Abstract: In view of the existing detection methods of steel plate defect, which have the low efficiency of detection, limited scope of application, cumbersome operation steps and so on, a real-time detection method of defect based on an improved YOLOv3(You Only Look Once version 3) algorithm is proposed. The method divides the captured images into N×N grids, each grid is used to detect whether there is a center point of defect in the grid, and through multi-scale detection and residual layer fusion feature to locate the defects in the image, get the boundary boxes of multiple defects, and finally use the non maximum inhibition method to screen the highest score boundary boxes. In order to improve the detection effect, the histogram equalization image is used in the input, and the weight based loss function is used, which effectively improves the problem that the model mistakenly judges scratches as indentation. Experimental detection of indentations and scratches on steel plate surfaces with an improved YOLOv3 algorithm. The results show that the method can effectively detect the indentation and scratch on the steel surface, with the accuracy of 92% and 90% respectively.
-
表 1 模型性能对比
模型 mAP 检测速度(张/秒) YOLOv3 33.0 48 Faster RCNN 35.9 8 SSD 21.9 45 表 2 检测结果统计
压痕 划痕 精确率P 召回率R 精确率P 召回率R 优化前 88.1% 94.9% 90.5% 95.0% 优化后 89.2% 84.6% 91.9% 91.9% -
[1] Arjun V, Sasi B, Rao B P C, et al. Optimisation of pulsed eddy current probe for detection of sub-surface defects in stainless steel plates[J]. Sensors and Actuators A:Physical, 2015, 226:69-75 doi: 10.1016/j.sna.2015.02.018 [2] Tsukada K, Majima Y, Nakamura Y, et al. Detection of inner cracks in thick steel plates using unsaturated AC magnetic flux leakage testing with a magnetic resistance gradiometer[J]. IEEE Transactions on Magnetics, 2017, 53(11):2501305 http://www.wanfangdata.com.cn/details/detail.do?_type=perio&id=6e5ac25f4007eb22dbe416c3564d8181 [3] 陈大鹏, 毛宏霞, 肖志河.红外热成像无损检测技术现状及发展[J].计算机测量与控制, 2016, 24(4):1-6, 9 http://www.wanfangdata.com.cn/details/detail.do?_type=perio&id=jsjzdclykz201604001Chen D P, Mao H X, Xiao Z H. Infrared thermography NDT and its development[J]. Computer Measurement & Control, 2016, 24(4):1-6, 9(in Chinese) http://www.wanfangdata.com.cn/details/detail.do?_type=perio&id=jsjzdclykz201604001 [4] Liu H W, Lan Y Y, Lee H W, et al. Steel surface in-line inspection using machine vision[C]//Proceedings Volume 10011, First International Workshop on Pattern Recognition. Tokyo: SPIE, 2016: 100110X [5] 吴贵芳, 徐科, 杨朝霖.钢板表面质量在线监测技术[M].北京:科学出版社, 2010Wu G F, Xu K, Yang C L. On line monitoring technology of steel plate surface quality[M]. Beijing:Science Press, 2010(in Chinese) [6] Li W B, Zhang Q Z, Sun J L, et al. Review of vision inspection technology for surface defect of steel bar[J]. Applied Mechanics and Materials, 2015, 740:543-546 doi: 10.4028/www.scientific.net/AMM.740.543 [7] 李怡.冷轧带钢表面缺陷数据关联规则挖掘方法研究[D].武汉: 武汉科技大学, 2017Li Y. Research on association rule mining method of surface defect data of cold rolled strip[D]. Wuhan: Wuhan University of Science and Technology, 2017(in Chinese) [8] 蒋芸, 彭婷婷, 谭宁, 等.基于YOLO算法的眼底图像视盘定位方法[J].计算机工程与科学, 2019, 41(9):1662-1670 http://www.wanfangdata.com.cn/details/detail.do?_type=perio&id=jsjgcykx201909020Jiang Y, Peng T T, Tan N, et al. An optic disc positioning method in fundus images based on YOLO[J]. Computer Engineering and Science, 2019, 41(9):1662-1670(in Chinese) http://www.wanfangdata.com.cn/details/detail.do?_type=perio&id=jsjgcykx201909020 [9] 胡联亭.基于机器视觉的钢板表面缺陷识别研究[D].武汉: 武汉科技大学, 2018Hu L T. Research on surface detect recognition of steel plate based on machine vision[D]. Wuhan: Wuhan University of Science and Technology, 2018(in Chinese) [10] 崔洁.基于随机森林的激光超声金属表面缺陷识别方法研究[D].太原: 中北大学, 2019Cui J. Research on laser ultrasonic metal surface defect recognition based on random forest[D]. Taiyuan: North University of China, 2019(in Chinese) [11] Redmon J, Divvala S, Girshick R, et al. You only look once: unified, real-time object detection[C]//2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). Las Vegas: IEEE, 2016 [12] Redmon J, Farhadi A. YOLO9000: better, faster, stronger[C]//2017 IEEE Conference on Computer Vision and Pattern Recognition (CVPR). Honolulu: IEEE, 2016 [13] Redmon J, Farhadi A. YOLOv3:An incremental improvement[J]. arXiv preprint arXiv:1804.02767, 2018 http://arxiv.org/abs/1804.02767 [14] Long J, Shelhamer E, Darrell T. Fully convolutional networks for semantic segmentation[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition. Boston: IEEE, 2015: 3431-3440 [15] He K M, Zhang X Y, Ren S Q, et al. Deep residual learning for image recognition[C]//2016 IEEE Conference on Computer Vision and Pattern Recognition. Las Vegas: IEEE, 2016: 770-778 [16] Krizhevsky A, Sutskever I, Hinton G E. ImageNet classifica-tion with deep convolutional neural networks[C]//Proceedings of the 25th International Conference on Neural Information Processing Systems. Red Hook: Curran Associates Inc., 2012: 1097-1105 [17] Xu B, Wang N Y, Chen T Q, et al. Empirical evaluation of rectified activations in convolutional network[J]. arXiv preprint arXiv:1505.00853, 2015 http://www.oalib.com/paper/4075127 [18] Neubeck A, van Gool L. Efficient non-maximum suppression[C]//18th International Conference on Pattern Recognition. Hong Kong, China: IEEE, 2006: 850-855