Skip to content

mohitr2111/FMDz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 

Repository files navigation

FMDz — Face Mask Detection

FMDz is a deep learning-based image classification system that detects whether a person in an image is wearing a face mask or not. It uses a Convolutional Neural Network (CNN) trained on labeled face images..


🚀 Features

  • Binary classification: With Mask vs Without Mask
  • CNN-based model built with TensorFlow / Keras
  • Real-time image prediction via input path
  • Training accuracy and loss visualization
  • Trained on ~7,500+ images

🗂️ Dataset

The dataset is sourced from Kaggle (omkargurav/face-mask-dataset) and contains two classes:

Class Label Count
With Mask 1 3,725
Without Mask 0 3,828

Images are resized to 128×128 pixels and normalized to the [0, 1] range.


🧠 Model Architecture

Input: (128, 128, 3)
│
├── Conv2D(32, 3×3, ReLU)
├── MaxPooling2D(2×2)
├── Conv2D(64, 3×3, ReLU)
├── MaxPooling2D(2×2)
├── Flatten
├── Dense(128, ReLU) + Dropout(0.5)
├── Dense(64, ReLU) + Dropout(0.5)
└── Dense(2, Sigmoid)  →  Output
  • Optimizer: Adam
  • Loss: Sparse Categorical Crossentropy
  • Metric: Accuracy
  • Epochs: 10
  • Validation Split: 10%

📦 Dependencies

numpy
matplotlib
opencv-python
Pillow
scikit-learn
tensorflow
kaggle

⚙️ Setup & Usage

1. Clone the Repository

git clone https://github.com/your-username/FMDz.git
cd FMDz

2. Install Dependencies

pip install numpy matplotlib opencv-python pillow scikit-learn tensorflow kaggle

3. Configure Kaggle API

Place your kaggle.json credentials file in ~/.kaggle/ and set permissions:

mkdir -p ~/.kaggle
cp kaggle.json ~/.kaggle/
chmod 600 ~/.kaggle/kaggle.json

4. Download & Extract Dataset

kaggle datasets download -d omkargurav/face-mask-dataset
unzip face-mask-dataset.zip

5. Run the Notebook

Open Face_Mask_Detection.ipynb in Google Colab or Jupyter and run all cells.


🔍 Prediction

After training, use the predictive system cell to test on a new image:

Path of the image to be predicted: /path/to/image.jpg

Output:

  • The person in the image is wearing a mask.
  • The person in the image is not wearing a mask.

📊 Results

Training plots are generated for:

  • Loss — Training vs Validation
  • Accuracy — Training vs Validation

📁 Project Structure

FMDz/
├── Face_Mask_Detection.ipynb   # Main notebook
├── kaggle.json                 # Kaggle API credentials (not committed)
├── data/
│   ├── with_mask/              # Mask images
│   └── without_mask/           # No-mask images
└── README.md

🛡️ License

This project is open-source and available under the MIT License.


🙌 Acknowledgements

  • Dataset by Omkar Gurav on Kaggle
  • Built with TensorFlow & Keras

About

FMDz is a deep learning-based image classification system that detects whether a person in an image is wearing a face mask or not.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors