Diffusion-bridge training for cellular perturbation modeling on BBBC021, JUMP-small, and Allen.
Paper: PerturbBridge: Direct Phenotypic Supervision for Cellular Perturbation Generation
- engines/: model architectures, training objectives, samplers, dataset loaders, and feature-statistics preparation code for the three datasets.
- configs/: dataset-specific training and sampling configurations and multi-stage training plans.
- train.py and scripts/: training launchers, checkpoint-resume utilities, and release checks.
- DATA.md: input formats, metadata fields, condition embeddings, and directory layouts.
- requirements.txt: Python dependencies.
Use Python 3.10 or 3.11 on a Linux machine with NVIDIA GPUs.
git clone https://github.com/yeung-lab/PerturbBridge.git
cd PerturbBridge
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtPrepare CellFlux-format cell images, metadata, and condition embeddings:
- BBBC021 / JUMP-small: see the CellFlux data instructions, preprocessed image data, and metadata and embeddings.
- Allen: obtain the drug-perturbation data from Allen Cell Explorer and prepare the cell arrays and metadata described in DATA.md.
Prepare 96 × 96 cell crops with their metadata, dataset splits, and condition embeddings following DATA.md, then arrange them as follows:
data/
├── bbbc/
│ ├── images/
│ ├── metadata.csv
│ └── embeddings.csv
├── jump/
│ ├── images/
│ ├── metadata.csv
│ └── embeddings.csv
└── allen/
├── images/
├── metadata.csv
└── embeddings.csv
Download the frozen Inception-v3 feature extractor used by the auxiliary losses:
mkdir -p external
curl -L --fail \
https://github.com/toshas/torch-fidelity/releases/download/v0.2.0/weights-inception-2015-12-05-6726825d.pth \
-o external/inception_v3.pthThe auxiliary losses use the torch-fidelity Inception-v3 weights linked above. The bridge models train from scratch.
For each dataset, first prepare the frozen training-data feature statistics, then start training. The controller runs the configured stages in sequence.
# BBBC021
python train.py --dataset bbbc --prepare
python train.py --dataset bbbc
# JUMP-small
python train.py --dataset jump --prepare
python train.py --dataset jump
# Allen
python train.py --dataset allen --prepare
python train.py --dataset allenRun inside an existing GPU allocation. BBBC021 requires at least 4 GPUs; JUMP-small and Allen require 8 GPUs to run all stages. The launcher selects the stage-specific GPU counts from configs/plans.json.
To use other storage locations:
python train.py --dataset bbbc \
--data-root ./data \
--output-root ./outputs \
--weights ./external/inception_v3.pthPass the same paths to --prepare. Checkpoints are saved under
outputs/<dataset>/seed42/phaseN/training/. Rerunning a stage resumes its latest
complete epoch checkpoint. Use --phase 1, --phase 2, etc. to run individual
stages in order; retain the same output directory and seed between stages.
Default training and sampling parameters are in configs/. To inspect the launch commands without starting training:
python train.py --dataset bbbc --dry-run
python train.py --helpIf you find this work useful, please cite our paper:
@article{yang2026perturbbridge,
title={{PerturbBridge}: Direct Phenotypic Supervision for Cellular Perturbation Generation},
author={Yang, Yucheng and Sun, Xiaoxiao and Sun, Huangqingbo and Sui, Elaine and Lundberg, Emma and Yeung-Levy, Serena},
journal={arXiv preprint arXiv:2610.17066},
year={2026},
doi={10.48550/arXiv.2610.17066},
url={https://arxiv.org/abs/2610.17066}
}This implementation builds on CellFlux and its diffusion-bridge utilities. Upstream licenses and source attributions are retained in third_party/ and the corresponding source files.