r/OCR_Tech • u/Particular_Leg_3173 • Mar 21 '26
OCR on Chemical compound structures

I'm working on extracting the chemical formula for such compounds. I've tried DECIMER, OSRA and a few more, nothing has worked. Has anyone worked on a similar problem? Or if anyone has worked on finetuning OCR models, please let me know how I can train a model to do this, and which would be the best to train.
7
Upvotes
1
u/hashiromer Mar 21 '26
Try MinerU. It is specialized for this task.
https://mineru.net/
1
u/Foodforbrain101 Mar 21 '26 edited Mar 21 '26
Are you sure image quality isn't the issue? Maybe try to increase the contrast to eliminate the small black dots around the structure? Might be worth investigating at small scale first then trying the tools you already tried, maybe find some other reference images that you know work well with the tools to find how "clean" the images have to be to make this work.
Update: I tested it out on my phone, maxed out contrast, increased resolution and uploaded it to decimer.ai, it worked. So I suggest investigating an intermediary step for doing exactly those two things before using DECIMER!
1
u/yraTech Mar 22 '26
I think the search term you are looking for is "Optical Chemical Structure Recognition (OCSR)."
1
u/Brilliant_Rich3746 Jul 24 '26
This looks like exactly the case DECIMER/OSRA struggle with: noisy real-world patent-style images rather than clean synthetic depictions. Patsnap just open-sourced Hiro-OCSR for this: https://github.com/patsnap/Hiro-OCSR
One heads up: it outputs SMILES, not a formula string directly, but converting SMILES → formula with subscripts is a one-liner in RDKit (`Chem.rdMolDescriptors.CalcMolFormula`). Post the image if you want and I can run it through and share the SMILES so you can see if it actually works for your case.
0
u/Correct-Aspect-2624 Mar 21 '26
In which form do you need to extract that formula? Text with special symbols?
You can try recognition ocr - https://recocr.com/
here you define custom schema with instructions what exactly and how do you want to extract - https://recocr.com/dashboard/extraction?schemaId=empty_schema
If there are special characters you can add them to allowed values