r/computervision • u/GS_negi_5494 • 9d ago
Help: Project Help improving OCR accuracy in my free document reader app for blind users (Tesseract and ML Kit v2)
Hello friends,
My name is Genden Singh Negi. I am visually impaired, and I am building an Android app called Document Reader for the visually impaired community. The app is free, and I want to keep it free.
What already works: all the document formats read well, and text-based PDFs are read correctly.
Where I am stuck: scanned PDFs that need OCR. I cannot get the recognized text to come out accurately.
What I have tried:
- Tesseract: the recognized text comes out inaccurate.
- Google ML Kit Text Recognition v2: the results are much more accurate, but there are still some mistakes.
More about my situation:
- The app supports 109 languages in total. For the languages that ML Kit covers, I have not found any way to train a custom model or build my own dictionaries to improve accuracy. If there is a way, please tell me.
- I chose offline OCR models on purpose, so the app works without internet and costs nothing to run. But the offline results are inaccurate and I have not been able to fix that.
- I am not working right now, so I cannot spend money on this. The app has to stay free for my community.
My questions:
- How can I improve the accuracy of offline OCR with Tesseract or ML Kit v2? Would things like image preprocessing or configuration changes help? Is there a better offline model I should look at? What should I do to fix inaccurate recognized text?
- Can I integrate an online OCR service instead? Which online OCR services can be used completely free, with no cost to me?
- I have seen many apps that offer online OCR for free. How do they manage that? How do developers offer it without paying?
Any help would mean a lot to me and to the community I am building this for. Thank you so much.
1
u/GS_negi_5494 7d ago
Quick update and one more question.
I am using Google ML Kit v2 for OCR in my app. Image quality has improved and most results are good now.
A few errors still remain, but they are occasional, not on every page:
- sometimes a word goes missing, especially near a stamp, signature or border in documents that have them
- sometimes two words get joined into one, the space between them disappears
- long numbers like registration IDs sometimes get split with a random space in the middle
- single letters or matras get misread here and there (these are Hindi + English documents), and things like emails and URLs come out garbled
- sometimes a serial number ends up attached to the wrong row
- once in a while the end of a line gets dropped, or there is some garbled noise near a stamp
How can I fix these remaining occasional errors with ML Kit v2? Are there any settings, preprocessing steps or other tricks that help with these cases?
1
u/Candid-Fudge-4015 7d ago
Render each page image at 300 DPI or higher before recognition. The Tesseract docs say that's where it works best, and the pictures inside image-only PDFs are often lower. Grayscale plus straightening tilted pages helps any engine. For the open-source engine, the tessdata_best language files are the most accurate set, and I'd pass only the languages each file uses rather than a long list.
1
u/Special_Ebb_1933 7d ago
With Tesseract, most accuracy problems on scanned PDFs come from the page image, not the model. These changes are free and usually make a clear difference:
tessdata_bestmodels instead oftessdata_fast. They are slower but more accurate, and they are on the tesseract-ocr GitHub page.eng+hin. The wrong language model produces text that looks like recognition errors.--psm 1or--psm 3. Bad layout detection mixes lines from different columns.ML Kit does not let you train a model or add a dictionary, but it also does much better with a sharp, upright, full-resolution image. ML Kit v2 covers only Latin, Chinese, Devanagari, Japanese and Korean scripts, so a hybrid makes sense: ML Kit for those scripts and Tesseract with
tessdata_bestfor the others. PaddleOCR is another offline option with mobile models that is worth a test on your worst pages.Online services such as Google Cloud Vision have a free monthly quota, but they need a billing account, and a popular app can go over the quota. Apps that offer online OCR for free normally pay for it with ads or subscriptions. For an app that must stay free, offline OCR with good preprocessing is the safer design.