Face Mask Detection: A Comparative Analysis of Deep Learning Models for Edge Deployment

Authors

  • Ali Asghar Department of Computer Systems Engineering, University of Engineering and Technology Peshawar, Peshawar, Pakistan
  • Suleman Shah Department of Computer Systems Engineering, University of Engineering and Technology Peshawar, Peshawar, Pakistan
  • Masood Ahmad Arbab Department of Computer Systems Engineering, University of Engineering and Technology Peshawar, Peshawar, Pakistan

DOI:

https://doi.org/10.33411/IJIST/2029

Keywords:

Face Mask Detection, Model Quantization, Edge Computing, Convolutional Neural Networks, Microcontroller Deployment

Abstract

Introduction/ Importance of Study: Automated face mask monitoring remains a practical requirement for respiratory-disease control in transport hubs, clinics, and institutional settings, yet the deep networks that perform it accurately are rarely small enough for the microcontrollers that would host them.

Novelty statement: This work treats quantization robustness as a first-class architectural property rather than a post-hoc implementation detail, reporting FP32 and INT8 accuracy for every model under one matched protocol—with two model-specific deviations documented explicitly in the Methods—and carrying the comparison through to physical microcontroller deployment.

Material and Method: Four architectures — VGG-16, ResNet-18, MobileNetV2 and YOLOv8n-cls — were trained on a merged 19,157-image corpus of cropped face regions under a common preprocessing, optimizer and epoch budget, with two model-specific deviations documented in the Methods, three of them at a unified 96×96 edge-compatible input. Each was exported to ONNX, quantized from FP32 to INT8 with the ESP-PPQ toolchain using layer-wise equalization and learned step-size quantization (LSQ), and deployed to an ESP32-S3-CAM through ESP-IDF and ESP-DL with Haar-cascade face localization.

Results and Discussion: In FP32 all four models achieved comparable performance, reaching 95.43–97.78% accuracy with macro-F1 above 0.95 and per-class recall above 95%. Quantization reduced memory uniformly by 73–75% but degraded accuracy very unevenly: VGG-16 lost 0.67 percentage points, ResNet-18 10.44 and MobileNetV2 14.30, while YOLOv8n-cls fell by 43.20 points to 54.58%, recovering only 9 of 1,728 masked faces and falling below its majority-class baseline. Expressed as error inflation, the separation is wider still, at 1.17×, 4.18×, 4.13× and 20.46× respectively. A calibration ablation showed equalization and LSQ recover a real but partial share of the loss without changing the ordering, which places the vulnerability in the four architectures tested rather than in the calibration procedure. Only MobileNetV2 and YOLOv8n-cls fitted the 8 MB PSRAM budget, at 576.03 ms and 242.20 ms per face.

Concluding Remarks: Quantization robustness, not floating-point accuracy, governs edge viability; across the four architectures tested, FP32 accuracy proved an unreliable proxy for deployed accuracy.

References

S. Rasheed, “Lightweight Deep Learning Models for Face Mask Detection in Real-Time Edge Environments: A Review and Future Research Directions,” Mach. Learn. Knowl. Extr. 2026, Vol. 8, Page 102, vol. 8, no. 4, p. 102, Apr. 2026, doi: 10.3390/MAKE8040102.

B. E, M. P, S. M, and O. J, “A multi-class framework for face mask compliance detection using lightweight deep learning models,” Sci. Reports 2026 161, vol. 16, no. 1, pp. 22059-, May 2026, doi: 10.1038/s41598-026-50603-1.

C. Pillay, S. Joseph, and B. van Niekerk, “Development of a Face Mask Detection and Masked Facial Recognition Model Based on a Hybrid Convolutional Neural Network,” IET Image Process., vol. 19, no. 1, Jan. 2025, doi: 10.1049/IPR2.70239.

Y. Mao, Y. Lv, G. Zhang, and X. Gui, “Exploring Transformer for Face Mask Detection,” IEEE Access, vol. 12, pp. 118377–118388, 2024, doi: 10.1109/ACCESS.2024.3449802.

X. Ren and X. Liu, “Mask wearing detection based on YOLOv3,” J. Phys. Conf. Ser., vol. 1678, no. 1, p. 012089, Nov. 2020, doi: 10.1088/1742-6596/1678/1/012089.

S. Somvanshi et al., “From Tiny Machine Learning to Tiny Deep Learning: A Survey,” ACM Comput. Surv., vol. 58, no. 7, Jun. 2025, doi: 10.1145/3776588.

S. Heydari and Q. H. Mahmoud, “Tiny Machine Learning and On-Device Inference: A Survey of Applications, Challenges, and Future Directions,” Sensors 2025, Vol. 25, Page 3191, vol. 25, no. 10, p. 3191, May 2025, doi: 10.3390/S25103191.

M. Echchidmi and A. Bouayad, “TinyML for Sustainable Edge Intelligence: Practical Optimization Under Extreme Resource Constraints,” Technol. 2026, Vol. 14, Page 215, vol. 14, no. 4, p. 215, Apr. 2026, doi: 10.3390/TECHNOLOGIES14040215.

S. H. Ji Lin, Wei-Ming Chen, Yujun Lin, John Cohn, Chuang Gan, “MCUNet: Tiny Deep Learning on IoT Devices,” NeurIPS 2020, doi: https://doi.org/10.48550/arXiv.2007.10319.

L. C. S. C. F. Capogrosso, “A machine learning-oriented survey on tiny machine learning,” researchgate, doi: DOI:10.1109/ACCESS.2024.3365349.

B. Jacob et al., “Quantization and Training of Neural Networks for Efficient Integer-Arithmetic-Only Inference,” Proc. IEEE Comput. Soc. Conf. Comput. Vis. Pattern Recognit., pp. 2704–2713, Dec. 2017, doi: 10.1109/CVPR.2018.00286.

A. Gholami, S. Kim, Z. Dong, Z. Yao, M. W. Mahoney, and K. Keutzer, “A Survey of Quantization Methods for Efficient Neural Network Inference,” Low-Power Comput. Vis., pp. 291–326, Mar. 2021, doi: 10.1201/9781003162810-13.

M. F. A. A. B. Nagel, “A white paper on neural network quantization,” researchgate, 2021, doi: DOI:10.48550/arXiv.2106.08295.

Raghuraman Krishnamoorthi., “Quantizing deep convolutional networks for efficient inference: A whitepaper,” researchgate, 2018, doi: DOI:10.48550/arXiv.1806.08342.

O. E. F. E. Krestinskaya, “Quantized convolutional neural networks: a hardware perspective,” researchgate, 2025, doi: DOI:10.3389/felec.2025.1469802.

A. W. Stone Yun, “Do all MobileNets quantize poorly? Gaining insights into the effect of quantization on depth wise separable convolutional networks through the eyes of multi-scale distributional dynamics,” Accept. Publ. Mob. AI, 2021, doi: https://doi.org/10.48550/arXiv.2104.11849 Focus to learn more.

G. Santacatterina and B. Z. Liberatori, “YOLO-based face mask detection on low-end devices using pruning and quantization,” researchgate, 2022, doi: DOI:10.23919/MIPRO55190.2022.9803406.

S. Ge, J. Li, Q. Ye, and Z. Luo, “Detecting masked faces in the wild with LLE-CNNs,” Proc. - 30th IEEE Conf. Comput. Vis. Pattern Recognition, CVPR 2017, vol. 2017-January, pp. 426–434, Nov. 2017, doi: 10.1109/CVPR.2017.53.

S. Yang, P. Luo, C. C. Loy, and X. Tang, “WIDER FACE: A Face Detection Benchmark,” Proc. IEEE Comput. Soc. Conf. Comput. Vis. Pattern Recognit., vol. 2016-December, pp. 5525–5533, Nov. 2015, doi: 10.1109/CVPR.2016.596.

K. Simonyan and A. Zisserman, “Very Deep Convolutional Networks for Large-Scale Image Recognition,” 3rd Int. Conf. Learn. Represent. ICLR 2015 - Conf. Track Proc., Sep. 2014, Accessed: Aug. 29, 2026. [Online]. Available: https://arxiv.org/pdf/1409.1556

K. He, X. Zhang, S. Ren, and J. Sun, “Deep residual learning for image recognition,” Proc. IEEE Comput. Soc. Conf. Comput. Vis. Pattern Recognit., vol. 2016-December, pp. 770–778, Dec. 2016, doi: 10.1109/CVPR.2016.90.

M. Sandler, A. Howard, M. Zhu, A. Zhmoginov, and L. C. Chen, “MobileNetV2: Inverted Residuals and Linear Bottlenecks,” Proc. IEEE Comput. Soc. Conf. Comput. Vis. Pattern Recognit., pp. 4510–4520, Jan. 2018, doi: 10.1109/CVPR.2018.00474.

Ultralytics, “Ultralytics YOLOv8 Documentation,” Ultralytics, 2025, [Online]. Available: https://docs.ultralytics.com/

M. Nagel, M. Van Baalen, T. Blankevoort, and M. Welling, “Data-Free Quantization Through Weight Equalization and Bias Correction,” Proc. IEEE Int. Conf. Comput. Vis., pp. 1325–1334, Jun. 2019, doi: 10.1109/ICCV.2019.00141.

S. K. Esser, J. L. McKinstry, D. Bablani, R. Appuswamy, and D. S. Modha, “Learned Step Size Quantization,” 8th Int. Conf. Learn. Represent. ICLR 2020, Feb. 2019, Accessed: Aug. 29, 2026. [Online]. Available: https://arxiv.org/pdf/1902.08153

“ESP-DL: Espressif deep-learning library for AIoT applications,” 2025, [Online]. Available: https://github.com/espressif/esp-dl

P. Viola and M. Jones, “Rapid object detection using a boosted cascade of simple features,” Proc. IEEE Comput. Soc. Conf. Comput. Vis. Pattern Recognit., vol. 1, 2001, doi: 10.1109/CVPR.2001.990517.

G. Yoo, J.; Ban, “Efficient deep learning model compression for sensor-based vision systems via outlier-aware quantization,” Sensors, 2025, doi: https://doi.org/10.3390/s25092918.

B. Pandya, D. Patel, and K. C. Yow, “Face Mask Detection using Vision Transformer,” Can. Conf. Electr. Comput. Eng., vol. 2023-September, pp. 268–272, 2023, doi: 10.1109/CCECE58730.2023.10288856.

M. Loey, G. Manogaran, M. H. N. Taha, and N. E. M. Khalifa, “A hybrid deep transfer learning model with machine learning methods for face mask detection in the era of the COVID-19 pandemic,” Measurement, vol. 167, p. 108288, Jan. 2021, doi: 10.1016/J.MEASUREMENT.2020.108288.

P. Nagrath, R. Jain, A. Madan, R. Arora, P. Kataria, and J. Hemanth, “SSDMNV2: A real time DNN-based face mask detection system using single shot multibox detector and MobileNetV2,” Sustain. Cities Soc., vol. 66, p. 102692, Mar. 2021, doi: 10.1016/J.SCS.2020.102692.

H. A. D. V. J. P. I. A. Abushahla, “Neural network quantization for efficient deployment on resource-constrained microcontrollers: A survey,” ResearchGate., 2025, doi: DOI:10.48550/arXiv.2508.15008.

F. Ben Aicha., “Optimized embedded artificial intelligence: Implementation of convolutional neural networks on the ESP32-CAM,”,” Computing, doi: doi: 10.1007/s00607-025-01559-z.

R. Chen, P. Wang, B. Lin, B. Lin, or hasn’t claimed this research yet. This person is not on ResearchGate, and L. Wang, “An optimized lightweight real-time detection network model for IoT embedded devices,” Sci. Rep., 2025, doi: DOI:10.1038/s41598-025-88439-w.

C. M. Bhushan et al., “Deploying TinyML for energy-efficient object detection and communication in low-power edge AI systems,” Sci. Reports 2025 151, vol. 15, no. 1, pp. 44299-, Dec. 2025, doi: 10.1038/s41598-025-27818-9.

Downloads

Published

2026-09-10
CITATION
Published: 2026-09-10
Crossref Citation Count: Loading...

How to Cite

Ali Asghar, Suleman Shah, & Arbab, M. A. (2026). Face Mask Detection: A Comparative Analysis of Deep Learning Models for Edge Deployment. International Journal of Innovations in Science & Technology, 8(6), 2607–2628. https://doi.org/10.33411/IJIST/2029