Deployment of a real-time face mask classification system using browser webcam streaming and FastAPI
Date
2026
Authors
Venkatraman, Yazhini
Journal Title
Journal ISSN
Volume Title
Publisher
Abstract
This project presents a real-time face mask classification system designed to support safety monitoring in public and controlled environments such as workplaces, institutions, and healthcare facilities. The system detects a person’s face and classifies mask usage into four categories: with mask, without mask, with N95 mask, and improper mask. A curated dataset of face images was preprocessed through face detection, cropping, resizing, normalization, and augmentation to improve the model’s robustness under different lighting and orientation conditions.
The model is built using a MobileNet based convolutional neural network, chosen for its efficiency and suitability for real-time applications. A classical Single Shot Detector is used to localize faces before classification. The trained model is evaluated using standard metrics including accuracy, precision, recall, F1-score, and a confusion matrix and achieves strong performance across all four mask categories. A live webcam interface has also been implemented to demonstrate real-time inference and practical usability.
Overall, this work shows that a lightweight deep learning pipeline can reliably classify mask wearing conditions in real time on standard hardware. The system forms a basis for further improvements, such as handling complex occlusions, expanding the dataset with more diverse samples, and deploying the model as a standalone desktop or mobile application for real-world monitoring needs.