Welcome to Journal of Graphics share: 

Journal of Graphics ›› 2023, Vol. 44 ›› Issue (1): 16-25.DOI: 10.11996/JG.j.2095-302X.2023010016

• Image Processing and Computer Vision • Previous Articles     Next Articles

Mask detection algorithm based on YOLOv5 integrating attention mechanism

LI Xiao-bo1(), LI Yang-gui1,2(), GUO Ning1, FAN Zhen1   

  1. 1. Department of Computer Technology and Applications, Qinghai University, Xining Qinghai 810016, China
    2. State Key Laboratory of Plateau Ecology and Agriculture, Qinghai University, Xining Qinghai 810016, China
  • Received:2022-06-05 Revised:2022-08-03 Online:2023-10-31 Published:2023-02-16
  • Contact: LI Yang-gui
  • About author:LI Xiao-bo (1998-), master student. His main research interests cover object detection and image processing. E-mail:1336441422@qq.com
  • Supported by:
    National Natural Science Foundation of China(61962051);Independent Project of the State Key Laboratory of Plateau Ecology and Agriculture(2021-ZZ-2)

Abstract:

Wearing masks correctly during the COVID-19 pandemic can effectively prevent the spread of the virus. In response to the detection challenge posed by dense crowds and small detection targets in public places, a mask wearing detection algorithm based on the YOLOv5s model and integrating an attention mechanism was proposed. Four attention mechanisms were introduced into the backbone network of the YOLOv5s model to respectively suppress irrelevant information, enhance the ability of the feature map to express information, and improve the model?s detection ability for small-scale targets. Experimental results show that the introduction of the convolutional block attention module could increase the mAP value by 6.9 percentage points compared with the original network, with the greatest improvement among the four attention mechanisms. The normalization-based attention module also showed excellent performance, with the least quantity of parameters while losing a small amount of mAP. Through comparative experiments, the GIoU loss function was selected to calculate the bounding box regression loss, resulting in further improvements to positioning accuracy, resulting in an mAP value that was improved by 8.5 percentage points compared to the original network. The detection results of the improved model in different scenarios prove the accuracy and practicability of the algorithm for small target detection.

Key words: mask detection, YOLOv5, attention mechanism, feature fusion, small target detection

CLC Number: