CoverTheFace: face covering monitoring and demonstrating using deep learning and statistical shape analysis

Yixin Hu, Xingyu LiarXiv 2021

Abstract

Wearing a mask is a strong protection against the COVID-19 pandemic, even though vaccines are widely available. However, many people wear them incorrectly. This observation prompts us to devise an automated approach to monitor the condition of people wearing masks. Unlike previous studies, our work goes beyond mask detection; it focuses on generating a personalized demonstration on proper mask-wearing, which helps people use masks better through visual demonstration rather than text explanation. The pipeline starts from the detection of face covering. For images where faces are improperly covered, our mask overlay module incorporates statistical shape analysis (SSA) and dense landmark alignment to approximate the geometry of a face and generates corresponding face-covering examples. Our results show that the proposed system successfully identifies images with faces covered properly. Our ablation study on mask overlay suggests that the SSA model helps to address variations in face shapes, orientations, and scales. The final face-covering examples, especially half profile face images, surpass previous arts by a noticeable margin.

Introduction

During the COVID-19 pandemic, mask-wearing became a primary line of defense. However, detection is only half the battle; many people wear masks incorrectly (the "nose-out" look being a common culprit), which health experts equate to not wearing a mask at all. While many AI systems can detect the presence of a mask, few provide actionable feedback. Existing "mask put-on" algorithms often struggle with non-frontal views, resulting in unrealistic distortions that look like stickers slapped onto a photo. This paper addresses the need for a system that can monitor mask conditions and provide a high-quality, personalized visual guide for users, even when they are captured at difficult angles.

Methodology

The "CoverTheFace" pipeline consists of two primary modules:

1. Mask Detection Module

This module uses a MobileNetV2 backbone (pre-trained on ImageNet) to classify an input image into three categories: "correctly wearing," "incorrectly wearing," or "not wearing."

2. Mask Overlay Module

If a person is wearing a mask incorrectly or not at all, this module takes over to generate a demonstration.

  • Mask Removal: For those wearing masks incorrectly, the system first removes the existing mask using a modified MCGAN (Mask-Conditioned GAN). This involves a segmentation network (U-Net with Squeeze-and-Excitation blocks) to identify the mask and an inpainting network with Gated Convolutions to reconstruct the hidden parts of the face.
  • Mask Put-on: To add a new, correctly positioned mask, the authors move away from standard deep learning. Instead, they use Statistical Shape Analysis (SSA) and an Active Shape Model (ASM).
  • Dense Landmark Alignment (DLA): Unlike previous methods that used only six facial landmarks, this system uses 17 landmarks (covering the nose bridge and chin line). By aligning these dense landmarks with a mask template, the system can realistically "wrap" the mask around the face, maintaining the correct geometry even in half-profile views.
Figure 3: A personalized demonstration of correct mask-wearing generated by the system using dense landmark alignment.

Key Insights

  • Visuals over Text: A personalized visual demonstration ("This is what you look like with a mask on properly") is more persuasive and easier to follow than text-based instruction.
  • The "Rigid Object" Fallacy: Most mask-overlay tools treat the face as a flat surface. By using SSA/ASM, this paper treats the face as a flexible geometry that changes with pose, allowing the mask to follow the contours of the chin and nose realistically.
  • Dense vs. Sparse Landmarks: Moving from 6 to 17 landmarks is critical for profile shots. The extra points along the chin and nose bridge prevent the mask from "floating" off the face in side-view images.
Figure 5: The system maintains realistic mask geometry even in profile views, a significant improvement over previous methods.

Results

The mask detection module achieved a 98% detection rate across its three categories. In qualitative comparisons, the proposed DLA+SSA method significantly outperformed previous "Sparse Landmark Alignment" (SLA) techniques. While SLA often failed to follow the face boundary in profile images, CoverTheFace maintained a tight, realistic fit. The system successfully handled variations in face shape, orientation, and scale, making it viable for real-world deployment in crowded areas like airports or malls.

Conclusion

The authors acknowledge that while the geometry of the mask is now much more accurate, environmental factors still pose a challenge. Future work will focus on improving performance under diverse lighting conditions, specifically addressing how shadows and reflections interact with the virtual mask. Additionally, expanding the model to support different mask types and colors could improve user engagement.

Summary updated

BibTeX
@misc{hu2021covertheface,
  author = {Yixin Hu and Xingyu Li},
  title = {{CoverTheFace: face covering monitoring and demonstrating using deep learning and statistical shape analysis}},
  year = {2021},
  eprint = {2108.10430},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2108.10430},
}
Figure