PhytoTarget ML — Devpost submission copy
Inspiration
Traditional medicine knows which plants work. Modern drug discovery needs to know why and which molecule hits which protein. That link is the bottleneck: testing one compound against one target in a lab costs thousands of euros and weeks of work, so most plant chemistry sits unscreened. We wanted to turn "this plant is used for memory problems" into a ranked, testable chemical hypothesis in seconds, for free, from open data.
What it does
PhytoTarget ML is a live web app where a researcher pastes a compound structure (SMILES) or picks from 9 well-known plant compounds (turmeric, green tea, sweet wormwood, snowdrop…) and gets:
- Ranked target diseases — Alzheimer's relevance vs inflammation relevance, with medal badges
- Per-target binding probabilities across 5 therapeutic proteins (AChE, BACE1, GSK3B for Alzheimer's; COX-2, TNF-α for inflammation)
- Two models side by side — RandomForest on fingerprints vs a Graph Neural Network, with an honest scorecard showing where each wins
- Molecule rendering, drug-likeness properties (MW, LogP, H-bond donors/ acceptors), and traditional-use context for every compound
Problem → Data → Method → Prototype → Results → Impact is the spine of this page: the problem is unscreened plant chemistry; the prototype is the linked app above and every number below is measured.
How we built it
- Data (11,421 measured bioactivities, ChEMBL, open CC-BY-SA, via live API): AChE 2,263 · BACE1 2,068 · GSK3B 2,625 · COX-2 (PTGS2) 2,043 · TNF-α 2,422. Labeled active at ≤10 µM with median-aggregation per compound.
- Baselines: per-target RandomForest on Morgan fingerprints (r=2, 2048-bit), 5-fold cross-validated — AUC 0.893 (COX-2) to 0.971 (TNF-α). Per target: AChE 0.947 · BACE1 0.954 · GSK3B 0.917 · COX-2 0.893 · TNF-α 0.971.
- GNNs: molecules as graphs (atoms as nodes with 9 features, bonds as edges), 3-layer GCN with 128 hidden units, trained on Kaggle 2×T4 GPUs in ~15 minutes (public notebook). Held-out test AUC 0.627–0.951 (TNF-α 0.951 near-tie; GSK3B 0.627 — see Challenges).
- Verification: Kaggle weights re-loaded locally reproduce all 45 demo predictions to <1e-4 — the same code path the app uses for live inference.
- Technologies: Python, RDKit, scikit-learn, PyTorch + PyTorch Geometric, Streamlit (deployed on Streamlit Community Cloud)
- Reproduce it:
pip install -r requirements.txt, weights inmodels/+gnn_models/, presets indata/plant_preds_all.csv— the gallery (src/gallery.py) regenerates both figures from the same code and data.
Challenges we ran into
- The GNN lost. Our GCN underperformed fingerprints on 4/5 targets (GSK3B: 0.627 vs 0.917). Rather than hide it, we made the comparison the centerpiece, small datasets favor fingerprints, and saying so is better science.
- Class imbalance: GSK3B is 89% active (2,341/2,625) — a known GNN punisher; documented as a limitation, not tuned away silently.
- Stereochemistry cost us huperzine A, a known AChE inhibitor (RF AChE only 0.40): dropping stereochemistry from SMILES measurably hurt it.
- Sparse-target worry: TNF-α looked like it might have no small-molecule data (mostly a biologics target) — it turned out to have 2,422 compounds, our richest set.
Accomplishments that we're proud of
- The model rediscovers real drugs (positive controls, exact app numbers): galantamine (snowdrop) → AChE 0.97, top of all 9 presets; EGCG (green tea) → BACE1 0.88, our strongest BACE1 signal, matching published anti-amyloid literature; berberine → COX-2 0.61, top inflammation call. The pipeline had no prior knowledge of any of these — which is why its novel predictions deserve lab follow-up.
- Fully working, public, reproducible: live app + open repo + public training notebook + open data, with every number in the results table measured, not claimed.
- Real ML rigor: two model families, honest eval (5-fold CV for RF + held-out test for GNN), limitations documented as features. Assumes ligand-similarity transfer; uncertain exactly where the GNN generalizes — stated on the page, not in fine print.
What we learned
- Fingerprints + RandomForest are a brutally strong baseline in cheminformatics — never skip them before reaching for deep learning.
- Small, imbalanced bioactivity sets punish GNNs far more than tree models; class balance and dataset scale decide the modeling choice as much as architecture does.
- Stereochemistry matters: dropping it from SMILES measurably cost us huperzine A, a known AChE inhibitor.
- Deployment is part of the science: if judges can't click it, it doesn't exist.
What's next for PhytoTarget
- Impact: any ethnopharmacology lab can paste a compound and get a ranked, testable hypothesis in seconds — the pipeline proposes, assays dispose. The goal is one validated novel plant–target interaction with a lab partner. Feasible beyond the hackathon: open data, commodity models, free hosting.
- KNApSAcK species–metabolite integration — from whole plant to all its compounds to ranked targets in one query.
- Bigger graphs: GIN/attention architectures, more epochs, more targets (anti-infective and metabolic panels).
- Docking-score features fused with ligand-based predictions.
- Lab partnership for experimental validation.
Responsible research
- Data: ChEMBL (CC-BY-SA) with attribution; no proprietary or personal data.
- Traditional knowledge: only open, published compound-use context is shown; no proprietary Indigenous knowledge is claimed or enclosed.
- Scientific integrity: all predictions are labeled research-prototype hypotheses with the disclaimer shown throughout the app — no unvalidated computational finding is presented as a medical fact. Not for clinical use.
Built With
- graph-neural-networks
- streamlit