Brain-MRI Anomaly Segmentation
diffusion model checkpoints for MRI anomaly detection
2 min readupdated
A collection of generative weights (Conditional DDPM and Schrödinger bridges) for contactless and unsupervised pathology detection on brain MRIs. The models are trained exclusively on healthy T1 scans: during testing, the test scan is noised and restored back, after which the discrepancy areas are marked as potential anomalies. The set includes models trained with and without synthetic lesions, as well as the SparK encoder. The development is intended for research tasks in medical image analysis.
Key features
- Architecture variety: Base cDDPM (OpenAI UNet + SparK ResNet-50) and compact generators based on Schrödinger bridges.
- Synthetic control: Some models are trained with added synthetic lesions for more accurate pathology detection.
- Flexible inference: Checkpoints at 1200, 1600, and 2000 training epochs with available PyTorch weights.
- SparK node weights: Includes condition encoder initialization for training custom cDDPMs.
What you can do
- Tumor segmentation: Apply models to evaluate MRI scans on datasets like BraTS21 to find neoplasms.
- Stroke trace analysis: Test brain lesion detection on test datasets (for example, ATLAS v2).
- Pipeline integration: Use evaluation scripts from the accompanying repository to run multi-MC sampling and calculate SSIM.
- Medical research: Study the impact of synthetic lesions on the accuracy of diffusion anomaly detection.
Example
import torch
from huggingface_hub import hf_hub_download
path = hf_hub_download("Mohith202/brain-mri-uad-diffusion-repair",
"cddpm_fake/2000ep/epoch-1999_step-23999_loss-0.00_fold-1.ckpt")
state = torch.load(path, map_location="cpu", weights_only=True)["state_dict"]
# загрузите веса в собственный класс модели из репозитория
Read more
Details• Training data: T1 scans of healthy patients from the IXI dataset (192x192x100 crop, resampling to 96x96x50).
• Dice results (BraTS21): cDDPM + synthetic lesions show up to 60.5% at epoch 2000.
• Limitations: Research use only, not a medical device; T1 modality support only.










Comments