Skip to content

brandondeemo/docker_MNIST

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

Introduction

This project is constructed by two docker Containers: an Application Docker Container and a Database Docker Container. While the user submits ports in any browser, the Flask Router will link to the HTML5 file. In the HTML5 file, there is a canvas which user can use mouse to draw. The Router then saves the handwritten image and requests the prediction from the MNIST Keras model. After the result returns, the Router forwards the result to HTML5 and show it to user via browser and submits all two data to the Cassandra Database Container through the Docker Network Bridge.

The main job for this poject is to recognize the user's handwritten digit. User can draw the digit in the canvas and press "predict it" button to start to predict the image, and it will return the result on the right side of the page. User can also press "clear it" button to clear their drawing if he is not satisify with it. Each time, the prediction and date will be recorded in the Cassandra database.

DEMO

Background

The main job of the project is to take fully use of docker to deploy a user handwriting digit recognition program into container. The goal of the project is to learn the frontier technology such as container Cassandra, Hadoop, Spark.etc and take these technologies into practices.

This project is deployed by Docker and used Canssandra database to record the predictions of user's handwritten digit and datetime. It used two Docker containers, Cassandra database container and our Application container, and they are connected by the Docker Network Bridge, which allows the communication between them.

It used Keras with backend TensorFlow to construct the MNIST model so that it can classify the user's handwritten digit. This MNIST model gets to 99.33% test accuracy after 4 epochs. User can run mnist_train.py first to test the accuracy.

UI

Requirements

  • Python (3 or more)
  • Docker
  • Cassandra Database

Preparation

To run project properly, here are several preparetion that you need to follow.

1. construct the Docker Network Bridge so that these to containers can commnuicate with each other.

docker network create mnist_test

2. pull the Cassandra Database image from Docker Hub.

docker pull Cassandra

3. construct the Docker container for Cassandra image.

docker run –network mnist_test -p 9042:9042 cassandra:latest 

4. build the Application image from the Dockerfile.

docker build -t mnist:latest .

5. run the container .

docker run -p 5000:5000 mnist:latest 

6. submit the Ports (it should be 192.168.99.100:5000) to any web browser.

7. call cqlsh shell.

docker exec -it mnist_cassandra cqlsh 

8. view the data recorded in Cassandra database.

USE mnist_key;
select*from record_data;

Acknowledgement

Thanks a lot for supervisor Dr.Zhang Fan’s great leadership and patience.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published