AI Engineering · Project

Federated ADMET / Toxicity Sandbox

A small-scale version of a cross-pharma federated network: four simulated companies train one toxicity model on public Tox21 data without ever pooling their molecules. Built to see where federated ADMET breaks, not just where it works.

← All AI engineering work
Data
Tox21 — 7,831 molecules × 12 toxicity assays
Network
3 simulated companies + 1 newcomer, no shared chemistry
Models
Fingerprint MLP or D-MPNN graph trunk, one flag apart
Gates
Data contract, leakage check, provenance manifest
One federated round: partners A, B and C send trunk weights to a server that averages them and sends the shared trunk back; a newcomer D starts from the shared trunk. Raw molecules and labels never leave a partner. Server: shared trunk FedAvg, weighted by data size Partner A own chemistry · 8 assays private data + head Partner B own chemistry · 8 assays private data + head Partner C smallest dataset private data + head D joins molecules and labels never leave a partner
One training round. Solid arrows: trunk weights up; dashed: averaged trunk back down. 10 rounds per run, 3 seeds, results reported per partner.
Finding
Result
Random splits flatter models NR-AhR, random vs scaffold split
PR-AUC 0.61 → 0.51
Federation can hurt the smallest partner negative transfer; local fine-tuning recovers it to 0.687
ROC-AUC 0.669 → 0.596
A graph model beats fingerprints once federated partner A, D-MPNN vs MLP, federated + fine-tuned
ROC-AUC 0.792 vs 0.723
Newcomers benefit most when data is scarce 50 labelled molecules, network trunk vs from scratch
ROC-AUC 0.647 vs 0.542
▸ Implementation details
  • Shared trunk + private heads trained with FedAvg: partners exchange weights, never molecules or labels, and each keeps its own output layer because "the same" assay differs from lab to lab
  • A data contract validates every partner upload where the data lives and returns only counts (errors, % missing, % active per assay) — quality control without seeing the data
  • Scaffold-based splits and partner assignment, so test molecules are new chemistry, not near-copies of training molecules
  • Applicability-domain check: predictions are scored by similarity to the network's training chemistry, because accuracy drops on unfamiliar molecules
  • Every model ships with a manifest hashing code commit, config, data snapshot and weights — answering "exactly what produced this model?"
  • Pydantic v2 for validated, frozen configs and manifests; typing.Protocol interfaces so the aggregator, splitter or trunk (MLP → ChemProp-style D-MPNN) swap without touching the training loop
  • uv lockfile + mise, pre-commit (ruff, ty, tests on push) and CI — plus plain-language docs on assays and drug-discovery approaches, every claim cited

Code: private repository, walkthrough available on request.

Next case study Indication Research & Drug Repurposing →