Skip to content

X-Mahalanobis: Transformer Feature Mixing for Reliable OOD Detection

2025 · Neural Information Processing Systems · 8 citations · ⚡ 2 influential · 60 references
Computer Science

TL;DR

A straightforward feature mixing approach for pre-trained Transformers is presented, which combines multi-layer representations via calculated importance weights, and identifies OOD samples using Mahalanobis distance in the blended feature space.

Abstract

Recognizing out-of-distribution (OOD) samples is essential for deploying robust machine learning systems in open-world environments. While conventional OOD detection approaches rely on feature representations from the penultimate layer of neural networks, they often overlook informative signals embedded in intermediate layers. In this paper, we present a straightforward feature mixing approach for pre-trained Transformers, which combines multi-layer representations via calculated importance weights, and identifies OOD samples using Mahalanobis distance in the blended feature space. When in-distribution samples are accessible, we show that parameter-efficient fine-tuning strategies effectively balance classification accuracy and OOD detection performance. We conduct extensive empirical analyses to validate the superiority of our proposed method under zero-shot, and fine-tuning settings using both class-balanced and long-tailed datasets. The source code is available at https://github.com/SEUML/X-Maha .

View source

Similar papers

Aug 2026

Feature-alteration Robustness for Out-of-distribution Detection.

It is found that a well-pretrained in-distribution model can memorize and recognize ID patterns, even when the features undergo alterations, even when the features undergo alterations.

Xue Jiang, Feng Liu, Zhen Fang et al. · 0 citations
Preprint Jul 2026

Sparse Autoencoders for Interpretable Out-of-Distribution Detection

A novel approach that leverages sparse autoencoders (SAEs) to learn interpretable features from these intermediate activations and proposes a new OOD score derived from the cosine similarity between the sparse feature activations of a test sample and the mean activations of ID classes.

Ayush Karmacharya, Luke Luschwitz, Lucia Romero et al. · 0 citations
Book Open access Aug 2026

When Models Leave the Training Distribution: A Tutorial on OOD Detection

This tutorial covers recent developments in OOD detection from both theoretical and practical perspectives, including four major categories: (1) post-hoc methods, (2) training-based methods with auxiliary outliers, (3) training methods without auxiliary outliers, and (4) foundation model-based approaches, along with re...

Suranga Seneviratne, Dishanika Denipitiyage, Sanjay Chawla et al. · 0 citations
Preprint Jul 2026

Pseudo-label distillation for discriminative anomalous sound detection

Pseudo-label distillation not only transfers the performance of SSL models to a compact model but also further improves performance by leveraging available coarse labels and data augmentation.

Takuya Fujimura, Tomoki Toda · 1 citation
Conference Aug 2026

WhisperEngineClassifier: A Transfer Learning Framework for Audio-Based Engine State Classification

The process of diagnosing and monitoring automotive systems through audio-based engine state classification has become more vital for intelligent vehicle systems as real-world applications face challenges from background noise, device differences, and class distribution problems which are issues addressed in this resea...

Yasin Arafat, Nayeem Miah, Shihab Uddin Ahammad et al. · 0 citations

DINO-MAC: First-Place Winner Solution of the CVPR2026 Robust DeepFake Detection Challenge

DINO-MAC is a simple yet effective model for robust deepfake detection under degraded conditions and is the first-place winner of the “NTIRE 2026 - Robust Deepfake Detection Challenge @ CVPR 2026”, significantly outperforms all competitors.

Chenfan Qu, Lianwen Jin, Junchi Li et al. · 3 citations

We use cookies to run the site and, with your consent, for analytics and to show ads. See our Cookie Policy.