For many years, the MNIST dataset has been the introductory data for all computer vision enthusiasts.
I built a production implementation of a Convolutional Neural Net MNIST classifier. The final website, with a full AI, can be found here if you want to play around:
http://mnist-classifer-alb-1431583388.us-east-1.elb.amazonaws.com/
(The site doesn’t work well on mobile, so I’d recommend viewing it on a desktop).
Here is the Github Repo.
Note: I didn’t hyperparameter tune as much as I could’ve. The online prediction performance is not great. Next steps are to improve the model performance.
Here are a few screenshots:


Technologies Used:
- Python
- Keras
- Flask
- Unittest Framework
- AWS Container Registry / AWS Container Service
- Javascript / HTML
Acknowledgments:
Most of the Javascript code on the front end was found here. I did some minor refactoring and replaced the hard-coded prediction implementation with an API call.
Neural Network
This is a pretty boilerplate CNN built with Keras.
Architecture
The hidden layers are the following:
- Convolution Layer
- Filters: 25
- Kernel Size: (3,3)
- Activation Function: Relu
- Max Pooling
- Pool Size: (2,2)
- Pool Size: (2,2)
- Fully Connected
- Num Units: 240
- Activation Function: Relu
- Output Layer
Training Parameters
- Optimization Algorithm was Adam, a variation of SGB
- Loss Function was categorical cross entropy
- Batch Size: 300
- Epochs: 7
Site Hosting
Nothing too fancy here. I am running a Flask app inside of a Docker Container. That app has the website front end (the home page of the site) and a /predict endpoint where we run the actual predictions.
For hosting, I used AWS for everything here – Elastic Container Registry to store my Docker Images, Elastic Container Service to run the containers, and an Application Load Balancer as my gateway.
