Abstract
Diffusion models have shown impressive performance for generative modelling of images. In this paper, we present a novel semantic segmentation method based on diffusion models. By modifying the training and sampling scheme, we show that diffusion models can perform lesion segmentation of medical images. To generate an image-specific segmentation, we train the model on the ground truth segmentation, and use the image as a prior during training and in every step during the sampling process. With the given stochastic sampling process, we can generate a distribution of segmentation masks. This property allows us to compute pixel-wise uncertainty maps of the segmentation, and allows an implicit ensemble of segmentations that increases the segmentation performance. We evaluate our method on the BRATS2020 dataset for brain tumor segmentation. Compared to state-of-the-art segmentation models, our approach yields good segmentation results and, additionally, detailed uncertainty maps.
Introduction
In medical imaging, precise lesion localization is critical, but clinicians also require a measure of confidence in these predictions. Standard deep learning architectures, such as the U-Net, typically produce deterministic, single-mask outputs. To estimate uncertainty or improve robustness through ensembles, researchers traditionally rely on training multiple models or employing techniques like Monte Carlo Dropout. However, these methods can be computationally burdensome or result in coarse uncertainty estimates.
This research addresses the need for an inherently probabilistic segmentation method. By repurposing Denoising Diffusion Probabilistic Models (DDPMs)—originally designed for high-fidelity image generation—the authors develop a model that explores the distribution of possible segmentations, effectively highlighting ambiguous boundaries where the model is less certain.
Methodology: Diffusion for Segmentation
The core innovation lies in adapting the diffusion framework for a supervised segmentation task. In a standard DDPM, a model learns to reverse a process that turns images into Gaussian noise. Here, the model is trained to transform noise into a binary segmentation mask.
Conditioning and Sampling
To ensure the generated mask aligns with the patient's specific anatomy, the original multi-sequence MRI images (T1, T2, FLAIR, and T1ce) are used as a conditional prior. These images are concatenated to the noisy mask at every step of the iterative denoising process. A modified U-Net architecture processes this multi-channel input to predict and remove noise.
Implicit Ensembling and Uncertainty
Because the diffusion sampling process is stochastic, running the model multiple times on the same input image produces a variety of slightly different masks. This creates an "implicit ensemble" from a single trained model. By generating a set of masks (e.g., $n=100$), the authors can calculate the pixel-wise variance. High variance areas directly correspond to regions where the model is uncertain about the tumor boundary.
Experimental Setup
The method was evaluated using the BRATS2020 dataset, a benchmark for brain tumor segmentation. The dataset includes four MRI sequences per patient. For this study, various tumor regions were merged into a single binary class. The model was trained on 16,298 axial slices from 332 patients and tested on 1,082 slices from 37 patients.
Results and Discussion
The diffusion-based approach demonstrated both competitive accuracy and superior qualitative insights.
Segmentation Performance
The ensemble approach significantly improved performance over single-sample inference. A 5-run ensemble achieved a Dice score of 0.881, outperforming a single run (0.866) and standard SegNet (0.839). This performance approaches the state-of-the-art nnU-Net (0.891). Quantitative analysis showed that Dice scores typically plateau after approximately 20 samples.
Uncertainty Visualization
As shown in the qualitative results, the variance maps provide a granular view of uncertainty. Unlike traditional methods like Bayesian SegNet, which may produce broader or less localized uncertainty, the diffusion model specifically traces the "fuzzy" edges of lesions. This localized uncertainty is invaluable for clinical applications like radiation therapy planning, where defining precise safety margins is essential.
Conclusion and Future Work
This work demonstrates that diffusion models can be effectively repurposed for medical image segmentation to provide high-quality ensembles and uncertainty maps. While the results are promising, the primary limitation is inference speed; generating a single sample currently takes 48 seconds due to the 1,000 iterative steps required.
Future research will focus on extending the model to multi-class segmentation and improving sampling efficiency. The authors suggest that implementing Denoising Diffusion Implicit Models (DDIM) could potentially reduce inference time to a few seconds by skipping steps during the sampling process without compromising segmentation quality.
Summary updated