CoolFace
Datasetpublic

hheiden/molecular-depiction-pairs-20k

Molecular depiction pairs, 20K 39,891 synthetic depictions of 19,990 drug-like PubChem molecules, each paired with the molecular identity it was rendered from, plus precomputed embeddings and fingerprints. This is the development-scale dataset from molecular-depiction-alignment, published so the experiments in that repository can be reproduced without standing up the generation environment. Why this exists Not because a synthetic depiction corpus is novel. It is… See the full description on the dataset page: https://huggingface.co/datasets/hheiden/molecular-depiction-pairs-20k.

sourceHugging Facecc0-1.0updated 2mo agoView on Hugging Face
1likes34downloads
Dataset Card

Molecular depiction pairs, 20K

39,891 synthetic depictions of 19,990 drug-like PubChem molecules, each paired with the molecular identity it was rendered from, plus precomputed embeddings and fingerprints.

This is the development-scale dataset from molecular-depiction-alignment, published so the experiments in that repository can be reproduced without standing up the generation environment.

Why this exists

Not because a synthetic depiction corpus is novel. It is not: rendering structure images from PubChem is established practice in optical chemical structure recognition, and DECIMER generated 15 million of them.

It exists because regenerating this particular set is more annoying than it looks. RanDepict reaches CDK through a JVM, needs NumPy 1.x against a training stack that needs NumPy 2.x, and wants epam-indigo pinned at 1.11.0 because newer releases fail on a subset of molecules rather than breaking loudly. That is a real barrier to anyone who wants to check a number rather than take it on trust. Downloading 1.3 GB is not.

At this scale the full pipeline runs end to end, including the two-arm comparison and its 5-seed error bars.

Unpacking

bash
tar -xf images.tar        # restores images/<INCHIKEY>_<n>.png

That restores the exact flat layout pairs.csv references, so the manifest works unchanged and matches what the generation pipeline produces locally. It is an archive only because Hugging Face rejects a directory holding more than 10,000 files, and this set has 39,891.

Contents

filesizewhat
images.tar1.2 GB39,891 PNG depictions; unpack before use, see below
pairs.csv20 MBone row per depiction; schema below
dinov2_224.npz56 MBDINOv2 ViT-S/14-reg features per depiction, 224px
dinov2_518.npz55 MBthe same at 518px
fingerprints.npz1.4 MBpacked ECFP fingerprints, for nearest-Tanimoto retrieval galleries

The caches are included deliberately: with them, the frozen-backbone experiments run in minutes and without a GPU. Every one of them regenerates from images/ and pairs.csv if you would rather not trust them.

Each .npz carries parallel arrays keyed by inchikeys (molecule-level) or keys (depiction-level, the image path), aligned row-for-row with its feature matrix and with pairs.csv.

pairs.csv

columnmeaning
imagepath relative to the dataset root
inchikeythe identity key, taken from the input molecule
canonical_smilesRDKit canonical SMILES of the input molecule
kekulized_smilesthe string actually handed to the renderer
cxsmilesRanDepict's returned cxSMILES, carrying atom coordinates
stereo_preserved1 if the depiction round-trips to the input InChIKey, else 0
depiction_indexwhich depiction of this molecule; 2 per molecule for all but 89

Key on `inchikey`, not on `cxsmiles`. The cxSMILES describes the drawing, and the drawing is not always the molecule: see stereochemistry below.

How it was made

Molecules are drawn from the PubChem CID-SMILES bulk export, filtered to drug-like organics and uniformly sampled. Depictions come from RanDepict, which renders one SMILES through RDKit, Indigo, CDK and PIKAChU as interchangeable backends, with style, hand-drawn and noise augmentation.

That multi-backend diversity is the point. A model trained on one toolkit's renders learns that toolkit's house style rather than chemistry, and the resulting brittleness does not show up in in-distribution metrics.

Two depictions were requested per molecule. 99 renders failed outright ("RanDepict returned no image"), which is why 89 molecules carry one depiction instead of two.

Evaluation-set disjointness

Deduplicated by InChIKey and verified clean against all seven MoleculeNet probe tasks used in the source project: BBBP, ESOL, BACE (classification and regression), Lipophilicity, and Tox21 NR-Aromatase and SR-MMP. Zero overlap across all 21 train/valid/test split files.

It is also disjoint from WildMol-10k, the real-depiction evaluation set, checked with a positive control that injects known evaluation molecules and confirms the check catches them.

Three molecules were removed to make this true. The original working set was deduplicated against WildMol-10k, BBBP and ESOL; BACE, Lipophilicity and Tox21 were added later and pruned at training time rather than from the stored set, leaving PLUBXMRUUVWRLT-UHFFFAOYSA-N, UYGVZNATVIIKQC-KRWDZBQOSA-N and VBICKXHEKHSIBG-UHFFFAOYSA-N in it. All three sat in train splits only, so no published result is affected, but a downloader running a Lipophilicity or Tox21 probe would have inherited a leak they did not cause. They are gone from every file here, images and caches included.

If you bring your own evaluation set, redo the check. Nothing about this dataset guarantees disjointness from a set it has never seen.

Limitations

Stereochemistry is missing from about a fifth of it. 32,028 of 39,891 depictions (80.29%) round-trip to their input InChIKey. The rest do not, because RanDepict frequently omits the wedge bond, so for a stereocentre-bearing molecule the image genuinely does not carry information the SMILES does. This is a property of the depictions rather than a labelling error: stereo_preserved marks every affected row, and filtering on it is the honest move if your task depends on stereo.

These are synthetic images. They are not literature depictions and do not substitute for them. Real-depiction evaluation in the source project uses WildMol-10k from MolParser, which is CC-BY-NC-SA and is not redistributed here or anywhere by this project.

Roughly two depictions per molecule. A batch drawn from this set routinely contains two views of the same molecule, so anything treating in-batch rows as automatically distinct will be wrong. This matters concretely for contrastive training: a label matrix built from batch position rather than from inchikey will push a vector away from a byte-identical copy of its own target.

License and provenance

Released under CC0-1.0.

The chain, so you can reason about it rather than take a conclusion:

  • —Structures come from PubChem; see NCBI's data usage policies.
  • —Images were generated by RanDepict (MIT), rendering through RDKit (BSD-3-Clause), Indigo (Apache-2.0), CDK (LGPL-2.1) and PIKAChU. All used unmodified; none redistributed here.
  • —MIST embeddings are deliberately not included. The alignment targets are activations of MIST-28M, and MIST's model card states research-use-only, no-redistribution and no-commercial-use conditions alongside its apache-2.0 tag. Publishing its activations under CC0, which dedicates them to the public domain for any use, would grant more than is clearly ours to grant. They are also the cheapest thing here to rebuild: one pass of scripts/20_precompute_mist.py over pairs.csv, about 30 seconds for this set on a laptop. Everything expensive, the 39,891 renders, is included.
  • —*`dinov2_.npz** are activations of DINOv2 vitsmallpatch14reg4dinov2.lvd142m` (Apache-2.0).

No MolParser or WildMol content is present in any form, including derived features.

Related