The Mask and Social Distancing Detection project is a computer vision–based system designed to automatically detect:
- Whether a person is wearing a face mask or not
- Whether social distancing rules are being maintained in public spaces
The system uses Deep Learning and Object Detection techniques to analyze images or video streams in real time. This project is particularly relevant for public safety monitoring, crowd management, and smart surveillance systems.
- Detect people in images or video streams
- Classify face mask usage (Mask / No Mask)
- Measure distance between individuals
- Identify social distancing violations
- Visualize results in real time with bounding boxes and alerts
The project consists of two main modules:
-
Detects human faces
-
Classifies each face as:
- Mask
- No Mask
- Detects people in a scene
- Computes pairwise distances between detected individuals
- Flags violations when distance falls below a predefined threshold
-
Images of people wearing masks and without masks
-
Labeled into:
maskno_mask
- Person detection dataset (e.g., COCO-style format)
- Used for identifying humans in crowded scenes
⚠️ Dataset sources depend on implementation. If using a public dataset, please cite the original source.
-
Convolutional Neural Network (CNN)
-
Transfer learning models (optional):
- MobileNetV2
- ResNet
- VGG16
-
Object Detection Model:
- YOLO (v3 / v4 / v5)
- SSD
- Faster R-CNN
-
Euclidean distance calculation between detected centroids
-
Programming Language: Python
-
Libraries & Frameworks:
- TensorFlow / Keras
- OpenCV
- NumPy
- Scikit-learn
- imutils
-
Deep Learning Models: CNN, YOLO (optional)
- Accuracy
- Precision
- Recall
- F1-score
- Confusion Matrix (for mask detection)
Performance varies based on dataset quality, lighting conditions, and camera angle.
The system successfully:
- Detects face masks in real time
- Identifies unsafe crowd distances
- Works on live webcam and recorded videos
Exact accuracy depends on:
- Model choice
- Training data
- Environmental conditions
- Reduced accuracy in low-light environments
- Occluded faces may affect mask detection
- Distance estimation is camera-angle dependent
- Not a medical-grade or law-enforcement system
- Add face recognition for identity tracking
- Improve distance estimation using depth sensors
- Deploy as a web-based surveillance dashboard
- Integrate alert notification system
- Optimize for edge devices (Raspberry Pi, Jetson Nano)
HOSEN ARAFAT
Software Engineer, China
GitHub: https://github.com/arafathosense
Researcher: Artificial Intelligence, Machine Learning, Deep Learning, Computer Vision, Image Processing