Face Mask Detector

The Face Mask Detection System is built using OpenCV, Keras/TensorFlow, and deep learning concepts to detect face masks in static images and real-time video streams. It helps to monitor and enforce mask-wearing during the COVID-19 pandemic, making it an essential tool for transportation, crowded areas, hospitals, and workplaces.
Key Features:
- Multiple Face Detection: The system can detect multiple faces in a single frame.
- Improper Mask Detection: It identifies incorrect mask-wearing, including uncovered chin, nose, or both.
- Alert System: The model triggers an alarm to notify authorities when a person is not wearing a mask.
Motivation: Due to the ongoing COVID-19 pandemic, face mask detection applications are crucial for ensuring safety in public places. The lack of datasets for “with_mask” images has made this task challenging. This project aims to bridge the gap by providing a robust solution for mask detection.
Technologies Used:
- OpenCV: A computer vision library used for processing images.
- TensorFlow/Keras: Deep learning frameworks used for model building and training.
- MobileNetV2: A lightweight pre-trained deep learning model for efficient image classification.
- NumPy: A Python library for array manipulation.
Datasets: The project uses a dataset of 7,388 images, with 3,846 images of faces without masks and 3,542 images of faces with masks. These images were collected from sources like Kaggle and RMFD datasets.
Data Preprocessing: To address the scarcity of labeled masked images, the system uses artificial mask generation. The process involves:
- Detecting faces in the images.
- Identifying key facial landmarks (nose and chin).
- Applying an artificial mask to the face based on these landmarks.
Installation:
- Clone the repository:
git clone https://github.com/Chaganti-Reddy/Face-Mask-Detector.git
- Navigate to the project folder:
cd Face-Mask-Detector
- Install required dependencies:
pip3 install -r requirements.txt
How to Run:
- For training:
python3 Training.py
- For real-time face mask detection:
python3 Face_Mask_Detect.py
Performance: The model achieved an accuracy of 98% in detecting face masks after training with TensorFlow-GPU. The accuracy can further improve with more epochs and training data.
Future Goals:
- Integration with voice systems.
- Development of Android and iOS apps for Face Mask Detection.
- Improving model performance for low-end cameras.
- Adding an email notification feature for mask violations.