dataset_info:
features:
- name: id
dtype: string
- name: image
dtype: image
- name: mol
dtype: string
- name: smiles
dtype: string
- name: selfies
dtype: string
- name: inchi
dtype: string
splits:
- name: train
num_bytes: 27937697
num_examples: 5740
download_size: 20547603
dataset_size: 27937697
configs:
- config_name: default
data_files:
- split: train
path: data/train-*
license: mit
tags:
- chemistry
- ocsr
- ocr
- documents
pretty_name: UOB OCSR Benchmark
size_categories:
- 1K<n<10K
Dataset Card for UOB OCSR Benchmark
This dataset is a benchmark for Optical Chemical Structure Recognition (OCSR), containing 5,740 images of chemical structures. Originally created by the University of Birmingham, each image is paired with its corresponding MOL file. This version has been augmented with canonical SMILES, InChI, and SELFIES strings to provide a comprehensive resource for training and evaluating image-to-structure models.
Dataset Details
Dataset Description
The UOB OCSR Benchmark dataset was created for the development and evaluation of systems that recognize and digitize chemical structures from images. The data originates from one of Maybridge's catalogues for drug design and discovery.
The original creation process involved scanning catalogue pages, automatically clipping the 2D structure diagrams along with their CAS numbers, and then using the CAS numbers to retrieve InChI identifiers from online databases. These InChI identifiers were subsequently converted into MOL file format using OpenBabel.
This particular version of the dataset was sourced from the benchmark suite compiled for the paper "A review of optical chemical structure recognition tools" by Rajan et al. In that benchmark, the original TIFF images were converted to 72dpi PNG files. This Hugging Face dataset version further processes the provided MOL files to generate canonical SMILES, InChI, and SELFIES strings using RDKit, providing a variety of useful representations for machine learning tasks.
- Curated by: The original dataset was curated by Noureddin M. Sadawi, Alan P. Sexton, and Volker Sorge. This Hugging Face version was prepared by Hunter Heidenreich.
- License: mit
Dataset Sources
- Repository:
- Paper:
Uses
Direct Use
This dataset is primarily intended for evaluating Optical Chemical Structure Recognition (OCSR) models. The goal is to take an image of a chemical structure as input and predict its molecular representation (e.g., MOL, SMILES, InChI). It can be used for tasks such as:
- Image-to-SMILES translation
- Image-to-InChI translation
- Image-to-SELFIES translation
- Benchmarking OCSR tool performance
Out-of-Scope Use
The dataset consists of relatively clean, well-segmented images from a single catalogue source. This dataset is not meant for training.
Dataset Structure
The dataset consists of a single split ('train') containing 5,740 examples. Each example has the following fields:
id(string): A unique identifier for the example, derived from the original filename (e.g.,maybridge-1025-000000001).image(image): A PIL-encoded image of the chemical structure.mol(string): The ground truth structure in MOL file format.smiles(string): The canonical SMILES string for the molecule, generated from themoldata using RDKit.inchi(string): The standard InChI string for the molecule, generated from themoldata using RDKit.selfies(string): The SELFIES (SELF-referencIng Embedded Strings) representation of the molecule, generated from thesmilesstring.
Dataset Creation
Curation Rationale
The dataset was originally created to provide a standardized benchmark for evaluating the performance of OCSR software, developed alongside the MolRec tool at the University of Birmingham.
Source Data
Data Collection and Processing
The source data comprises 2D chemical structure diagrams from a Maybridge drug design catalogue. The original curation process was as follows:
- Catalogue pages were scanned as RGB images at 600x600 dpi.
- Images were thresholded using Otsu's method.
- A bespoke tool automatically clipped structures and their corresponding CAS numbers.
- CAS numbers were used to look up InChI identifiers in online databases.
- The InChI identifiers were converted into MOL files using the OpenBabel toolkit.
This Hugging Face version is based on data from the Kohulan/OCSR_Review repository, which converted the original .tif images to .png format. A custom script was then used to process the MOL files, generating canonical SMILES, InChI, and SELFIES strings for each entry using the RDKit and selfies libraries.
Who are the source data producers?
The chemical structure diagrams were originally produced by Maybridge. The dataset was collected and curated by Noureddin M. Sadawi, Alan P. Sexton, and Volker Sorge at the University of Birmingham.
Annotations [optional]
The dataset does not contain manual annotations. The ground truth labels (MOL, SMILES, etc.) are derived programmatically from the chemical identifiers associated with the images in the source catalogue.
Bias, Risks, and Limitations
- Source Homogeneity: The dataset is sourced from a single catalogue. This means the images share a consistent style, font, and quality, which may not be representative of the diversity of chemical diagrams found in other sources like scientific literature or patents.
- Image Quality: The images in this version were converted from 600dpi TIFFs to 72dpi PNGs for a previous benchmark study. This downsampling may have resulted in a loss of detail compared to the original scans.
- Cleanliness: The images are generally clean and well-segmented. This makes the dataset less challenging than real-world scenarios where diagrams might be noisy, occluded, or surrounded by other text and figures.
Recommendations
Users should be aware of the dataset's limitations. Users should only ever use this for testing their OCSR models.
Citation
If you use this dataset in your work, please cite the original paper and the benchmark review. It is also recommended to cite this dataset card to ensure reproducibility.
BibTeX:
@inproceedings{sadawi2012chemical,
title={Chemical structure recognition: a rule-based approach},
author={Sadawi, Noureddin M and Sexton, Alan P and Sorge, Volker},
booktitle={Document recognition and retrieval XIX},
volume={8297},
pages={101--109},
year={2012},
organization={SPIE}
}
@article{Rajan2020,
author = {Rajan, Kohulan and Brinkhaus, Henning Otto and Zielesny, Achim and Steinbeck, Christoph},
doi = {10.1186/s13321-020-00465-0},
journal = {Journal of Cheminformatics},
title = {{A review of optical chemical structure recognition tools}},
year = {2020}
}
@misc{huggingface_dataset_UOB,
author = {Heidenreich, Hunter},
title = {UOB OCSR Benchmark},
year = {2025},
publisher = {Hugging Face},
journal = {Hugging Face repository},
howpublished = {\url{[https://huggingface.co/datasets/hheiden/UOB_OCSR_benchmark](https://huggingface.co/datasets/hheiden/UOB_OCSR_benchmark)}}
}
Dataset Card Authors
Original dataset: Noureddin M. Sadawi, Alan P. Sexton, Volker Sorge
Hugging Face version: Hunter Heidenreich, hheiden