Diffusion Models with Implicit Guidance for Medical Anomaly Detection

Cosmin I. Bercea, Benedikt Wiestler, Daniel Rueckert, Julia A. Schnabel

Introduction: The Challenge of "Over-cleaning"

Unsupervised anomaly detection in medical imaging often employs a "restoration" strategy. A potentially pathological scan is corrupted with noise to obscure details, and a generative model—typically a Denoising Diffusion Probabilistic Model (DDPM)—is used to reconstruct a "pseudo-healthy" version. By calculating the difference between the original scan and this reconstructed healthy version, clinicians can identify anomalies like tumors or fractures.

However, standard DDPMs face a significant trade-off. To effectively obscure large pathologies, a high level of noise is required. This excessive noise often destroys the unique, fine details of a patient's healthy anatomy. Consequently, the model reconstructs healthy regions that differ slightly from the original, leading to false positives that complicate diagnostic accuracy.

The THOR Framework: Temporal Harmonization for Optimal Restoration

To address this, researchers introduced THOR (Temporal Harmonization for Optimal Restoration). THOR incorporates an "implicit guidance" mechanism during the denoising (inference) phase without requiring model retraining.

The process involves three key steps:

  1. Intermediate Anomaly Mapping: At specific timesteps during denoising, the model generates a "rough draft" of the healthy image. THOR compares this draft to the original input to create a temporary anomaly map.
  2. Temporal Harmonization: This map guides the reconstruction. In regions identified as "healthy" (low discrepancy), THOR prioritizes the original image's pixels. In "anomalous" regions (high discrepancy), the diffusion model is allowed to generate its own "pseudo-healthy" pixels.
  3. Refined Scoring: The final anomaly score is derived from the harmonic mean of these maps across multiple timesteps, providing a robust signal.
The THOR denoising process featuring periodic harmonization steps to preserve healthy tissue details.

By dynamically blending original context back into the reconstruction, THOR maintains the integrity of healthy tissue while effectively "healing" pathological regions.

Experimental Setup and Datasets

The framework was evaluated on two distinct medical imaging modalities:

  • Brain MRI (Stroke): Training utilized 582 T1-weighted scans from the IXI dataset and 217 healthy samples from ATLAS v2.0. Testing was conducted on 655 scans from ATLAS v2.0 containing expertly segmented stroke lesions.
  • Pediatric Wrist X-rays: The GRAZPEDWRI-DX dataset (10,643 X-rays) was used, covering various anomalies including fractures, bone anomalies, and soft tissue conditions.

The study also compared the effects of Gaussian noise versus Simplex noise. While Simplex noise proved effective for large lesions like strokes due to its coarser patterns, it struggled with general anomaly detection (e.g., fractures) where it occasionally "reconstructed" the anomalies it was meant to remove.

Key Results and Discussion

THOR consistently outperformed state-of-the-art baselines, including standard DDPM, AutoDDPM, and AnoDDPM.

Quantitative and qualitative comparison of THOR against baseline diffusion models on brain MRI scans.

In Brain MRI tasks using Gaussian noise, THOR achieved an average Dice score of 20.41, a substantial improvement over the standard DDPM's 8.05. For small lesions, the improvement was even more pronounced, showing a 103% increase over the best baseline. In wrist X-rays, THOR significantly improved fracture detection, reaching a recall of 75.39% compared to 28.53% for standard DDPM. It also achieved near-perfect recall (99.76%) for detecting metal implants.

Conclusion and Future Directions

THOR demonstrates that anomaly detection is a delicate balancing act between pathology removal and context preservation. By leveraging implicit guidance, THOR bypasses the traditional noise trade-off without the need for specialized architectures or retraining.

Future work will focus on extending THOR to a wider variety of organs and modalities. Additionally, the researchers aim to refine the harmonization process to better distinguish between benign anatomical variations and actual active pathologies, further reducing false positives in clinical settings.

Summary updated

BibTeX
@inproceedings{bercea2024diffusion,
  author = {Cosmin I. Bercea and Benedikt Wiestler and Daniel Rueckert and Julia A. Schnabel},
  title = {{Diffusion Models with Implicit Guidance for Medical Anomaly Detection}},
  booktitle = {International Conference on Medical Image Computing and Computer-Assisted Intervention},
  year = {2024},
  doi = {10.1007/978-3-031-72120-5\_20},
}
Figure