This repository contains official code for the DGM4MICCAI 2025 paper "Conditional diffusion models for guided anomaly detection in brain MRI using fluid-driven anomaly randomization".
To run the scripts it is necessary to edit the dataloaders and configuration files by editing the example paths. The code in this repository was run using Python 3.11.
bash ./install.shpython ./scripts/training_autoencoderKL.pywhich uses the parameters in aekl_ad_3d.yaml
python ./scripts/train_ddpm_pl_cunet.py --config ./conddiff/configs/precalc/train_conddiff_healthy_synthetic.yamlpython ./scripts/train_ddpm_pl_unet.py --config ./conddiff/configs/healthy/train_unet_healthy.yamlpython ./scripts/train_ddpm_pl_cunet.py --config ./conddiff/configs/precalc/train_condunet_healthy_synthetic.yamlpython ./scripts/train_ddpm_pl_cunet.py --config ./conddiff/configs/cond_baseline/train_condunet.yamlpython ./scripts/training_vaebaseline.pywhich uses the parameters in aekl_ad_3d_vae.yaml
