Kohulan/DECIMER-Image_Transformer

DECIMER Image Transformer is a deep-learning-based tool designed for automated recognition of chemical structure images. Leveraging transformer architectures, the model converts chemical images into SMILES strings, enabling the digitization of chemical data from scanned documents, literature, and patents.

What it solves

Chemists often encounter chemical structure images in papers, databases, or hand-drawn sketches. Manually transcribing them into machine-readable formats is slow and error-prone. DECIMER automates Optical Chemical Structure Recognition (OCSR) — it takes an image of a molecule and outputs the corresponding SMILES string, the standard text representation used in cheminformatics.

How it works

DECIMER uses a deep learning pipeline with two main parts:

  • Image feature extraction: an EfficientNet-V2 convolutional network reads the image and extracts visual features.
  • SMILES prediction: a transformer model (similar to those used in language tasks) generates the SMILES sequence from those features. The project was trained on a large dataset (over 1 million images) using Google TPUs for speed. It supports both printed and hand-drawn chemical structures — the hand-drawn model is a separate component that can be loaded on demand.

The software is easy to install via pip (pip install decimer) and provides a simple Python interface. The first time you run prediction, the model weights (about 300 MB for the printed-structure model) are downloaded from Zenodo and cached. You can pre-load both models with DECIMER.load_models() to avoid the download later, and you can point to a local model directory to run entirely offline.

Who it's for

  • Chemists and cheminformaticians who need to extract molecule structures from images.
  • Researchers digitizing publications, lab notebooks, or hand-drawn structures.
  • Developers building tools that need to convert chemical images to SMILES.

Highlights

  • Open source (MIT) and available on PyPI.
  • High performance: trained on over 1 million images using TPUs.
  • Two models: one for printed structures, one for hand-drawn structures.
  • Simple Python API: predict_SMILES(image_path) returns a SMILES string.
  • On-demand model download and caching; supports offline use with pre-installed models.
  • Ongoing development by the Steinbeck Group at Friedrich Schiller University Jena.

Related

  • Project
  • Project
  • Project
  • Project