激光与光电子学进展2024,Vol.61Issue(14) :145-154.DOI:10.3788/LOP232025

改进YOLOv5s的旋转框工业零件检测算法

Enhanced Rotating Frame Industrial Part Detection Algorithm of YOLOv5s

魏瑶坤 康运江 王丹伟 赵鹏 徐斌
激光与光电子学进展2024,Vol.61Issue(14) :145-154.DOI:10.3788/LOP232025

改进YOLOv5s的旋转框工业零件检测算法

Enhanced Rotating Frame Industrial Part Detection Algorithm of YOLOv5s

魏瑶坤 1康运江 2王丹伟 2赵鹏 2徐斌2
扫码查看

作者信息

  • 1. 机科发展科技股份有限公司,北京 100044;中国机械科学研究总院集团,北京 100044
  • 2. 机科发展科技股份有限公司,北京 100044
  • 折叠

摘要

在工业场景应用中,对于紧密排列分布的工业零件,采用水平框目标检测,会存在零件错选漏选及边界方向丢失的问题,因此提出一种基于改进YOLOv5s的旋转工件目标检测算法.首先,引入无参的SimAM网络,在不增加模型参数量的基础上,使网络更聚焦于关键信息,提高在复杂背景下的特征提取能力并抑制噪声干扰.其次,将原来的完全交并比(CIoU)回归函数替换为引入角度因子的SIoU函数,更加符合旋转框检测要求,将激活函数替换为Mish函数,提高模型收敛速度与精度.最后,引入移相编码法和改进的HardL-Tanh激活函数,实现角度和回归角度余弦值的预测,解决五参数表示法带来的角度多一性和边界问题,实现工件的旋转框检测.所提算法的平均精度均值达97.4%.实验结果表明所提算法权重文件小、平均准确率高、预测用时少,满足工业实时性要求.

Abstract

In industrial settings,with densely arranged and distributed industrial parts,the use of horizontal box object detection often leads to issues,such as incorrect selection,missing parts,and loss of boundary direction.In this study,we propose a rotating workpiece object detection algorithm based on an enhanced version of YOLOv5s.First,a free parameter SimAM network is introduced to prioritize crucial information without increasing the number of model parameters.This enhancement enhances feature extraction in complex backgrounds and mitigates noise interference.Second,the original complete intersection over union(CIoU)regression function is replaced with the SIoU function,which incorporates an angle factor,aligning more with the rotation box detection.Substituting the activation function with Mish further enhances the model's convergence speed and accuracy.The algorithm introduces the phase-shifting coding method and an improved HardL-Tanh activation function to realize the prediction of angle and regression angle cosine values,thereby overcoming the angle multiuniformity and boundary problems associated with the five-parameter representation method and realizing the rotation frame detection of the workpiece.Experimental results demonstrate a mean accuracy precision of 97.4%,highlighting the proposed algorithm's advantages,including smaller weight files,higher average accuracy,and reduced prediction time.These qualities align with the real-time requirements of industrial applications.

关键词

工业零件检测/SimAM/旋转目标检测/移相编码法/YOLOv5s

Key words

industrial part detection/SimAM/rotating target detection/phase-shifting coding method/YOLOv5s

引用本文复制引用

基金项目

国家重点研发计划(2020YFB1313300)

出版年

2024
激光与光电子学进展
中国科学院上海光学精密机械研究所

激光与光电子学进展

CSTPCDCSCD北大核心
影响因子:1.153
ISSN:1006-4125
参考文献量6
段落导航相关论文