Face Mask Detection System
Faisal Mehmood
Author
5 min read
Abstract
This project aims to develop an automated face mask detection system using deep learning techniques. The system will identify whether a person in an image is wearing a mask or not wearing a mask. A Convolutional Neural Network (CNN) model will be trained on a dataset containing face images with and without masks. The model will be integrated with a real-time detection interface to monitor live camera feeds or uploaded images. This technology can be applied in public safety monitoring, hospital check-ins, and smart surveillance systems.
Functional Requirements
1. Data Collection & Preprocessing
- Collect or create a dataset containing face images with and without masks.
- Apply face detection using OpenCV or MediaPipe.
- Resize and normalize images for model compatibility.
- Perform data augmentation (e.g., rotation, flipping, brightness adjustment) to improve robustness.
2. Model Development
- Implement a Convolutional Neural Network (CNN) or fine-tune a pretrained model (such as MobileNet or VGG16).
- Train the model to classify images into two categories: Mask and No Mask.
- Use dropout, batch normalization, and hyperparameter tuning to optimize performance.
- Target validation accuracy above 90%.
3. User Interface Development
Desktop Application (Tkinter/PyQt):
- Allow users to upload photos for detection.
- Display prediction results and confidence scores.
Web Application (Flask/Django):
- Provide a web-based interface for image uploads or live camera feed integration.
4. Real-Time Detection
- Use OpenCV to capture live video from a webcam or CCTV feed.
- Detect and classify faces as Mask or No Mask in real-time.
- Display bounding boxes and labels with confidence scores.
5. Database Integration
- Store detection results including timestamps, image paths, and predictions using SQLite or MySQL.
- Allow administrators to view and analyze detection logs.
6. Performance Evaluation & Optimization
- Evaluate system performance using metrics such as accuracy, precision, recall, and F1-score.
- Test under various lighting and camera conditions.
- Optimize the model for faster real-time performance while maintaining high accuracy.
Tools and Technologies Required
Programming Language:
Python
Libraries & Frameworks:
- Deep Learning: TensorFlow / Keras or PyTorch
- Image Processing: OpenCV, Pillow, dlib
- Backend: Flask / Django
- GUI: Tkinter / PyQt
Dataset:
- Kaggle Face Mask Dataset (https://www.kaggle.com/datasets/omkargurav/face-mask-dataset)
- Custom images (optional for fine-tuning)
Database:
SQLite / MySQL
IDE:
PyCharm, VS Code, or Jupyter Notebook
Hardware:
- CPU: Intel i5 or AMD Ryzen 5 and above
- RAM: Minimum 4GB
- GPU (optional for faster training)
- Storage: A few GBs for dataset and model weights
-
Tools & Technologies
- Python
- TensorFlow / Keras or PyTorch
- OpenCV
- Pillow
- dlib
- Flask / Django
- Tkinter / PyQt
- Kaggle Face Mask Dataset
- SQLite / MySQL
- PyCharm
- VS Code
- or Jupyter Notebook
Faisal Mehmood
Faisal Mehmood Expert in CS619 Final Year Projects and software development.
View all projects