Abstract
Medical image segmentation is inherently ambiguous due to the fuzzy boundaries of anatomical structures and varying expert interpretations. While diffusion models have emerged as a powerful tool for generating diverse outputs, standard Gaussian-based diffusion models are ill-suited for the discrete nature of binary segmentation masks. This paper presents BerDiff, a conditional Bernoulli diffusion model specifically designed for binary medical image segmentation. By utilizing a Bernoulli forward process and a discrete reverse process, BerDiff effectively captures the underlying distribution of plausible masks. Experimental results on lung CT and brain MRI datasets demonstrate that BerDiff outperforms state-of-the-art deterministic and probabilistic models, providing both high accuracy and meaningful uncertainty quantification through saliency maps.
Introduction
In clinical practice, the precise delineation of structures such as lung nodules or brain tumors is often a subject of debate among experts. This "ground truth" ambiguity means that a single deterministic prediction from a standard deep learning model—like a U-Net—may fail to represent the full range of clinical possibilities. To address this, researchers have turned to generative modeling to produce multiple plausible segmentation hypotheses.
Diffusion Probabilistic Models (DPMs) have recently set new benchmarks in generative tasks. However, most DPMs rely on Gaussian noise, which operates in a continuous space. Applying continuous noise to binary segmentation masks (where pixels are strictly 0 or 1) creates a mathematical discrepancy that can lead to sub-optimal performance and slower convergence. BerDiff bridges this gap by introducing a diffusion framework that operates natively on discrete Bernoulli distributions.
Methodology: The Bernoulli Diffusion Framework
BerDiff redefines the standard diffusion pipeline to accommodate the discrete nature of binary masks.
1. Bernoulli Forward Process
Instead of adding Gaussian noise, the forward process in BerDiff gradually corrupts the ground-truth mask by flipping pixel values according to a Bernoulli distribution. As the number of timesteps increases, the mask transitions from a clean segmentation to a state of pure discrete noise (a random binary grid).
2. Conditional Reverse Process
The core of BerDiff is a U-Net-based denoising network conditioned on the original medical image. This network is trained to reverse the Bernoulli corruption. A key innovation in BerDiff is the use of a calibration function to parameterize the Bernoulli noise. Rather than attempting to predict the clean mask directly at each step, the model estimates the noise parameters, which leads to more stable training and higher-quality samples.
3. Accelerated Inference and Saliency Mapping
To mitigate the computational cost of iterative sampling, BerDiff incorporates a sub-sequence sampling strategy inspired by Denoising Diffusion Implicit Models (DDIM). This allows the model to generate high-quality masks in significantly fewer steps. By running the inference process multiple times with different random seeds, BerDiff generates a set of diverse masks. These are then averaged to create a saliency map, where the intensity of each pixel represents the model's confidence, highlighting regions of high uncertainty—typically the ambiguous boundaries of a lesion.
Experimental Evaluation
The authors evaluated BerDiff against two major benchmarks: the LIDC-IDRI lung CT dataset and the BRATS 2021 brain MRI dataset.
Performance on LIDC-IDRI
The LIDC-IDRI dataset is unique because it provides four different radiologist annotations for each scan, making it ideal for testing a model's ability to handle ambiguity. BerDiff achieved a Generalized Energy Distance (GED) of 0.238 and a Hungarian-matched IoU (HM-IoU) of 0.596. These metrics indicate that BerDiff's generated samples are not only accurate but also cover the distribution of human expert annotations more effectively than previous probabilistic models like Prob.U-net or Gaussian-based diffusion models like SegDiff.
Performance on BRATS 2021
On the BRATS 2021 dataset, BerDiff was tested for its ability to produce a single high-quality consensus mask. It achieved a Dice score of 89.7, surpassing:
- nnU-net (Deterministic): 88.2
- Swin UNETR (Transformer-based): 89.0
- SegDiff (Gaussian Diffusion): 89.3
Efficiency and Convergence
Ablation studies revealed that the Bernoulli kernel is significantly more efficient for binary tasks. BerDiff reached superior performance levels in just 21,000 training iterations, whereas a comparable Gaussian-based model required over 86,500 iterations to achieve similar results.
Discussion and Conclusion
BerDiff demonstrates that matching the noise distribution to the data type is critical for efficient and accurate generative modeling. By treating binary segmentation as a discrete process, BerDiff provides a more mathematically sound and computationally efficient framework than standard diffusion models.
While the current model is limited to binary tasks and faces the common diffusion challenge of slow inference speeds (approximately 0.4 seconds per image), its ability to produce diverse, "second-opinion" style outputs makes it a valuable tool for clinical decision support. Future work will focus on extending this Bernoulli framework to multi-class segmentation and further optimizing sampling speeds to bring diffusion-based segmentation closer to real-time clinical application.
Summary updated