Synthetic brain MR images generated with Mediffusion and StyleGAN2-ADA
收藏资源简介:
This repository accompanies the study: Lai, M., Marzi, C., & Diciotti, S. (2025). Reproducibility of synthetic image quality in brain MRI for reliable benchmarking. The study systematically investigates the impact of stochastic training variability on the quality of synthetic brain MR images produced by two state-of-the-art generative frameworks: StyleGAN2-ADA and Mediffusion. Both models were trained on 3,227 T1-weighted brain MR images from the publicly available OpenBHB dataset, using 30 random seeds for weight initialization per framework. Real dataset used to train the models The real data employed for model training were obtained from the OpenBHB dataset, which can be downloaded from its official repository. However, due to data usage agreement restrictions, the specific data employed in this study cannot be redistributed within this repository. To preserve the native anatomical characteristics of the scans, we used the quasi-raw images provided in OpenBHB. Each volume was intensity-normalized to the [0, 1] range. From each 3D image, the central axial slice (182 × 218 pixels) was extracted to obtain a single 2D representation per subject. The resulting 2D slices were zero-padded to 256 × 256 pixels and concatenated into a single NIfTI volume of dimensions 256 × 256 × N, where N = 3,227 (the total number of images used for training). The files OpenBHB_train.nii.gz and OpenBHB_val.nii.gz, referenced in the .slurm training scripts, were prepared following this procedure. This dataset was used consistently for training both StyleGAN2-ADA and Mediffusion models. Repository contents Mediffusion.zipContains the complete collection of results obtained from the Mediffusion framework across 30 random seeds (seed_0 to seed_29).Each seed folder (e.g., seed_0/, seed_1/, …, seed_29/) includes: synthetic_200kimg_3k.nii.gz – NIfTI file containing 3,000 synthetic brain MR images generated by the model trained with the corresponding seed, after 200 kimgs of training. These synthetic images were compared against 3,227 real OpenBHB images to compute all evaluation metrics using the Synthetic Images Metrics (SIM) Toolkit. metrics_SIM_toolkit/ – Directory generated by the SIM Toolkit v3.2, containing: report_sim_toolkit.pdf – Full evaluation report combining all quantitative and qualitative analyses. figures – Subfolder of full-resolution images included in the report (e.g., PCA/t-SNE plots, k-NN visualizations). metrics.csv – Summary table with numerical scores for all computed metrics (FID, KID, precision, recall, density, coverage, α-precision, β-recall, and authenticity). oc_detector.pkl – Pretrained one-class detector used by the SIM Toolkit to project real and synthetic images into a hyperspherical embedding space for α/β-precision and authenticity assessment. StyleGAN2ADA.zipAnalogous structure to Mediffusion.zip, containing the complete set of synthetic brain MR images and evaluation reports for the StyleGAN2-ADA framework trained under 30 random weight initialization seeds. Each seed_X/ directory includes the corresponding metrics_SIM_toolkit/ folder and synthetic_3k.nii.gz volume, generated following the same training protocol and evaluation pipeline as described above. Training and reproducibility scripts Both models were trained using Docker containers (matteolai/mediffusion and matteolai/stylegan2ada), each containing the source code from the original public repositories together with the full experimental environment. For execution on the high-performance computing (HPC) system, these containers were converted into Singularity images and run through SLURM submission scripts: train_mediffusion_hpc.slurm train_stylegan2ada_hpc.slurm Each script automatically iterates over all 30 random seeds and reproduces the training experiments using the same hyperparameter configuration employed in the original study.



