This project implements a machine learning model to classify hand-drawn sketches using the Quick, Draw! dataset. It includes data preprocessing, model training, evaluation, and a GUI application for testing the model.
quickdraw_project/
│
├── quickdraw_data/ # Raw .ndjson files from Quick, Draw! dataset
├── datasets/ # Processed datasets
├── models/ # Saved models and visualizations
├── scripts/
│ ├── preprocess_data.py # Data preprocessing
│ ├── train_model.py # Model training
│ ├── evaluate_model.py # Model evaluation
│ └── gui_app.py # GUI application
├── requirements.txt # Dependencies
└── README.md # This file
-
Create a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Download Quick, Draw! dataset files (.ndjson format) and place them in the
quickdraw_data
folder.
-
Preprocess the data:
python3 scripts/preprocess_data.py
-
Train the model:
python3 scripts/train_model.py
-
Evaluate the model:
python3 scripts/evaluate_model.py
-
Run the GUI application:
python3 scripts/gui_app.py
The model uses a CNN architecture with:
- Multiple convolutional layers with batch normalization
- Max pooling layers
- Dropout for regularization
- Dense layers for classification
The model's performance metrics and visualizations will be saved in the models
directory after evaluation:
- confusion_matrix.png: Visualization of model predictions
- prediction_samples.png: Sample predictions on validation data
- training_history.png: Training and validation metrics over time
The GUI application provides a simple interface to:
- Draw sketches
- Get real-time predictions
- Clear the canvas
- View prediction confidence
- TensorFlow
- OpenCV
- NumPy
- PyQt5
- scikit-learn
- matplotlib
- tqdm
The data used in this project is sourced from the Quick, Draw! dataset.