Face Mask Assistant: Detection of Face Mask Service Stage Based on Mobile Phone

Yuzhen Chen, Menghan Hu, Chunjun Hua, Guangtao Zhai, Jian Zhang, Qingli Li, Simon X. Yang

Abstract

During the COVID-19 pandemic, the reuse of surgical masks became common despite recommendations for single-use. However, users lack objective tools to determine when a mask's filtration efficiency has degraded. This paper introduces the "Face Mask Assistant," a system combining a smartphone-mounted micro-lens with machine learning to categorize a mask's service stage. By analyzing microscopic textures using Gray Level Co-occurrence Matrix (GLCM) and K-Nearest Neighbor (KNN) classification, the system achieves a macro precision of 82.87%, offering a portable solution for personal mask quality assessment.

Introduction

The global necessity of face masks during the COVID-19 pandemic led to widespread reuse, often in low-risk environments, due to supply shortages or convenience. While surgical masks are designed for single use, their actual filtration lifespan varies based on activity and environment. Currently, there is no accessible method for individuals to evaluate whether a mask's pores are clogged or its fibers degraded. This research addresses this gap by developing a mobile-based tool that moves mask quality assessment from specialized labs to the palm of a user's hand.

Methodology

Hardware Integration

The core of the detection system is the "TIPSCOPE," a compact, detachable microscope lens that attaches to a standard smartphone camera. This hardware modification enables the capture of high-magnification "micro-photos" of the mask's inner surface, revealing details invisible to the naked eye, such as accumulated droplets and fiber degradation.

The hardware components: (a) the TIPSCOPE mobile microscope, (b) the standard smartphone camera, and (c) the integrated device setup.

Feature Extraction and Classification

The system processes these micro-images through a classic machine learning pipeline. Instead of raw pixel analysis, the researchers utilized Gray Level Co-occurrence Matrix (GLCM) to quantify surface texture. Four key metrics were extracted: Contrast, Correlation, Energy, and Homogeneity. These features serve as proxies for mask wear; for instance, Contrast and Correlation typically increase as debris accumulates and fibers fray, while Energy and Homogeneity decrease as the surface becomes less uniform.

Classification is performed using the K-Nearest Neighbor (KNN) algorithm. The model categorizes masks into three stages based on usage duration:

  • Type I (Normal Use): Day 0–1.
  • Type II (Early Warning): Day 2–3.
  • Type III (Not Recommended): Day 4–5.

The system is deployed via a WeChat Applet, where users upload images to a back-end server for real-time analysis.

Dataset and Experimental Setup

The researchers compiled a custom dataset of 87 micro-images. Masks were worn during various real-world activities, such as running, shopping, and speaking. To ensure accuracy and mitigate local noise or anomalies, three photos (left, middle, and right sides) were taken for each assessment, and their features were averaged before classification.

Results and Discussion

The "Face Mask Assistant" demonstrated strong performance in distinguishing between the three service stages, proving that texture is a viable proxy for mask wear.

Classification Accuracy

The system achieved a Macro Precision of 82.87% ± 8.50%. When the task was simplified to a binary classification (Safe vs. Not Recommended), the accuracy improved to 88.51%. Empirical testing identified K=6 as the optimal hyperparameter for the KNN model, balancing sensitivity and robustness.

Confusion matrix showing the classification performance across the three mask service types.

The Necessity of Microscopic Imaging

A critical finding of the study is that standard smartphone photography is insufficient for this task. Without the TIPSCOPE lens, the textural changes indicative of mask degradation are not captured, rendering the GLCM analysis ineffective. Micro-photos reveal a "landscape" of accumulated particles and fiber wear that provides the necessary data for reliable classification.

Limitations and Future Work

The current study focused exclusively on surgical masks. Future iterations will need to incorporate N95 respirators and cloth masks, which possess distinct material properties. Additionally, the researchers aim to expand the dataset to improve robustness against variations in lighting and different smartphone camera sensors. Environmental factors, such as moisture or facial lint, also present challenges for future algorithmic refinement.

Summary updated

Abstract

Coronavirus Disease 2019 (COVID-19) has spread all over the world since it broke out massively in December 2019, which has caused a large loss to the whole world. Both the confirmed cases and death cases have reached a relatively frightening number. Severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2), the cause of COVID-19, can be transmitted by small respiratory droplets. To curb its spread at the source, wearing masks is a convenient and effective measure. In most cases, people use face masks in a high-frequent but short-time way. Aimed at solving the problem that we do not know which service stage of the mask belongs to, we propose a detection system based on the mobile phone. We first extract four features from the gray level co-occurrence matrixes (GLCMs) of the face mask's micro-photos. Next, a three-result detection system is accomplished by using K Nearest Neighbor (KNN) algorithm. The results of validation experiments show that our system can reach an accuracy of 82.87% (measured by macro-measures) on the testing dataset. The precision of Type I 'normal use' and the recall of type III 'not recommended' reach 92.00% and 92.59%. In future work, we plan to expand the detection objects to more mask types. This work demonstrates that the proposed mobile microscope system can be used as an assistant for face mask being used, which may play a positive role in fighting against COVID-19.
BibTeX
@misc{chen2020face,
  author = {Yuzhen Chen and Menghan Hu and Chunjun Hua and Guangtao Zhai and Jian Zhang and Qingli Li and Simon X. Yang},
  title = {{Face Mask Assistant: Detection of Face Mask Service Stage Based on Mobile Phone}},
  year = {2020},
  eprint = {2010.06421},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2010.06421},
}
Figure