docling-project / MarkushGrapher-2

huggingface.co
Total runs: 163
24-hour runs: -4
7-day runs: 0
30-day runs: -8
Model's Last Updated: March 23 2026
image-to-text

Introduction of MarkushGrapher-2

Model Details of MarkushGrapher-2

MarkushGrapher-2 Banner

MarkushGrapher-2 is an end-to-end multimodal model for recognizing chemical structures from patent document images. It jointly encodes vision, text, and layout information to convert Markush structure images into machine-readable CXSMILES representations.

Overview

MarkushGrapher-2 is a transformer-based model that integrates two complementary encoders:

  • A Vision Encoder (Swin-B ViT), pretrained for Optical Chemical Structure Recognition (OCSR) (taken from Model: MolScribe*)
  • A Vision-Text-Layout (VTL) Encoder (T5-base), trained for Markush feature extraction

The model also includes ChemicalOCR , a dedicated OCR module fine-tuned for chemical images, enabling fully end-to-end processing without external OCR dependencies.

*MolScribe: https://github.com/thomas0809/MolScribe

Architecture

The input image is processed through two parallel pipelines:

  1. Vision pipeline : The image is encoded by the OCSR vision encoder and projected via an MLP.
  2. VTL pipeline : The image is passed through ChemicalOCR to extract text and bounding boxes, which are then fused with image patches in the VTL encoder.

The outputs of both pipelines are concatenated and fed to a text decoder that autoregressively generates a CXSMILES sequence describing the Markush backbone and a substituent table.

Two-Stage Training Strategy
  • Phase 1 (Adaptation) : The Vision Encoder is frozen while the projector and text decoder are trained on 243K real-world image-SMILES pairs for standard molecular structure recognition.
  • Phase 2 (Fusion) : The VTL encoder is introduced and trained jointly with the text decoder on 235K synthetic and 145K real-world Markush structure samples for CXSMILES and substituent table prediction.
Performance
Markush Structure Recognition (CXSMILES Accuracy)
Benchmark MarkushGrapher-2 MolParser-Base MolScribe MarkushGrapher-1 DeepSeek-OCR GPT-5
M2S (103) 56 39 21 38 0 3
USPTO-M (74) 55 30 7 32 0 -
WildMol-M (10K) 48.0 38.1 28.1 - 1.9 -
IP5-M (1K) 53.7 47.7 22.3 - 0.0 -
Molecular Structure Recognition (SMILES Accuracy)
Benchmark MarkushGrapher-2 MolParser-Base MolScribe MolGrapher
WildMol (10K) 68.4 76.9 66.4 45.5
JPO (450) 71.0 78.9 76.2 67.5
UOB (5.7K) 96.6 91.8 87.4 94.9
USPTO (5.7K) 89.8 93.0 93.1 91.5
Model Details
  • Parameters : 831M total (744M trainable)
  • Vision Encoder : Swin-B ViT (from MolScribe, frozen during Phase 2)
  • VTL Encoder/Decoder : T5-base architecture with UDOP fusion
  • OCR Module : ChemicalOCR (256M parameters, based on SmolDocling)
  • Input : Patent document image crop (1024x1024)
  • Output : CXSMILES sequence + substituent table
Usage
# Load the model checkpoint
from transformers import AutoModel

model = AutoModel.from_pretrained("docling-project/MarkushGrapher-2")

For full inference pipeline usage, see the MarkushGrapher repository .

Datasets

Training and evaluation datasets are available at docling-project/MarkushGrapher-2-Datasets .

Citation
@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}
}
License

This model is released under the Apache 2.0 License .

Runs of docling-project MarkushGrapher-2 on huggingface.co

163
Total runs
-4
24-hour runs
-2
3-day runs
0
7-day runs
-8
30-day runs

More Information About MarkushGrapher-2 huggingface.co Model

More MarkushGrapher-2 license Visit here:

https://choosealicense.com/licenses/apache-2.0

MarkushGrapher-2 huggingface.co

MarkushGrapher-2 huggingface.co is an AI model on huggingface.co that provides MarkushGrapher-2's model effect (), which can be used instantly with this docling-project MarkushGrapher-2 model. huggingface.co supports a free trial of the MarkushGrapher-2 model, and also provides paid use of the MarkushGrapher-2. Support call MarkushGrapher-2 model through api, including Node.js, Python, http.

docling-project MarkushGrapher-2 online free

MarkushGrapher-2 huggingface.co is an online trial and call api platform, which integrates MarkushGrapher-2's modeling effects, including api services, and provides a free online trial of MarkushGrapher-2, you can try MarkushGrapher-2 online for free by clicking the link below.

docling-project MarkushGrapher-2 online free url in huggingface.co:

https://huggingface.co/docling-project/MarkushGrapher-2

MarkushGrapher-2 install

MarkushGrapher-2 is an open source model from GitHub that offers a free installation service, and any user can find MarkushGrapher-2 on GitHub to install. At the same time, huggingface.co provides the effect of MarkushGrapher-2 install, users can directly use MarkushGrapher-2 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

MarkushGrapher-2 install url in huggingface.co:

https://huggingface.co/docling-project/MarkushGrapher-2

Url of MarkushGrapher-2

Provider of MarkushGrapher-2 huggingface.co

docling-project
ORGANIZATIONS

Other API from docling-project