计算机与现代化 ›› 2022, Vol. 0 ›› Issue (09): 32-39.

• 算法设计与分析 • 上一篇    下一篇

基于改进YOLOv4的汽车钢铁零件表面缺陷检测

  

  1. (上海师范大学信息与机电工程学院,上海200234)
  • 出版日期:2022-09-22 发布日期:2022-09-22
  • 作者简介:彭露露(1996—),女,河南周口人,硕士研究生,研究方向:基于深度学习的目标检测算法,E-mail: 1808728150@qq.com; 通信作者:朱媛媛(1971—),女,副教授,博士,研究方向:新型材料与结构力学特性分析的数学建模,计算方法与工程应用,E-mail: zhuyuanyuan@shnu.edu.cn; 金文倩(1995—),女,硕士研究生,研究方向:基于深度学习的目标检测; 王笑梅(1970—),女,副教授,博士,研究方向:图像分析,基于OCT生物医学图像处理,基于视频的目标检测与识别,生物特征提取与验证。
  • 基金资助:
    上海市自然科学基金资助项目(17ZR1419800)

Surface Defect Detection of Automotive Steel Parts Based on Improved YOLOv4

  1. (College of Information, Mechanical and Electrical Engineering, Shanghai Normal University, Shanghai 200234, China)
  • Online:2022-09-22 Published:2022-09-22

摘要: 针对YOLOv4在自建的汽车钢铁零件表面缺陷数据集中检测精度不足的问题,利用深度学习的优势,提出一种基于改进YOLOv4的汽车钢铁零件表面缺陷检测方法。首先采用加权K-means算法确定初始anchors预选框,增强anchors框和特征图尺寸的匹配精度,提高检测效率;然后在YOLOv4主干网络的残差单元中引入SE模块,增加有用特征的权重,抑制无效特征的权重来提高检测精度;最后在76×76的特征图后连接RFB-s模块,增强对小目标信息的特征提取能力。实验结果表明,针对自建汽车零件表面缺陷数据集有无缺陷单类检测问题,改进算法比原始YOLOv4的mAP50值提高了4.3个百分点,对小目标具有更好的检测效果。这说明改进算法能满足针对特定的汽车钢铁零件表面缺陷检测问题下的检测速度和精度要求,有效解决了实际问题。针对COCO数据集多分类问题,改进后模型的mAP50值比原始YOLOv4提高了0.2个百分点,FPS值达到20,说明改进算法能够迁移到其他数据集,验证了该算法的泛化性。

关键词: 小目标检测, YOLOv4, 深度学习, 实时检测, 加权K-means, SENet, RFB-s模块

Abstract: Aiming at the problem of insufficient detection accuracy of YOLOv4 in the data set of surface defects of self-built automobile steel parts, this paper proposes a surface defect detection method of automobile steel parts based on improved YOLOv4 by taking the advantage of deep learning. Firstly, the weighted K-means algorithm is used to determine the initial anchors pre-selection box to enhance the matching accuracy of anchors and feature map size and improve the detection efficiency. Then the SE module is introduced into the residual unit of the YOLOv4 backbone network to increase the weight of useful features and suppress the weight of invalid features to improve the detection accuracy. Finally, the RFB-s module is connected to the 76×76 feature map to enhance the feature extraction ability of small target information. Aiming at the single defect detection problem of self-built data set of surface defects of automobile parts, the experimental results show that the improved model improves the detection accuracy of mAP50 by 4.3 percentage points compared with the original YOLOv4 model, and has a better detection effect on small targets. It shows that the improved algorithm can meet the requirements of detection speed and accuracy for specific steel parts surface defect detection, and effectively solve the practical problems. Aiming at COCO data set multi-classification problem, the mAP50 value of the improved model is 0.2 percentage points higher than that of the original YOLOv4, and the FPS value reaches 20, which indicates that the improved algorithm can be migrated to other data sets, and the generalization of the algorithm is verified.

Key words: small target detection, YOLOv4, deep learning, real-time detection, weighted K-means, SENet, RFB-s module