基于改进YOLOv5的带钢表面缺陷检测

杨威,杨俊,许聪源

计量学报 ›› 2024, Vol. 45 ›› Issue (11) : 1671-1680.

PDF(893 KB)
PDF(893 KB)
计量学报 ›› 2024, Vol. 45 ›› Issue (11) : 1671-1680. DOI: 10.3969/j.issn.1000-1158.2024.11.11
光学计量

基于改进YOLOv5的带钢表面缺陷检测

  • 杨威1,2,杨俊2,许聪源2
作者信息 +

Strip Surface Defect Detection Based on Improved YOLOv5

  • YANG Wei1,2,YANG Jun2,XU Congyuan2
Author information +
文章历史 +

摘要

针对带钢表面缺陷检测方法存在检测精度低和检测速度慢的问题,提出一种基于改进YOLOv5的带钢表面缺陷检测方法。首先,采用内容感知特征重组CARAFE作为多尺度特征融合的上采样算子,构建具有通道缩放的自适应空间特征融合CS-ASFF结构,以增强多尺度特征融合并控制模型复杂度。其次,在模型的卷积层和跨层级结构引入GSConv和VoVGSCSP模块,以减小计算量并提高检测精度。最后,采用Focal-GIOU Loss作为损失函数来解决带钢缺陷图像中难易样本不平衡的问题,并提升模型对复杂数据的适应能力。实验结果表明,在NEU-DET数据集上该方法达到了80.6%的均值平均精度(PmAP),计算量为14.8 GFLOPs。与YOLOv5相比,PmAP提高了4.3%且计算量减少了6.33%。与当前主流目标检测网络相比,在更低的计算量下该方法具有最高的检测精度,能够满足真实工业场景下的带钢表面缺陷实时检测。

Abstract

Aiming at the problems of low detection accuracy and slow detection speed in strip surface defect detection methods, a strip surface defect detection method based on improved YOLOv5 is proposed. Firstly, the Content-Aware ReAssembly of FEatures (CARAFE) is used as the upsampling operator of multi-scale feature fusion, and the Channel Scaling-Adaptively Spatial Feature Fusion (CS-ASFF) is constructed to enhance multi-scale feature fusion and control model complexity. Secondly, the GSConv and VoVGSCSP modules are introduced into the convolutional layer and cross-layer structure of the model to reduce computation and improve detection accuracy. Finally, the Focal-GIOU Loss is used as the loss function to solve the problem of imbalance between difficult and easy samples in strip defect images, thereby improving the adaptability to complex data. Experimental results show that the method achieves 80.6% mean average precision (PmAP) on NEU-DET dataset, with a calculation amount of 14.8 GFLOPs. Compared with YOLOv5, PmAP is increased by 4.3% and the computation amount is reduced by 6.33%. Compared with the current mainstream object detection networks, this method has the highest detection accuracy with a lower calculation amount and can meet the real-time detection of surface defects on steel strips in real industrial scenarios.

关键词

机器视觉;带钢表面缺陷检测 / YOLOv5 / 多尺度融合 / 损失函数

Key words

machine vision;strip surface defects detection / YOLOv5 / multi-scale fusion / loss function

引用本文

导出引用
杨威,杨俊,许聪源. 基于改进YOLOv5的带钢表面缺陷检测[J]. 计量学报. 2024, 45(11): 1671-1680 https://doi.org/10.3969/j.issn.1000-1158.2024.11.11
YANG Wei,YANG Jun,XU Congyuan. Strip Surface Defect Detection Based on Improved YOLOv5[J]. Acta Metrologica Sinica. 2024, 45(11): 1671-1680 https://doi.org/10.3969/j.issn.1000-1158.2024.11.11
中图分类号: TB96   

参考文献

[1]范细忠, 何士国, 于斌, 等. 钢带表面质量缺陷原因分析及改进措施[J]. 鞍钢技术, 2020(6): 52-55.
FAN X Z, HE S G, YU B, et al. Analysis on causes leading to surface quality defects of steel strips and improvement measures[J]. Angang Technology, 2020(6): 52-55.
[2]姚波, 温秀兰, 焦良葆, 等. 改进YOLOv3算法用于铝型材表面缺陷检测[J]. 计量学报, 2022, 43(10): 1256-1261.
YAO B, WEN X L, JIAO L B, et al. Improved YOLOv3 algorithm for surface defect detection of aluminum profile[J]. Acta Metrologica Sinica, 2022, 43(10): 1256-1261.
[3]胡亮, 段发阶, 丁克勤, 等. 基于线阵CCD钢板表面缺陷在线检测系统的研究[J]. 计量学报, 2005, 26(3): 200-203.
HU L, DUAN F J, DING K Q, et al. Study on In-line surface defect detection system for steel strip based on linear CCD sensor [J]. Acta Metrologica Sinica, 2005, 26(3): 200-203.
[4]LI C F, XU A, CAI Y F, et al. Improved YOLOX-based Method for Steel Surface Defect Detection [C]//IAECST, 2023 5th International Academic Exchange Conference on Science and Technology Innovation, Guangzhou, China, 2023: 929-934
[5]崔文靓, 王玉静, 康守强, 等. 基于改进YOLOv3算法的公路车道线检测方法[J]. 自动化学报, 2022, 48(6): 1560-1568.
CUI W L, WANG Y J, KANG S Q, et al. Road lane line detection method Based on improved YOLOv3 algorithm[J]. Acta Automatica Sinica, 2022, 48(6): 1560-1568.
[6]ZHAO W, CHEN F, HUANG H, et al. A new steel defect detection algorithm based on deep learning[J]. Computational Intelligence and Neuroscience, 2021, 2021: 1-13.
[7]CHEN F, DENG M, GAO H, et al. ACA-Net: An adaptive convolution and anchor network for metallic surface defect detection[J]. Applied Sciences, 2022, 12(16): 8070.
[8]季娟娟, 王佳, 陈亚杰, 等. 基于改进YOLO v4的热轧带钢表面缺陷检测[J]. 计算机工程与设计, 2023, 44(9): 2786-2793.
JI J J, WANG J, CHEN Y J, et al. Surface defect detection of hot rolled strip based on improved YOLO v4[J]. Computer Engineering and Design, 2023, 44(9): 2786-2793.
[9]WANG J Q, CHEN K, XU R, et al. Carafe: content-aware reassembly of features[C]. ICCV. 2019 the IEEE/CVF international conference on computer vision. Seoul, Korea, 2019: 3007-3016.
[10]LI H, LI J, WEI H, et al. Slim-neck by GSConv: A better design paradigm of detector architectures for autonomous vehicles[J/OL]. https: //arxiv. org/abs/2206. 02424, 2022.
[11]ZHANG Y F, REN W Q, ZHANG Z, et al. Focal and efficient IOU loss for accurate bounding box regression[J]. Neurocomputing, 2022, 506: 146-157.
[12]LIN T Y, DOLLAR P, GIRSHICK R, et al. Feature pyramid networks for object detection[C]//CVPR. 2017 IEEE Conference on Computer Vision and Pattern Recognition. Honolulu, USA, 2017: 2117-2125
[13]LIU S, QI L, QIN H, et al. Path aggregation network for instance segmentation[C]// CVPR. 2018 IEEE Conference on Computer Vision and Pattern Recognition. Salt Lake City, USA, 2018: 8759-8768.
[14]邓世爽, 狄岚, 梁久祯, 等. 结合注意力机制与自适应记忆性融合网络的纺织品瑕疵检测[J]. 模式识别与人工智能, 2022, 35(6): 536-547.
DENG S S, DI L, LIANG J Z, et al. Textile defect detection combining attention mechanism and adaptive memory fusion network [J]. Pattern Recognition and Artificial Intelligence, 2022, 35(6): 536-547.
[15]LIU S, HUANG D, WANG Y. Learning spatial fusion for single-shot object detection[J/OL]. https: //arxiv. org/abs/1911. 09516, 2019.
[16]CHOLLET F. Xception: deep learning with depthwise separable convolutions[C]// CVPR. 2018 IEEE Conference on Computer Vision and Pattern Recognition. Honolulu, USA, 2017: 1251-1258.
[17]HOWARD A G, ZHU M, CHEN B, et al. Mobilenets: Efficient convolutional neural networks for mobile vision applications[J/OL]. https: //arxiv. org/abs/1704. 04861, 2017.
[18]MA N, ZHANG X, ZHENG H T, et al. Shufflenet v2: Practical guidelines for efficient cnn architecture design[C]// ECCV. 2018 European Conference on Computer Vision. Munich, Germany, 2018: 116-131.
[19]HE Y, SONG K, MENG Q, et al. An end-to-end steel surface defect detection approach via fusing multiple hierarchical features[J]. IEEE transactions on instrumentation and measurement, 2019, 69(4): 1493-1504.
[20]REN S, HE K, GIRSHICK R, et al. Faster r-cnn: Towards real-time object detection with region proposal networks[J]. Advances in neural information processing systems, 2015, 39: 1137-1149.
[21]LIU W, ANGUELOV D, ERHAN D, et al. Ssd: Single shot multibox detector[C]// ECCV. 2015 European Conference on Computer Vision. Amsterdam, NetherLands, 2016: 21-37.
[22]ZHOU X, WANG D, PHILIPP K. Objects as points[J/OL]. https: //arxiv. org/abs/1904. 07850, 2019.
[23]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]// CVPR. 2023 IEEE Conference on Computer Vision and Pattern Recognition. Vancouver, Canada, 2023: 7464-7475.
[24]GLENN J. YOLOv8[EB/OL]. (2023-01-10)[2024-03-04]. http: //github. com/ultralytics/ultralytics.

基金

国家自然科学基金 (62302197);浙江省自然科学基金 (LQ23F020006);浙江省基础公益研究计划 (LGG22F020021)

PDF(893 KB)

Accesses

Citation

Detail

段落导航
相关文章

/