Effectiveness of Detection-based and Regression-based Approaches for Estimating Mask-Wearing Ratio

Khanh-Duy Nguyen, Huy H. Nguyen, Trung-Nghia Le, Junichi Yamagishi, Isao Echizen

TL;DR

This paper presents a comparative study of detection-based versus regression-based computer vision approaches for estimating mask-wearing ratios in crowded public spaces. To support this research, the authors introduce the NFM dataset, a large-scale benchmark of over 581,000 face annotations from real-world street-view videos, finding that while detection is more accurate for classification, regression offers a significant speed advantage for real-time monitoring.

What Problem Does This Paper Address?

During the COVID-19 pandemic, monitoring mask-wearing compliance became a vital tool for public health officials to analyze and implement safety policies. However, automating this task via computer vision is difficult. Most existing mask datasets rely on high-resolution images crawled from the Internet, which don't reflect the challenges of real-world surveillance: tiny face areas, severe occlusions, and high pedestrian density in street-view footage.

Furthermore, there is a lack of consensus on the best methodology. Should we detect every individual face and classify it (detection-based), or should we predict a "density map" of masked vs. unmasked faces to estimate the count (regression-based)? The authors set out to fill these gaps in both data and methodology.

Methods

The authors evaluate two distinct paradigms:

  1. Detection-based (Improved RetinaFace): The authors enhanced the state-of-the-art RetinaFace detector by integrating a Bi-directional Feature Pyramid Network (BiFPN). This allows the model to better fuse multi-scale features, which is crucial for identifying tiny faces. They also employed Focal Loss during training to handle the class imbalance between the high number of unmasked faces and the relatively fewer masked faces in the dataset. The improved RetinaFace pipeline for face detection and classification.
Fig. 1: Proposed face detection and classification pipeline based on RetinaFace.
  1. Regression-based (CSRNet): Typically used for crowd counting, CSRNet uses dilated convolutional layers to predict a density map from an image. To estimate the mask-wearing ratio, the authors trained two separate CSRNet models: one to estimate the density of masked faces and another for unmasked faces. The CSRNet architecture utilizing dilated convolutions for density map estimation.
The CSRNet architecture utilizing dilated convolutions for density map estimation.

Datasets

The core of this work is the new NFM (New Face Mask) dataset.

  • Source: 18,088 video frames extracted from 17 street-view videos of Japanese cities (day and night, before and during the pandemic).
  • Scale: 581,108 face annotations.
  • Labels: Each face is labeled as "Masked," "Unmasked," or "Unknown."
  • Challenge: Unlike Internet datasets, NFM contains many "Small" (8-16px) and "Medium" (16-32px) faces, making it a much tougher benchmark for existing models. Statistics of the NFM dataset showing face sizes and mask-wearing ratios.
Statistics of the NFM dataset showing face sizes and mask-wearing ratios.

Key Insights and Ideas

  • Classification vs. Counting: Detection-based methods are inherently better at ratio estimation because they explicitly classify each face. Regression-based methods, while excellent at counting in high-density crowds, struggle to distinguish between "masked" and "unmasked" features because they lack an explicit classification layer and rely on less discriminative backbones (like VGG-16).
  • The "Tiny Face" Hurdle: Even with improvements, both methods struggle as face size decreases. The improved RetinaFace achieved ~91% accuracy for large faces but dropped significantly for faces smaller than 16 pixels.
  • Environmental Impact: Both models performed better in daytime conditions. Nighttime footage, with its lower image quality and unclear facial features, remains a significant challenge for accurate ratio estimation.
  • Speed-Accuracy Trade-off: There is a clear divide. If you need high precision, detection is the way to go. If you need to process high-volume video streams on limited hardware, regression is far more efficient.

Key Results

  • Accuracy: The improved RetinaFace significantly outperformed the regression-based CSRNet in ratio estimation, achieving a Pearson correlation coefficient ($\gamma$) of 0.94 compared to CSRNet's 0.73*.
  • Detection Performance: The improved RetinaFace achieved a mean Average Precision (mAP) of 64.2%*, outperforming the original RetinaFace by 2.6%.
  • Speed: CSRNet was roughly 4 times faster, operating at 3.17 FPS compared to RetinaFace's 0.81 FPS* on the same hardware (Tesla V-100 GPU). Visual comparison of ratio estimation across different crowd density scenarios.
Visual comparison of ratio estimation across different crowd density scenarios.

Limitations and Future Work

The primary limitation is the trade-off between speed and accuracy. The detection-based approach is too slow for many real-time applications, while the regression-based approach isn't accurate enough for reliable policy-making.

The authors suggest that future work should focus on creating a unified framework that integrates both approaches. Such a system could potentially switch between detection and regression based on the scene's density or environmental conditions, leveraging the strengths of both paradigms.

Summary updated

BibTeX
@inproceedings{nguyen2021effectiveness,
  author = {Khanh-Duy Nguyen and Huy H. Nguyen and Trung-Nghia Le and Junichi Yamagishi and Isao Echizen},
  title = {{Effectiveness of Detection-based and Regression-based Approaches for Estimating Mask-Wearing Ratio}},
  booktitle = {FG},
  year = {2021},
  doi = {10.1109/fg52635.2021.9667046},
}
Figure