Face Mask Detection - ResNet, OpenCV
Many measurements have been taken to tackle the COVID-19 pandemic. Among which, wearing a face mask is one way to prevent spreading the virus. This work aims to detect if a person is wearing a mask or not. With this objective, a machine learning model is developed, which leverages transfer learning to detect mask.
For collecting human faces with the mask, a subset (1000 images) of the MAFA dataset is used. For collecting human faces without the mask, a subset (1000 images) of the UTKFace dataset is used. The dataset can be found in the following links:
Mafa: https://www.escience.cn/people/geshiming/mafa.html UTKFace: https://susanqq.github.io/UTKFace/
Finally, the trained model is used to detect a human face with/without face mask in real-time using webcam feed.
- Keras is used to develop the model.
- Resnet-50 is used to train the model.
- Data augmentation (horizontal and vertical shift, flip) is performed as a preprocessing step.
- 99% accuracy is achieved while testing with hold-out images.
- OpenCV is used to detect the face mask in real time.
This Project’s GitHub Repository