r/MLQuestions • u/GS_negi_5494 • 6d ago
Computer Vision 🖼️ 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 6d ago
Can I use OpenCV together with ML Kit v2 to improve OCR accuracy in my document reader app? If so, how should I use them together?
1
u/owen800q 6d ago
migrate to use LLM to do the OCR
1
u/Leodip 6d ago
Sadly, OCR is still a challenge.
One approach that you could try is guessing the font (which is more accurate) and trying to replicate the text in the image applying all the necessary distortions, but finding these distortions is not going to be trivial, and it would totally fail when using a font not in your database. You'd have to do this either character by character or word-by-word to use a locally-linear distortion. I can see this approach getting very expensive, since you basically have to brute-force the text though, but you can use your Tesseract output to have a starting guess.
Otherwise, look into SLMs that can be run locally to correct your OCR readings. It's not going to be as light as traditional OCR, but hard problems often required hard solutions. The main issue with this would be that numbers are really susceptible to misreads, and an SLM does not really have any way of knowing whether the sentence would make more sense with an 8, a 6, or a 3 (e.g., if you are reading blood analyses or something like that).