Introduction
In response to the global COVID-19 pandemic, wearing face masks has become a critical measure to prevent the spread of the virus. In this project, I leverage the power of computer vision and deep learning to develop a real-time face mask detection system.
Project Overview
Using state-of-the-art object detection techniques, I analyse live video streams to identify faces and determine whether individuals are wearing masks correctly, improperly, or not at all. By integrating deep learning models trained on labelled datasets of masked and unmasked faces, I am able to accurately classify and localize face masks in real-time.
Key Features
1. Two-Phase Mask Detector
- Training Phase: In this phase, I focused on loading the face mask detection dataset, training a custom deep learning model using Keras and TensorFlow, and serializing the trained model to disk.
- Deployment Phase: Once the model is trained, the deployment phase involves loading the trained model, performing face detection on video streams, and classifying each detected face as either wearing a mask or not wearing a mask.
2. Dataset Information
The face mask detection dataset consists of 1,376 images belonging to two classes:
- with_mask: 690 images
- without_mask: 686 images
3. Model Architecture
For this project, I utilized the MobileNet V2 architecture, known for its efficiency and suitability for deployment on embedded devices with limited computational capacity.
4. Training
To train the face mask detector, I implemented a training script using Keras and TensorFlow. The script involves the following steps:
- Loading the face mask dataset from disk.
- Fine-tuning the MobileNet V2 architecture for mask detection.
- Training the classifier on the dataset.
- Serializing the trained model to disk for future use.
- Utilising the trained model to detect face mask in real time.
Conclusion
Through this project, I have demonstrated my ability to leverage cutting-edge technology to address real-world challenges. By developing a robust face mask detector, I aim to contribute to efforts in promoting public health and safety during the COVID-19 pandemic.