CYF2000127 / MolNexTR

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MolNexTR

This is the offical code of following paper "MolNexTR: A Generalized Deep Learning Model for Molecular Image Recognition".

Highlights

In this work, We propose MolNexTR, a novel graph generation model. The model follows the encoder-decoder architecture, takes three-channel molecular images as input, outputs molecular graph structure prediction, and can be easily converted to SMILES. We aim to enhance the robustness and generalization of the molecular structure recognition model by enhancing the feature extraction ability of the model and the augmentation strategy, to deal with any molecular images that may appear in the real literature.

visualization

Overview of our MolNexTR model.

Using the code

Please clone the following repositories:

git clone https://github.com/CYF2000127/MolNexTR

Experiments

Requirement

pip install -r requirements.txt

Data preparation

For training and inference, please download the following datasets to your own path.

Training datasets

  1. Synthetic: PubChem
  2. Realistic: USPTO

Testing datasets

  1. Synthetic: Indigo, ChemDraw
  2. Realistic: CLEF, UOB, USPTO, Staker, ACS
  3. Perturbed by img transform: CLEF, UOB, USPTO, Staker, ACS
  4. Perturbed by curved arrows: CLEF, UOB, USPTO, Staker, ACS

Training

Run the following command:

sh ./exps/train.sh

The default batch size was set to 256. And it takes about 20 hours to train with 10 NVIDIA RTX 3090 GPUs.

Inference

Run the following command:

sh ./exps/eval.sh

The default batch size was set to 32 with a single NVIDIA RTX 3090 GPU.

Visualization

Use prediction.ipynb for single or batched prediction and visualization.

We also show some qualitative results of our method below:

visualization

Qualitative results of our method on ACS.

visualization Qualitative results of our method on some hand-drawn molecules images.

About

License:Apache License 2.0


Languages

Language:Jupyter Notebook 77.0%Language:Python 22.8%Language:Shell 0.2%