Abstract
Optical Chemical Structure Recognition (OCSR) is crucial for digitizing chemical knowledge by converting molecular images into machine-readable formats. While recent vision-language models (VLMs) have shown potential in this task, their image-captioning approach often struggles with complex molecular structures and inconsistent annotations. To overcome these challenges, we introduce GTR-Mol-VLM, a novel framework featuring two key innovations: (1) the Graph Traversal as Visual Chain of Thought mechanism that emulates human reasoning by incrementally parsing molecular graphs through sequential atom-bond predictions, and (2) the data-centric principle of Faithfully Recognize What You've Seen, which addresses the mismatch between abbreviated structures in images and their expanded annotations. To support model development, we constructed GTR-CoT-1.3M, a large-scale instruction-tuning dataset with meticulously corrected annotations, and introduced MolRec-Bench, the first benchmark designed for a fine-grained evaluation of graph-parsing accuracy in OCSR. Comprehensive experiments demonstrate that GTR-Mol-VLM achieves superior results compared to specialist models, chemistry-domain VLMs, and commercial general-purpose VLMs. Notably, in scenarios involving molecular images with functional group abbreviations, GTR-Mol-VLM outperforms the second-best baseline by approximately 14 percentage points, both in SMILES-based and graph-based metrics.
Introduction
Converting an image of a molecule into a machine-readable format, such as a SMILES string, is known as Optical Chemical Structure Recognition (OCSR). Despite its importance for digitizing chemical knowledge, OCSR remains a difficult task for several reasons. Standard Vision-Language Models (VLMs) typically treat this as an image-captioning problem, attempting to map pixels directly to long strings. This approach often fails on complex molecules where a single character error can invalidate the entire chemical identity. Furthermore, chemists frequently use abbreviations (e.g., "Ph" for a phenyl ring), creating a mismatch between the visual representation and the expanded ground-truth annotations found in most datasets. Finally, hand-drawn molecular structures present unique challenges due to their inherent messiness and lack of precise coordinate data.
Methodology
The GTR-Mol-VLM framework addresses these challenges through two core design principles and a robust two-stage training process.
Graph Traversal as Visual Chain of Thought (CoT)
Instead of predicting atoms and bonds in isolation or jumping straight to a SMILES string, GTR-VL performs a depth-first traversal of the molecular graph. By interleaving atom and bond predictions in a single sequence, the model mimics human reasoning. This step-by-step approach provides mutual constraints—bonds are predicted based on previously identified atoms—which significantly reduces the search space and improves structural consistency.
Faithfully Recognize What You’ve Seen
To bridge the "abbreviation gap," the authors treat chemical abbreviations as "superatoms." Rather than forcing the model to hallucinate underlying atoms that are not visually present, the model is trained to recognize abbreviations like "Ph" or "Et" as single units. This aligns the model's output with the visual evidence in the image.
Two-Stage Training and Reinforcement Learning
The model undergoes a two-stage training process:
- Supervised Fine-Tuning (SFT): The model is first trained on GTR-1.3M, a massive dataset of printed molecular images.
- Reinforcement Learning (RL): To improve performance on hand-drawn data, the authors employ Group Relative Policy Optimization (GRPO). A composite reward system—based on the Maximum Common Subgraph (MCS), format validity, and SMILES accuracy—guides the model toward correct structures without requiring pixel-level coordinates.
Datasets and Benchmarks
- GTR-1.3M: A new instruction-tuning dataset containing 1.3 million samples, including 1 million PubChem molecules and 351k USPTO patent-based samples with corrected annotations.
- MolRec-Bench: A fine-grained benchmark for evaluating graph-parsing accuracy, specifically focusing on complex Markush structures and abbreviations.
- DECIMER-HD & ChemPix: Standard datasets used to evaluate performance on challenging hand-drawn structures.
Key Results and Insights
GTR-Mol-VLM demonstrates significant improvements over specialized OCSR models (e.g., MolScribe, MolNexTR) and general-purpose VLMs (e.g., GPT-4o).
- Abbreviation Mastery: On the MolRec-Abb benchmark, GTR-VL achieved 84.5% accuracy, whereas previous state-of-the-art models struggled below 20% due to annotation mismatches.
- Hand-drawn Breakthrough: Following Stage 2 RL training, the model's SMILES accuracy on the DECIMER-HD-Test set surged from 9.53% to 75.44%.
- The Power of Interleaving: The success of the model highlights that atom and bond prediction should not be separate stages. Interleaving them allows the bond structure to act as a "visual anchor" for subsequent atom predictions.
- Graph Similarity as Reward: Using the Maximum Common Subgraph (MCS) as a reward signal in RL proved highly effective, providing the model with informative partial credit for nearly correct structures.
Conclusion and Future Work
GTR-Mol-VLM sets a new standard for OCSR by integrating graph traversal logic into the VLM reasoning process. While the model excels at 2D structure recognition, challenges remain regarding 3D spatial information and chirality. Future research will focus on refining dataset quality and extending the traversal logic to 3D molecular conformations to further advance the field of cheminformatics.
Summary updated