Multi-Class Face Mask Detection with YOLOv8: Class-Imbalance Effects and a Field-Tested Domain Shift from Eye-Level Training Data to Overhead Drone Imagery
Abstract
Manual verification of face mask compliance at building entrances is slow and depends on sustained human attention, motivating automated alternatives built on modern object detection. This study presents a YOLOv8-based system trained to distinguish three conditions, correctly worn masks, no mask, and incorrectly worn masks, on a public dataset of 853 annotated images, together with a two-stage extension that applies the trained detector to overhead drone footage via a person-detection cropping stage. The model achieved an overall mAP50 of 0.897, precision of 0.896, and recall of 0.821 on a held-out validation set, with per-class mAP50 scores of 0.960, 0.897, and 0.833 for the correctly-worn, no-mask, and incorrectly-worn classes respectively, the last of these constrained by the incorrectly-worn class making up only 3.0 percent of labelled training instances. A field test applying the trained model to five overhead drone photographs, each showing three pedestrians, produced a materially different result from the validation-set evaluation: only six of fifteen visible faces received any mask-related label at all, including two unambiguous incorrectly-worn cases that went entirely undetected. This gap is attributed to a domain shift between the eye-level, front-facing training distribution and the foreshortened, top-down viewing geometry of drone imagery, a specific and previously undocumented failure mode for this detection task that this study reports in full rather than omitting. The central methodological finding is that a model can achieve strong, standard validation metrics while still degrading substantially under a viewing-angle shift the validation set does not represent, a distinction with direct relevance for any deployment of eye-level-trained detectors on aerial platforms.
References
Bochkovskiy, A., Wang, C. Y., & Liao, H. Y. M. (2020). YOLOv4: Optimal speed and accuracy of object detection. arXiv. https://arxiv.org/abs/2004.10934
Jocher, G., Chaurasia, A., & Qiu, J. (2023). Ultralytics YOLOv8 [Computer software]. GitHub. https://github.com/ultralytics/ultralytics
Kaggle (Andrew, M.). (n.d.). Face Mask Detection Dataset [Data set]. Kaggle. https://www.kaggle.com/datasets/andrewmvd/face-mask-detection
Liu, R. (2021). Application of YOLO on mask detection task. arXiv. https://arxiv.org/abs/2102.05402
Liu, W., Anguelov, D., Erhan, D., Szegedy, C., Reed, S., Fu, C. Y., & Berg, A. C. (2016). SSD: Single shot multibox detector. In Proceedings of the European Conference on Computer Vision (pp. 21-37).
Redmon, J., Divvala, S., Girshick, R., & Farhadi, A. (2016). You only look once: Unified, real-time object detection. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition (pp. 779-788).
Ren, S., He, K., Girshick, R., & Sun, J. (2015). Faster R-CNN: Towards real-time object detection with region proposal networks. Advances in Neural Information Processing Systems, 28, 91-99.
Viola, P., & Jones, M. (2001). Rapid object detection using a boosted cascade of simple features. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition.
Wang, J., Wang, J., Zhang, X., & Yu, N. (2023). A mask-wearing detection model in complex scenarios based on YOLOv7-CPCSDSA. Electronics, 12(14), Article 3128. https://doi.org/10.3390/electronics12143128
Xu, Q., Zhu, Z., Ge, H., Zhang, Z., & Zang, X. (2021). Effective face detector based on YOLOv5 and superresolution reconstruction. Computational and Mathematical Methods in Medicine, 2021, Article 7748350. https://doi.org/10.1155/2021/7748350
Refbacks
- There are currently no refbacks.