ocsr-dataset / README.md
yaniguan's picture
Upload folder using huggingface_hub
8e00509 verified
|
Raw History Blame Contribute Delete
6.03 kB
metadata
license: cc-by-nc-4.0
language:
  - en
pretty_name: VERDICT-PMC OCSR corpus
task_categories:
  - image-to-text
tags:
  - chemistry
  - optical-chemical-structure-recognition
  - ocsr
  - smiles
  - molecules
size_categories:
  - 10K<n<100K
configs:
  - config_name: default
    data_files:
      - split: train
        path: data/train-*
      - split: validation
        path: data/validation-*
dataset_info:
  features:
    - name: image
      dtype: image
    - name: smiles
      dtype: string
    - name: inchikey
      dtype: string
    - name: n_agree
      dtype: int8
    - name: n_agree_open
      dtype: int8
    - name: engines
      dtype: string
    - name: pmcid
      dtype: string
    - name: doi
      dtype: string
    - name: figure_id
      dtype: string
    - name: crop_index
      dtype: int16
    - name: license
      dtype: string
  splits:
    - name: train
      num_examples: 17249
    - name: validation
      num_examples: 1193

VERDICT-PMC OCSR corpus

Molecule images cropped from figures in open-access journal articles (PubMed Central), each paired with a SMILES string. Labels are weak labels: a structure is kept only when at least two independent recognition engines produced the same molecule. For non-commercial research and teaching only.

split rows articles unique molecules (InChIKey)
train 17,249 1,119 13,371
validation 1,193 125 1,025

Total 18,442 image–SMILES pairs from 1,244 articles, ~173 MB of Parquet.

Quick start

from datasets import load_dataset

ds = load_dataset("yaniguan/ocsr-dataset")
ex = ds["train"][0]
ex["image"]          # PIL.Image (RGB PNG)
ex["smiles"]         # e.g. "C1C[NH+]2CCN1CC2"

# Stricter subset: at least two open-source engines agree (excludes pairs that rely on the VLM vote)
strict = ds["train"].filter(lambda r: r["n_agree_open"] >= 2)

Fields

field meaning
image cropped molecule depiction, PNG; path is <pmcid>/<figure_id>_<crop_index>.png
smiles agreed structure as reported by the voting engines (not re-canonicalised)
inchikey standard InChIKey of smiles (RDKit)
n_agree number of engines (out of 4) whose outputs share this InChIKey — 2, 3 or 4
n_agree_open same count restricted to the three open-source engines (DECIMER, MolScribe, MolNexTR)
engines which engines agreed, `
pmcid, doi source article
figure_id, crop_index source figure file stem in the article package, and the index of the crop within it
license licence of the source article: CC BY or CC BY-NC

attribution.csv lists every source article with DOI, licence and full citation.

How it was built

  1. Harvest. Figures from PMC Open Access articles published 2025–2026 were segmented into single-molecule crops.
  2. Recognise. Each crop was read independently by four engines: DECIMER, MolScribe, MolNexTR, and a LoRA-fine-tuned vision-language model (weights not released).
  3. Vote. Outputs were compared by InChIKey; a crop is labelled only if ≥2 engines agree.
  4. Entity gate. Removed structures that fail RDKit parsing, contain dummy / R-group atoms, have fewer than 6 heavy atoms, or lack a standard InChIKey.
  5. Benchmark decontamination. Removed every molecule whose InChIKey appears in the ACS, CLEF, UOB, USPTO, JPO or Staker OCSR benchmarks (plus the author's own held-out evaluation sets).
  6. Licence filter. Kept only articles licensed CC BY or CC BY-NC (per PMC metadata license_code); CC BY-NC-ND and text-mining-only articles were dropped.
  7. Split by article: ~10% of articles (md5 of PMCID) go to validation; articles contributing more than 100 crops are always in train so that no single paper dominates validation.

Re-checked on the released files: all 18,442 SMILES parse in RDKit, none contain dummy atoms, none have fewer than 6 heavy atoms, and every inchikey matches its smiles.

Label quality

There is no human-verified gold label for this release. The closest measurement is a blind manual check of the earlier (first-round) harvest built with the same four-engine vote, 200 crops per tier:

agreement precision 95% Wilson CI
≥3 engines 0.995 (198/199) 0.972–0.999
exactly 2 engines 0.958 (183/191) 0.920–0.979

These numbers were not re-measured on this release; treat them as indicative. Label mix here: n_agree = 2 / 3 / 4 → 6,796 / 6,086 / 5,560 rows.

Limitations

  • Weak labels. Engines can share failure modes, so agreement does not guarantee correctness. The error types in this release have not been characterised.
  • Selection bias. Only crops where engines agree are included, so the set is skewed toward structures that current OCSR tools already read well. Hard cases (R-groups, Markush structures, abbreviations, very large molecules) are under-represented or absent.
  • Molecule overlap across splits. Splitting is by article, not by molecule: 143 validation molecules (193 validation rows) also appear in train. Filter by inchikey for a molecule-disjoint evaluation.
  • Uneven article sizes. Median 5 crops per article; the largest article contributes 897 train rows.
  • Small, non-square images. Median crop is about 146×94 px (long/short aspect ~1.6).
  • Journal skew. 1,244 articles, 85% of them from four journals: RSC Advances 442, Molecules 328, Int J Mol Sci 280, Pharmaceuticals 93. Publication years 2025 (187) and 2026 (1,057).

Licence and attribution

  • Images are cropped from figures in the listed articles; copyright stays with the original authors / publishers under each article's licence (license column, attribution.csv).
  • Because the set contains CC BY-NC material, the dataset as a whole is released under CC BY-NC 4.0. Non-commercial research and teaching use only. Cite the original article when you show or reuse an individual image.
  • If you are an author and want an article removed, open an issue on this dataset page.