Skip to main page content
U.S. flag

An official website of the United States government

Dot gov

The .gov means it’s official.
Federal government websites often end in .gov or .mil. Before sharing sensitive information, make sure you’re on a federal government site.

Https

The site is secure.
The https:// ensures that you are connecting to the official website and that any information you provide is encrypted and transmitted securely.

Access keys NCBI Homepage MyNCBI Homepage Main Content Main Navigation
Review
. 2022 Jul 12:2022:2452291.
doi: 10.1155/2022/2452291. eCollection 2022.

Face Mask-Wearing Detection Model Based on Loss Function and Attention Mechanism

Affiliations
Review

Face Mask-Wearing Detection Model Based on Loss Function and Attention Mechanism

Zhong Wang et al. Comput Intell Neurosci. .

Abstract

Face mask-wearing detection is of great significance for safety protection during the epidemic. Aiming at the problem of low detection accuracy due to the problems of occlusion, complex illumination, and density in mask-wearing detection, this paper proposes a neural network model based on the loss function and attention mechanism for mask-wearing detection in complex environments. Based on YOLOv5s, we first introduce an attention mechanism in the feature fusion process to improve feature utilization, study the effect of different attention mechanisms (CBAM, SE, and CA) on improving deep network models, and then explore the influence of different bounding box loss functions (GIoU, CIoU, and DIoU) on mask-wearing recognition. CIoU is used as the frame regression loss function to improve the positioning accuracy. By collecting 7,958 mask-wearing images and a large number of images of people without masks as a dataset and using YOLOv5s as the benchmark model, the mAP of the model proposed in the paper reached 90.96% on the validation set, which is significantly better than the traditional deep learning method. Mask-wearing detection is carried out in a real environment, and the experimental results of the proposed method can meet the daily detection requirements.

PubMed Disclaimer

Conflict of interest statement

The authors declare that there are no conflicts of interest regarding the publication of this paper.

Figures

Figure 1
Figure 1
The proposed model network structure.
Figure 2
Figure 2
Convolutional block attention module.
Figure 3
Figure 3
Sample images from the dataset.
Figure 4
Figure 4
Performance detection curves of different attention mechanisms.
Figure 5
Figure 5
Performance curves of different loss functions. (a) Precision. (b) Recall. (c) mAP@0.5.
Figure 6
Figure 6
Detection results with different loss function. (a) Varifocal. (b) CIoU.
Figure 7
Figure 7
Detection results with the proposed model. (a) YOLOv5s + CIoU and (b) YOLOv5s + CBAM + CIoU.

Similar articles

Cited by

References

    1. Yang C. W., Phung T. H., Shuai H. H., Cheng W. H. Mask or non-mask? robust face mask detector via triplet-consistency representation learning. ACM Transactions on Multimedia Computing, Communications, and Applications . 2022;18(1s):1–20. doi: 10.1145/3472623. - DOI
    1. Wang B., Zhao Y., Chen C. L. P. Hybrid transfer learning and broad learning system for wearing mask detection in the covid-19 era. IEEE Transactions on Instrumentation and Measurement . 2021;70:1–12. doi: 10.1109/TIM.2021.3069844. - DOI - PMC - PubMed
    1. Goyal H., Sidana K., Singh C., Jain A., Jindal S. A real time face mask detection system using convolutional neural network. Multimedia Tools and Applications . 2022;81:1–17. doi: 10.1007/s11042-022-12166-x. - DOI - PMC - PubMed
    1. Zhang J., Han F., Chun Y. A novel detection framework about conditions of wearing face mask for helping control the spread of covid-19. IEEE Access . 2021;9:42975–42984. doi: 10.1109/access.2021.3066538. - DOI - PMC - PubMed
    1. Kumar A., Kalia A., Sharma A., Kaushal M. A hybrid tiny YOLO v4-SPP module based improved face mask detection vision system. Journal of Ambient Intelligence and Humanized Computing . 2021:1–14. doi: 10.1007/s12652-021-03541-x. - DOI - PMC - PubMed

LinkOut - more resources