Abstract:
Face masks are a vital precautionary measure in the fight against the Covid-19 pandemic.
This study aims to develop a face mask detection system suitable to deploy on single
board computers (SBCs) by comparing the performance of three Convolution Neural
Networks (CNN) namely on MobileNet, MobileNetV2, and EfficientNet. The system
was implemented using tensorflow and keras with OpenCV for the computer vision
component. Models were trained on a publicly available balanced dataset in Kaggle
consisting of 10000 training, 992 testing, and 800 validation data. Same batch size
and epoch hyperparameters were used with Adam optimizer to train each model. Loss,
accuracy, precision, and recall were used as metrics to compare the model performance.
MobileNet outperformed the others, attaining a test accuracy and precision of 97.93%
and 97.84% respectively. MobilNetV2 showed an accuracy of 96.12% and a precision of
96.57% ranking the second. Trained models were compressed to TensorflowLite models in
order to be deployed in Raspberry Pis efficiently. Real time inference performance of the
models were measured in both standard hardware and Raspberry pi 4 by connecting to a
camera feed. MobileNet, MobileNetV2, and EfficientNet each reached average inference
times (in seconds) of 0.816, 0.751 and 1.418 for standard hardware and 0.332, 0.221,
and 0.776 for the Raspberry pi. Results on the accuracy and performance indicate
that both the MobileNet versions are deployable in the real world. These types of
models that are deployable on SBCs enable data security, low latency, and low cost
in real world deployment of face mask detection systems. Offline deployment is possible
as data is referenced on device compared to a server implementation while securing
monitored individuals’ privacy. The system can be further developed as a distributed
system consisting of multiple SBCs deployed in a wider area.