Seven models I trained: what each does, how, and what it scored. Failures included.
Text recogniser
Not shipped
Characters wrong on a font never seen (lower is better)
Mine1.2 %
docTR3.5 %
tesseract11.9 %
From image columns to text with CTCThe trained recogniser reads one damaged line: one guess per column, repeated letters joined, blanks dropped.1. The image of a line, as the network gets it2. One guess per column (shade is the confidence, a dot is a blank)·R··I··Z··␣␣·BB·AA·S··MM·AA·TT·II·␣␣·11·KK··G··␣··␣··␣·␣␣·␣␣·␣␣·␣␣·␣␣·␣␣·␣␣·␣␣·␣␣·␣␣··8··,··6··4···3. Repeats are joined, blanks dropped: the textRIZ␣BASMATI␣1KG␣␣␣␣␣␣␣␣␣␣␣␣␣8,64✓ the same as what was printed
Task
Reads the image of one printed line. Built from scratch.
Network
CNN, BiLSTM, CTC, 1.29 million parameters
Training data
52,257 generated lines, two fonts
Loss
CTC
Optimiser
AdamW, one learning-rate cycle
Machine
Kaggle GPU, 20 min
Problem found
Trained on one font it scored 0.19 % on it and 22.6 % on another: it had memorised the font. More fonts fixed it.
It can be sure and wrong, so the app treats its answer as a suggestion only.
Right category, unseen products (higher is better)
Mine79.6 %
TF-IDF81.3 %
Both averaged82.2 %
Product classifier networkFive convolution widths read the abbreviation; two outputs share the same body.hidden wordscategory384max + meanconvolutions 2 to 6embedding 6440 characters
Product classifier networkFive convolution widths read the abbreviation; two outputs share the same body.two outputs384max + meanconv 2 to 6embedding 6440 characters
Task
Guesses the category of an abbreviated product name.
Network
character CNN, 1.57 million parameters
Training data
61,197 abbreviations made from Open Food Facts names
Loss
category, plus the words hidden behind the abbreviation