用马氏距离提升医学图像分布外检测的鲁棒性
MaRS: Robust Out-of-Distribution Detection via Mahalanobis Residual Scoring
- 用轻量自编码器学习正常数据流形,再用马氏距离衡量重建残差
- 在三种影像模态上均优于现有方法,尤其在设备/患者变化下表现稳定
- 无需标签、无需训练,适合医疗场景中模型可靠性评估
基础模型为医学图像提供了高度描述性的表征,但在患者、设备或采集条件变化导致的分布偏移下,其可靠性下降。因此,可靠的分布外(OOD)检测对安全部署至关重要。近期后处理检测器高效利用冻结嵌入(如kNN),而基于重构的潜在空间检测因性能不一致未被广泛采用。本文发现,潜在空间重构方法的局限性并非源于重构质量差,而是重构误差的评分方式问题:标准L2残差范数会压缩残差的各向异性结构,从而抑制了关键偏差信息。为此,我们提出MaRS(马氏残差评分),一种无标签的后处理OOD检测器:通过轻量自编码器学习分布内流形,再以马氏距离衡量重构残差,生成考虑方差的OOD分数。在三种影像模态、多种分布偏移类型及不同模型家族与规模下,MaRS均显著优于现有置信度、距离和重构基线方法,且保持完全后处理与轻量特性。代码已公开于https://github.com/francescodisalvo05/mars。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。