《计算机应用》唯一官方网站 ›› 2023, Vol. 43 ›› Issue (1): 242-249.DOI: 10.11772/j.issn.1001-9081.2021111926

• 多媒体计算与计算机仿真 • 上一篇    下一篇

融合频域注意力机制和解耦头的YOLOv5带钢表面缺陷检测

孙泽强1, 陈炳才1,2, 崔晓博1, 王磊1, 陆雅诺1   

  1. 1.新疆师范大学 计算机科学技术学院,乌鲁木齐 830054
    2.大连理工大学 计算机科学与技术学院,辽宁 大连 116024
  • 收稿日期:2021-11-15 修回日期:2022-05-02 发布日期:2023-01-12
  • 通讯作者: 陈炳才(1978—),男,福建漳平人,教授,博士,主要研究方向:图像处理、无线通信china@dlut.edu.cn
  • 作者简介:孙泽强(1997—),男,山西运城人,硕士研究生,主要研究方向:缺陷检测;崔晓博(1996—),男,山西运城人,硕士研究生,主要研究方向:图像处理;王磊(1997—),男,安徽合肥人,硕士研究生,主要研究方向:深度学习;陆雅诺(1996—),男,安徽铜陵人,硕士研究生,主要研究方向:计算机视觉;
  • 基金资助:
    国家自然科学基金资助项目(61961040,61771089);新疆自治区区域协同创新专项(科技援疆计划)(2020E0247,2019E0214)。

Strip steel surface defect detection by YOLOv5 algorithm fusing frequency domain attention mechanism and decoupled head

SUN Zeqiang1, CHEN Bingcai1,2, CUI Xiaobo1, WANG Lei1, LU Yanuo1   

  1. 1.School of Computer Science and Technology, Xinjiang Normal University, Urumqi Xinjiang 830054, China
    2.College of Computer Science and Technology, Dalian University of Technology, Dalian Liaoning 116024, China
  • Received:2021-11-15 Revised:2022-05-02 Online:2023-01-12
  • Contact: CHEN Bingcai, born in 1978, Ph. D., professor. His research interests include image processing, wireless communication.
  • About author:SUN Zeqiang, born in 1997, M. S. candidate. His research interests include defect detection;CUI Xiaobo, born in 1996, M. S. candidate. His research interests include image processing;WANG Lei, born in 1997, M. S. candidate. His research interests include deep learning;LU Yanuo, born in 1996, M. S. candidate. His research interests include computer vision;
  • Supported by:
    This work is partially supported by National Natural Science Foundation of China (61961040, 61771089), Xinjiang Autonomous Region Regional Collaborative Innovation Project — Science and Technology Assistance Program for Xinjiang (2020E0247, 2019E0214).

摘要: 针对带钢表面缺陷在实际场景中检测精度低,易出现漏检和误检的情况,构建一种YOLOv5-CFD模型对带钢缺陷目标进行更精确的检测,该模型由CSPDarknet53、FcaNet与解耦检测头(Decoupled head)组成。首先,采用模糊C均值(FCM)算法对东北大学公开的NEU-DET热轧带钢表面缺陷检测数据集中的锚框进行聚类,优化先验框和真实框之间的匹配度;其次,为提取目标区域丰富的细节信息,在原始YOLOv5算法基础上添加频域通道注意力模块FcaNet;最后,采用解耦检测头将分类任务和回归任务分离。在NEU-DET数据集上的实验结果表明,改进的YOLOv5算法在引入较少参数量的情况下,检测精度提高了4.2个百分点,平均精度均值(mAP)达到85.5%,每秒传输帧数(Frames Per Second,FPS)达到27.71,与原YOLOv5相差不大,能够满足检测实时性的要求

关键词: YOLOv5, 频域注意力机制, 解耦头, 锚框, 聚类算法, 表面缺陷检测

Abstract: Aiming at the low detection precision of strip steel surface defects in actual scenarios, which is prone to missed detection and false detection, a YOLOv5-CFD model consisted of CSPDarknet53, Frequency channel attention Network (FcaNet) and Decoupled head was constructed to detect strip steel defects more accurately. Firstly, Fuzzy C-Means (FCM) algorithm was used to cluster anchor boxes in NEU-DET hot-rolling strip steel surface defect detection dataset published by Northeastern University to optimize the matching degree between the prior box and the ground-truth box. Secondly, in order to extract the rich detailed information of the target area, the frequency domain channel attention module FcaNet (Frequency channel attention Network) was added to the original YOLOv5 algorithm. Finally, the decoupled head was used to separate the classification and regression tasks. Experimental results on NEU-DET dataset show that with introducing a small number of parameters to the original YOLOv5 algorithm, the improved YOLOv5 algorithm has the detection precision increased by 4.2 percentage points, the detection mean Average Precision (mAP) of 85.5%; and the detection speed reaches 27.71 Frames Per Second (FPS), which is not much different from the original YOLOv5 so that YOLOv5-CFD can meet the real-time detection requirements.

Key words: YOLOv5, frequency domain attention mechanism, decoupled head, anchor box, clustering algorithm, surface defect detection

中图分类号: