This Git repository contains the code developed for the final course project, replicating the paper Generating Realistic Brain MRIs via a Conditional Diffusion Probabilistic Model by Peng et al.
We provide a brief explanation of each folder:
common
- this contains the code for preprocessing, data loading and sampling, as well as utils and scripts for data cleaning, downsizing and the code for evaluating the MS-SSIM metric.experiments
- this contains the model training code for each experiment conducted as part of the iterative development process;experiment14
contains the final replication model and associated code for generating synthetic MRIs and producing t-SNE plots.notebooks
- this contains several Python notebooks used for exploring the available datasets, designing the model architecture and index sampling, and investigating the samples generated by the trained models in our experiments.
We acknowledge HuggingFace for their UNet2DConditionModel
that we used for initialising our models and the MRIAnatEval Git repository for their MS-SSIM evaluation code.