北京邮电大学学报

  • EI核心期刊

北京邮电大学学报 ›› 2025, Vol. 48 ›› Issue (2): 119-125.

• 研究报告 • 上一篇    下一篇

改进YOLOv7的金属表面缺陷检测方法

马小林, 邓翔予, 钱亚飞, 旷海兰, 刘新华   

  1. 1. 武汉理工大学 信息工程学院 2. 武汉理工大学 宽带无线通信与传感器网络湖北省重点实验室
  • 收稿日期:2024-02-04 修回日期:2024-03-26 出版日期:2025-04-30 发布日期:2025-04-30
  • 通讯作者: 旷海兰 E-mail:kuanghailan@whut.edu.cn
  • 基金资助:

Improved YOLOv7 for Metal Surface Defect Detection Method

  • Received:2024-02-04 Revised:2024-03-26 Online:2025-04-30 Published:2025-04-30

摘要: 金属材料的质量问题直接关系到工业产品的安全性,传统的金属材料质量缺陷检测算法无法实现高精度的实时检测。为解决该问题,提出了一种针对金属表面缺陷检测框架 (YOLOv7-BCA)。首先采用动态稀疏采样来进行特征提取,增强网络对于细粒度的特征提取;接着设计特征增强模块,以实现3个相邻层的特征融合增强,使得定位信息更加准确;最后结合自适应空间特征融合思想,有效结合深度网络特征图的语义信息和浅层网络特征图的位置信息。实验结果表明,提出的YOLOv7-BCA平均检测精度为75.9%,比原始模型提升4.7%,证实了YOLOv7-BCA的性能在金属表面缺陷检测中具有较为明显的优势,可以对金属表面缺陷进行高度精确的定位,具有较强的实时性。

关键词: 缺陷检测, 稀疏注意力机制, 自适应空间特征融合

Abstract: The quality of metal materials directly affects the safety of industrial products. However, traditional defect detection algorithms on metal material quality cannot achieve high-precision real-time detection. To address it, a metal surface defect detection framework called you only look once v7-bi concatenation adaptive (YOLOv7-BCA) has been proposed. The YOLOv7-BCA framework first uses dynamic sparse sampling for feature extraction, enhancing the network's ability to extract fine-grained features. Next, a feature enhancement module is designed to achieve feature fusion and enhancement for three adjacent layers, improving the accuracy of localization information. Finally, combining the idea of adaptive spatial feature fusion, the semantic information from deep network feature maps and the positional information from shallow network feature maps are effectively integrated. Comprehensive and detailed experimental results demonstrate that the proposed YOLOv7-BCA achieves an average detection accuracy of 75.9%, a 4.7% improvement over the original model. YOLOv7-BCA exhibits significant advantages in metal surface defect detection, it can achieve highly accurate localization of metal surface defects and demonstrating strong real-time performance.

Key words: defect detection, sparse attention mechanism, adaptive spatial feature fusion

中图分类号: