U2AD: Uncertainty-based Unsupervised Anomaly Detection Framework for Detecting T2 Hyperintensity in MRI Spinal Cord
Qi Zhang, Xiuyuan Chen, Ziyi He, Kun Wang, Lianming Wu, Hongxing Shen, Jianqi Sun
TL;DR
This work tackles automatic detection of T2-weighted spinal cord hyperintensities with a novel uncertainty-guided unsupervised anomaly detection framework, $U^{2}AD$. By leveraging a Vision Transformer architecture in a mask-and-reconstruct paradigm and integrating both epistemic and aleatoric uncertainty via Monte Carlo sampling, the method adapts within the same clinical dataset to counter domain shifts and task conflicts. A two-stage process—pretraining on healthy data followed by uncertainty-guided adaptation—enables robust reconstruction of normal regions while amplifying anomalies, yielding superior patient-level and segment-level performance compared to both supervised and other unsupervised methods. The approach demonstrates clinical utility for detecting and localizing T2 hyperintensities and sets a new benchmark for uncertainty-guided UAD in medical imaging, with open-source code available for replication and extension.
Abstract
T2 hyperintensities in spinal cord MR images are crucial biomarkers for conditions such as degenerative cervical myelopathy. However, current clinical diagnoses primarily rely on manual evaluation. Deep learning methods have shown promise in lesion detection, but most supervised approaches are heavily dependent on large, annotated datasets. Unsupervised anomaly detection (UAD) offers a compelling alternative by eliminating the need for abnormal data annotations. However, existing UAD methods rely on curated normal datasets and their performance frequently deteriorates when applied to clinical datasets due to domain shifts. We propose an Uncertainty-based Unsupervised Anomaly Detection framework, termed U2AD, to address these limitations. Unlike traditional methods, U2AD is designed to be trained and tested within the same clinical dataset, following a "mask-and-reconstruction" paradigm built on a Vision Transformer-based architecture. We introduce an uncertainty-guided masking strategy to resolve task conflicts between normal reconstruction and anomaly detection to achieve an optimal balance. Specifically, we employ a Monte-Carlo sampling technique to estimate reconstruction uncertainty mappings during training. By iteratively optimizing reconstruction training under the guidance of both epistemic and aleatoric uncertainty, U2AD reduces overall reconstruction variance while emphasizing regions. Experimental results demonstrate that U2AD outperforms existing supervised and unsupervised methods in patient-level identification and segment-level localization tasks. This framework establishes a new benchmark for incorporating uncertainty guidance into UAD, highlighting its clinical utility in addressing domain shifts and task conflicts in medical image anomaly detection. Our code is available: https://github.com/zhibaishouheilab/U2AD
