Code Monkey home page Code Monkey logo

flutter-handwritten-digit-classifier's Introduction

Handwritten Digit Classifier

Overview

The Handwritten Digit Classifier is a cross-platform mobile application to capture and classify handwritten digits. The application leverages Google's mobile UI framework, Flutter, and is completely written in the Dart programming language. A few Dart packages are used to ease cross-platform resource management:

  • camera (BSD) - A Flutter plugin for iOS and Android allowing access to the device cameras.
  • tflite (MIT) - A Flutter plugin for accessing TensorFlow Lite API. Supports Classification and Object Detection on both iOS and Android.
  • path_provider (BSD) - A Flutter plugin for finding commonly used locations on the filesystem. Supports iOS and Android.
  • image (Apache 2.0) - A Dart library providing the ability to load, save and manipulate images in a variety of different file formats.

Author

David Rogers

License

See LICENSE file.

Usage

Example handwritten digit recognition

Step-by-step Instructions

  1. For best results, write a digit with black marker on a white piece of paper.
    • Black or blue pen may work as well, but will likely need to be traced multiple times
  2. Launch the "Handwritten Digit Classifier" application
    • Home Page
  3. Press the floating camera button to launch the camera
    • You may need to read and accept and camera permissions prompts
  4. With sufficient lighting, center the written digit from step 1 onto the screen so that it is centered and takes up roughly 80% of the preview window.
    • Note: The image may be blurry due to how close the camera is to the paper.
    • Example capture of a 0
  5. Capture the digit with the camera by pressing the blue circle button at the bottom of the application screen.
  6. Await the classification processing.
  7. View the top classification result on the screen for each image previously captured.
    • Example classification of a 0
  8. Repeat!

Available Feature Set

  • Maintains scrolling list of all images taken and the classification results.
    • The captured image is rescaled to the size inputted into the neural network and displayed on screen.
    • The classification results indicate the digit recognized and the confidence (a probability in the range [0, 1]) of the recognition.
  • Allows user to easily capture unique input via the device camera.
  • Leverages artificial intelligence (AI) through the use of a neural network model built in TensorFlow in order to classify input images.
  • The neural network model is trained on a variant of the MNIST handwriten digit database in order to improve ease of deployment and real-world accuracy within a mobile device. See my notebook for more details.
    • Pixel values are normalized from [0, 255] to [0, 1]
    • Gaussian noise N(0.3, 0.1) is added to background pixels and thresholded to [0, 1]
    • Colors are inverted for black writing on white background

Developer

Requirements

  • Minimum Android SDK version of 21, target of 28 for best results.

Build and Run Commands

  • flutter build apk - To build and Android APK file.
  • flutter build ios - To build an iOS application bundle (Mac OS X only).
  • flutter run - To run on an attached device.

flutter-handwritten-digit-classifier's People

Contributors

doclrogers avatar

Watchers

 avatar

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.