Mask wearing detection algorithm based on improved Yolov7


  • Xu Zhou
  • Guojun Lin



YOLOV7 algorithm, Depth separable convolution, Dilated convolution, Loss function, Target detection


Manual inspection of the mask is too time-consuming and laborious. In order to detect whether a mask is worn in a crowded public place, a mask-wearing detection method based on improved YOLOV7 is proposed, which uses Depth wise separable convolution instead of conventional convolution, in order to integrate the local feature information and the whole image information deeply, Dilated Convolution was used to improve the Pyramid Pooling Module (DC-PPM) , at last, the loss function of target location is optimized, which makes it not only have the ability of feature extraction to fuse the whole and local information, but also have the ability of not losing the detail information. The experimental results show that the detection accuracy and speed of the algorithm are 95.07% and 79 frames/s respectively, which are 3.4% and 14 frames/s higher than the original YOLOV7 algorithm, very good to meet the actual application needs.


YISX, YANGZJ, ZHOU L Q, et al. Intelligent localization sampling system based on deep learning and image processing technology [J] Sensors, 2022, DOI: 10.3390/s22052021.

LIU W, ANGUELOV D, ERHAN D, et al. SSD: single shot multibox detector [C]//Proceedings of the European Conference on Computer Vision, Netherlands, Oct 10-162016 Berlin, Heidelberg: Springer Verlag, 2016:21-37.

REDMON J, DIVVALA S, GIRSHICK R, et al. You only look once: unified, real-time obj ect detection [C]//Processed ings of the IEEE Computer Vision&Pattern Recognition, 2016:779-788.

REDMON J, FARHADI A. Yolo9000: better, faster ter, stronger [C]//Proceedings of the IE-EE Conference on Computer Vision and P-attern Recognition, 2017:7263-7271

REDMON J, FARHADI A. YOLOv3: an incremental improvement [J]. arXiv: 1804.02767.2018.

BOCHKOVSKIY A, WANG C Y, LIAO H.YOLOv4: o-ptimal speed and a.ccuracy of object de section [J]. arXiv: 204.109342020.

WANG C Y, BOCHKOVSKIY A, LIAO H.YOLOv7: t-trainable bag of freebies sets new stat-e-of-the-art for real-time object dead actors [EB/OL] (2022-07-02) [2022-10-26].

Duan Zhongjing, Li Shaobo, Hu Jianjun, et al. Review of Deep Learning Object Detection Methods and Mainstream Frameworks [J]. Progress in Laser and Optoelectronics, 2020,57 (12): 59-74.

REN S Q, HE K M, GIRSHICK R, et al. Faster R-CNN: rewards real-time object detection with region proposal networks [J] I-EEE Transactions on Pattern Analysis a-nd Machine Intelligence, 2017,39 (6): 1137-1149.

Zhaowei Cai, and Nuno Vasconcelos, "Casc-ade R-CNN: Delving into High Quality O-object Detection," in IEEE Conference on Computer Vision and Pattern Recognition (CVPR), 2017.

C. Fu, W. Liu, A. Ranga, A. Tyagi, and A.C. Berg. DSSD: Deconvolutional single shot detector CoRR, abs/1701.066592017.

Bo Jingwen, Zhang Chuntang. Lightweight mask wearing detection algorithm based on YOLOv3 [J]. Electronic Measurement Technology, 2021,44 (23): 105-110. DOI: 10.19651/j.cnki. emt. 2107568.

Zhang Lieping, Li Zhihao, Tang Yuliang. A lightweight YOLOv2 mask wearing detection method based on transfer learning [J]. Electronic Measurement Technology, 2022, 45 (10): 112-117. DOI: 10.19651/j.cnki.emt.2108620.

Xiang Rongrong, Li Bo, Zhao Qiao. Mask wearing detection algorithm based on improved YOLOv5s [J]. Foreign Electronic Measurement Technology, 2022, 41 (07): 39-44. DOI: 10.19652/j.cnki. femt2203765.

Li Liangfu, Wang Nan, Wu Biao, et al. Bridge crack image segmentation algorithm based on improved PSPNet [J]. Progress in Laser and Optoelectronics, 2021,58 (22): 101-109

Ge S, Li J, Ye Q, et al. Detecting Masked Faces in the Wild with LLE-CNNs [C]//IEEE Conference on Computer Vision&P-pattern Recognition IEEE, 2017.

Yang S, Luo P, et al. WIDER FACE: A Fa ce Detection Benchmark [C]//IEEE Conference on Computer Vision and Pattern Re cognition, IEEE, 2016.







How to Cite

Zhou, X., & Lin, G. (2024). Mask wearing detection algorithm based on improved Yolov7. Journal of Computing and Electronic Information Management, 12(1), 71-77.

Similar Articles

1-10 of 82

You may also start an advanced similarity search for this article.