Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Tesseract can be very accurate (>99%), especially when you train it for your particular data set.

This does involve creating your own labeled data.

I got this 99% accuracy by performing incremental training using latest Manheim model as a base. I added about 20k lines which is not really that much. https://github.com/tesseract-ocr/tesseract/wiki

The hard part was crowd sourcing those 20k lines :)

Tesseract might not be best for photos as you said but I did not have major problems.

Of course some documents the source is so bad that a human can't achieve 99%.

Tesseract used to be quite average before they moved onto LTSM models a few years ago.



Care to share resources/lessons learned for training tesseract with custom data? I'm using it for a side project and would love to hear about your insights.


I followed the resources here: https://github.com/tesseract-ocr/tessdoc/blob/master/Trainin...

Also this: https://github.com/UB-Mannheim/tesseract/wiki

The original data was here: https://github.com/tesseract-ocr/langdata_lstm

I did use another data source from Manheim but can't locate it right now.

Using vanilla Ubuntu 18.04

I looked at the example training files and made a small script to convert my own labeled data to fit the format that tesseract requires.

I did do a bit of pre-processing adjusting contrast.

All the data munging was done on Python (Pillow for image processing, Flask for collecting data into a simple SQLite DB before converting back to format that Tesseract requires).

Python was not necessary just something that felt most comfortable to me. I am sure someone could do it using bash scripts or node.js or anything else.

EDIT: To make life easier for my curators I did run Tesseract first to generate prelabeled data for my training set. It was about 90% accurate to start with.

So the process was: Tesseract OCR on some documents to be trained -> hand curation (2 months)-> train (took about 12 hours) -> 99% (on completely separate test set)


If you don't mind disclosing, what was your particular use-case (the labeled dataset you trained on)?


It was for digitizing 19th century books written in a font and language not supported in a vanilla Tesseract.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: