DigitVision

AI handwritten digit classifier, by Vikranth Reddy

Try the live model

Draw a digit (0–9) in the box. A real softmax (multinomial logistic regression) model, trained in Python on 1,797 digit images, exported as weights, running 100% in your browser, predicts what you drew.

Draw a digit, then hit Classify.
The 8×8 image above is what the model actually sees.
Or load a real sample digit from the training set:

How it works

1. Data
1,797 handwritten 8×8 grayscale digit images (0–9), pixel values scaled to 0–1.
2. Model
Softmax regression (multinomial logistic regression, scikit-learn). It learns one 64-pixel weight map per digit plus a bias. The weights literally look like the digits. 5-fold CV accuracy: 97.0%.
3. Browser
weights.json (10 weight vectors + 10 biases + sample digits) is shipped to the site; JavaScript downsamples your drawing to 8×8 and re-runs the exact same softmax math as sklearn's predict_proba.
4. Explainable
The prediction is just a weighted vote of pixels: no black box. Draw messily and watch the probability spread.

Tech stack

Python · scikit-learn · NumPy · vanilla JavaScript (canvas) · static hosting (Vercel)

Files in this repo

train.py: trains the model and exports weights.json · index.html: this demo · vercel.json: security headers