Abstract
A significant portion of chemical knowledge is contained within 2D images in patent documents and scientific literature. Traditional Optical Chemical Structure Recognition (OCSR) methods attempt to reconstruct exact molecular graphs or SMILES strings, but these processes are often brittle and prone to failure when faced with degraded images or complex Markush structures. We present SubGrapher, a novel machine learning approach that bypasses full reconstruction in favor of generating searchable "visual fingerprints." By detecting functional groups via instance segmentation and encoding their topological relationships, SubGrapher achieves state-of-the-art performance in chemical structure identification and retrieval.
Introduction
The digitization of chemical data from legacy documents is a critical challenge for drug discovery and materials science. Currently, researchers rely on OCSR tools to translate molecular images into machine-readable formats. However, these tools struggle with non-standard drawing conventions, low-resolution scans, and the "Markush" structures common in patents—generic representations that use variable R-groups to claim broad chemical classes. A single misidentified bond in a traditional OCSR pipeline can result in an invalid SMILES string, rendering the data unsearchable. SubGrapher addresses this by focusing on "visual fingerprints" that capture the essence of a molecule's structure without requiring perfect graph reconstruction.
The SubGrapher Pipeline
SubGrapher replaces the traditional image-to-text pipeline with an image-to-fingerprint workflow based on instance segmentation.
The methodology consists of three primary stages:
- Substructure Detection: Utilizing Mask R-CNN, the model detects 1,534 expert-defined functional groups and 27 carbon backbone patterns directly from image pixels.
- Graph Construction: A "substructure-graph" is built by analyzing the spatial relationships and overlapping bounding boxes of detected groups. To ensure connectivity between adjacent groups, bounding boxes are expanded by 10%.
- Visual Fingerprinting: This graph is transformed into a Substructure-based Visual Molecular Fingerprint (SVMF). Unlike binary fingerprints, the SVMF is a continuous, count-based matrix encoding both substructure occurrences and the topological distances between them.
Experimental Results
To evaluate SubGrapher, the authors generated synthetic training data using an extended MolDepictor pipeline, mapping atoms to pixel masks for molecules from PubChem and synthetic Markush structures.
Substructure Detection
SubGrapher was tested against established baselines (OSRA, DECIMER, MolScribe, MolGrapher) on real-world datasets including JPO (Japanese patents) and USPTO-10K-L. It achieved a Substructure F1-score (S-F1) of 97% on the USPTO-10K-L dataset, significantly outperforming the next best model (90%). On the more challenging USPTO-Markush dataset, it reached 88% S-F1.
Molecule Retrieval
In simulated database searches, SubGrapher demonstrated superior retrieval capabilities. When searching for specific molecules (e.g., adenosine, camphor) among 500 highly similar, augmented "distractor" images, SubGrapher retrieved the target molecule at an average rank of 95, significantly outperforming traditional OCSR combined with standard fingerprinting methods. The authors further demonstrated the model's practical utility by successfully extracting and matching a complex Markush structure from a 54-page US patent document.
Discussion and Limitations
A key advantage of SubGrapher is its "graceful degradation." While traditional models fail completely on uncertain predictions, SubGrapher’s continuous fingerprint remains largely intact even if a single bond is missed, preserving searchability. Furthermore, its focus on localized functional groups allows it to handle complex Markush structures naturally, ignoring non-chemical patent annotations like brackets.
However, several limitations remain:
- Textual Abbreviations: The model does not currently recognize text-based abbreviations (e.g., "Me" for methyl, "Ph" for phenyl).
- Stereochemistry: The current iteration ignores 3D spatial arrangements, preventing the differentiation of enantiomers.
- Single-Atom Fragments: Isolated single-atom fragments, such as certain charged ions, are not yet recognized.
Future developments will focus on integrating Optical Character Recognition (OCR) to parse abbreviations and expanding the substructure vocabulary to include stereochemical nuances and ionic fragments.
Summary updated