Introduction
Detecting abnormalities in brain imaging is a cornerstone of clinical neurology, yet it remains a significant challenge due to the extreme heterogeneity of pathologies like tumors, strokes, or multiple sclerosis lesions. Traditional supervised deep learning requires vast amounts of pixel-perfect manual labels, which are costly and time-consuming to acquire. Unsupervised methods offer an alternative by learning the "landscape of normality" from healthy scans and identifying anomalies as deviations from this norm.
However, current state-of-the-art unsupervised approaches, primarily based on Variational Autoencoders (VAEs), suffer from blurry reconstructions and the "fidelity paradox," where the model occasionally reconstructs the anomaly itself, leaving no error signal for detection. This paper introduces a novel framework that combines Vector Quantized Variational Autoencoders (VQ-VAEs) with Transformers to overcome these limitations.
Methodology
The proposed pipeline moves away from simple reconstruction error toward a probabilistic "healing" approach:
- VQ-VAE Compression: 2D MRI slices are compressed into a grid of discrete "codebook" indices, transforming the image into a sequence of tokens.
- Transformer Modeling: An ensemble of "Performers" (efficient linear Transformers) learns the probability distribution of these tokens in healthy brains, capturing long-range dependencies across the brain structure.
- Anomaly Detection and "Healing": The Transformer identifies tokens with a low probability of belonging to a healthy brain. These "abnormal" tokens are removed and resampled (healed) by the Transformer to generate a "healthy" version of the latent space.
- Residual Analysis: The healed latent space is decoded back to pixel space. The difference between the original and healed images reveals the exact location of the anomaly.
- Ensemble of Orderings: To ensure robustness, the model uses an ensemble of eight Transformers, each scanning the image in a different direction (e.g., horizontal, vertical, rotated).
Experimental Setup
The model was trained on 15,000 radiologically normal participants from the UK Biobank (UKB) to define the normality baseline. Evaluation was conducted across four distinct real-world datasets representing various pathologies: UKB (Test set) for white matter hyperintensities (WMH), MSLUB for multiple sclerosis lesions, the WMH Challenge benchmark, and BRATS for brain tumor (glioma) segmentation.
Results and Discussion
The Transformer-based approach consistently outperformed state-of-the-art VAE methods across all benchmarks. On the challenging BRATS tumor dataset, the method reached a DICE score of 0.759, nearly doubling the performance of the VQ-VAE baseline (0.331). For the task of flagging whether an image is "sick" or "healthy," the model achieved an AUCROC of 0.932 on near-out-of-distribution data.
Key insights from the study include:
- Transformers over VAEs: Transformers are superior at modeling the complex structural organization of the brain compared to standard convolutional VAEs. By treating the brain as a sequence of discrete parts, the model more accurately predicts expected healthy structures.
- Healing vs. Reconstructing: Actively "fixing" the image prevents the fidelity paradox where the model might otherwise try to represent the lesion.
- Spatial Masking: Using the Transformer's internal probability to create a resampling mask allows the model to ignore residuals in high-frequency healthy areas (like the cortex), significantly reducing false positives.
Conclusion and Future Work
While highly effective in 2D, extending this framework to 3D volumes remains a key area for future work to capture vertical structural context. Additionally, the model's sensitivity to the purity of the "healthy" training set highlights the importance of a robust definition of normality. Despite these challenges, the combination of VQ-VAEs and Transformers represents a significant step forward in unsupervised medical image analysis, achieving high-fidelity segmentations without the need for complex post-processing.
Summary updated