Skip to content

About

Handwritten digit recognition app built with Java, JavaFX, and TensorFlow

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Number Recognizer

A real-time handwritten digit recognition desktop application built with Java and JavaFX, powered by a TensorFlow-trained CNN model.

Demo

Draw any digit (0–9) on the canvas, click Recognize, and get an instant prediction with confidence score.

Tech Stack

  • Java / JavaFX — GUI and drawing canvas
  • TensorFlow + Python — CNN model training on MNIST dataset
  • ONNX Runtime — Model inference in Java
  • Maven — Dependency management

How to Run

Prerequisites

Steps

  1. Clone the repository
  2. Navigate to the project folder:
   cd NumberRecognizer
  1. Run the application:
   mvn javafx:run

Model & Deployment

A CNN trained on MNIST (99.34% test accuracy), served in Java:

Training (Python) → ONNX export → Inference (Java, ONNX Runtime)

The TensorFlow SavedModel couldn't run in Java on Apple Silicon due to native library incompatibility, so the model is exported to ONNX — decoupling the training stack from the serving stack.

Canvas input is preprocessed before inference: bounding-box detection → centering → 28×28 grayscale, matching MNIST's input format.

Project Structure

  • Main.java — Application entry point
  • MainController.java — UI logic and mouse drawing
  • Predictor.java — Model inference and image preprocessing
  • ModelLoader.java — Model loading from resources

About

Handwritten digit recognition app built with Java, JavaFX, and TensorFlow

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages