This project helps us to spread the awareness among people using face mask properly. It detects the face mask on your face whether the person is wearing mask or not and tells the percentage of the accuracy of wearing the face mask properly or not.
In order to train a custom face mask detector, I need to split our project into two distinct phases:
-
Training Phase (Training the model):
In this I will focus on loading our face mask detection datasets from disk, training a model using CNN on the datasets, and then serializing the face mask detector to disk. -
Deployment Phase (Deployment of the model):
Once the face mask detector is trained, then move on to loading the mask detector, performing the face mask detection and then identifying each face as with mask or without mask.
Our face mask detector didn't uses any morphed masked images dataset. The dataset consists of 1,376 images belonging to two classes:
- with_mask: 690 images
- without_mask: 686 images
I choose this dataset because it consists artificially dataset of people wearing masks. If you include the original images used to generate face mask samples as non-face mask samples, your model will become heavily biased and fail to generalize well. Avoid that at all costs by taking the time to gather new examples of faces without marks.
- OpenCV
- Caffe-based face detector
- Keras
- TensorFlow
- Convolutional Neural Network
- Scikit-learn
- Matplotlib
All the dependencies and required libraries are included in the file requirements.text
Clone my repo and install the libraries and the run the Face_Mask_detection.ipynb
colab notebook for the image output.
A Classification report is used to measure the quality of predictions from a classification
algorithm. How many predictions are True and how many are False. More specifically, True
Positives, False Positives, True negatives and False Negatives are used to predict the metrics
of a classification report as shown below
The accuracy of the model is 96% after trained and tested on the images.
The model is accurate, and since we used the simple Sequential Model architecture, it’s also computationally efficient and thus making it easier to deploy the model to embedded systems (Raspberry Pi, Google Coral, etc.).
This system can therefore be used in real-time applications which require face-mask detection for safety purposes due to the outbreak of Covid-19. This project can be integrated with embedded systems for application in airports, railway stations, offices, schools, and public places to ensure that public safety guidelines.