JOSH/K Digit classifier

Write one digit in the box.

A small convolutional network, trained on 60,000 handwritten digits, reads it while you write. You can see what each layer picked up. Nothing leaves this page.

Test accuracy–
Learned weights–
Time to read–

Write here

Write a digit from 0 to 9

C clears, Ctrl+Z undoes the last stroke.

Office use only

Machine read
Read as
?
Nothing written yet.
Write big and centered. It reads as you go.

Probability for each digit

What the network saw

Your writing moves left to right. Dark pixels are where a learned filter fired.

Input

28 × 28, cleaned up

Layer 1

8 filters: edges and stroke ends

Layer 2

16 filters: curves and corners

Dense layer

64 neurons weigh the evidence

1

Clean up

Your writing is cropped, shrunk into a 20 × 20 box and centered by its center of mass inside 28 × 28. That's how the MNIST training digits were prepared, so yours looks like theirs.

2

Find strokes

Eight 5 × 5 filters slide across the image. Each learned on its own to fire for one pattern, like a vertical edge, a diagonal or the end of a stroke.

3

Combine shapes

Sixteen 3 × 3 filters build those strokes into loops, corners and curves. Max-pooling halves the size after each layer, so a digit drawn a little off-center still reads.

4

Vote

64 dense neurons turn the shapes into evidence, and softmax turns the evidence into ten probabilities that add up to 100%. The biggest one is the answer.