This is a Convolutional Neural Network classification implementation for Google's "Quick, Draw!" dataset. The instructions outlined here are primarily for OSX systems (even runs on an M1), but could be ported reasonably easy to other unix* operating systems.
This repository contains the code for training, evaluating, and using a CNN to classify drawings from the QuickDraw dataset. The outline for this repository is given below:
This implementation follows the suggestion by Chandra Kanth and reflects a standard approach to image classification tasks. The CNN is as follows:
- A convolutional layer of size 5x5
- Max pooling of size 2x2
- Hidden convolutional layer of size 2x2
- Hidden max pooling of size 2x2
- Dropout layer with probability of 20%
- Flatten layer
- Fully-connected layer with 128 units and ReLu activation
- Fully-connected layer with 50 units and ReLu activation
- Output layer (classification)
Downloads the data using gsutil
. You can specify the name of individual files instead of a wildcard, if you are not interested in training all 345
categories.
brew install --cask google-cloud-sdk
cd data
gsutil -m cp 'gs://quickdraw_dataset/full/numpy_bitmap/*.npy' .
Creates a virtual environment and installs the necessary dependencies, proceeds to train the CNN. Make sure you have sufficient amount of memory at your disposal, otherwise this script will likely be killed by your OS.
python3 -m venv venv && source venv/bin/activate
(if you usepyenv
orpoetry
, you know what to do here)pip install -r requirements.txt
python3 cnn/train_cnn.py
(run--help
if you want to see available parameters)
Since most users have restricted access to computing power
Once the classifier is trained you can run the evaluation script.