Table of Contents
Fetching ...

Dual-Adapter: Training-free Dual Adaptation for Few-shot Out-of-Distribution Detection

Xinyi Chen, Yaohui Li, Haoxing Chen

TL;DR

This work tackles few-shot out-of-distribution detection by introducing training-free Dual-Adapter, which leverages CLIP priors through dual caches built from in-domain data. It constructs complementary Positive and Negative adapters from partitioned CLIP channels to produce ID- and non-ID signals from both textual and visual perspectives, fused via softmax to detect OOD without training. Across four benchmarks and multiple shot settings, Dual-Adapter achieves state-of-the-art AUROC and reduced FPR95 while eliminating the overhead of training-based prompts. The approach highlights the value of negative-feature awareness for robust OOD discrimination and enables fast deployment in data-scarce scenarios.

Abstract

We study the problem of few-shot out-of-distribution (OOD) detection, which aims to detect OOD samples from unseen categories during inference time with only a few labeled in-domain (ID) samples. Existing methods mainly focus on training task-aware prompts for OOD detection. However, training on few-shot data may cause severe overfitting and textual prompts alone may not be enough for effective detection. To tackle these problems, we propose a prior-based Training-free Dual Adaptation method (Dual-Adapter) to detect OOD samples from both textual and visual perspectives. Specifically, Dual-Adapter first extracts the most significant channels as positive features and designates the remaining less relevant channels as negative features. Then, it constructs both a positive adapter and a negative adapter from a dual perspective, thereby better leveraging previously outlooked or interfering features in the training dataset. In this way, Dual-Adapter can inherit the advantages of CLIP not having to train, but also excels in distinguishing between ID and OOD samples. Extensive experimental results on four benchmark datasets demonstrate the superiority of Dual-Adapter.

Dual-Adapter: Training-free Dual Adaptation for Few-shot Out-of-Distribution Detection

TL;DR

This work tackles few-shot out-of-distribution detection by introducing training-free Dual-Adapter, which leverages CLIP priors through dual caches built from in-domain data. It constructs complementary Positive and Negative adapters from partitioned CLIP channels to produce ID- and non-ID signals from both textual and visual perspectives, fused via softmax to detect OOD without training. Across four benchmarks and multiple shot settings, Dual-Adapter achieves state-of-the-art AUROC and reduced FPR95 while eliminating the overhead of training-based prompts. The approach highlights the value of negative-feature awareness for robust OOD discrimination and enables fast deployment in data-scarce scenarios.

Abstract

We study the problem of few-shot out-of-distribution (OOD) detection, which aims to detect OOD samples from unseen categories during inference time with only a few labeled in-domain (ID) samples. Existing methods mainly focus on training task-aware prompts for OOD detection. However, training on few-shot data may cause severe overfitting and textual prompts alone may not be enough for effective detection. To tackle these problems, we propose a prior-based Training-free Dual Adaptation method (Dual-Adapter) to detect OOD samples from both textual and visual perspectives. Specifically, Dual-Adapter first extracts the most significant channels as positive features and designates the remaining less relevant channels as negative features. Then, it constructs both a positive adapter and a negative adapter from a dual perspective, thereby better leveraging previously outlooked or interfering features in the training dataset. In this way, Dual-Adapter can inherit the advantages of CLIP not having to train, but also excels in distinguishing between ID and OOD samples. Extensive experimental results on four benchmark datasets demonstrate the superiority of Dual-Adapter.
Paper Structure (29 sections, 12 equations, 5 figures, 3 tables)

This paper contains 29 sections, 12 equations, 5 figures, 3 tables.

Figures (5)

  • Figure 1: Effectiveness demonstration of Dual-Adapter.(a) (b) Compared to the performance of Tip-Adapter, Dual-Adapter remains the original logits values for ID images. In contrast, for OOD images, the logits of Dual-Adapter drop significantly. This means that Dual-Adapter can easily detect OOD samples. (c) (d) Performance comparison of OOD detection, evaluated using AUROC and FPR metrics, across 1, 2, 4, 8, and 16-shot settings for Dual-Adapter, Tip-Adapter zhang2021tip, LoCoOp miyai2024locoop, and MCM ming2022delving methods.
  • Figure 2: An overview of Dual-Adapter. Dual-Adapter is composed of positive adapter $P_{+}$ and negative adapter $P_{-}$, each constructed from textual and visual perspectives. These adapters further refine a new test image's features into positive and negative logits, which are concatenated and processed through a softmax function to yield the final logits for OOD detection.
  • Figure 3: Few-Shot OOD detection performance of Dual-Adapter and other methods on the ID dataset (ImageNet-1k) and four OOD datasets
  • Figure 4: Comparative analysis of OOD detection performance and training time on the 16-shot ImageNet deng2009imagenet dataset reveals that our Dual-Adapter model achieves superior performance while maintaining high implementation efficiency.
  • Figure 5: Heatmap for extracted channels. Note that the above images are only a partial listing of positive and negative channels.