计算机科学 ›› 2024, Vol. 51 ›› Issue (6A): 230800018-5.doi: 10.11896/jsjkx.230800018

• 图像处理&多媒体技术 • 上一篇    下一篇

基于改进YOLOv7的钢材缺陷检测

黄海新, 吴迪   

  1. 沈阳理工大学自动化与电气工程学院 沈阳 110159
  • 发布日期:2024-06-06
  • 通讯作者: 黄海新(huanghaixin@sylu.edu.cn)
  • 基金资助:
    国家自然科学基金(61672359)

Steel Defect Detection Based on Improved YOLOv7

HUANG Haixin, WU Di   

  1. School of Automation and Electrical Engineering,Shenyang Ligong University,Shenyang 110159,China
  • Published:2024-06-06
  • About author:HUANG Haixin,born in 1973,Ph.D,associate professor.Her main research interests include machine learning,artificial intelligence and intelligent grid.
  • Supported by:
    National Natural Science Foundation of China(61672359).

摘要: 钢材表面缺陷检测在实际生产中非常重要。为了准确检测缺陷,设计了一种基于改进的YOLOv7的钢材表面缺陷检测模型。首先在骨干网络结构中引入Ghost模块,增强模型提取特征和识别小特征的能力,同时降低模型参数量;其次在池化模块中嵌入注意力机制;最后通过引入EIOU改善损失函数,从而更好地优化 YOLOv7 网络模型,且可以更好地处理样本的不平衡,从而达到更好的优化相似度。实验结果表明,与原模型相比,所提模型mAP达到76.9%,提高了4.2%。该模型可以满足钢表面缺陷的准确检测和识别需求。

关键词: yolov7, 缺陷检测, 深度学习, 注意力模块

Abstract: Steel surface defect detection is very important in actual production.In order to accurately detect defects,this paper designs a steel surface defect detection model based on improved YOLOv7.Firstly,the Ghost module is introduced into the backbone network structure to enhance the ability of the model to extract features and identify small features while reducing the number of model parameters.Secondly,the attention mechanism is embedded in the pooling module.Finally,the loss function is improved by introducing EIOU,so as to better optimize the YOLOv7 network model,which can better deal with the imbalance of samples,so as to achieve better optimization similarity.Experimental results show that,compared with the original model,the mAP of the proposed model increases by 4.2% to 76.9%.The model can meet the needs of accurate detection and identification of steel surface defects.

Key words: YOLOv7, Defect detection, Deep learning, Attention module

中图分类号: 

  • TP391
[1]TANG B,KONG J Y,WU S Q.A review of surface defect detection in machine vision[J].China figure Journal of Elephant Graphics,2017,22(12):1640-1663.
[2]GUAN S,CHANG J,SHI H,et al.Strip steel defect classification using the improved GAN and EfficientNet[J].Applied Artificial Intelligence,2021,35(15):1887-1904.
[3]REDMON J,DIVVALA S,GIRSHICK R,et al.You only look once:Unified,real-time object detection[C]//Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition.2016:779-788.
[4]TONG L,WONG W K,KWONG C K.Differential evolution-based optimal Gabor filter model for fabric inspection[J].Neurocomputing,2016,173:1386-1401.
[5]TSAI D M,CHEN M C,LI W C,et al.A fast regularity measure for surface defect detection[J].Machine Vision and applications,2012,23:869-886.
[6]WANG J,LI Q,GAN J,et al.Surface defect detection via entity sparsity pursuit with intrinsic priors[J].IEEE Transactions on Industrial Informatics,2019,16(1):141-150.
[7]LIU K,WANG H,CHEN H,et al.Steel surface defect detection using a new Haar-Weibull-variance model in unsupervised manner[J].IEEE transactions on instrumentation and measurement,2017,66(10):2585-2596.
[8]CHOI D,JEON Y J,KIM S H,et al.Detection of pinholes in steel slabs using Gabor filter combination and morphological features[J].Isij International,2017,57(6):1045-1053.
[9]WANG C Y,BOCHKOVSKIY A,LIAO H Y M.YOLOv7:Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors[C]//Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition.2023:7464-7475.
[10]NIU J,LI H,CHEN X,et al.An improved YOLOv5 network for detection of printed circuit board defects[J/OL].https://www.hindawi.com/journals/js/2023/7270093/.
[11]DING F,SHI J,WU H J.Improving the Lightweight RemoteSensing Image of YOLOv4 for Building Inspection[J].Computer Engineering and Applications,2023,59(10):213-220.
[12]SUN Y Z,GAO J W.Wheelset Tread Defect Detection Based on Improved YOLOv5[J].Advances in Laser and Optoelectronics,2022,59(22):228-234.
[13]WU D,LI M H,MA W K,et al.Steel surface defects based on improving YOLOv5[J].Journal of Shaanxi University of Science and Technology,2023,41(2):162-169.
[14]HE Y,SONG K,MENG Q,et al.An end-to-end steel surfacedefect detection approach via fusing multiple hierarchical features[J].IEEE Transactions on Instrumentation and Measurement,2019,69(4):1493-1504.
Viewed
Full text


Abstract

Cited

  Shared   
  Discussed   
No Suggested Reading articles found!