Transformer Based Models for Unsupervised Anomaly Segmentation in Brain MR Images

Ahmed Ghorbel, Ahmed Aldahdooh, Shadi Albarqouni, Wassim Hamidouche

Introduction

In medical imaging, the precise segmentation of tumors and lesions is a cornerstone of effective diagnosis and treatment planning. Traditionally, this task has relied on supervised deep learning models that require vast amounts of expert-labeled data—a resource that is both expensive and time-consuming to acquire. Unsupervised Anomaly Detection (UAD) offers a compelling alternative by training models exclusively on healthy brain scans. By learning the distribution of "normal" anatomy, these models can identify pathologies as deviations (residuals) from a reconstructed healthy version of the input image.

While Convolutional Neural Networks (CNNs) have been the standard for UAD, they are limited by their local receptive fields, which often struggle to capture the global context of the entire brain. This paper investigates the potential of Vision Transformers (ViTs) to overcome these limitations through self-attention mechanisms, proposing five distinct architectures for brain anomaly segmentation.

Methodology

The researchers developed five Transformer-based autoencoder architectures to evaluate different methods of capturing spatial and global information:

  1. B_TAE (Basic Transformer Autoencoder): A vanilla Transformer model that treats image patches as a sequence.
  2. SC_TAE (Spatial Convolutional): A hybrid model that uses a spatial bottleneck to combine local CNN-derived features with global Transformer features.
  3. DC_TAE (Dense Convolutional): Similar to the SC_TAE but utilizes a dense bottleneck for richer feature representation.
  4. H_TAE (Hierarchical): A multi-scale approach inspired by Swin-Transformers that processes images at varying resolutions.
  5. H_TAE_S (Hierarchical with Skip Connections): A hierarchical model incorporating skip connections (similar to a U-Net) to preserve fine-grained spatial details from the encoder to the decoder.

Experimental Setup

The models were trained on the OASIS-3 dataset, utilizing 16,896 slices from 574 healthy subjects. Performance was then evaluated on two distinct pathological datasets:

  • BraTS-20: Focused on the detection of gliomas (brain tumors).
  • MSLUB: Focused on identifying Multiple Sclerosis (MS) lesions.

All images underwent standard preprocessing, including skull-stripping, normalization, and resizing to 256x256 pixels.

Key Insights and Results

The Reconstruction Paradox

One of the most significant findings involved the B_TAE (Basic Transformer). Despite its theoretical advantages, it performed poorly in anomaly detection. The model was "too good" at reconstruction; it successfully modeled the intensity of the anomalies themselves, leaving a negligible residual signal for segmentation. This highlights the need for architectures that specifically constrain the model to reconstruct only "healthy" features.

The Power of Hybrid and Hierarchical Models

The study found that the most successful models were those that effectively balanced local texture and global structure.

  • BraTS (Tumors): The H_TAE_S model achieved a state-of-the-art (SOTA) Dice Similarity Coefficient (DSC) of 0.5296, significantly outperforming the best CNN-based Variational Autoencoder (VAE) at 0.4663.
  • MSLUB (MS Lesions): The DC_TAE model achieved a DSC of 0.1728, performing comparably to existing SOTA models for this difficult task.
  • Fidelity: The H_TAE_S model demonstrated exceptional reconstruction accuracy on healthy data, achieving a Structural Similarity Index (SSIM) of 0.9958.

The Importance of Skip Connections

In hierarchical architectures, the addition of skip connections (H_TAE_S) proved vital. These connections allow high-resolution spatial information to bypass the bottleneck, enabling the model to define the boundaries of anomalies with much higher precision than models relying solely on the latent representation.

Conclusion and Future Work

Transformer-based models represent a significant step forward for Unsupervised Anomaly Detection in medical imaging. By leveraging global context, they provide more coherent and accurate segmentations of complex pathologies like brain tumors.

However, this performance comes at the cost of computational complexity. The top-performing H_TAE_S model requires over 100 million parameters, making it significantly more resource-intensive than traditional CNNs. Future research will focus on optimizing these architectures for efficiency and improving the model's ability to "hallucinate" healthy tissue in the presence of large, complex anomalies—a remaining challenge in the field of reconstruction-based UAD.

Summary updated

BibTeX
@inproceedings{ghorbel2022transformer,
  author = {Ahmed Ghorbel and Ahmed Aldahdooh and Shadi Albarqouni and Wassim Hamidouche},
  title = {{Transformer Based Models for Unsupervised Anomaly Segmentation in Brain MR Images}},
  booktitle = {BrainLes @ MICCAI},
  year = {2022},
  doi = {10.1007/978-3-031-33842-7\_3},
}
Figure