Skip to content
Back to projects

Deep Learning · 2026

Face Mask Detection

Real-time mask detection with PyTorch, MobileNetV2 transfer learning and OpenCV, webcam inference and a modular pipeline.

Model

  • MobileNetV2 backbone (ImageNet weights) with a new classification head
  • Two classes: mask / no-mask
  • OpenCV face crop → resize → normalize → classify

Dataset

Face mask dataset (with/without mask images) plus live webcam frames at inference.

Results & metrics

Accuracy
~0.98
Inference
real-time webcam
Backbone
MobileNetV2

Deployment steps

  1. 1Fine-tune MobileNetV2 on the mask dataset
  2. 2Serialize the best checkpoint
  3. 3Run the OpenCV webcam loop: detect faces, crop, classify per frame
  4. 4Modular pipeline lets the classifier swap into other video sources

Tech stack

  • PyTorch
  • MobileNetV2
  • OpenCV
M

drawing ideas into systems...