Datasets¶
Training corpus: ChEMBL 37¶
Source: https://ftp.ebi.ac.uk/pub/databases/chembl/ChEMBLdb/latest/chembl_37_chemreps.txt.gz
(279 MB, released 2026-05-29; ChEMBL is distributed under CC BY-SA 3.0).
curl -sSL -o chembl_37_chemreps.txt.gz "$URL"
zcat chembl_37_chemreps.txt.gz | tail -n +2 | cut -f2 > chembl_37_smiles.txt # 2,897,819 SMILES
pic2smiles corpus \
--source chembl_37_smiles.txt \
--output data/corpus/chembl \
--holdout data/corpus/decimer_holdout.smi \
--min-heavy-atoms 4 --max-heavy-atoms 48 \
--val-size 5000 --test-size 5000 --min-token-count 20
Declared scope¶
| Constraint | Value |
|---|---|
| heavy atoms | 4 to 48 |
| elements | B, Br, C, Cl, F, I, N, O, P, S, Se, Si |
| formal charges | allowed |
multi-fragment (salts, .) |
excluded |
| SMILES length cap | 160 tokens |
Curation outcome¶
| count | |
|---|---|
| read | 2,897,819 |
| rejected (unparseable or out of scope) | 269,119 |
| duplicate by canonical SMILES | 141 |
| removed by the DECIMER leakage guard | 210 |
| kept | 2,628,559 |
| train / val / test | 2,618,349 / 5,000 / 5,000 |
| vocabulary | 88 tokens |
| val molecules containing an unknown token | 1 |
Splits are disjoint by canonical SMILES and asserted at build time, not assumed.
corpus_meta.json in the output directory records all of the above plus the seed.
Evaluation set: rendered ChEMBL test molecules¶
5,000 molecules that appear in no training batch, frozen to disk once with a fixed seed in three difficulty tiers:
| tier | rendering | corruption |
|---|---|---|
clean |
one layout engine, black atoms, fixed bond width, no rotation | none |
varied |
full style randomization: layout engine, rotation, bond width, font, palette, condensed abbreviations, comic mode | none |
degraded |
full style randomization | full pipeline: stroke morphology, blur, downscale, JPEG, perspective, paper texture, speckle |
pic2smiles eval-set --smiles data/corpus/chembl/test.smi --output data/eval/chembl_test --count 1000
Freezing matters: with on-the-fly evaluation images, a regression and an unlucky render are indistinguishable.
Evaluation set: DECIMER hand-drawn molecules¶
5,088 human-drawn depictions with reference SMILES, from Zenodo
(10.5281/zenodo.6456306, CC BY 4.0). This is the out-of-distribution test:
nothing in the training pipeline reproduces human line breaks, inconsistent
bond lengths or misplaced labels. RDKit's comicMode gives wobbly strokes and
is the closest the renderer gets, which is not close.
All 5,088 reference SMILES are subtracted from the training corpus before splitting (D10 in the decision log).
Not used, and why¶
- USPTO-30K (MolGrapher's real-image benchmark): the right next evaluation set, but it needs a download and a page-segmentation step that this project does not implement.
- Procedurally generated molecules: unlimited and fully offline, but the distribution does not match real chemistry, which is what the model must generalize to. Considered as a fallback if the ChEMBL download had been declined.