Lab · Experiment 2 · Handwriting

Write one letter

Like the touchpad on a car's rotary controller: draw an uppercase letter with your finger, and a network with 22,298 parameters reads it. A classic recogniser that compares your letter with 1,560 stored examples reads it too, for about 1,300 times the arithmetic.

How it works

from your ink to a letter, and how the classic recogniser differs
your strokesfinger or mouse 32 pointsevenly spaced 16×16 gridink per cell network256 → 64 → 64 → 26 A … Z26 probabilities

From ink to input. Your strokes are joined in the order you wrote them, centred, scaled to a square (keeping their proportions, so an I stays thin) and resampled to 32 points evenly spaced along the ink. The points are drawn on a 16×16 grid: each of the 256 inputs is how much ink falls in one cell, from 0 to 1.

The network. 256 inputs → 64 → 64 ReLU units → 26 outputs, 22,298 parameters, written and trained from scratch. A softmax turns the outputs into a probability per letter, with a temperature fitted on writers kept aside so that “90%” means right about 90% of the time. The top three become the alternatives above the pad.

How it learned. From 1,560 letters by 30 writers of the UJI Pen Characters database, each shown again every epoch with a small random rotation, stretch, slant and jitter, for 60 epochs. It never saw the 20 writers it is tested on.

The classic recogniser, $P. It needs no training: it turns your letter into a cloud of 32 points and compares it with all 1,560 stored letters, matching points greedily and keeping the closest. That is about 57.7 million operations per letter; the network needs 44,288, whatever the number of stored examples.

Touchpad

Input
write A–Z here

Multistroke letters are fine: the letter is read 0.6 s after you lift your finger.

What each one read

The network loading…

    $P, the classic recogniser loading templates…

      Inside the network

      The real forward pass for your last letter. Left: the 16×16 grid the letter is drawn on, lit by the ink. Middle: two layers of 64 units. Right: the 26 letters, sized by probability. Only the connections that contribute most are drawn (positive, negative); into the letters, those into the chosen letter and the runner-up, to show why one beat the other. Drag to orbit.

      Measured, not demoed

      Loading the published results…