ML2026

MedFusion-Diff

A pixel-space conditional diffusion model — Conditional U-Net with cross-attention, DDPM — synthesising brain tumour MRI slices from BraTS 2023, conditioned on patient metadata including age, gender, diagnosis, and WHO grade.

Training slices
~9.5K
Conditioning variables
4
Mixed-precision training
RTX 4090

The problem

Brain tumour imaging datasets are small, hard to access, and unevenly distributed across the conditions that matter — a rare WHO grade may have a handful of examples. You cannot simply augment your way out of that: rotating an existing scan does not create a new patient. What is needed is generation that is *controllable*, so you can ask for the underrepresented case specifically.

The approach

A DDPM operating directly in pixel space, with a Conditional U-Net whose cross-attention layers consume patient metadata. Conditioning on age, gender, diagnosis, and WHO grade means the model is steerable — you request a slice matching a specific clinical profile rather than sampling blindly and hoping.

Medical imaging research is throttled by scarce, privacy-locked scans. I wanted to prove a conditional diffusion model could generate realistic, metadata-controllable MRI slices that expand training sets without exposing a single real patient.

Why I built it

Architecture

  1. 01

    Data pipeline

    Scans pulled directly from Synapse, preprocessed into roughly 9,500 training slices from BraTS 2023.

  2. 02

    Conditional U-Net

    Cross-attention layers inject patient metadata (age, gender, diagnosis, WHO grade) into the denoising path.

  3. 03

    DDPM training

    Pixel-space denoising diffusion, mixed-precision AMP on RunPod RTX 4090 GPUs.

  4. 04

    Sampling

    Metadata-conditioned generation — request a clinical profile, get a matching slice.

Stack

Architecture
Conditional U-Net · DDPM · cross-attention
Data
BraTS 2023 via Synapse
Compute
RunPod RTX 4090 · CUDA · AMP
  • PyTorch
  • DDPM
  • U-Net
  • Cross-Attention
  • BraTS 2023
  • RunPod
  • CUDA
  • AMP
  • NumPy

Outcome

A working conditional DDPM over BraTS 2023 producing metadata-steerable MRI slices. The interesting result is control rather than raw fidelity: being able to ask for a specific clinical profile is what makes synthetic imaging useful for balancing a training set.

NextData Eng · Web

Bloomberg Terminal-style analytics across 84 global instruments.