DOI:10.3969/j.issn.1003-5060.2024.03.003
面向带钢表面小目标缺陷检测的改进 YOLOv7 算法
樊嵘,马小陆
(安徽工业大学电气与信息工程学院,安徽 马鞍山 243002)
摘要
带钢表面小目标缺陷检测是工业质检领域的研究热点。针对热轧带钢表面缺陷检测任务中小目标缺陷易产生漏检的问题, 文章提出一种改进的 YOLOv7 算法。在骨干网络中融入通道空间注意力模块(convolutional block attention module, CBAM) 和可重参数化卷积模块, 以提升小目标特征的提取效率; 采用改进的双向特征金字塔网络(bi-directional feature pyramid network, BiFPN) 颈部网络替换原有的路径聚合网络(path aggregation network, PANet) 颈部网络, 实现对小目标缺陷特征的高效提纯; 采用解耦检测头进行检测结果输出, 使网络在训练时进一步收敛至更高精度。实验结果表明, 改进后的 YOLOv7 算法在小目标带钢缺陷检测场景下检测精度领先 YOLOv7 算法 4.3 AP50 精度, 领先 YOLOv6 算法 5.0 AP50 精度, 领先 YOLOX 算法 4.8 AP50 精度, 说明该算法可以较好地应用于小目标带钢缺陷检测。
关键词
机器视觉;缺陷检测;YOLOv7算法;双向特征金字塔网络(BiFPN);注意力机制
中图分类号:TP391.7
文献标志码:A
文章编号:1003-5060(2024)03-0303-07
Improved YOLOv7 algorithm for small target defect detection on strip steel surface
FAN Rong, MA Xiaolu
(School of Electrical and Information Engineering, Anhui University of Technology, Ma'anshan 243002, China)
Abstract
The detection of small target defects on the surface of hot rolled strip steel is a hot research topic in the field of industrial quality inspection. An improved YOLOv7 algorithm is proposed for the problem of small target defects prone to miss detection in hot rolled strip steel surface defect inspection tasks. Convolutional block attention module (CBAM) module and RepConv module are incorporated in the backbone network to improve the efficiency of small target feature extraction. The original path aggregation network (PANet) neck network is replaced by the improved bi-directional feature pyramid network (BiFPN) neck network to achieve efficient purification of small target defect features. Decoupled detection heads are used for detection result output, so that the network can further converge to higher accuracy during training. Finally, it is shown experimentally that the improved YOLOv7 is ahead of YOLOv7 algorithm by 4.3 AP50 accuracy, ahead of YOLOv6 algorithm by 5.0 AP50 accuracy and ahead of YOLOX algorithm by 4.8 AP50 accuracy in detecting defects in small target hot rolled strip steel detection scenarios. The proposed algorithm can be better applied to small target strip steel defect detection.
Keywords
machine vision; defect detection; YOLOv7 algorithm; bi-directional feature pyramid network (BiFPN); attention mechanism
收稿日期:2023-02-07
修回日期:2023-03-01
基金项目:国家自然科学基金资助项目(61872004; 62172004); 安徽省科技重大专项资助项目(202003a05020028)和安徽高校自然科学研究重点资助项目(KJ2019A0065)