Face Mask Detection

Well I’d a lot of free time and I was trying to learn Pytorch, so I made a simple project of face mask detection. (Note: This project doesn’t seem to show the best results but is decent enough.)

No Mask screenshot

No Mask example

Mask screenshot

Mask example

As you can see, the model I trained can do a lot better at detecting masks, but nevertheless this was for learning purpose. My mask classifier model is a very simple one as shown below, I used 3 Convolutional layers and 3 Fully Connected Layers. The dataset can be found here and the mask classifier model was trained on 30 epochs. Test accuracy was around 98%. For face detection I used OpenCV’s frontal face cascade classifier and then predicted on the detected regions.

Model Summary

Model Architecture

Demo

Improvements/Future Work

References