mlsanityData to 7 Oct 2026

MaRS: Robust Out-of-Distribution Detection via Mahalanobis Residual Scoring

arXiv 2606.22649 ↗First posted 21 Jun 2026cs.CV cs.LG eess.IVcited by 0

Not on the map. Why?

Abstract (arXiv)

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.

Key facts. No citing papers in the map yet (data through 7 Oct 2026). Builds on 24 of its 33 references that are in the map. First posted on arXiv 21 Jun 2026.

Builds on

24 of 33 references.

References · 24

  1. 2020An Image is Worth 16x16 Words: Transformers for Image Recognition at Scalecited by 29,915
  2. 2023DINOv2: Learning Robust Visual Features without Supervisioncited by 7,764
  3. 2016A Baseline for Detecting Misclassified and Out-of-Distribution Examples in Neural Networkscited by 2,362
  4. 2018A Simple Unified Framework for Detecting Out-of-Distribution Samples and Adversarial Attackscited by 1,472
  5. 2017Enhancing The Reliability of Out-of-distribution Image Detection in Neural Networkscited by 1,325
  6. 2025DINOv3cited by 1,297
  7. 2017ChestX-ray8: Hospital-scale Chest X-ray Database and Benchmarks on Weakly-Supervised Classification and Localization of Common Thorax Diseasescited by 969
  8. 2021MedMNIST v2 -- A large-scale lightweight benchmark for 2D and 3D biomedical image classificationcited by 682
  9. 2022Out-of-Distribution Detection with Deep Nearest Neighborscited by 596
  10. 2022ViM: Out-Of-Distribution with Virtual-logit Matchingcited by 404
  11. 2022OpenOOD: Benchmarking Generalized Out-of-Distribution Detectioncited by 267
  12. 2023OpenOOD v1.5: Enhanced Benchmark for Out-of-Distribution Detectioncited by 178
12 more
  1. 2023Generative models improve fairness of medical classifiers under distribution shiftscited by 90
  2. 2023Domain Generalization for Medical Image Analysis: A Reviewcited by 47
  3. 2025Mahalanobis++: Improving OOD Detection via Feature Normalizationcited by 30
  4. 2024DinoBloom: A Foundation Model for Generalizable Cell Embeddings in Hematologycited by 27
  5. 2024Out-of-distribution Detection in Medical Image Analysis: A surveycited by 22
  6. 2018Anomaly Detection for Skin Disease Images Using Variational Autoencodercited by 20
  7. 2020Out-Of-Distribution Detection With Subspace Techniques And Probabilistic Modeling Of Featurescited by 20
  8. 2023On the use of Mahalanobis distance for out-of-distribution detection with neural networks for medical imagingcited by 15
  9. 2025OpenMIBOOD: Open Medical Imaging Benchmarks for Out-Of-Distribution Detectioncited by 13
  10. 2024Is Large-Scale Pretraining the Secret to Good Domain Generalization?cited by 9
  11. 2020Out-of-Distribution Detection for Skin Lesion Images with Deep Isolation Forestcited by 6
  12. 2025Anomaly Detection by Clustering DINO Embeddings using a Dirichlet Process Mixturecited by 5

Built on by

Not cited yet.