Abstract
Unsupervised anomaly detection (UAD) in medical imaging offers a scalable solution for identifying diverse pathologies without the need for exhaustive, expert-labeled datasets. While autoregressive transformers have previously set the benchmark for UAD, their clinical utility is hampered by extreme computational costs and error accumulation. This paper presents a novel approach utilizing Denoising Diffusion Probabilistic Models (DDPMs) to "heal" anomalous brain images. By training exclusively on healthy data, the model learns to reconstruct pathological regions as healthy tissue. Our method achieves state-of-the-art performance across multiple modalities (CT and MRI) while reducing inference times from over an hour to under a minute.
Introduction
Detecting lesions such as tumors, hemorrhages, or multiple sclerosis plaques in brain scans is a cornerstone of neuroradiology. However, manual segmentation is labor-intensive and prone to inter-observer variability. Unsupervised models are attractive because they can theoretically detect any deviation from "normal" anatomy.
Currently, Autoregressive Transformers are the dominant architecture for this task, but they suffer from three primary limitations:
- Computational Latency: Processing a single 2D slice can take several minutes, making them impractical for real-time clinical workflows.
- Dimensionality Constraints: Their 1D sequence-based processing struggles to scale to high-resolution 3D volumes.
- Error Accumulation: Small errors in the sequential generation process often lead to incoherent or blurry reconstructions.
To address these challenges, we propose a latent diffusion-based framework that leverages spatial context more effectively and offers significant gains in inference speed.
Methodology
Two-Stage Architecture
Our approach utilizes a two-stage generative pipeline:
- Compression (VQ-VAE): High-resolution brain images are first compressed into a lower-dimensional latent space using a Vector Quantized Variational Autoencoder. This reduces the computational complexity of the diffusion process while preserving essential structural features.
- Latent Diffusion (DDPM): A Diffusion Model is trained on the latent representations of healthy brain scans only. The model learns to reverse a Gaussian noise process to recover the original healthy latent distribution.
The "Healing" Mechanism
To segment anomalies in a patient scan, the model performs a "forward" diffusion step (adding noise) followed by a "reverse" step (denoising). Because the model's training distribution excludes pathology, it lacks the capability to reconstruct tumors or bleeds. Instead, it "heals" these regions by replacing them with the most probable healthy tissue configurations.
We identify anomalous regions by calculating the KL Divergence across the diffusion chain. This divergence acts as a signal to create an anomaly mask. We then perform "inpainting" on the masked regions to generate a synthetic "healthy version" of the patient's brain. The final segmentation is derived from the residual difference between the original scan and the healed reconstruction.
Experimental Setup
Datasets
The model's robustness was evaluated across diverse imaging modalities and pathologies:
- Healthy Training Data: 9,000 Head CT images (MedNIST) and 15,000 FLAIR MRI scans (UK Biobank).
- Pathological Evaluation Data:
- Synthetic anomalies (sprites) on MedNIST.
- Real MRI pathology: White Matter Hyperintensities (WMH), Tumors (BRATS), and Multiple Sclerosis (MSLUB).
- Real CT pathology: Intracerebral Hemorrhage (CROMIS, KCH, and CHRONIC).
Results and Discussion
Detection Performance
On synthetic data, the proposed DDPM achieved a DICE score of 0.920, significantly outperforming single Transformers (0.768) and even ensembles of Transformers (0.895). In real-world MRI datasets like BRATS and WMH, the model remained competitive with state-of-the-art ensembles while providing superior consistency compared to single-model baselines.
The Diffusion "Sweet Spot"
An important discovery in our research is that anomaly visibility is not uniform throughout the diffusion process. We found that lesions are most detectable in the mid-range of the diffusion chain (specifically between steps $t=400$ and $600$). Early steps are dominated by high-frequency noise, while late steps focus on global structural alignment; the middle steps provide the optimal balance for identifying localized pathological deviations.
Computational Efficiency
The most significant advantage of this method is its speed. By utilizing Denoising Diffusion Implicit Models (DDIM) to skip steps in the reverse process, we achieved a massive reduction in latency. For a batch of 100 CT slices, Transformer ensembles required over an hour to process, whereas our DDPM/DDIM framework completed the task in 12 to 46 seconds.
Conclusion
This work demonstrates that Diffusion Models are a viable and superior alternative to Transformers for unsupervised brain anomaly detection. By preserving spatial context and offering a 100x speedup, this method moves unsupervised segmentation closer to practical clinical implementation. Future work will focus on refining thresholding techniques for different scanner types and extending the framework to fully native 3D volumes.
Summary updated