This project implements a robust and adaptive skin tone detection system using deep learning techniques in combination with the DeepGaze library. Our approach integrates computer vision and machine learning to accurately identify and classify various skin tones in images. By leveraging the power of Convolutional Neural Networks (CNNs) and the specialized capabilities of DeepGaze, we've created a system that can reliably detect skin areas and categorize them into distinct tone categories.
- 🔍 Utilizes DeepGaze for initial skin detection
- 🧠 Employs a CNN model for accurate skin tone classification
- 🌈 Supports multiple skin tone categories (black, brown, white)
-
Clone the repository:
git clone https://github.com/inquisitour/skin_tone_detection.git cd skin-tone-detection
-
Set up your environment:
python -m venv venv # Activate the virtual environment:- # On Windows: venv\Scripts\activate # On Unix or macOS: source venv/bin/activate # Install required packages: pip install -r requirements.txt
- Prepare your dataset in the
data/raw
directory - Preprocess the data:
python data/data_preprocessing.py
- Train the model:
python train.py
- Evaluate the model:
python evaluate.py
- Make predictions:
python predict.py
For detailed instructions, check out our Step-by-Step Guide 📚
skin-tone-detection/
│
├── audit/ # Specific audit tasks
├── data/ # Raw and processed data
├── models/ # CNN model architecture
├── config.py # Configuration settings
├── train.py # Training script
├── predict.py # Prediction script
├── evaluate.py # Evaluation script
└── README.md # You are here!
- Skin Detection: DeepGaze library for initial skin area detection
- Feature Extraction & Classification: Custom CNN model for skin tone classification
- Post-processing: Combining DeepGaze skin mask with CNN predictions for final output
Using EfficientNetB0 as the base model
- Two-phase training: It first trains the model with a frozen base, then fine-tunes the top layers with a lower learning rate.
- Separate callbacks for each phase: This allows for saving the best model from each training phase.
- Comprehensive plotting: The training history plot now shows both training phases, with a vertical line separating them.
- Informative output: The script prints information about data shapes, training phases, and final accuracies.
Training History
Confusion Matrix
We welcome contributions! Please read our Contributing Guide for details on our code of conduct and the process for submitting pull requests.
Check out our Improvement Plan for future enhancements!
Made with ❤️ by the Gravitas AI Team