Attention-YOLOv5s:引入注意力机制的YOLOv5s算法
(1.湖州师范学院 理学院,浙江 湖州 313000;2.湖州市数据建模与分析重点实验室,浙江 湖州 313000; 3.浙江水利水电学院 计算机科学与技术学院,浙江 杭州 310018)
摘要
为了提高图像目标检测的准确率,提出一种结合注意力机制的YOLOv5s目标检测算法。首先,针对局部遮挡以及小目标难以检测的问题,在YOLOv5s主干网络中引入注意力机制以提高目标检测算法对重要区域的特征提取能力;然后,为降低模型复杂度并加快网络收敛速度,使用SIoU损失函数替换YOLOv5s原有损失函数CIoU;最后,利用改进模型与人群检测算法进行对比试验,分析模型行人检测能力。在VOC2007数据集上的对比实验表明,改进后的YOLOv5s目标检测算法平均准确率达到了70.5%,有效改善了复杂背景下的行人检测效果,同时实现了网络的轻量化。
关键词
YOLOv5s;目标检测;注意力机制;损失函数;行人检测
参考文献
- [1] REN S,HE K,GIRSHICK R,et al. Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks [J].IEEE Transactions on Pattern Analysis and Machine Intelligence,2017,39(6):1137-1149.
- [2] REDMON J,DIVVALA S,GIRSHICK R,et al. You Only Look Once:Unified,Real-Time Object Detection: 2016 IEEE Conference on Computer Vision and Pattern Recognition (CVPR) [J/OL].(2015-06-08).https://arxiv.org/abs/1506.02640.
- [3] LIU W,ANGUELOV D,ERHAN D,et al. SSD: Single Shot MultiBox Detector [C]//Computer Vision-ECCV 2016.Amsterdam:Springer,2016:21-37.
- [4] ZHOU L. End-to-End Video Violence Detection with Transformer [C]//2022 5th International Conference on Pattern Recognition and Artificial Intelligence (PRAI).Chengdu:IEEE,2022:880-884.
- [5] TIAN Z,SHEN C,CHEN H,et al. FCOS: Fully Convolutional One-Stage Object Detection [C]//2019 IEEE/CVF International Conference on Computer Vision (ICCV).Seoul:IEEE,2019:9626-9635.
- [6] HU J,SHEN L,ALBANIE S,et al. Squeeze-and-Excitation Networks [J].IEEE Transactions on Pattern Analysis and Machine Intelligence,2020,42(8):2011-2023.
- [7] WOO S,PARK J,LEE J Y,et al. CBAM: Convolutional Block Attention Module [C]//Computer Vision-ECCV 2018.Munich:Springer,2018:3-19.
- [8] HOU Q,ZHOU D,FENG J. Coordinate Attention for Efficient Mobile Network Design [C]//2021 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR).Nashville:IEEE,2021:13708-13717.
- [9] WANG Q L,WU B G,ZHU P F,et al. ECA-Net: Efficient Channel Attention for Deep Convolutional Neural Networks [C]//2020 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR).Seattle:IEEE,2020:11534-11542.
- [10] 张秀再,邱野,张晨.改进YOLOv5s算法的地铁场景行人目标检测 [J].激光与光电子学进展,2023,60(6):144-153.
- [11] 刘彦磊,李孟喆,王宣宣.轻量型YOLOv5s车载红外图像目标检测 [J].中国光学:中英文,2023,16(5):1045-1055.
- [12] 吴思,张旭光,方银锋.基于注意力机制的人群计数方法 [J].中国安全科学学报,2022,32(1):127-134.
- [13] 李朝,兰海,魏宪.基于注意力的毫米波-激光雷达融合目标检测 [J].计算机应用,2021,41(7):2137-2144.
- [14] YING X,WANG Q ,LI X W,et al. Multi-Attention Object Detection Model in Remote Sensing Images Based on Multi-Scale [J].IEEE Access,2019,7:94508-94519.
- [15] REZATOFIGHI H,TSOI N,GWAK J,et al. Generalized Intersection over Union: A Metric and A Loss for Bounding Box Regression [C]// 2019 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR).LongBraach:IEEE,2019:658-666.
- [16] WANG X,SONG J. ICIoU: Improved Loss Based on Complete Intersection Over Union for Bounding Box Regression [J].IEEE access,2021,9:105686-105695.
基金项目
浙江省教育厅科研资助项目(Y202248528);湖州市科技计划资助项目(2023YZ28);国家级大学生创新创业训练计划项目(202410347044);浙江省大学生创新创业训练计划项目(S202410347087)
作者简介
杨可帆(2003—),男,汉族,浙江慈溪人,本科在读,研究方向:目标检测和数据挖掘;宋涛(1980—),男,汉族,江苏句容人,讲师,博士,研究方向:复杂系统建模及大数据分析。