The presented project is a demo of machine learning models usage which is implemented with the most popular frameworks like Tensorflow and PyTorch.
The project contains two type of models:
- A classifier that is used to classify drawings.
- An image generator to generate images from label.
I use Quick Draw Dataset.
Quick Draw Dataset is a collection of 50 million drawings across 345 categories, contributed by players of the game Quick, Draw!.
Classification is the process of predicting the class of given data points. Classes are sometimes called as targets/ labels or categories. Classification predictive modeling is the task of approximating a mapping function from input variables to discrete output variables.
The classifier is a model implemented by the PyTorch framework. It is used to classify images either created by a user or those generated by the GAN generator.
Model Architecture:
Model quality:
DCGAN - Deep Convolutional Generative Adversarial Network. Generative Adversarial Networks (GANs) are one of the most interesting ideas in computer science today. Two models are trained simultaneously by an adversarial process. A generator ("the artist") learns to create images that look real, while a discriminator ("the art critic") learns to tell real images apart from fakes.
The solution uses a generator implemented by Tensorflow framework in order to generate images of required classes.
GAN-apple train process:
Model Architecture:
We can compose these two models and use the GAN model results as input to improve classifier accuracy.
Look at how this process works on the UI. Open in Web
Python model train jobs:
draw_classifier_train_job.py
- PyTorch classifierdraw_gan_train_job.py
- Tensorflow GAN
Notebooks:
notebooks/draw-classification.ipynb
notebooks/draw-GAN.ipynb
Models:
service/models/<label>-gan.h5
- Tensorflow GANsservice/models/model.nnet
- PyTorch classifier
Run build script service/buid.sh
- build docker image with service.
Run deploy script service/deploy.sh
- deploy service to your Heroku application.