🩺 Face Mask Detection — Short Project Story

🌟 About the Project

A real-time AI system that detects whether a person is wearing a face mask. I built it using Python, TensorFlow/Keras, and OpenCV. The model classifies faces into with mask and without mask from webcam or image input.


🚀 Inspiration

I was inspired by the need for contactless monitoring during COVID-19 and wanted to build a practical computer vision project that helps with safety and automation.


📘 What I Learned

  • How to prepare and clean image datasets
  • How CNNs work for classification
  • Training a model with TensorFlow/Keras
  • Real-time face detection using OpenCV
  • Designing a simple classification pipeline

Basic cross-entropy loss used: [ \text{Loss} = -\sum y \log(\hat{y}) ]


🛠️ How I Built It

  • Organized dataset into with_mask and without_mask
  • Preprocessed images (224×224, normalization)
  • Trained a CNN with softmax output
  • Connected model to OpenCV for live detection
  • Displayed results with colored bounding boxes

⚠️ Challenges

  • Cleaning low-quality dataset images
  • Fixing overfitting using augmentation
  • Optimizing real-time detection speed
  • Installing TensorFlow + OpenCV on Windows 11

Built With

  • apis
  • github
  • keras
  • list-as-optional.)-google-colab-(for-training
  • matplotlib
  • numpy
  • opencv
  • opencv-python
  • python
  • sklearn
  • tensorflow
  • tensorflow/keras
  • you-can-add-these.-for-now
Share this project:

Updates