It's a very interesting idea, but the potential for hallucinations reminds me of JBIG2, a compression format which would sometimes substitute digits in faxed documents: https://en.wikipedia.org/wiki/JBIG2#Character_substitution_e... > In 2013, various substitutions (including replacing "6" with "8") were reported to happen on many Xerox Workcentre photocopier and printer machines. Numbers printed on scanned (but not…
Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
11–20 of 178 posts
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#12Have you tried using other OCR packages? I had to give up on Tesseract after every mode and model I tried read a quite plain image of "77" as "7" (and interestingly the javascript port reads it as "11"). Pic related: https://i.postimg.cc/W3QkkhCK/speed-roi-thresh.png
You know, I’ve really looked hard at what’s out there and haven’t been able to find anything else that’s totally free/open, that runs well on CPU, and which has better quality output than Tesseract. I found a couple Chinese projects but had trouble getting them to work and the documentation wasn’t great. If you have any leads on others to try I’d love to hear about them. One of the benefits of this project is that it…
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#13I'm curious if a multimodal model would be better at the OCR step than tesseract? Probably would increase the cost but I wonder if that would be offset by needing less post processing.
[edit] But it is not applicable to OCR specialised models like Florence-2
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#14Very cool! I have a hotkey to grab a region and pipe a screenshot through tesseract and then pipe that into my clipboard. I'll have to add on to it to pipe it though Ollama too :)
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#15It's a very interesting idea, but the potential for hallucinations reminds me of JBIG2, a compression format which would sometimes substitute digits in faxed documents: https://en.wikipedia.org/wiki/JBIG2#Character_substitution_e... > In 2013, various substitutions (including replacing "6" with "8") were reported to happen on many Xerox Workcentre photocopier and printer machines. Numbers printed on scanned (but not…
An OCR will always mix up characters so I don’t really see the issue here?
Let's say the text is "The laptop costs $1,000 (one thousand dollars)." but the image is blurry.
Normal compression will give you an image where "$1,000" is blurry. JBIG2 can give you an image where "$1,000" has been replaced by a perfectly-clear "$7,000."
Normal OCR will give you some nonsense like "The laptop costs $7,000 (one 1housand dollars)". The LLM can "fix this up" to something more plausible like "The laptop costs $2,000 (two thousand dollars)."
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#16what are examples of local LLMs that accept images, that are mentioned in the README?
https://huggingface.co/xtuner/llava-llama-3-8b-v1_1-gguf
But I see that this new one just came out using Llama 3.1 8B:
https://huggingface.co/aimagelab/LLaVA_MORE-llama_3_1-8B-fin...
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#17what are examples of local LLMs that accept images, that are mentioned in the README?
Although LLaVA specifically it might not be great for OCR; IIRC it scales all input images to 336 x 336 - meaning it'll only spot details that are visible at that scale.
You can also search on HuggingFace for the tag "image-text-to-text" https://huggingface.co/models?pipeline_tag=image-text-to-tex... and find a variety of other models.
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#18I'm curious if a multimodal model would be better at the OCR step than tesseract? Probably would increase the cost but I wonder if that would be offset by needing less post processing.
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#19Tessy and LLM is a good pipe, it's likely what produced SCHNELL and will soon be the reverse of this configuration, used for testing and checking while the LLM does the bulk of transcription via vision modality adaption. The fun part of that is that multi lingual models will be able to read and translate, opening up new work for scholars searching through digitized works. Already I have had success in this area with no development at all, after we get our next SOTA vision models I am expecting a massive jump in quality. I expect english vision model adapters to show up using LLAVA architecture first, this may put some other latin script languages into the readable category depending on the adapted model, but we could see a leapfrog of scripts becoming readable all at once. LLAVA-PHI3 already seems to be able to transcribe tiny pieces of hebrew with relative consistency. It also has horrible hallucinations, so there is very much an unknown limiting factor here currently. I was planning some segmentation experiments but schnell knocked that out of my hands like a bar of soap in a prison shower, I will be waiting for a distilled captioning sota to come before I re-evaluate this area.
Exciting times!
Re: Show HN: LLM-aided OCR – Correcting Tesseract OCR errors with LLMs
#20I'm curious if a multimodal model would be better at the OCR step than tesseract? Probably would increase the cost but I wonder if that would be offset by needing less post processing.