Skip to content

Face Mask detection system is built using the Deep Learning technique called as Convolutional Neural Networks (CNN). This CNN Model is built using the Tensor Flow framework and the OpenCV library which is highly used for real-time applications.

License

Notifications You must be signed in to change notification settings

Primus66/Face-Mask-Detection-Project

Repository files navigation

Face-Mask-Detection-Project

Using Machine Learning concepts to design several models that determine whether an individual is wearing a face mask, not wearing a face mask, or wearing a face mask incorrectly. We will use the performance metrics gathered on these models (including accuracy, precision, recall, and f1 scores) to determine which model performs the best. The models explored include KNN, Decision Trees, CNN, Naive Bayes, and SVM.

Face Mask Detection

Overview

Dataset

We combined 2 different datasets together to form a three class classification dataset with face mask, no face mask, or incorrect face mask wear categories. This new dataset containes over 17,000 images. As for the dataset we used to test bias, we created a W (white) and POC (people of color) dataset. Since there was not an existing dataset available, we obtained the images for W and POC by creating our own dataset collections, each containing around 100-200 image samples.

Frame Works Used

OpenCV

Keras

TensorFlow

Features

Our face mask detector doesn't use any morphed masked images dataset and the model is accurate. Owing to the use of MobileNetV2 architecture, it is computationally efficient, thus making it easier to deploy the model to embedded systems (Raspberry Pi, Google Coral, etc.).

All the dependencies and required libraries listed below:

Installation; pip install the following:

  • Tensorflow
  • Keras
  • imutils
  • numpy
  • opencv-python>=4.22
  • matplotlib
  • argparse
  • scipy
  • scikit-learn
  • pillow
  • streamlit
  • onnx
  • tf2onnx

Create a Python virtual environment named 'test' and activate it

Results

KNN The optimal parameters resulted in 86.7% accuracy, and performed lower when dimensionality reduction techniques were included.

Decision Tree The optimal parameters resulted in 84% accuracy, and performed lower when dimensionality reduction techniques were included.

SVM Reached an accuracy of ~93% with our testing dataset.

Naive Bayes Because of naive bayes assumption and how much pixels correlate with each other, it performed with ~68% for multinomial and ~77% for Gaussian.

CNN Best performing: Reached an accuracy of ~98% with our testing data.

Conclusion

In conclusion our best performing model was CNN, achieving 98% testing accuracy. Models that were comparable to our baseline paper underperformed by 11-16%. In regards to our POC and W datasets, all models also underperformed dramatically, with an emphasis on poorer results for the W dataset. We suspect differences in image perspectives and dataset quality led to this disparity.

Credits

About

Face Mask detection system is built using the Deep Learning technique called as Convolutional Neural Networks (CNN). This CNN Model is built using the Tensor Flow framework and the OpenCV library which is highly used for real-time applications.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published