Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Document AI fails for one particular image, else works great

We are delivering a platform to a customer based on Document AI. The use case it to send a lottery ticket via API and return the structure information using Document AI. We tried for several hundred images and the Document AI OCR worked great (95%+ times captured right string, only errors were line feeds and Q turning into O etc. that we could resolve using a post-processor). But for one set of images (from DC), the OCR fails miserably.  This is a corner case that seems to throw the Document AI engine off the mark.I will appreciate greatly if anyone can help explain it.

See one particular image which is the most problematic.

20220501_151137_resized_1_auto_x2.jpg

0 7 603
7 REPLIES 7

Could you please share the output that you are receiving, and what errors are the ones that you are presenting?

Hi Eduardo,

The error is that several characters that are on the image are not captured by OCR (whereas it does capture in case of several other images).

Refer to the screenshot attached. See the right side after line "DCLOTTERY.COM".  You will notice lines "8", "B. 4" etc.

Line "8", the rest of the characters 0 1 1 4 STRAIGHT ... are missing.

Line "4 0", characters 2 8 4 STRAIGHT ... are missing.

Same for following 3 lines.

----Missing-Numbers-in-OCR-Text.png

I could find this guide that might seem helpful for your case, if not, please give me more time so I can provide you a proper answer for the issue you are facing.

Sorry, you missed the entire point, the issue is that the core OCR engine is failing to process the image properly. If the product team takes a look at the image and result, it may give a clue. Hopefully they may be able to find a corner case that will improve the OCR results.

We are quite familiar with the documents and how to parse the result of the DOcument AI.  

Hi Anil, sorry it took me so long to answer you, couldn't find any information on why the OCR is failing for that image that you specify, so my best recommendation for you, is that you file an issue tracker or open a support ticket since this seems like an issue that you are only facing.

What DocAI processor are you using?  What, if anything, is returned from the processing?

Deskewing the image in a pre processing step is doing the trick