Try it yourself

Draw a digit and watch six neural networks read it

The networks guess from your first stroke and change their minds as the digit takes shape. Everything runs in your browser; nothing you draw is sent anywhere.

MNIST test digits
9,974 of 10,000 99.74%
Your digits
none yet

Loading…

The networks think it is

?

Waiting for the first stroke

What they see, 28 Ă— 28

How likely each digit is

Each network's vote

The networks read

?

Leave a small gap between digits. Each one is cut out, centred and read on its own.

Inside the first network

Each square is a pattern detector; brighter means it found its pattern there. Early layers pick out edges, later ones whole shapes, and the sparks follow the strongest signals to the answer.

The 26 test digits it gets wrong

Out of 10,000 test digits the networks had never seen, these are the ones they misread. Each shows the digit's label, what the networks read and how sure they were. Some are hard to call even for a person. Pick one to send it through the network above.

    How it works

    Six convolutional neural networks each look at your drawing and vote. They were trained in PyTorch on 60,000 handwritten digits from the MNIST collection, then run by code I wrote from scratch, first in plain Java and here in plain JavaScript, with no machine learning library on the page.

    Your drawing is cropped to the ink, shrunk to fit a 20 by 20 box and centred in a 28 by 28 image, the same way the training digits were prepared. Your own score is kept in this browser only.

    Back to projects Source on GitHub