Article Details

Title · Authors · Abstract · Keywords · DOI · References

Attention-YOLOv5s: YOLOv5s Algorithm with Introduced Attention Mechanism

YANG Kefan1, WEI Xinkai1, MA Yan1, WANG Jialing1, SONG Tao1,2, WEI Yanfang3

(1.School of Science, Huzhou University, Huzhou 313000, China; 2.Huzhou Key Laboratory of Data Modeling and Analysis, Huzhou 313000, China; 3.School of Computer Science and Technology, Zhejiang University of Water Resources and Electric Power, Hangzhou 310018, China)

Section:Artificial Intelligence · Vol. 2025, Issue 5 · Pages:25-32,38 · 2096-4706(2025)05-0025-09 · CLC number:TP391.4 · Document code:A · DOI:10.19850/j.cnki.2096-4706.2025.05.005

Abstract

In order to improve the accuracy of image object detection, a YOLOv5s object detection algorithm combined with the Attention Mechanism is proposed. Firstly, in response to the issues of local occlusion and the difficulty in detecting small objects, the Attention Mechanism is introduced into the backbone network of YOLOv5s to enhance the feature extraction capability of the object detection algorithm for important regions. Then, to reduce the model complexity and accelerate the network convergence speed, the SIoU loss function is used to replace the original CIoU loss function in YOLOv5s. Finally, comparative experiments are carried out between the improved model and the crowd detection algorithm to analyze the pedestrian detection capability of the model. The comparative experiments on the VOC2007 dataset show that the average accuracy of the improved YOLOv5s object detection algorithm reaches 70.5%, effectively improving pedestrian detection effect in complex backgrounds and achieving the lightweighting of the network simultaneously.

Keywords

YOLOv5s; Object Detection; Attention Mechanism; loss function; pedestrian detection

References

  1. [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. [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. [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. [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. [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. [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. [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. [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. [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. [10] Zhang Xiuzai, Qiu Ye, Zhang Chen Improved YOLOv5s algorithm for pedestrian target detection in subway scenes [J]. Advances in Laser and Optoelectronics, 2023, 60 (6): 144-153
  11. [11] Liu Yanlei, Li Mengzhe, Wang Xuanxuan Lightweight YOLOv5s vehicle mounted infrared image target detection [J]. China Optics: Chinese English, 2023, 16 (5): 1045-1055
  12. [12] Wu Si, Zhang Xuguang, Fang Yinfeng A crowd counting method based on attention mechanism [J]. Chinese Journal of Safety Science, 2022, 32 (1): 127-134
  13. [13] Li Chao, Lan Hai, Wei Xian Attention based millimeter wave lidar fusion target detection [J]. Computer Applications, 2021, 41 (7): 2137-2144
  14. [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. [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. [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.

Funding

Research Funding Project of Zhejiang Provincial Department of Education (Y202248528); Huzhou Science and Technology Plan Funding Project (2023YZ28); National College Students' Innovation and Entrepreneurship Training Program (202410347044); Zhejiang Province College Students Innovation and Entrepreneurship Training Program Project (S202410347087)

About the authors

Yang Kefan (2003-), male, Han nationality, from Cixi, Zhejiang Province, undergraduate student, research direction: object detection and data mining; Song Tao (1980-), male, Han ethnicity, born in Jurong, Jiangsu, lecturer, PhD, research direction: complex system modeling and big data analysis.