Overview
- Accuracy — 98.9% on the MNIST test set
- Architecture — 2 conv layers, max pooling, dense classifier
- Preprocessing — Bounding-box crop and centering to match MNIST format
Machine Learning
Draw a digit with your mouse or finger. The model uses the same MNIST preprocessing pipeline as the Python version: crop, resize, and center the drawing in a 28×28 grid.
Loading model…
Trained on 60,000 MNIST images with pixel values normalized to 0–1. The model learns spatial features through convolution and pooling layers before a dense classification head.
The Python version uses OpenCV for a desktop drawing window. For the portfolio demo, the same preprocessing logic runs in JavaScript on an HTML canvas.
The Keras model is exported to TensorFlow.js so visitors can draw digits and get predictions directly on GitHub Pages without a backend.
TensorFlow/Keras for training and evaluation, OpenCV for drawing and image preprocessing
TensorFlow.js, HTML Canvas, and vanilla JavaScript for in-browser inference
Conv2D → MaxPool → Conv2D → MaxPool → Flatten → Dense(64) → Dense(10)