MaRS: Robust Out-of-Distribution Detection via Mahalanobis Residual Scoring
- URL: http://arxiv.org/abs/2606.22649v2
- Date: Thu, 25 Jun 2026 20:47:02 GMT
- Title: MaRS: Robust Out-of-Distribution Detection via Mahalanobis Residual Scoring
- Abstract summary: We introduce MaRS, a label-free OOD detector that learns an in-distribution manifold using a lightweight autoencoder and measures deviation via a Mahalanobis distance on reconstruction residuals.<n>MaRS outperforms established confidence-, distance-, and reconstruction-based baselines, while remaining fully post-hoc and lightweight.
- Score: 2.0480448867367476
- License: http://creativecommons.org/licenses/by/4.0/
- Abstract: Foundation models provide highly descriptive representations for medical images, yet their reliability degrades under distribution shifts arising from changes in patients, devices, or acquisition conditions. Reliable out-of-distribution (OOD) detection is therefore essential for safe deployment. Recent post-hoc detectors efficiently exploit frozen embeddings (e.g., kNN), whereas reconstruction-based OOD detection in latent feature space has seen limited adoption due to inconsistent performance. In this work, we show that the limitation of reconstruction-based methods in latent space does not stem from poor reconstruction quality, but from how reconstruction errors are scored. Standard L2 residual norms collapse the anisotropic residual structure, thereby suppressing informative deviations. To address this limitation, we introduce MaRS (Mahalanobis Residual Scoring), a label-free OOD detector that learns an in-distribution manifold using a lightweight autoencoder and measures deviation via a Mahalanobis distance on reconstruction residuals, yielding variance-aware OOD scores. Across three imaging modalities, multiple types of distribution shift, and different model families and scales, MaRS outperforms established confidence-, distance-, and reconstruction-based baselines, while remaining fully post-hoc and lightweight. The code is available at https://github.com/francescodisalvo05/mars.
Related papers
- Reconstruction-Shift Discrimination via Mask-Guided Latent Diffusion for Medical Anomaly Detection [58.92871907037662]
Unsupervised medical anomaly detection learns normal anatomical patterns from healthy training images and identifies deviations at test time.<n>Reconstruction-based and diffusion-based methods commonly use the difference between an input image and its reconstruction as anomaly evidence.<n>We propose discriminative mask-guided diffusion (DMD), a medical anomaly detection framework that complements residual-based localization with reconstruction-shift discrimination.
arXiv Detail & Related papers (2026-08-01T04:56:39Z) - A Diagnostic Gap Framework for Evaluating Reconstruction Fidelity in Weakly Supervised Mammography [0.0]
We present the diagnostic gap framework, a practical evaluation tool that measures decision preservation and explanation preservation.<n>We evaluate on curated lesion ROI crops using a fidelity ladder of three class-conditional reconstructors.<n>The framework provides an architecture-agnostic instrument for identifying when and where multi-stage pipelines lose diagnostic signal.
arXiv Detail & Related papers (2026-07-22T19:59:26Z) - Spatial-Aware Reduction Framework: Towards Efficient and Faithful Visual State Space Models [71.59431204970339]
STORM is a spatial-aware token reduction framework.<n>It reformulates reduction into a structured operation on spatial units.<n>It achieves state-of-the-art pruning accuracy across diverse vision Mamba backbones.
arXiv Detail & Related papers (2026-06-18T08:31:11Z) - Clipping Bottleneck: Stabilizing RLVR via Stochastic Recovery of Near-Boundary Signals [83.0127582612634]
Near-boundary Rescue (NSR) is a minimal, plug-and-play modification that retains out-of-bound tokens to recover lost signals.<n>NSR substantially improves training stability and delivers consistent gains over strong baselines such as DAPO and GSPO.
arXiv Detail & Related papers (2026-05-21T16:45:31Z) - Next-Acceleration-Scale Prediction for Autoregressive MRI Reconstruction [52.32112533846212]
MRI reconstruction is an inherently ill-posed inverse problem, since incomplete measurements admit many plausible solutions.<n>We address this limitation by moving reconstruction to discrete multi-scale latent space and posing it as autoregressive next-acceleration-scale prediction.<n>We show that our approach delivers improved reconstruction performance across diverse sampling patterns under extreme undersampling.
arXiv Detail & Related papers (2026-05-19T04:40:50Z) - Robust Uncertainty Estimation under Distribution Shift via Difference Reconstruction [2.920726125254978]
Estimating uncertainty in deep learning models is critical for reliable decision-making in high-stakes applications such as medical imaging.<n>Prior research has established that the difference between an input sample and its reconstructed version can serve as a useful proxy for uncertainty.<n>We propose Difference Reconstruction Uncertainty Estimation (DRUE), a method that mitigates this limitation by reconstructing inputs from two intermediate layers and measuring the discrepancy between their outputs as the uncertainty score.
arXiv Detail & Related papers (2026-01-27T08:23:00Z) - Toward Architecture-Agnostic Local Control of Posterior Collapse in VAEs [0.6144680854063939]
Variational autoencoders (VAEs) are known to suffer from posterior collapse, a phenomenon that reduces the diversity of generated samples.<n>We propose Latent Reconstruction(LR) loss, inspired by mathematical properties of injective and composite functions, to control posterior collapse without restriction to a specific architecture.<n>We experimentally evaluate our approach, which controls posterior collapse on varied datasets such as MNIST, fashionMNIST, Omniglot, CelebA, and FFHQ.
arXiv Detail & Related papers (2025-08-17T23:45:41Z) - Diffusion-based Layer-wise Semantic Reconstruction for Unsupervised Out-of-Distribution Detection [30.02748131967826]
Unsupervised out-of-distribution (OOD) detection aims to identify out-of-domain data by learning only from unlabeled In-Distribution (ID) training samples.
Current reconstruction-based methods provide a good alternative approach by measuring the reconstruction error between the input and its corresponding generative counterpart in the pixel/feature space.
We propose the diffusion-based layer-wise semantic reconstruction approach for unsupervised OOD detection.
arXiv Detail & Related papers (2024-11-16T04:54:07Z) - Exploring Out-of-distribution Detection for Sparse-view Computed Tomography with Diffusion Models [1.6704428692159]
We study the use of a diffusion model, trained to capture the target distribution for CT reconstruction as an in-distribution prior.<n>We employ the model to reconstruct partially diffused input images and assess OOD-ness through multiple reconstruction errors.<n>Our findings suggest that effective OOD detection can be achieved by comparing measurements with forward-projected reconstructions.
arXiv Detail & Related papers (2024-11-09T23:17:42Z) - Leveraging the Mahalanobis Distance to enhance Unsupervised Brain MRI Anomaly Detection [35.46541584018842]
Unsupervised Anomaly Detection (UAD) methods rely on healthy data distributions to identify anomalies as outliers.
In brain MRI, a common approach is reconstruction-based UAD, where generative models reconstruct healthy brain MRIs, and anomalies are detected as deviations between input and reconstruction.
We construct multiple reconstructions with probabilistic diffusion models. We then analyze the resulting distribution of these reconstructions using the Mahalanobis distance to identify anomalies as outliers.
arXiv Detail & Related papers (2024-07-17T11:02:31Z) - DiAD: A Diffusion-based Framework for Multi-class Anomaly Detection [55.48770333927732]
We propose a Difusion-based Anomaly Detection (DiAD) framework for multi-class anomaly detection.
It consists of a pixel-space autoencoder, a latent-space Semantic-Guided (SG) network with a connection to the stable diffusion's denoising network, and a feature-space pre-trained feature extractor.
Experiments on MVTec-AD and VisA datasets demonstrate the effectiveness of our approach.
arXiv Detail & Related papers (2023-12-11T18:38:28Z) - Mind the Backbone: Minimizing Backbone Distortion for Robust Object
Detection [52.355018626115346]
Building object detectors that are robust to domain shifts is critical for real-world applications.
We propose to use Relative Gradient Norm as a way to measure the vulnerability of a backbone to feature distortion.
We present recipes to boost OOD robustness for both types of backbones.
arXiv Detail & Related papers (2023-03-26T14:50:43Z) - READ: Aggregating Reconstruction Error into Out-of-distribution
Detection [5.069442437365223]
Deep neural networks are known to be overconfident for abnormal data.
We propose READ (Reconstruction Error Aggregated Detector) to unify inconsistencies from classifier and autoencoder.
Our method reduces the average FPR@95TPR by up to 9.8% compared with previous state-of-the-art OOD detection algorithms.
arXiv Detail & Related papers (2022-06-15T11:30:41Z) - Unsupervised Anomaly Detection with Adversarial Mirrored AutoEncoders [51.691585766702744]
We propose a variant of Adversarial Autoencoder which uses a mirrored Wasserstein loss in the discriminator to enforce better semantic-level reconstruction.
We put forward an alternative measure of anomaly score to replace the reconstruction-based metric.
Our method outperforms the current state-of-the-art methods for anomaly detection on several OOD detection benchmarks.
arXiv Detail & Related papers (2020-03-24T08:26:58Z)
This list is automatically generated from the titles and abstracts of the papers in this site.
This site does not guarantee the quality of this site (including all information) and is not responsible for any consequences.