Skip to content

MrSanad26/Mask

Repository files navigation

Mask and Withoutmask Classification using YOLO

This README provides guidelines on how to train a YOLO model for detecting the presence or absence of masks on faces, using the dataset available on Kaggle. The instructions cover setup, training, and usage of the model.

Dataset

The dataset for this project can be accessed on Kaggle: Mask and Without Mask Dataset

Setup

Clone YOLO Repository

Clone the appropriate YOLO repository (YOLOv5 or YOLOv8) to your local machine or development environment.

Install Dependencies

Install all required dependencies specified in the repository's requirements.txt.

Prepare the Dataset

Download and organize the dataset from Kaggle. Ensure the data is structured properly for YOLO training.

Training

Update data.yaml

Adjust the data.yaml file to correctly point to your train and validation data paths.

Configure Model

If necessary, adapt the model configuration to match the number of classes and adjust any other hyperparameters or architectural details.

Launch Training

Execute the training script provided by YOLO with parameters tailored to your dataset and training requirements.

Model Usage

After training, use the trained weights to detect masks in new images or video streams.

Improving Model Accuracy

Addressing Dataset Bias

The dataset may exhibit bias, particularly if one class (e.g., 'with_mask') is over-represented compared to another (e.g., 'without_mask'). This imbalance can skew the model's performance and limit its effectiveness in practical applications.

Recommendations:

  • Data Augmentation: Apply data augmentation techniques such as rotation, cropping, flipping, and color adjustment to enhance the diversity of the training set, particularly for underrepresented classes.

  • Balancing the Dataset: Add more 'without_mask' images to achieve a more balanced dataset. This helps in training a more equitable and effective model.

  • Continuous Training: Continuously train and fine-tune the model with newly augmented or sourced data to improve its accuracy and robustness.

About

Mask and Withoutmask Classification using yolo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors