IterMask3D: Unsupervised Anomaly Detection and Segmentation with Test-Time Iterative Mask Refinement in 3D Brain MRI

Ziyun Liang, Xiaoqing Guo, Wentian Xu, Yasin Ibrahim, Natalie Voets, Pieter M Pretorius, J. Alison Noble, Konstantinos Kamnitsas · 2025

Read IterMask3D: Unsupervised Anomaly Detection and Segmentation with Test-Time Iterative Mask Refinement in 3D Brain MRI by Ziyun Liang, Xiaoqing Guo, Wentian Xu, Yasin Ibrahim, Natalie Voets, Pieter M Pretorius, J. Alison Noble, Konstantinos Kamnitsas (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2504-04911.txt.

Introduction

Ziyun Liang, Xiaoqing Guo, and their co-authors present IterMask3D, a 2025 method that finds and outlines anomalies in three dimensional brain MRI scans without labeled examples. Such methods learn what normal scans look like, then flag anything that departs from normal. The usual trick damages the input image and rebuilds it, but the damage also erases healthy detail, which causes false alarms.

Their method masks only part of the image at a time, rebuilds that part, and then shrinks the mask where the rebuild error is low. Round by round, healthy regions are unmasked and only odd regions stay covered. The final mask marks the anomalies. This test time loop aims at cleaner outlines of tumors and lesions with fewer false positives.

Catalog record

CREATORZiyun Liang, Xiaoqing Guo, Wentian Xu, Yasin Ibrahim, Natalie Voets, Pieter M Pretorius, J. Alison Noble, Konstantinos Kamnitsas
YEAR2025
COLLECTIONPAPERS
FORMATTXT
FILE SIZE78 KB
VERSION1.0
LICENSEhttp://creativecommons.org/licenses/by/4.0/
RIGHTSCC BY
SOURCEarXiv

Source: https://arxiv.org/abs/2504-04911

Browse the full library · About the Tower of Babel

Full text

The opening of the work, from the library's hosted text:

IterMask3D: Unsupervised Anomaly Detection and Segmentation with Test-Time Iterative Mask Refinement in 3D Brain MRI Ziyun Liang, Xiaoqing Guo, Wentian Xu, Yasin Ibrahim, Natalie Voets, Pieter M Pretorius, J. Alison Noble, Konstantinos Kamnitsas Abstract Unsupervised anomaly detection and segmentation methods train a model to learn the training distribution as ‘normal’. In the testing phase, they identify patterns that deviate from this normal distribution as ‘anomalies’. To learn the ‘normal’ distribution, prevailing methods corrupt the images and train a model to reconstruct them. During testing, the model attempts to reconstruct corrupted inputs based on the learned ‘normal’ distribution. Deviations from this distribution lead to high reconstruction errors, which indicate potential anomalies. However, corrupting an input image inevitably causes information loss even in normal regions, leading to suboptimal reconstruction and an increased risk of false positives. To alleviate this, we propose IterMask3D \rm{IterMask3D} , an iterative spatial mask-refining strategy designed for 3D brain MRI. We iteratively spatially mask areas of the image as corruption and reconstruct them, then shrink the mask based on reconstruction error. This process iteratively unmasks ‘normal’ areas to the model, whose information further guides reconstruction of ‘normal’ patterns under the mask to be reconstructed accurately, reducing false positives. In addition, to achieve better reconstruction performance, we also propose using high-frequency image content as additional structural information to guide the reconstruction of the masked area. Extensive experiments on the detection of both synthetic and real-world imaging artifacts, as well as segmentation of various pathological lesions across multiple MRI sequences, consistently demonstrate the effectiveness of our proposed method. Code is available at https://github.com/ZiyunLiang/IterMask3D. 1 Introduction Segmenting anomalies is crucial in the field of medical image analysis as it enables applications such as early disease detection and diagnosis, guides treatment planning, and reduces clinical workload. Conventional anomaly segmentation methods are mostly supervised, relying on annotated training data, where images contain anomalies with corresponding manual labels. Trained on a limited set of data types, the model can only segment anomalies resembling those in its training data, and struggles to detect other types of unseen anomalies. In the context of brain MRI images, the focus of this study, this type of methods typically target a specific pathology ( Kamnitsas et al., 2017 ; Isensee et al., 2021 ; Stollenga et al., 2015 ) . Unsupervised anomaly segmentation, on the other hand, does not require any ‘anomalous’ images or their manual segmentations during training. Instead, it is trained exclusively on ‘normal’ images and treats this training distribution as the ‘normal’ reference. During testing, the method regards any deviation from this reference as ‘anomaly’ and attempts to segment it. This enables the detection of previously unseen patterns, including new pathologies or even imaging artifacts, making it suitable for tasks such as automatic screening for incidental findings ( Rowley et al., 2023 ) or automatic scan quality control ( Hendriks et al., 2024 ) . Such an approach is especially beneficial when training data are limited and the specific pathology type is unknown in advance, facilitating the detection of rare diseases. In this work, we explore unsupervised anomaly segmentation, with a focus on brain MRI data. A prevalent strategy for learning the training distribution is reconstruction-based methods that follow the ‘corrupt and reconstruct’ paradigm. During training, images are first artificially corrupted, then models are trained to reconstruct the provided ‘normal’ in-distribution images, thus internalizing the normal distribution through the reconstruction process. At testing, regions that deviate from the learned normal distribution, i.e., anomalies, tend to yield high reconstruction errors, which can then be exploited for segmentation. Common ways of adding corruptions include compression ( Atlason et al., 2019 ; Baid et al., 2021 ) or noise as in diffusion models ( Pinaya et al., 2022a ; Bercea et al., 2023a ; Wolleb et al., 2022 ) , where the model is tasked to reconstruct from these corruptions. A common challenge of these types of methods is sensitivity-precision trade-off , as shown in Fig. 1 . In order to amplify reconstruction error in abnormal areas for better segmentation, more corruption is preferred. However, since the location of anomalies is unknown in advance, corruption is applied to the entire image. Thus, more corruptions will not only increase the reconstruction error in abnormal area, but it will also increase it in normal areas, which leads to false positives. As shown in Fig. 1 , increasing the noise level and compression results in higher reconstruction error over the anomaly (in this case, the hyper-intense tumor), thus leads to better detection of the anomaly area. But at the same time, normal areas also have larger reconstruction errors, leading to false positives. This sensitivity-precision trade-off serves as the main motivation of our paper: Can we use input corruptions to amplify reconstruction errors in anomalous areas for better segmentation, while preserving the information in normal areas to minimize reconstruction errors and reduce false positives? To address this problem, we propose IterMask3D , an iterative mask refinement method for unsupervised anomaly segmentation and detection that can be used on 3D MRI data. To amplify reconstruction errors in anomalous regions, we introduce spatial masking as a form of corruption. To minimize errors in normal regions, we employ an iterative spatial mask shrinking process, gradually refining the mask toward the anomaly to reduce information loss. As normal tissues are progressively unmasked and fed into the model, they guide the reconstruction of normal structures beneath the mask to reduce false positives. Additionally, we generate a structural image using high-frequency masking, providing structural guidance to steer the reconstruction of normal areas for the mask-shrinking process. Figure 1: Sensitivity–Precision Trade-off in reconstruction-based methods: When corruption (e.g., noise or compression) is lower, the reconstruction error over anomalous regions (the hyper-intense tumor) remains low, often resulting in missed detections. As corruption increases, errors in abnormal regions become more pronounced, improving sensitivity—but at the cost of higher errors in normal regions, which can increase false positives and reduce precision. Our main contributions are: (1) We propose a 3D unsupervised anomaly segmentation and detection method IterMask3D , which iteratively shrinks a spatial mask towards the anomaly to reduce false positives on normal areas. (2) We further propose the use of frequency masking to generate high-frequency images as structural guidance for the mask-shrinking process, enhancing the reconstruction of normal areas and further reducing false positives. (3) We introduce a subject-specific thresholding strategy that determines, at each iteration, which regions on the error map can be confidently classified as normal. This allows the iterative mask-shrinking process to automatically determine the optimal stopping point for each individual subject without the need to require extra information from validation data. (4) We evaluate the effectiveness of our method on diverse types of anomalies, including both pathological and artifact-based abnormalities. Specifically, we test our model on synthetic and real-world artifacts, as well on tumor and stroke as pathologies across multiple MRI sequences. This paper builds upon our previous work ( Liang et al., 2024 ) , where we introduced Iterative Mask Refinement ( IterMask^{2} ) for unsupervised anomaly segmentation in 2D brain MRI pathology. The 2D-based model follows the standard practice of anomaly segmentation, where it is trained on healthy slices and evaluated on anomaly slices from the same

Read the complete text