ivus_ddpm_generation: Porcine IVUS DDPM Image Generation
Research use only. Generated images are synthetic. They are not clinical data and must not be used for diagnosis or clinical decision making. The model has not been clinically validated and has no regulatory clearance.
Model description
An unconditional denoising diffusion model (DDPM) that generates 256x256 single-channel intravascular ultrasound (IVUS) B-mode cross-sections. It was trained from scratch, with no pretrained weights and no base model, on porcine in-vivo frames from a 30 MHz rotational catheter.
- Network: pixel-space U-Net (
diffusers.UNet2DModel, 113.7M parameters), 6 resolution levels with channels 128-128-256-256-512-512, self-attention at 16x16. - Objective: v-prediction on a cosine noise schedule rescaled to zero terminal SNR. The weights are the exponential moving average (decay 0.9999) of the training weights.
- Sampling: DDIM (eta 0), 100 steps by default, trailing timesteps, no sample clipping. These settings are part of the model. Sampling with
leadingtimesteps or without the zero-terminal-SNR rescaling gives wrong images.scripts/generate.pyapplies the rescaling to MONAI's DDIM scheduler. - Output: 8-bit grayscale PNG frames. Model space is [-1, 1].
How to use
The repository follows the MONAI bundle layout. Install monai, torch, diffusers, pillow, pyyaml and fire (versions in configs/metadata.json), then run from the repository root:
python -m monai.bundle run --config_file configs/inference.yaml
python -m monai.bundle run --config_file configs/inference.yaml --num_samples 64 --num_inference_steps 250 --seed 1000
The step count must divide 1,000. Do not change prediction_type, zero_terminal_snr or timestep_spacing.
Training
configs/train.yaml trains the same network from scratch with MONAI's SupervisedTrainer, following the recipe below. The pieces MONAI does not provide (the v-prediction target, the learning-rate schedule, gradient clipping and the weight EMA) are in scripts/training.py. Prepare 256x256 8-bit grayscale PNG frames in <dataset_dir>/train and <dataset_dir>/val, then run:
python -m monai.bundle run --config_file configs/train.yaml --dataset_dir /path/to/frames
The defaults need a GPU with about 24 GB of memory. Each checkpoint holds the raw weights (model) and their EMA (ema_model); sample from the EMA weights. See docs/README.md for details. The released weights were trained with an equivalent diffusers script, not with this config, and the config has only been run end to end on a small network, so training with it gives a model of the same kind rather than these exact weights.
Training data
NVIDIA Open-H-RF, mosaic-nuevosono subset: 9 in-vivo porcine IVUS acquisitions, 1,010 B-mode frames (CC BY 4.0). The data was split by acquisition (7 train, 1 validation, 1 test; 760 / 100 / 150 frames), because neighbouring frames in a pullback are nearly identical. Training used the 8 lossless D4 transforms (rotations and mirroring) as augmentation. No human data and no data from any other source was used. The dataset is not redistributed here.
Attribution (CC BY 4.0): the training data is provided by Mosaic Intelligence Labs in collaboration with NuevoSono, published by NVIDIA as part of the Open-H-RF dataset. See docs/data_license.txt.
Training configuration
40,000 steps at batch size 8 (about 420 epochs), AdamW, learning rate 1e-4 with 500 warmup steps then cosine decay, gradient clipping 1.0, dropout 0.1, bf16 autocast, one NVIDIA A10G 24 GB GPU (about 7.3 hours).
Evaluation
Mean pixel value (0-255) of 16 generated frames (DDIM 100 steps, seed 0) compared with real frames:
| Whole image | Inside field of view | Outside field of view | |
|---|---|---|---|
| Generated (16 frames) | 18.9 | 28.1 | 0.9 |
| Real training frames | 17.6 | ||
| Real test frames | 25.8 | ||
| Real test frames (first 16) | 37.6 | 0.8 |
The generated background is black, as in real frames, and the overall brightness matches the training frames. Inside the field of view the samples are somewhat darker than the real test frames. A nearest-neighbour memorisation check on the training run's 16 preview samples gave a ratio of 0.90 (1.0 means samples are as far from the training frames as unseen real frames are), with no sign of copying.
FID and KID against real frames have not been computed for this checkpoint. An earlier epsilon-prediction model with the same architecture and data (not released) produced images about 5x too bright; v-prediction with zero terminal SNR fixed that.
Limitations
- Only 7 training acquisitions from porcine vessels and one device. The model has not been evaluated on human IVUS, other catheters or other frequencies.
- Evaluation is limited to 16 generated frames and one 150-frame test acquisition. No reader study has been done.
- Unconditional only: generation cannot be controlled by anatomy, pathology or segmentation.
- Only DDIM sampling with the settings above has been checked.
Intended use
Research and method development, for example studying synthetic data for ultrasound image analysis. Not for clinical use, and not for any use that presents synthetic images as real patient data.
Responsible AI Considerations
At Amazon, we are committed to developing AI responsibly and take a people-centric approach that prioritizes education, science, and our customers, to integrate responsible AI across the end-to-end AI lifecycle. We believe the use of AI must respect the rule of law and human rights, and we encourage the safe and responsible development of AI. When downloaded or used in accordance with AWS Responsible AI Policy, developers should work with their internal model team to ensure this model meets requirements for the relevant industry and use case and addresses unforeseen product misuse.
Please report model quality, risk, security vulnerabilities or Amazon AI Concerns here.
License
The model weights are released under the Apache License 2.0 (LICENSE). The bundle code in configs/ and scripts/ is released under the MIT License (LICENSE-code-MIT). The training data is licensed under CC BY 4.0 (docs/data_license.txt).
References
- Ho, Jain and Abbeel. Denoising Diffusion Probabilistic Models. NeurIPS 2020. https://arxiv.org/abs/2006.11239
- Nichol and Dhariwal. Improved Denoising Diffusion Probabilistic Models. ICML 2021. https://arxiv.org/abs/2102.09672
- Song, Meng and Ermon. Denoising Diffusion Implicit Models. ICLR 2021. https://arxiv.org/abs/2010.02502
- Salimans and Ho. Progressive Distillation for Fast Sampling of Diffusion Models. ICLR 2022. https://arxiv.org/abs/2202.00512
- Lin, Liu, Li and Yang. Common Diffusion Noise Schedules and Sample Steps are Flawed. WACV 2024. https://arxiv.org/abs/2305.08891
