Fine-tuning DeepSeek-OCR-2 for Molecular Structure Recognition
Organizations: School of Pharmacy, University of Pittsburgh, Pittsburgh, PA, USA · Computational Chemical Genomics Screening Center, University of Pittsburgh, Pittsburgh, PA, USA · Khoury College of Computer Science, Northeastern University, Boston, MA, USA · Department of Computer Science, Princeton University, Princeton, NJ, USA
Abstract
Optical Chemical Structure Recognition (OCSR) is critical for converting 2D molecular diagrams from printed literature into machine-readable formats. While Vision-Language Models have shown promise in end-to-end OCR tasks, their direct application to OCSR remains challenging, and direct full-parameter supervised fine-tuning often fails. In this work, we adapt DeepSeek-OCR-2 for molecular optical recognition by formulating the task as image-conditioned SMILES generation. To overcome training instabilities, we propose a two-stage progressive supervised fine-tuning strategy: starting with parameter-efficient LoRA and transitioning to selective full-parameter fine-tuning with split learning rates. We train our model on a large-scale corpus combining synthetic renderings from PubChem and realistic patent images from USPTO-MOL to improve coverage and robustness. Our fine-tuned model, MolSeek-OCR, demonstrates competitive capabilities, achieving exact matching accuracies comparable to the best-performing image-to-sequence model. However, it remains inferior to state-of-the-art image-to-graph modelS. Furthermore, we explore reinforcement-style post-training and data-curation-based refinement, finding that they fail to improve the strict sequence-level fidelity required for exact SMILES matching.
Figures & tables
| Dataset | Source | No. of Images | % of chiral |
| Indigo | synthetic | 5,719 | 20.2% |
| ChemDraw | synthetic | 5,719 | 20.2% |
| CLEF | patent (US) | 992 | 32.7% |
| JPO | patent (Japanese) | 450 | 0% |
| UOB | catalog | 5,740 | 0% |
| USPTO | patent (US) | 5,719 | 20.2% |
| Synthetic | Realistic | Perturbed | ||||||||||
| Models | Method | Indigo | ChemDraw | CLEF | UOB | USPTO | Staker | ACS | CLEF p | UOB p | USPTO p | Staker p |
| Rule-based | MolVec | 95.4 | 87.9 | 82.8 | 80.6 | 88.4 | 0.8 | 47.4 | 43.7 | 74.5 | 29.7 | 5.0 |
| OSRA | 95.0 | 87.3 | 84.6 | 78.5 | 87.4 | 0.0 | 55.3 | 11.5 | 68.3 | 4.0 | 4.6 | |
| Image to Sequence | Img2Mol | 58.9 | 46.4 | 18.3 | 68.7 | 26.3 | 17.0 | 23.0 | 21.1 | 74.9 | 29.7 | 51.7 |
| DECIMER | 69.6 | 86.1 | 62.7 | 88.2 | 41.1 | 40.8 | 46.5 | 70.6 | 87.3 | 46.4 | 47.9 | |
| SwinOCSR | 74.0 | 79.6 | 30.0 | 44.9 | 27.9 | – | 27.5 | 32.2 | – | – | – | |