基于注意力机制的轻量YOLOv5识别定位算法
Lightweight YOLOv5 Identification and Localization Algorithm Based on Attention Mechanism
宋建辉 1李亚洲 1刘砚菊 1刘晓阳1
作者信息
- 1. 沈阳理工大学 自动化与电气工程学院,沈阳 110159
- 折叠
摘要
为解决医疗看护环境下桌面生活物品检测效果不佳、定位误差较大的问题,提出一种基于YOLOv5 的改进模型.首先,在主干网络末端使用坐标注意力(coordinate attention,CA)机制,使算法能够捕获跨通道、跨方向和位置的信息,提高算法的识别精度;然后,引入Ghost-Conv卷积减少模型参数量,使模型更加轻量化,提高检测速度;最后,使用SIoU替换原算法的定位损失函数,使定位损失计算考虑到真实框与预测框的方向差异,有助于提升模型的稳定性.在COCO数据集部分物品种类上进行多次对比实验,结果表明,与原算法相比较,改进算法的精确率和召回率分别提高了4.1%和1.3%,在交并比为0%~50%和50%~90%时的均值平均精度分别提高了2.7%和3.9%,参数量减少了 16.9%,每秒传输帧数提高了 0.47 帧,平均定位误差在X轴方向上减小了0.29 mm、在Y轴方向上减小了0.14 mm.
Abstract
In order to solve the problem of poor detection effect and large positioning error of desk-top living objects in medical nursing environment,an improved model based on YOLOv5 is pro-posed.Firstly,the coordinate attention(CA)mechanism is used at the end of the backbone network to enable the algorithm to capture information across channels,directions and locations,and improve the identification accuracy of the algorithm.Then,GhostConv convolution is introduced to reduce the number of model parameters,make the model more lightweight,and improve the detection speed.Finally,the positioning loss function of the original algorithm is replaced with SIoU,so that the positioning loss calculation takes into account the direction difference between the real box and the predicted box,which is helpful to improve the stability of the model.The results show that com-pared with the original algorithm,the improved algorithm increases the accuracy and recall by 4.1%and 1.3%,respectively,the mean accuracy of 0%~50%and 50%~90%in the intersec-tion and union ratio is improved by 2.7%and 3.9%respectively,the number of parameters by 16.9%,the number of frames per second is increased by 0.47 frames,and the average positioning error by 0.29 mm in the X-axis direction,which is reduced by 0.14 mm in the Y-axis direction.
关键词
YOLOv5/GhostConv卷积/注意力机制/损失函数/目标识别Key words
YOLOv5/GhostConv convolution/attention mechanism/loss function/target identification引用本文复制引用
基金项目
辽宁省教育厅高等学校基本科研项目(LJKZ0275)
沈阳市中青年科技创新人才支持计划项目(RC210247)
出版年
2024