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.
The dataset for this project can be accessed on Kaggle: Mask and Without Mask Dataset
Clone the appropriate YOLO repository (YOLOv5 or YOLOv8) to your local machine or development environment.
Install all required dependencies specified in the repository's requirements.txt.
Download and organize the dataset from Kaggle. Ensure the data is structured properly for YOLO training.
Adjust the data.yaml file to correctly point to your train and validation data paths.
If necessary, adapt the model configuration to match the number of classes and adjust any other hyperparameters or architectural details.
Execute the training script provided by YOLO with parameters tailored to your dataset and training requirements.
After training, use the trained weights to detect masks in new images or video streams.
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.