计算机与现代化 ›› 2023, Vol. 0 ›› Issue (12): 82-86.doi: 10.3969/j.issn.1006-2475.2023.12.014

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

改进YOLOv7算法在西林瓶轧盖缺陷检测中的应用

  

  1. (1.长沙理工大学物理与电子科学学院,湖南 长沙 410114; 2.纳威尔智能科技有限公司,湖南 长沙 410007)
  • 出版日期:2023-12-24 发布日期:2024-01-29
  • 作者简介:宁娟(1998—),女,湖南邵东人,硕士研究生,研究方向:计算机视觉,图像处理,深度学习,E-mail: 869994143@qq.com; 周庆华(1977—),男,湖南长沙人,教授,博士,研究方向:人工智能及其应用,电磁波与电磁场理论及应用,E-mail: zhouqinghua@csust.edu.cn; 曾小为(1992—),男,湖南长沙人,工程师,硕士,研究方向:图像处理,E-mail: 197025991@qq.com。
  • 基金资助:
    国家自然科学基金资助项目(42074198)

Application of Improved YOLOv7 Algorithm in Detection of Capping Defects of Vials

  1. (1. School of Physics and Electronic Science, Changsha University of Science and Technology, Changsha 410114, China;
    2. Nevil Intelligent Technology Co., LTD., Changsha 410007, China)
  • Online:2023-12-24 Published:2024-01-29

摘要: 摘要:针对西林瓶轧盖缺陷检测中存在目标缺陷较小和特征不清造成的漏检问题,提出一种基于改进YOLOv7算法的缺陷检测方法。首先在真实工业环境下采集西林瓶轧盖的缺陷图像,包括划痕、缺帽、凹裂、复合缺陷4种常见缺陷,并进行数据增强,构造一个具有3220张西林瓶轧盖缺陷图像的数据集。然后在原始YOLOv7的基础上引入CBAM(Convolution Block Attention Module)注意力模块和ASFF(Adaptively Spatial Feature Fusion)自适应特征融合模块,以提高网络提取特征的能力,提高对小目标缺陷的检测精度,降低西林瓶轧盖缺陷漏检率。实验结果表明,改进后算法的平均检测精度(mAP)达到99.3%,比改进前提升1.9个百分点。改进后算法为工业界西林瓶轧盖缺陷检测提供了新思路,具有较好的应用前景。

关键词: 关键词:西林瓶轧盖, 缺陷检测, YOLOv7, 注意力机制, 自适应特征融合

Abstract: Abstract: Aiming at the problem of missing inspection caused by small target defects and unclear features in the defect detection of the capping of penicillin bottles, this paper proposes a defect detection method based on the improved YOLOv7 algorithm. First, the defect images of the capping of penicillin bottles are collected in the real industrial environment, including four common defects: scratches, missing cap, concave-crack, and composite defect, and the data are enhanced to construct a data set with 3220 images of penicillin bottle capping defects. Then CBAM (convolution block attention module) and ASFF (adaptive spatial feature fusion) adaptive feature fusion modules are introduced on the basis of the original YOLOv7 in order to improve the ability of network to extract features, improve the detection accuracy of small target defects, and reduce the missed detection rate of penicillin bottle capping defects. The experimental results show that the average detection accuracy (mAP) of the improved algorithm reaches 99.3%, which is 1.9 percentage points higher than that before the improvement. The improved algorithm provides a new idea for the detection of capping defects of penicillin bottles in industry, and has good application prospect.

Key words: Key words: vials, defect detection, YOLOv7, attention module, adaptive feature fusion

中图分类号: