A study of the lightweight algorithm for recognizing masks incorporating attention mechanism and G-GhostNet
Abstract
As COVID-19 and humanity's protracted battle makes wearing masks a norm, intelligent recognition of mask-wearing and wearing criteria is investigated to lessen the labor of epidemic control and detection personnel. To achieve the purpose of not having to manually identify mask use in a busy, open setting, to be able to provide a real-time warning of the whole mask non-wearing phenomenon in mobile devices, and to address the issue of sluggish efficiency and poor precision of traditional target detection and tracking means in complex scenes, this work presents a lightweight mask identification method that combines G-GhostNet with an attention mechanism. Firstly, YoLov5's BackBone network is replaced with a more lightweight G-GhostNet with fewer convolution kernels to reduce the parameters and computation more significantly; secondly, an attention mechanism is introduced to G-GhostNet’s feature mixing process to increase discovered features’ weight values.Then, the dichotomous unmasked and masked datasets are prepared to enhance the model accuracy and speed by the loss function. The experiments compare the effects of Squeeze-and-Excitation Networks (SE), Convolutional Block Attention Module(CBAM), Efficient Channel Attention (ECA), and Coordinate Attention (CA), the four attention processes on the enhanced model with the model without the added attention mechanisms. The results show that adding the attention mechanisms all make the model recognize masks better, among which adding CA has the best recognition effect with a 2% improvement in accuracy but 1.3 times increase in Latency time; in contrast, adding SE, ECA balanced speed and accuracy.
References
- Ren Lei , Liu Guoqing , Wang Lihua , et al . A new and efficient mobile deep learning image classification system. 2021 Int. Th. Tec. , (5):58-63.
- Wang Lihui, Yang Xianzhao, Liu Huikang, et al . Pedestrian detection and tracking algorithm based on GhostNet and attention mechanism. 2022, Dat. Col. Proc.,37(01): 108-121.
- Han K ,Wang Y ,Tian Q, et al. Ghostnet: More features from cheap operations. 2020, Conf. Com. Vis. Pat. Recog..1580-1589.
- Kai Han ,Yunhe Wang, Qi Tian ,et al .GhostNets on Heterogeneous Devices via Cheap Operations. 2022 Int. J. Com. Vis.130:1050–1069.
- Ye Xun , Zhang Hongying , He Yujun .A lightweight mask-wearing face recognition algorithm fused with attention mechanism.2022, Com. Eng. App.:1-10.
- Jin Yinggu , Zhang Tao, Yang Yaning, et al. Research on mask wearing recognition based on MobileNet V2 .2021, J. Dalian Univ. Nat., 23(05): 404-409+431.
- X. Hao, C. Shan, Y. Xu, et al.An Attention-based Neural Network Approach for Single Channel Speech Enhancement.2019, Int.Conf. Aco.,Spe. Sig. Proc. 6895-6899.
- Woo S, Park J, Lee J Y, et al. Cbam: Convolutional block attention module.2018, Euro. Conf. Com. Vis. 3-19.
- Liu T, Luo R, Xu L, et al. Spatial Channel Attention for Deep Convolutional Neural Networks., 2022, Math. 10(10): 1750.
- Hou Q, Zhou D, Feng J. Coordinate attention for efficient mobile network design. 2021 Conf. Com. Vis. Pat. Recog. 13713-13722.
- Han X, Chang J, Wang K. You only look once: Unified, real-time object detection. Procedia, 2021, Comp. Sci., 183: 61-72.
- Redmon J, Farhadi A. YOLO9000: better, faster, stronger. 2017 Conf. Com. Vis. Pat. Recog. 7263-7271.
- Lin T Y, Dollár P, Girshick R, et al. Feature pyramid networks for object detection. 2017, Conf. Com. Vis. Pat. Recog. 2117-2125.
- Yuan S, Wang Y, Liang T, et al. Real‐time recognition and warning of mask wearing based on improved YOLOv5 R6.1., 2022 Int. J. Com. Vis.45.
- Wang Z, Sun W, Zhu Q, et al. Face Mask-Wearing Detection Model Based on Loss Function and Attention Mechanism. 2022, Com. Int. Neur.82.