Skip to content

veerpandya/Kuzushiji-MNIST-Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kuzushiji MNIST Classifier

Live Application Site

Kuzushiji MNIST Classifier

Live Deployment

Overview

Kuzushiji MNIST Classifier is a web based deployment of a deep learning convolutional neural network trained using the KMNIST Dataset. KMNIST is similar to the popular MNIST Dataset except it contains images of handwritten Japanese Hiragana characters. I am using the Kuzushiji-49 dataset which contains 270,912 images spanning 49 classes. This project contains both the development notebook detailing the creation of the CNN model, and the source code for the Flask based web app.

CNN Model Outcome

The model I created achieved a final balanced accuracy of about 91.3% over all of the classes. I saved this model and am using it to create class predictions from a given input file in the web app.

Web Application Process

The app uses the JavaScript Canvas API to capture mouse or touch input from a web browser and then streams the image data back to the Flask backend where it is resized and processed into a numpy array for consumption into the Tensorflow Keras predict method of the model. The method returns an array of prediction scores, of which the greatest score is selected and matched with the character map to obtain the associated Hiragana character.

Docker Deployment

For deployment, I created a Dockerfile to build the image and a docker-compose file to create the container. The app is launched using Gunicorn and network connections are routed through the Traefik reverse proxy alongside the other services I have running on my personal server.

Local Testing Deployment

If you would like to deploy this app locally, follow the following steps to set up your environment and launch the Flask development server:

To launch this app on your local environment, clone this repository and change directory to the app folder:

git clone https://github.com/Kou-kun42/Kuzushiji-MNIST-Classifier.git && cd Kuzushiji-MNIST-Classifier/app

Assuming you have Python3 and pip installed, set up a python virtual environment using:

python3 -m venv env

and then activate it:

source env/bin/activate

Next, install all the required packages:

pip3 install -r requirements.txt

Finally, launch the app and navigate to the localhost endpoint on your browser:

python3 main.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published