1. The pen feels, it does not see
Sensors in the pen record how it moves, turns and presses, 100 times a second. Nothing records where the ink goes. The AI has to work out the letter from movement alone.
Draw a letter or pick a real one: see what the pen feels, what the AI does and what it answers. Every answer is a real result on people the AI never learned from.
Give the AI one character, one of two ways. The pen feels movement, not ink.
ADraw it draw every part, then press Recognize
BOr pick a real recording the dot says how the AI did
Input: your drawing, as you drew it.
A small drawing reader runs in this page. It looks at the shape you drew and gives a score to each of the 62 letters and digits. Below is the movement of your hand, worked out from the screen positions and their times.
A sensor pen measures 13 signals, including tilt and tip force. A screen gives only where and when, so these five are all your drawing has, and the pen AI cannot read them.
Draw a character or press Recognize.
Raw sensor counts; g and °/s use the conversions in
imu2text/filters.py (the gyroscope one is inferred).
Sensors in the pen record how it moves, turns and presses, 100 times a second. Nothing records where the ink goes. The AI has to work out the letter from movement alone.
It was shown about 20,000 letters with the right answer, and learned which movements go with which letter. Then it was tested on people it had never seen, which is the fair test for a new pen owner.
A small o and a capital O are the same movement at a different size, and the pen barely feels size. 43% of the AI's mistakes are exactly this. Ignoring small and capital, it reads 84.3% right.
Five copies of the AI were trained separately and vote together. Together they read 74.46% right; one alone reads 72.18% on average. When they disagree, it is a sign the writing is unusual.
The words that trip people up on this page, each as a short loop. The drawings are sketches, not recordings; every number written in them comes from a real run. The glossary below has the one-line meanings.
The deep learning behind this page, one idea per loop: what a neural network is, how a CNN and an LSTM read a pen signal, what attention adds, and how the hybrid used here puts them together. The drawings are sketches; the sizes and scores are this project's.
Hover or tap a bar for its source. Every score is letters read right on the same test.
The left-handed OnHW-chars_L set, 2,270 letters, with writers shared between training and test. Only good for comparing these four with each other.
Curves, calibration and mix-ups per algorithm appear here once each design is trained on the same test. That is an open task: it takes hours on a CPU.
bash scripts/run_algorithms.sh data/onhw-chars_2021-06-30The CNN-BiLSTM ×5 vote on all 7,956 test letters from new people. Hover or tap a point to read it. Method and papers: docs/uncertainty.md.
A small c and a capital C are the same movement, bigger. The pen measures speed and turning, not position, and capitals are also written faster, so the signals nearly match. 43.1% of the mistakes are this mix-up; ignoring small and capital, one CNN-BiLSTM reads 84.34% of letters from new people right instead of 72.46%.
Everyone has their own habits. For numbers and symbols, the same design reads 94.71% when it has seen the writer before and 71.03% for new people.
Most training letters come from right-handed people. For new left-handed people the 5-run vote reads 59.47%, against 74.46% for right-handed people.
In a word the model also has to find where each letter starts and ends. The word model here trained for only 15 rounds and reads 40.78% of words exactly.
A model tested on the same people it learned from can score near 99% and still fail on a new writer. Every score on this page is on people the model never saw, unless it says "familiar people".
These are open in this repo. Pick one, try it, and share what you find.
imu2text/seq2seq.pyimu2text/augment.pyimu2text/models.pyscripts/make_learning_curve.pyplayground/stages.jsEvery number is in docs/benchmarks.md with how it was measured.
| What | Written by | AI | Read right |
|---|---|---|---|
| Letters (52: small and capital) | new people | 5 models together | 74.46% |
| Letters | new left-handed people | 5 models, also learned from left-handed people | 59.47% |
| Numbers and symbols (15) | new people | one model | 71.03% |
| Numbers and symbols (15) | familiar people | one model | 94.71% |
| Words | new people | word reader with a word list | 40.78% of words exactly |
Each card is an open piece of work. Pick one, and the playground shows your result next.
A pen recording is a short time series: 13 numbers, 100 times a second. Each design below reads it differently. Scores are letters from people the model never saw, unless the row says otherwise; "not measured" means nobody has run it on this data in this project yet.
Slides small windows along the signal and spots short patterns, like a quick upstroke.
The design on this page. The CNN finds the strokes, the BiLSTM joins them in order, attention picks the moments that matter.
Reads the signal in time order and remembers what came before. A BiLSTM also reads it backwards.
Every moment looks at every other moment through attention; no reading order.
Several small models, the experts, plus a router that sends each recording to the experts that suit it.
A GRU is an LSTM with fewer parts. It learns the same kind of order.
Treats the 13 sensors as connected points and learns how they relate.
After the CNN, a plain layer looks at everything at once and forgets the order.
Learns to squeeze a recording and rebuild it, without any labels.
Learns to make new, realistic recordings.
A small quantum circuit does part of the work, for example the filter of a CNN, and a normal network does the rest.
An older stack of layers trained one at a time, from before CNNs and LSTMs took over.
* Left-handed OnHW-chars_L, 2,270 letters, a split that shares writers between training and test, so these four are only comparable with each other. The official-test figures are right-handed OnHW-chars, 52 classes, seed 0. Details in docs/benchmarks.md.
A larger BiLSTM (2 layers of 100) scored 99.2% on its own training letters and 70.4% on new people. It memorised. The smaller one with the same tricks did better on new people.
Training the same design 5 times and averaging lifts letters from new people from 72.18% (one run, on average) to 74.46%. A vote of different designs, say a CNN-BiLSTM and a Transformer, has not been tried.
A CNN in front of a Transformer, as speech models do. An autoencoder trained on
unlabelled recordings first, then taught letters. A router that sends each
recording to one of several small experts (build_moe is in the code,
not measured).
Short, plain meanings of the words on this page, in five groups. The coloured row in each group is the word to know first. More detail in docs/glossary.md.