Skip to content
ModelListedExternal
Download

Brain Ddpm 128

This model is a diffusion-based model for unconditional image generation of brain MRI FLAIR slices of size 128x128 pixels. The model was trained using the DDPM architecture, with attention mechanisms in the middle of...

KindOtherVersionRevision c361bdb

Model source

Kind
Other
File size
434 MB
Version
vRevision c361bdb
Updated
Sep 15, 2026
Downloads
10
Source
Hugging Face

Source description

Brain MRI Synthesis with DDPM (128x128)

This model is a diffusion-based model for unconditional image generation of brain MRI FLAIR slices of size 128x128 pixels.
The model was trained using the DDPM architecture, with attention mechanisms in the middle of the U-Net.
It is trained from scratch on a dataset of brain MRI slices, specifically designed for generating synthetic brain images.

Training Details

  • Architecture: DDPM (Denoising Diffusion Probabilistic Model)
  • Resolution: 128x128 pixels
  • Dataset: Lesion2D VH splitted (FLAIR MRI slices) (70% of the dataset)
  • Channels: 1 (grayscale, FLAIR modality)
  • Epochs: 50
  • Batch size: 16
  • Optimizer: AdamW with learning rate of 1.0e-4
  • Scheduler: Cosine with 500 warm-up steps
  • Gradient Accumulation: 2 steps
  • Mixed Precision: No
  • Hardware: Trained on one NVIDIA GeForce GTX 1080 Ti GPU of 12GB
  • Memory Consumption: Around 11 GB during training

U-Net Architecture

  • Down Blocks: [DownBlock2D, DownBlock2D, DownBlock2D, AttnDownBlock2D, DownBlock2D]
  • Up Blocks: [UpBlock2D, AttnUpBlock2D, UpBlock2D, UpBlock2D]
  • Layers per Block: 2
  • Block Channels: [128, 128, 256, 256, 512]

Usage

You can use the model directly with the diffusers library:

from diffusers import DDPMPipeline
import torch

# Load the model
pipeline = DDPMPipeline.from_pretrained("benetraco/brain_ddpm_128")
pipeline.to("cuda")  # or "cpu"

# Generate an image
image = pipeline(batch_size=1).images[0]

# Display the image
image.show()

Sources

1 source
Hugging FacePrimaryVersion c361bdbfc575c1fd189f5140f9a0d785d7d5a051
huggingface.co/benetraco/brain_ddpm_128/tree/c361bdbfc575c1fd189f5140f9a0d785d7d5a051

Verified Sep 15

Model artifacts

1 artifact

unet/diffusion_pytorch_model.safetensors

safetensors · 434 MB · SHA-256 b7922c3f7181…542d · Hugging Face

Download file

Source excerpts

2 excerpts

--- license: mit tags: - pytorch - diffusers - unconditional-image-generation - diffusion-models-class - medical-imaging - brain-mri - multiple-sclerosis --- # Brain MRI Synthesis with DDPM (128x128) This model is a diffusion-based model for unconditional image generation of **brain MRI FLAIR slices** of size **128x128 pixels**. The model was trained using the [DDPM](https://arxiv.org/abs/2006.11239) architecture, with attention mechanisms in the middle of the U-Net. It is trained from scratch on a dataset of brain MRI slices, specifically designed for generating synthetic brain images. ## Training Details - **Architecture:** DDPM (Denoising Diffusion Probabilistic Model) - **Resolution:** 128x128 pixels - **Dataset:** Lesion2D VH splitted (FLAIR MRI slices) (70% of the dataset) - **Channels:** 1 (grayscale, FLAIR modality) - **Epochs:** 50 - **Batch size:** 16 - **Optimizer:** AdamW with learning rate of `1.0e-4` - **Scheduler:** Cosine with 500 warm-up steps - **Gradient Accumulation:** 2 steps - **Mixed Precision:** No - **Hardware:** Trained on **one NVIDIA GeForce GTX 1080 Ti GPU of 12GB** - **Memory Consumption:** Around **11 GB** during training ## U-Net Architecture - **Down Blocks:** [DownBlock2D, DownBlock2D, DownBlock2D, AttnDownBlock2D, DownBlock2D] - **Up Blocks:** [UpBlock2D, AttnUpBlock2D, UpBlock2D, UpBlock2D] - **Layers per Block:** 2 - **Block Channels:** [128, 128, 256, 256, 512] ## Usage You can use the model directly with the `diffusers` library: ```python from diffusers import DDPMPipeline import torch # Load the model pipeline = DDPMPipeline.from_pretrained("benetraco/brain_ddpm_128") pipeline.to("cuda") # or "cpu" # Generate an image image = pipeline(batch_size=1).images[0] # Display the image image.show()

Source context: 10 downloads · 1 likes · Pipeline unconditional-image-generation · Library diffusers · Repo benetraco/brain_ddpm_128