作者投稿和查稿 主编审稿 专家审稿 编委审稿 远程编辑

计算机工程 ›› 2025, Vol. 51 ›› Issue (1): 208-215. doi: 10.19678/j.issn.1000-3428.0068397

• 图形图像处理 • 上一篇    下一篇

基于改进YOLOv7-tiny的带钢表面缺陷检测算法

阳丽莎, 李茂军, 胡建文, 王鼎湘*()   

  1. 长沙理工大学电气与信息工程学院, 湖南 长沙 410114
  • 收稿日期:2023-09-17 出版日期:2025-01-15 发布日期:2024-04-15
  • 通讯作者: 王鼎湘
  • 基金资助:
    国家自然科学基金青年项目(62106072); 国家自然科学基金(62271087)

Strip Steel Surface Defect Detection Algorithm Based on Improved YOLOv7-tiny

YANG Lisha, LI Maojun, HU Jianwen, WANG Dingxiang*()   

  1. School of Electrical and Information Engineering, Changsha University of Science and Technology, Changsha 410114, Hunan, China
  • Received:2023-09-17 Online:2025-01-15 Published:2024-04-15
  • Contact: WANG Dingxiang

摘要:

针对带钢表面缺陷检测任务存在的小目标检测效率低、缺陷定位不准确、检测算法参数量大、难以部署在终端设备上等问题, 提出一种改进的YOLOv7-tiny检测算法。首先, 使用GSConv替换颈部网络中的标准卷积, 基于GSConv设计一种改进的高效聚合网络(ELAN-G), 保证带钢表面缺陷特征信息被充分融合同时降低算法的参数量; 其次, 在预测头和颈部网络之间增加针对低分辨率和小缺陷的SPDConv模块, 模块生成一个中间特征图, 通过对中间特征图中的小缺陷特征信息进行过滤学习得到最终特征图, 以此提高预测头对小缺陷的检测精度; 最后, 引入MPDIoU损失函数, 合理利用边界回归框的几何性质, 简化损失函数计算过程并提高缺陷定位精度。实验结果表明, 在NEU-DET数据集上, 改进算法比其他6种先进目标检测算法效果更好, 性能更均衡, 其平均精度均值(mAP)可达74.1%, 且参数量和计算量低于所有对比算法, 可应用于工业环境中的带钢表面缺陷检测系统。

关键词: YOLOv7-tiny, 目标检测, 表面缺陷, GSConv, MPDIoU

Abstract:

An improved YOLOv7-tiny detection algorithm is proposed to address several challenges, including low efficiency in small-target detection, inaccurate defect localization, excessive parameters in the detection algorithm, and difficulties in deploying the model on terminal equipment for surface defect detection on strip steel. First, GSConv is introduced to replace the standard convolution in the Neck network, followed by the design of an improved and efficient aggregation network, ELAN-G, based on GSConv, which reduces the model parameters while ensuring adequate fusion of strip steel surface defect features. Second, the SPDConv module is integrated between the Head and Neck networks to improve detection of low-resolution and small defects. The module generates an intermediate feature map, which is subsequently filtered and processed to obtain the final feature map, improving the detection accuracy of the Head network for small defects. Finally, the MPDIoU loss function is adopted to leverage the geometric properties of the bounding regression box, simplifying the loss calculation process and enhancing defect localization accuracy. The experimental results indicate that the improved algorithm outperforms six other advanced target detection algorithms on the NEU-DET dataset, demonstrating a more balanced performance. The mean Average Precision (mAP) of the improved algorithm reaches 74.1%, while the parameter count and computational requirements are lower than those of all comparative algorithms, making it suitable for deployment in a steel surface defect detection system within an industrial environment.

Key words: YOLOv7-tiny, object detection, surface defect, GSConv, MPDIoU