Giter Club home page Giter Club logo

mnist-browser's Introduction

Digit Recognition using Tensorflow and Tensorflow.js

The model is trained with Tensorflow using Python and then saved as using simple_save. The saved model is then converted to a web format using tensorflowjs_converter.

Using tensorflowjs_converter the saved and converted model is loaded in JS and then used to recognize digits drawn in an image canvas. Images are preprocessed in the same way as was done for the images in the MNIST dataset:

  1. crop image from white background
  2. center in square canvas respecting aspect ratio
  3. resize to 20x20
  4. place on 28x28 canvas respecting center of mass

Model

The model used consists of one input layer and one output layer which are fully connected: A*x + b

Todo

  • display prediction scores for all digits
  • add link to show example digits from mnist dataset
  • add more models with more layers and option to switch model in the ui

Convert Saved Model to Web Format

tensorflowjs_converter --input_format=tf_saved_model --output_node_names=y --saved_model_tags=serve ./saved ./saved_web

Other examples of Digit Recognition in the Browser using models trained with MNIST

mnist-browser's People

Contributors

philippstucki avatar

Watchers

 avatar James Cloos avatar

Forkers

neojiangtw

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.