ChemicalOCR is a compact vision-language model fine-tuned specifically for optical character recognition (OCR) in chemical structure images. It extracts text and bounding boxes from molecular drawings, enabling the recognition of atom labels, abbreviations, and descriptive text within chemical structures.
ChemicalOCR is fine-tuned from SmolDocling, a lightweight 256M-parameter model originally developed for end-to-end document conversion. By specializing for chemical images, ChemicalOCR substantially outperforms general-purpose OCR systems on chemical structure recognition tasks.
ChemicalOCR substantially outperforms existing OCR models on chemical structure benchmarks:
| Benchmark | ChemicalOCR (Ours) | PaddleOCR v5 | EasyOCR |
|---|---|---|---|
| M2S (103 images) — F1@IoU₀.₅ | 87.2 | 7.7 | 10.2 |
| USPTO-M (74 images) — F1@IoU₀.₅ | 93.0 | 1.2 | 18.0 |
| IP5-M (1000 images) — F1@IoU₀.₅ | 86.5 | 1.9 | 18.4 |
| Benchmark | Precision | Recall | F1 | Accuracy@IoU₀.₅ |
|---|---|---|---|---|
| M2S | 86.9 | 87.4 | 87.2 | 32.0 |
| USPTO-M | 93.5 | 92.6 | 93.0 | 63.5 |
| IP5-M | 85.6 | 87.4 | 86.5 | 69.5 |
from transformers import AutoProcessor, AutoModelForVision2Seq
from PIL import Image
model = AutoModelForVision2Seq.from_pretrained("docling-project/ChemicalOCR")
processor = AutoProcessor.from_pretrained("docling-project/ChemicalOCR")
image = Image.open("chemical_structure.png")
inputs = processor(images=image, return_tensors="pt")
outputs = model.generate(**inputs)
result = processor.decode(outputs[0], skip_special_tokens=True)
ChemicalOCR is a key component of MarkushGrapher-2, an end-to-end model for multimodal recognition of chemical structures from patent documents. In the MarkushGrapher-2 pipeline, ChemicalOCR provides the text and layout information that is fused with visual features for Markush structure recognition.
@inproceedings{strohmeyer2026markushgrapher2,
title = {MarkushGrapher-2: End-to-end Multimodal Recognition of Chemical Structures},
author = {Strohmeyer, Tim and Morin, Lucas and Meijer, Gerhard Ingmar and Weber, Valery and Nassar, Ahmed and Staar, Peter W. J.},
booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
year = {2026}
}
This model is released under the Apache 2.0 License.
optimizer.pt 1.0 GBmodel.safetensors 513 MBrng_state_1.pth 15.1 kBrng_state_2.pth 15.1 kBrng_state_3.pth 15.1 kBrng_state_0.pth 15 kBtraining_args.bin 5.5 kBscheduler.pt 1.1 kB