欢迎访问《图学学报》 分享到:

图学学报 ›› 2024, Vol. 45 ›› Issue (3): 446-453.DOI: 10.11996/JG.j.2095-302X.2024030446

• 图像处理与计算机视觉 • 上一篇    下一篇

基于改进YOLOv7-tiny的橡胶密封圈缺陷检测方法

张相胜(), 杨骁   

  1. 江南大学轻工过程先进控制教育部重点实验室,江苏 无锡 214122
  • 收稿日期:2023-10-08 接受日期:2024-02-20 出版日期:2024-06-30 发布日期:2024-06-06
  • 第一作者:张相胜(1977-),男,副教授,博士。主要研究方向为计算机视觉与图像处理、机器人智能控制等。E-mail:zxs_vip@163.com

Defect detection method of rubber seal ring based on improved YOLOv7-tiny

ZHANG Xiangsheng(), YANG Xiao   

  1. Key Laboratory of Advanced Process Control for Light Industry (Ministry of Education), Jiangnan University, Wuxi Jiangsu 214122, China
  • Received:2023-10-08 Accepted:2024-02-20 Published:2024-06-30 Online:2024-06-06
  • First author:ZHANG Xiangsheng (1977-), associate professor, Ph.D. His main research interests cover computer vision and image processing, intelligent control of robots, etc. E-mail:zxs_vip@163.com

摘要:

针对橡胶密封圈表面缺陷传统检测效率低下的问题,提出一种改进YOLOv7-tiny的橡胶密封圈表面缺陷检测算法。在主干特征提取网络中引入PConv优化ELAN结构,增强算法特征提取能力,并减少参数量;在特征融合网络中引入全局注意力机制(GAM),利用每一对三维通道、空间宽度和空间高度之间的注意力权重,在3个维度上捕捉重要特征来提高效率,增强算法特征融合能力;使用WIoU损失函数优化原边界框损失函数,通过符合情况的梯度增益分配策略,增强算法对检测目标的定位能力;增加P2小目标检测层,加强深层与浅层特征信息的融合,增强算法对小目标缺陷的检测能力。在O-Rings数据集进行实验对比,改进后的算法与YOLOv7-tiny算法比较,mAP提升了7.8%,达到了90.9%的检测精度,能够满足实际工业生产需求。

关键词: YOLOv7-tiny, 橡胶密封圈, 缺陷检测, 注意力机制, 小目标检测层

Abstract:

Aiming at the problem of low efficiency in traditional detection of surface defects of rubber seal rings, an improved YOLOv7-tiny algorithm for surface defect detection of rubber seal rings was proposed. The PConv optimized ELAN structure was introduced into the backbone feature extraction network to enhance the algorithm’s feature extraction capability and to reduce the number of parameters. The global attention mechanism (GAM) was introduced into the feature fusion network, utilizing the attention weights between each pair of 3D channels, spatial widths, and spatial heights to improve efficiency by capturing the important features in three dimensions, thus enhancing the algorithm’s feature fusion capability. The WIoU loss function was employed to optimize the original bounding box loss function, enhancing the algorithm’s ability to locate the detected targets through a situation-compliant gradient gain allocation strategy. Additionally, a P2 small-target detection layer was added to strengthen the fusion of the deep and shallow feature information, thereby enhancing the algorithm’s ability to detect small-target defects. Experimental comparisons were conducted using the O-Rings dataset. The improved algorithm was compared with the YOLOv7-tiny algorithm, resulting in a 7.8% improvement in mAP and achieving a detection accuracy of 90.9%, meeting the needs of actual industrial production.

Key words: YOLOv7-tiny, rubber seal ring, defect detection, attention mechanism, small target detection layer

中图分类号: