Adaptive Multi-prompt Contrastive Network for Few-shot Out-of-distribution Detection
Authors: Xiang Fang
Arvind Easwaran
Blaise Genest
Venue: ICML 2025 spotlightposter (2025)
Keywords: Adaptive Multi-prompt Contrastive Network
Primary area: applications->computer_vision

Abstract: Out-of-distribution (OOD) detection attempts to distinguish outlier samples to prevent models trained on the in-distribution (ID) dataset from producing unavailable outputs. Most OOD detection methods require many ID samples for training, which seriously limits their real-world applications. To this end, we target a challenging setting: few-shot OOD detection, where only a few labeled ID samples are available. Therefore, few-shot OOD detection is much more challenging than the traditional OOD detection setting. Previous few-shot OOD detection works ignore the distinct diversity between different classes. In this paper, we propose a novel network: Adaptive Multi-prompt Contrastive Network (AMCN), which adapts the ID-OOD separation boundary by learning inter- and intra-class distribution. To compensate for the absence of OOD and scarcity of ID image samples, we leverage CLIP, connecting text with images, engineering learnable ID and OOD textual prompts. Specifically, we first generate adaptive prompts (learnable ID prompts, label-fixed OOD prompts, and label-adaptive OOD prompts). Then, we generate an adaptive class boundary for each class by introducing a class-wise threshold. Finally, we propose a prompt-guided ID-OOD separation module to control the margin between ID and OOD prompts. Experimental results show that AMCN outperforms other state-of-the-art works.

Adaptive Multi-prompt Contrastive Network for Few-shot Out-of-distribution Detection
Xiang Fang 12 Arvind Easwaran 2 Blaise Genest 3
Abstract
image classification (Bai et al., 2024; Gu et al., 2024; Li et al., 2024a). Unfortunately, most of DNNs refer to closed-set assumption that all the test samples are seen dur- ing training and no outliers are observed during inference. In fact, there are many unseen test samples (i.e., outliers) in real-world applications, such as autonomous driving (Zen- del et al., 2022; Vyas et al., 2018; Lu et al., 2023). These DNN methods still mistakenly classify each outlier into a seen class. The wrong classification of outliers will result in irrecoverable losses in some safety-crite aaittc-citiicll scenarios. To solve the above problem, the cuttof-dditributtin detection (OOD detection) task (Gautam et al., 2023; Zhang et al., 2024a; Hendrycks & Gimpel, 2016; Sun & Li, 2022; Fort et al., 2021; Liu et al., 2020) is proposed to accurately de- tect outliers in OOD classes and correctly classify samples from in-distribution (ID) classes during testing. Therefore, OOD detection has attracted increasing attention and vari- ous OOD detection models have been proposed for various safety-critical scenarios (Kirchheim et al., 2024; Abrecht et al., 2024; Kaur et al., 2024; Wu et al., 2024). Most OOD detection works (Shen et al., 2024; Regmi et al., 2024a; Xue et al., 2024; Regmi et al., 2024b; Zhang et al., 2024b) refer to sully-super assumption that samples of all types (e.g., all races of cats) of an ID class (e.g. cat) in all situations are accessible during training, which is unrealis- tic. Further, many OOD samples are also usually required during training.
Out-of-distribution (OOD) detection attempts to distinguish outlier samples to prevent models trained on the in-distribution (ID) dataset from producing unavailable outputs. Most OOD de- tection methods require many ID samples for training, which seriously limits their real-world applications. To this end, we target a challeng- ing setting: few-shot OOD detection, where only few labeled ID samples are available. There- fore, few-shot OOD detection is much more chal- lenging than the traditional OOD detection set- ting. Previous few-shot OOD detection works ignore the distinct diversity between different classes. In this paper, we propose a novel net- work: Adaptive Multi-prompp Contrastive Net- work (AMCN), which adapts the ID-OOD sepa- ration boundary by learning inter- and intra-class distribution. To compensate for the absence of OOD and scarcity of ID image samples, we leverage CLIP, connecting text with images, en- gineering learnable ID and OOD textual prompts. Specifically, we first generate adaptive prompts (learnable ID prompts, label-fixed OOD prompts and -ddativee OOD prompts). Then, we gen- erate an adaptive class boundary for each class by introducing a class-wise threshold. Finally, we propose a prompt-guided ID-OOD separation module to control the margin between ID and OOD prompts. Experimental results show that AMCN outperforms other -late-of-the-art works.
Few-shot OOD detection posed to first train the designed model on few samples in each ID class and then conduct OOD detection the whole test set. Such a setting lim- its the performance of standard OOD detection methods. Existing few-shot OOD detection task meets the following challenges: 1) Most few-shot methods (Jeong & Kim, 2020; Dionelis et al., 2022; Mehta et al., 2024; Zhan et al., 2022; Zhu et al., 2024) are sensitive to the background of the im- age. When they train the designed model on a few number of images of each class, it might lead to the understanding bias, resulting in the wrong OOD detection results. For example, "dog" (ID) class and "wolf" (OOD) class share many visual characteristics. When a dog appears on the grassland, the de- signed model might misidentify it as a wolf. Besides, some similar classes have various backgrounds, which might lead to wrong OOD detection reasoning results. For instance, in real-world training dataset, cat images are mainly in- doors, while dog images are mostly outdoors. Thus, the
1. Introduction
Deep neural networks (DNNs) receive more and more atten- tion due to their wide machine learning applications, such
'Energy Research Institute @ NTU, Interdisciplinary Grad- uate Programme, Nanyang Technological University. Singapore *College of Computing and Data Science, Nanyang Technological University, Singapore *CNSS and C 2955, France and Singapore. Correspondence to: Xiang Fang <xiang003@c.mll @e..ste.ccnnusg.......
@ CREATE, IPAL IRL
Proceedings of the 42nd International Conference Machine Learning, Vancouver, Canada. PMLR 267, 2025. Copyright 2025 by the author(s).

---

multi-prompt prompt contrastive Adaptive Multi-prompl Contrastive Network for Few-shot Out-of-distributiin Detection
I-shot
K-hoo
100
OOD
OOD
Cat
Cat
Dog
F Few-shot
Dog
AUROCT
80
Tabby (L eLs diversity)
learning
Dittoeant
Distribution
Bird
Bird
Ship
NPOS GPALMM Oure
OOD detection
Train set
Test sot
Few-shot OOD detection
Train set
Test
1000
512
128
8
(More diversity) (c) Distinct diversity for different classes
(a) Traditional OOD detection vs fho- OOD detection
(b) Effect of different shots
Pull
P=AA (1 A
Distribution
matching
Statistics
Statistics H4
M M te
Fa
Any image
H,
Push
LFOPs
Cosine similariyy
K-shot ID images
Statistics 14, o
A
Statistics H, σ
16
16
LAOPS
Intra class DN
Inter-class DN
0OD Labels
The cer
Cosine similurity
leamable prompt LA OP: label- aabeptvdee OOD prompt
μ:: mean, standard deviation
LFOP: label-fixed OOD prompt DN: distribution normalization
Prototypes
Train
ID (cat)
Test
(d) Framework of our proposed method
Figure 1. (a) Comparison between traditional OOD detection and Few-shot OOD detection. (b) Performance different methods (NPOS (Tao al., 2023), PALM (Lu et al., 2024) and Ours) on the SUN dataset with ImageNet- Ik the set. (c) Diversity comparison between the "cat" class and the "ox" class. (d) Brief framework of our method. Best viewed in color.
dog images often contain more complex backgrounds than the cat images. Besides, different classes have various lev- els of diversity, which makes difficult to accurately learn the class boundaries with only a few samples. 2) the few-shot setting, as the class number increases, the model performance always decreases since the ID-OOD boundary becomes complex. Thus, the model has learn more subtle differences between classes with only few examples. With more classes, there is a greater likelihood of overlap between class features, making harder for the model to distinguish between them accurately. 3) Few-shot learning inherently suffers from accessing limited samples, which exacerbates the issue of lacking representative examples to generalize well across more classes. Also, the limited sam- ples might lead to overfitting, seriously limiting the model performance.
ative impact of the background. 2) As for the second chal- lenge, a prompt-guided OOD detection module is designed to learn an explicit margin between ID and OOD prompts for precise ID-OOD boundary. 3) About the third challenge, we ingeniously introduce two carefully derstand the ID image features: (a) To ensure that the label- adaptive OOD prompts have similar semantics with ID prompts, we design an OOD alignment loss based on label- fixed OOD prompts and label-adaptive OOD prompts. (b) We utilize the weighted cross-entropy loss with ID images, ID prompts and OOD prompts for multi learning.
losses un-
In summary, our main contributions include:
We target the challenging multi-diversity few-shot OOD detection task, which randomly utilizes a cer- tain number of images with different diversity from each class for training, and conduct OOD detection on the whole testing dataset. Unlike previous works that only learn ID prompts for training, we construct ID and OOD prompts for each class to fully understand the images.
To address the above challenges, we design a novel network for the challenging few-shot OOD detection task. 1) To compensate for the absence of OOD and scarcity of ID age samples, we leverage CLIP (Radford et al., 2021), con- necting text with images, engineering learnable ID and OOD textual prompis. we first generate three kinds of adaptive prompts (learnable ID prompts, label-fixed OOD prompts and label-adaptive OOD prompts). Then, we construct the corresponding prototypes, which effectively reduce the neg-
We propose novel AMCN for the challenging few- shot OOD detection task. Three carefully-designee
2

---

Adaptive Multi-prompi Contrastive Network for Few-shot Out-of-distribution Detection
(a)
Disiribttion
All losses (Lc
CLiP encoder
leaminng
similarity larity
4
Le
Cosine
1,6
Lc
ID CLIP features
K-shot ID images
Distribution
learnngg
CLIP encoder
Wg
W2
Wi
(c)
OOD alignment La
LIP
:
LIP CLIP features
Prompl
ID Labels
Dog
Cat
MOP CLIP features
ID-OOD Separation
M
Ms
M
Distribution leaming
L4
LFOP
CLIP encoder
Th
I
IIss
LAOP
LOP CLIP features
ID alignment
L
++
OOD Labels
Time
Car
Test
Inter- class DN
(b)
similarity
P=ip
CLIP encoder
Cosine
ID or OOD
+(1-2)
CLIP feature
Query image
DN: distribution normalization
Frozen
Learnale
P: class- wise threshold
Prototypes
μ:: mean, a: standard deviation
Intra-class DN L
Figure Brief framework of our proposed method. (a) denotes the "Adaptive Prompt Generation" module Section 3.1, (b) denotes the "Prompt-based Multi-diversity Distribution Learning" module in Section 3.2, and (c) denotes the "Prompt-guided OOD Detection" module in Section 3.3. utilize three module (a,b and c) for training and "Test" inference. Best viewed color.
modules are utilized in AMCN to address three chal- lenges.
cess, most of them require all the samples for training. Be- sides, they ignore the different levels of diversity between different classes. Different from these OOD detection meth- ods, aim more challenging task: few-shot OOD detection with multi-diversity distribution.
Extensive experiments show that our proposed AMCN can significantly outperform existing state-of-the-art works the few-shot OOD detection task.
2.2. Prompt Learning
2. Related Works
Prompt learning (Gao et al., 2024: Park et al., 2024; Kim et al., 2024) is emerging area in natural language pro- cessing that leverages prompts instructions to guide pre- trained language models like GPT (Brown et al., 2020), BERT (Devlin, 2018), T5 (Raffel et al., 2020), etc., to per- form various downstream tasks. Prompt learning approaches (Liu et al., 2023; Pouramini Faili, 2024; Xing et al., 2024) aim bridge the gap between pre-training and fine-tuning by providing models with task-specific context or guidance in the form of natural language prompts. However, most prompt learning works (Pouramini & Faili, 2024; Xing et al., 2024) refer to the closed-set assumption, and cannot be di- rectly utilized into challenging few-shot OOD detection task.
2.1. Out-of-distribution Detection
As challenging machine learning task, the out-of- distribution (OOD) detection task aims to detect test samples from distributions that do not overlap with the training dis- tribution. Previous OOD detection methods (Liang et al., 2018b; Liu et al., 2020; Sun et al., 2021; Lee et al., 201 8b; Mohseni et al., 2020; Vyas et al., 2018: & Aizawa, 2019; Zaeemzadeh al., 2021: Hsu et al., 2020; Ming et al., 2023; Jiang al., 2024) can be divided into four types: classification-based methods (Hendrycks & Gimpel, 2016; Liang et al., 20b8b; Lee et al., 201 (c;a), density-based meth- ods (Kirichenko et al., 2020; Serrà et al., 2019), distance- based methods (Techapanurak et al., 2020; Lee et al., 2018b) and reconstruction based methods (Zhou. 2022; Yang et al., 2022). Although previous works have achieved decent suc-
3

---

Adaptive Multipprompt Contrastive Network for Few-shot Out-of-distribution Detection
2.3. Few-shot Learning
the class label. For the text prompt for class yt, we follow the popular predefined templates: "a photo of [yd]", where [y:] denotes the corresponding class name. Thus, we can design the learnable ID prompt as follows:
Few-shot learning (Hu et al., 2024; Zhang et al., 2025; Hu et al., 2025; Wang et al., 2025) is branch of machine learn- ing that focuses on building models capable of learning new concepts with only few examples. Unlike traditional ma- chine learning models that require large amounts of labeled data to generalize well, few-shot learning aims to make the most out of limited data, mimicking the human ability to learn from only a few examples. Since only few samples can be used during few-shot training, we often obtain lim- ited knowledge from these training samples. Obviously, our targeted few-shot OOD detection is more challenging than traditional OOD detection.
Php = [Wi] ... ..
(1)
where NIP denotes the length of the ID prefix and [Wi] denotes the i-th text token learned from the CLIP network. By Eq. (1), we can construct the learnable II) prompt.
Similarly, we generate OOD prompts from the OOD la- bels in other large-scale datasets, which can provide partial knowledge about OOD samples (Yang et al., 2024; Liu et al., 2021; Cao et al., 2024). In real-world applications, we can obtain partial knowledge about OOD samples. For example, when we treat the CIFAR-10 dataset (Krizhevsky, 2009) ID, we can use "chair" in the CIFAR-100 dataset (Krizhevsky, 2009) as OOD since CIFAR-I0 has the "chair" class. In this way, we want to generate two types of label- adaptive OOD prompts: label-fixed OOD prompts and label- adaptive OOD prompts. The label-fixed OOD prompt will introduce some human knowledge to assist our model for OOD detection. As for the label-adaptive OOD prompt, we let it learn prefixes and labels by itself. To obtain the OOD prompt based on the ID prompt and the OOD labels, we utilize a similar process to generate the adaptive OOD prompts:
3. Methodology
Problem definition. For the K-shot OOD detection task, it aims to use only K labeled ID images from each class for model training, and to test on the complete test set for OOD detection. For the training process, we denote the training set as: Did {(z;, 3: E
Wi E {I,....CO C}} with N labeled images from C' ID classes. We denote Dood= = (oor y y as the OOD dataset, where ood is the input OOD image, and yood yood == C+ I,.... C C+6 O denotes the OOD label, where O is the OOD label number. Please note that the OOD labels are unknown during train- ing, and they have no overlap of classes with ID labels, i..., yood n iid = Φ. Please note that the OOD data Dood is inaccessible during training.
fijop = [M] ... [M Mo [os]; flaop = [H1]... ... [HN..o
Pipeline. We present our pipeline in Figure 2. Firstly, we utilize the pretrained CLIP encoder (Radford et al., 2021) to extract the image features. Then, generate adaptive prompts for ID classification. Specifically, we combine P learnable ID prefixes and the label name to generate the learnable ID prompts (LIPs). Also, we generate S label- fixed OOD prompts (LFOPs) by introducing OOD labels from other datasets that disjoint with the ID label set. Since the introduced OOD labels are often limited, we explore Z label-adaptive OOD) prompts (LAOPs) for each ID) prompt. Besides, we align the image features and ID prompt features by prompt-guided contrastive loss for ID classification. Moreover, we learn the different distributions of all the classes for adaptive ID alignment. Finally, a prompt-guided OOD detection module is designed to control the explicit margin between ID and OOD prompts for OOD detection.
where [o.] is the OOD label from other datasets (Dood) that disjoint with D'd; [o]] is the learnable label, which is initialized by [og]; NNoop denotes the length of label-adaptive OOD prefix, fijop and fisop denote the label-fixed OOD prompt and label-adaptive OOD prompt, respectively. For fifop its prefix is Icarnable and its label is fixed. As for Shoo both its prefix and its label are learnable. Based on fifop we can handle various prefix structures; by fiagp we are able to explore different latent OOD labels. To ensure that the prompt feature dimensions are consistent, we make all the text encoders share the parameter weights. Besides, we align ID prompts with corresponding ID images, and push OOD prompts away from ID images. During training, since more negative prompts (OOD prompts) will help us conduct better multi-prompt contrastive learning for guidance, we utilize all OOD prompts to compare with ID images. For convenience, we introduce a similarity function S(a, b) for two inputs (a and b) as follows:
3.1. Adaptive Prompt Generation for ID Classification
In real-world applications, we only access ID samples dur- ing training. Therefore, it is unrealistic to directly obtain the OOD prompt for the future OOD detection task. Given sentence, we can obtain different sentences with various se- mantics by changing the prefix of the sentence or replacing
S(a b) = expl1/a cos(a, b)].
(3)
where cos(::)) denotes the cosine similarity; is tem- perature parameter. Therefore, we introduce the following
4

---

Adaptive Multi-promp Contrastive Network for Few-shot Out-of-distribation Detection
Differet
sample is the real OOD sample for both "cat" and "dog" classes. In this section, we design adaptive distribution extraction module to fully learn the distribution of each class based on only a few samples and fine-tune the prediction output of any test sample.
dvverity
Tabby (Less diversitt)
Ox (liveriieess)
T-SNE visunlization
Learning distribution. Since the mean and the standard deviation are two significant metries learn the distribu- tion, we calculate them in each class. Given K ID training samples {a; ) E D in the e-th class, we estimate the mean Pin and standard deviation din as follows:
Tabby OOC
Class bounday
Figure 3. T-SNE visualization of diversity for different classes on ImageNet-Ik.
Σ Sc(x,)
Me =
K
prompt learning loss for ID classification:
0e Liz1 (Sc(x;) Mc)2
(5)
K
Esg S(Fa,
Lo=EBg log S(f2 fip +0 I en S(f2,
where (x:) is class distribution score, which is defined as follows:
(4)
So(2;) exp (o.():)) To + MM=
where f/ denotes ID image feature: Püpp ave(flip Ship.... Shpp -hp) is the prototype of ID prompt features for the i-th image, where ave(.) denotes E
(6)
where To is a parameter adjustable need, (z;)) denotes the logit output of sample 2; in class e, and M E R denotes the initial pscudo-OOD distribution. To adapt the pseudo-OOD distribution Mase, we first use the OOD filter to predict OOD samples, and then conduct a momentum update of MD during inference. Based on the above pro- cess, Mese is updated as the mean of distribution for the predicted OOD samples. For the pseudo-OOD distribution MBse we first initialize its entries based on the mean distri- bution of the pseudo-OOD samples. Then, we update these entries by an online fashion module.
the average pooling; Fo = {ave(fāp)lfap [Jifop)
Nisop U ([iaap))110)) N is a set of OOD prompt features. Based on L1, we can train our ID classifier by ID prompts and OOD prompts.
3.2. Prompt-based Multi-diversity Distribution Learning for Adaptive ID Alignment
In real-world applications, different classes indeed exhibit varying degrees of sample diversity. This diversity, which reflects how varied the images within class are, can be influenced by multiple factors, including the nature of the class, its semantic breadth, and the challenges of collecting representative samples.
As shown in Figure 3, different classes have distinct diver- sity. Therefore, diversity-guider decision boundary is required for each class during classification. We propose the following novel P-score as the class-wise threshold for diversity- decision boundary:
In fact, there is a distribution gap between unseen ID sam- ples (i.e., not selected in K samples) and OOD samples. Since these unseen ID samples is not used for training, pre- vious OOD detection methods might treat these unseen ID samples as OOD samples, which will lead to incorrect de- tection results. In addition, these methods utilize the same threshold for all classes, seriously limiting their performance in real-world complex applications. Motivated by the effec- tiveness of normal distribution, we try to learn the threshold for each ID class.
P. À Me + (1 - X) d.c
where À is a parameter to balance the weight of mean and standard deviation. Based on (x,s)) and Pc. we can obtain:
I; belongs to pseudo-OOD, Sc(x.) > Po. S,(1;) S Pa-
(8)
class
Based on (8), if sample x; is pseudo-OOD for all the classes, it will be detected as real OOD. If any sample 2; is detected as pseudo- sample, we can update the distribution Mase as follows:
For any class c, name these samples with y * pseudo-OOD samples, where (1,..,C) C} is the cor- responding class of fi.. If a sample is the pseudo-OOD sample for all the classes, is a real OOD sample. For a dataset with classes ("cat" and "dog"), a "dog" sample is the pseudo-OO1 OODd sample for the "cat" class, while "tree"
MM -11,
S.(x)) > Pa. Se(xy) $ Pa.
ME (t)
(0. (t-1) 0+1
5

---

Adaptive Multi-prompt Contrastive Network for Few-shot Out-of-distribution Detection
where I denotes the 1-th iteration during training and O denotes the number of predicted OOD samples. We only keep O and current Ma unchanged during inference.
observe that many OOD prompts can help us understand the ID images. For example, "a photo of a cat" contains the ID semantics (cat), and we can change the label to obtain an OOD prompt "a photo of a chair", which corresponds to the OOD semantics. To update these OOD prompts, we initialize their embeddings and introduce a weighted OOD alignment loss. Then, we integrate ID prompts and OOD prompts by a multi-prompt contrastive learning strategy for OOD detection.
Previous OOD detection works utilize common global dis- tribution loss to learn the vanilla pseudo-OOD) distribution M Besides, we have to manually fine-tune the sen- sitive hyperparameters on distribution margins in complex datasets under the challenging few-shot setting, which might result in an sensitive OOD filter and then destroy the distri- bution learning. To this end, we aim to explore intra-class distribution and inter-class distribution.
Remark 3.1. our proposed AMCN, all final features are projected onto the unit hyper-sphere for cross-modal match- ing.
Intra-class distribution normalization. To fully learn the intra-class distribution of ID samples for better classification, we independently normalize the distribution for each class by the following loss:
Therefore, we propose a novel prompt-guided ID-OOD sep- aration module to generate an explicit margin between ID and OOD prompt features. Thus, we introduce the following prompt-guided ID-OOD separation loss:
11 T S(fá Ripp) ))
C = Σ e
c=1 (B(rs,)) E1
-E
St
Sap 1.fépll2
1=1
Mi
C2 min 0, el
11S
B (1 (1-n) CF, S(L;:
Ee1 1=1
(14)
+ E 13 er [(max(())
e2)
M,
where e(.:-) denotes the euclidean distance. To mine the la- tent OOD information, we conduct weighted average on all
(10)
OOD prompt features to generate the final OOD prototype Pap:
where a and E2 are two parameerra,,ers, B denotes the batch size, and M, is defined as:
Fap S E S ave(f()mp) + + ave afropp (15)
M2 = E, SUL, Pipp +0 +0- Fb S(E,, fop), (11)
Similarly, we normalize the features in L2 and set the margin to O. Unlike L1. L2 attempts to generate a larger margin between ID samples and the OOD prototype than between ID samples and the ID prototype, allowing our model to correctly distinguish ID and OOD prototypes. To keep the label-adaptive OOD prompts away from the ID prompts, we conduct the following weighted OOD alignment based on label-fixed OOD prompts and label-adaptive OOD prompts:
where Ti is a parameter adjustable as need, Based on C), we can balance the the sum of distribution score on all ID samples for each ID) class within a batch.
Inter-class distribution normalization. Similar to intra- class distribution normalization, we balance the distributions of all the classes by the following loss:
> TI Ess S(fi Flip)
2 = B (maxx(0,s ( e3-
)
T2 Maao
(1- -ijop
cml
Mi
L3 L==E,
(16)
(12)
11fifopl2
+ /3, eF eF, [mmax(() c (1 (1-Ti) Ro er.
S(fi: fop)
where || lla is the L2-norm; T2 is weight parameter, for the i-th image, Jipop and floop are respectively the feature prototypes of label-fixed OOD prompts and label-adaptive OOD prompts.
M,
where ey and c two hyper-parameters.
By integrating Lc, L) and f3,, we can obtain the final ID) classification loss as follows:
Similar to the ID classification loss L,, we design the multi- prompt contrastive learning loss for OOD detection:
L = = + +)+
(13)
T3 Er. S(fe,
La = F
-log (1 (1-Ta) Si. S(12 )rs S Fop)
Es
3.3. Prompt-guided OOD Detection
(17)
The realistic OOD detection networks always face the fol- lowing challenges: 1) we rarely obtain OOD images. 2) The OOD prompts (label-fixed and label-adaptive) in Eq. (4) are treated equally, and only treat ID image features to generate negative samples for multi-prompt contrastive learning, which might lead to an unclear margin between ID and OOD prompt and wrong OOD detection results. We
where Tis is a weight parameter. Based on L4, we can mini- mize the similarity between ID prompts and OOD prompts for clearer ID- separation.
The overall loss function with balanced hyperparameters (on, 22 and (:)) for training is as follows:
f = L1 + on + azh3 + 0zL4,
(18)
6

---

Adaptive Multi-prompt Contrastive Network for Few-shot Out-of-distribation Detection
where a1; 02 0r and 0i are parameters balance the signifi- cance between different losses.
45
Etaup Clocooo
5.uus
96
EPRUS
AUROUT
93
30
4. Experiments
20
Coopp LaCaOp
4.1. Experimental Setup
A-urrs Rit
I-hhot
2-thol
4-abol
8-thol
16-sbed
I-abol
3-hhut
4-shmt
g-dbok
Datasets. For fair comparison, we follow MOS (Huang & Li, 2021) and MCM (Ming et al., 2022) to utilize ImageNet- ik (Deng al., 2009) as ID set and a subset of iNaturalist (Horn et al., 2018) PLACES (Zhou al., 2018), TEXTURE (Cimpoi et al., 2014) and SUN (Xiao et al., 2010) as OOD set. For each OOD set, the classes are not overlapping with
Figure 4. Performance of different shots on iNaturalist.
the ID set. Also, we follow (Huang & Li, 2021) to randomly select these OOD data from the classes disjointing from ImageNet-Ik Ik (Deng et al., 2009). Please refer to (Huang Li, 2021; Miyai et al., 2023; Ming et al., 2022) for more dataset details and public dataset split.
FPR051
80
AURO
80
O
60
0
Value
Value
Implementation details. Following (Miyai et al., 2023), we adopt CLIP-VTT-B/16 (Radford et al., 2021) as the pre- trained model for OOD prompt learning. For the few-shot setting (Ye et al., 2020), following previous works (Miyai et al., 2023; Ye et al., 2020), we try different shots (1, 2, 4, 8, 16). For the parameters, we set 01 = 0.4, 022 0.2, 0z3 = 0.8,0 0 0.8,7 1.0, 7 = 0.7, P = 1,5 = 50, Z 50. We set A (Loshchilov & Hutter, 2019) the optimizer, the learning rate of 0.003, the batch size as 64, the token length as 16 and the training epoch as 100. Codes are available in Github.
Figure 5. Parameter analysis on SUN.
4, we compare our proposed method with statc-of-the-art methods, where our proposed method achieves the best per- formance all the cases. In particular, with the Texture dataset as the OOD set in terms of "FPR95", our method out- performs state-of-the-art method SCT by 9.71 % under the she-shot setting. The significant performance improvement is mainly because our method can first construct adaptive ID and OOD prompts by only limited labeled ID images, and then conduct prompt-based ID-OOD separation. On the SUN dataset, compared with SCT in terms of "AUROC", our method improves the OOD detection performance by 0.27% under the one-shot setting and by 1.1% under the eight-shot setting. The main reason is that our method can effectively learn the distribution of each class to reduce the negative impact of multi-diversity distribution on SUN. In Figure 4, we compare two representative few-shot OOD detection works (LoCoOp and CoOp) under different few- shot settings. Obviously, our method outperforms LoCoOp and CoOp in all the cases by a large margin. In many cases, LoCoOp and CoOp even perform worse than zero- shot GL-MCM, while our method significantly outperforms GL-MCM. The core reason is that LoCoOp and CoOp are misled by the various background information in the images. Different from LoCoOp and CoOp, we can learn the proper prototypes for each input (ID image, learnable ID prompt, label-fixed OOD prompt and label-adaptive OOD prompt) based the limited images handle various backgrounds.
Evaluation metrics. Following (Miyai et al., 2023; Bukhsh & Saeed, 2023; Nakamura al., 2024; Kahya al., 2024), we employ three popular evaluation metrics: FPR95, AU- ROC and ACC. FPR95 means the false positive rate of OOD samples when the true positive rate of ID samples is at 95%. AUROC measures the area under the receiver operating characteristic curve.
4.2. Comparison With State-of-the-arts
Compared methods. To comprehensively analyze the performance of our model, we compare our model with four types of sfate-of-the-art OOD detection models: fully- supervised (Full), zero-shot, one-shot and eight-shot, where fully-supervised methods and zero-shot methods are base- lines for performance comparison. The following open- source methods are selected for performance comparison. I) Fully-supervised: ODIN (Liang et al., 2018a), ViM (Wang et al., 2022), KNN (Sun et al., 2022), NPOS (Tao et al., 2023). 2) Zero-shot: MCM (Ming et al., 2022), SeTAR (Li et al., 2024b) with MCM Score and GL-MCM (Miyai et al., 2025). 3) One-shot and eight-shot: CoOp (Zhou al., 2022) and LoCoOp (Miyai et al., 2023), SCT (Yu et al., 2024).
Visualization results. To qualitatively investigate the effec- tiveness of our method, we report a representative example. As shown in Figure 6, our method achieves better perfor- mance in both ID classification and OOD detection, which further shows the effectiveness of our method.
Experimental results. As shown in Table 1 and Figure
7

---

Adaptive Multi-prompi Contrastive Network for Few-shot Out-of-distribation Detection
Table Performance comparison for the few-shot OOD detection task. We direct cite the results of compared methods from corresponding
works.
OOD set
Texture
Places
SUN
iNaturalist
Average
Method
Shot
FPR954
AUROCT
4
AUROCT
FPR954
AUROCT
FPR954
AUROC1
FPR954
AUROCT
KNN
Full
64.35
85.67
39.61
91.02
35.62
92.67
29.17
94.52
42.19
90.97
ViM
Full
53.94
87.18
60.67
83.75
54.01
87.19
32.19
93.16
50.20
87.82
ODIN
Full
51.67
87.85
55.06
85.54
54.04
87.17
30.22
94.65
47.75
88.80
NPOS
Full
46.12
88.80
45.27
89.44
43.77
90.44
16.58
96.19
37.94
91.22
GL-MCM
57.93
83.63
38.85
89.90
30.42
93.09
15.16
96.71
35.59
90.83
MCM
57.77
86.11
44.69
89.77
37.67
92.56
31,86
94.17
43.00
90.65
SeTAR
55.83
86.58
42.64
90.16
35.57
92.79
26.92
94.67
40.24
91.05
CoOp
50.64
87.83
46.68
89.09
38.53
91.95
43.80
91.40
44.91
90.07
LoCoOp
49.25
89.13
39.23
91.07
33.27
93.67
28.81
94.05
37.64
91.98
SCT
48.87
86.66
32.81
91.23
23.52
94.58
19.16
95.70
31.09
92.04
Ours
39.16
89.88
32.76
92.78
23.26
94.85
18.84
96.18
30.87
92.47
CoOp
43.29
89.92
41.17
89.76
34.45
92.50
38.52
90.24
39.36
90.61
LoCoOp
42.49
90.98
40.53
91.53
33.87
93.23
27.45
94.86
36.09
92.40
SCT
40.35
91.82
38.77
92.41
23.48
94.77
18.65
95.82
32.32
93.53
Ours
38.31
93.43
32.45
93.96
23.17
95.89
18.17
96.89
30.56
94.29
Confidence score
Confidence score
Table 2. Main ablation study on Texture, where "M1" is "Adaptive Prompt Generation", "M2" "Prompt-based Multi-diversity Dis- tribution Learning" and "M3" is "Prompt-guided OOD Detection". We remove key individual component and keep the other two modules to investigate its effectiveness.
Valley
Minibas Palace
Paling
10'0 000000
Minivan
Cliff
Mosque
One-shot
Eight-shot
Cam
M1 M2 MB
FPR95
AUROC1
FPR95
AUROCI
41.36
82.59
40.82
86.24
OOD
800
X
V
40.95
83.24
40.26
86.88
(b)
X
40.35
83.19
39.72
87.92
39.16
89.88
38.31
93.43
Figure 6. Visualization results (a) classification and (b) OOD detection on Places.
Table Ablation study about different prompts on Texture, where remove each prompt to investigate its effectiveness.
for the challenging few-shot OOD) detection task. As the core module, "Adaptive Prompt Generation" can generate adaptive prompts to fully understand the images and labels by three adaptive prompts (LIP, L.OP and LAOP) for ID classification. In Texture, different classes have distinct diversities, which makes many few-shot OOD detection methods difficult to learn the correct distribution for each class. Fortunately, "Prompt-based Multi-diversity Distribu- tion Learning" can effectively learn the intra-class distribu- tion and inter-class distribution, which reduces the negative impact of distinct diversity of different classes. Based on three adaptive prompts, "Prompt-guidee OOD detection" can correctly detect OOD samples in Texture.
One-shot
Eight-shot
LIP LFOP LAOP
FPR95J
AUROCT
FPR95.,
AUROCT
X
40.27
86.23
38.87
89.01
V
X
40.52
85.67
39.36
88.37
V
V
x
39.80
87.59
39.15
89.50
39.16
89.88
38.31
93.43
4.3. Ablation Study
Main ablation study. To demonstrate the effectiveness of each module in our model, we conduct ablation studies Texture in Table 2. Based on Table 2, we can observe that all three modules contribute a lot to the final performances under both the one-shot setting and the eight-shot setting, which shows the effectiveness our well-designed prompts
Importance of diff'erett prompts. In the "Adaptive Prompt Generation" module, we design three adaptive prompts (LIP, LFOP and LAOP) for each labeled ID sample. To show the importance of different prompts, we conduct an ablation
8

---

Adaptive Multi-prompt Contrastive Network for Few-shot Out-of-distribution Detection
100
100
11-1616 (1-bbut)
5. Conclusion
SIIVIT ST 1832 (1 (1-shot)
AUROC
Pet retornnance
80
IIVV (816 (1-shor))
HMVVIT WV-1- (B-ohort)
In this paper, we target a challenging machine learning task: few-shot OOD detection, which only uses a few labeled ID images from each class to train the designed model and to test the complete test set for OOD detection. To address it, we propose a novel method, AMCN, which generates adap- tive prompts by the given label set to learn the distribution of each class for adaptive OOD detection. Experimental results on multiple challenging benchmarks demonstrate the effectiveness of our proposed method.
90
30
1es (i-shet) 68 (B-shoti (oZ (1-bhe) dh-bte)
25
50
75
10
FPR95
AUROC1 Evaluation metrics
Prompt number
Figure? 7. Ablation study on iNaturalist, where the left figure is the ablation about the prompt number and the right figure is the ablation about feature encoders.
Acknowledgement
Table 4. Ablation study adaptive threshold on iNaturalist.
Threshold
One-shot
Eight-shot
This research was conducted as part of the DesCartes pro- gram and was supported by the National Research Founda- tion, Prime Minister's Office, Singapore, under the Cam- pus for Research Excellence and Technological Enterprise (CREATE) program. This research is also supported by the National Research Foundation, Singapore and DSO National Laboratories under the AI Singapore Programme (AISG Award No: AISG2-RP-2020-017)) The computa- tional work for this article was (fully/partially) performed on resources of the National Supercomputing Centre, Singa- pore (https//www.nsccc.g))
type
FPR95
AUROC1
FPR95
AUROCT
Fixed
20.70
93.83
20.51
94.16
Adaptive 18.84
96.18
18.17
96.89
study on different prompts in Table 3. All three prompts can bring significant performance improvement under different settings, showing the effectiveness of our three prompts in the challenging few-shot OOD detection task.
Effeec of the prompt number. We further conduct an ab- lation study to analyze the impact of the negative prompt numbers (LFOP number S and LAOP number Z) iNat- uralist. As shown in Figure 7, we can observe that, with the increase of K, the variation of the performance follows a general trend, iee. rises at first and then starts to decline. The optimal LFOP number S is 50 and the optimal LAOP number Z 50. Thus we set Z= 50 in this paper.
Impact Statement
This paper presents work whose goal is to advance the field of Machine Learning. There are many potential societal consequences of our work, none which we feel must be specifically highlighted here.
Influence of adaptive threshold. In our "Prompt-based Multi-diversity Distribution Learning" module, we design an adaptive threshold P. for each class. To assess the perfor- mance of the adaptive threshold Pc, we change the threshold to obtain the ablation models. Table 4 illustrates the per- formance comparison for different models. Obviously, our full model obtains the best results since our module can generate an adaptive threshold, which illustrates the effec- tiveness of our adaptive threshold learn both inter-class distribution and inter-class distribution on multi-diversity dataset iNaturalist.
References
Abrecht, S., Hirsch, A., Raafatnia, S., and Woehrle, M. Deep learning safety concerns in automated driving per- ception. IEEE TIV, pp. 1-12, 2024. doi: 10.1109/TIV. 2024.3428415.
Bai, Y., Han, Z., Zhang, C., Cao. B., Jiang, X., and Hu, Q. Id-like prompt learning for few-shot distr--iittiitttin detection. In CVPR, 2024.
Brown, T. Mann, B., Ryder, N., Subbiah, M., Kaplan, J. D., Dhariwal, P., Neelakantan, A., Shyam, P., Sastry, G., Askell, A., et al. Language models are few-shot learners. Advances in neural information processing systems, 33: 1877-1901, 2020.
Parameter analysis. We introduce some losses to supervise the training process. To evaluate the significance of these losses, we conduct experiments on the SUN dataset under the eight-shot setting. Figure 5 presents the ablation study on the performance only varies in a small range, indicating that our model is insensitive to these parameters. Our model can achieve the best performance with a = 0.4, a2 = 0.2, az- = 0.8. Therefore, we utilize the above parameter setting in our all experiments.
(a1, a22 ary). We can find that, their
Bukhsh, Z. A. and Saced, A. On out-of-distribution detec- tion for audio with deep nearest neighbors. In ICASSP, pp. 1-5. IEEE, 2023.
Cao, C., Zhong, Z., Zhou, Z., Liu, Y., Liu, T., and Han,

---

Adaptive Multi-prompt Contrastive Network for Few-shot Out-of-distribation Detection
Envisioning outlier exposure by large language models for out-of-distribution detection. In ICML,, 2024.
Huang, R. and Li, Y. MOS: towards scaling out-of-
distribution detection for large semantic space. In CVPR, 2021.
Cimpoi, M., Maji, S., Kokkinos, I., Mohamed, S., and Vedaldi, A. Describing textures in the wild. In CVPR, 2014.
Jeong, T. and Kim, H. Ood-maml: Meta-learning for few-shot out-of-distribution detection and classification. NeurIPS, 33:3907-3916, 2020.
Deng, J., Dong, W., Socher, R., Li, I.-J., Li, K., and Fei-Fei, L. Imagenet: A large-scale hierarchical image database. In CVPR, pp. 248-255. IEEE, 2009.
Jiang, X., Liu, F., Fang, Z.. Chen, H., Liu, T., Zheng, F., and Han, B. Negative label guided ood detection with pretrained vision-language models. In The Twelfth Inter- national Conference Learning Representations, 2024.
Devlin, J. Bert: Pre-training of deep bidirectional trans- formers for language understanding. arXiv preprint OrXiv:1810.0440 2018.
Kahya, S. M., Yavuz, M. S., and Steinbach, E. G. Harood:
Human activity classification and out-of-distribution de- tection with short-range FMCW radar. In ICASSP, pp. 69544 IEEE, 2024.
Dionelis, N., Tsaftaris, S. A., and Yaghoobi, M. Frob: Few-shot robust model for joint classification and out- of-distribution detection. In ECMI PKDD, pp. 137-153. Springer, 2022.
Kaur, R.. Yang. Y.. Sokolsky, O., and Lee, I. Out- of-distribution detection in dependent data for cyber- physical systems with conformal guarantees. ACM Trans. Cyber-Phys. Syst. 2024. ISSN 2378-962X.
Fort, S., Ren, J., and Lakshminarayanan, B. Exploring the limits of out-of-distributic detection. NeurlPS, 34:
2021.
Gao, J., Ruan, J., Xiang, S., Yu, Z., Ji, K., Xie, M., Liu, T., and Fu, Y. Lamm: Label alignment for multi-modal prompt learning. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 38, pp. 1815-1823, 2024.
Kim, G., Kim, S., and Lee, S. Aapl: Adding attributes prompt learning for vision-language models. In Proceed- ings of the IEEE/CVF Conference Computer Vision and Pattern Recognition, pp. 1572-1582, 2024.
Kirchheim, K., Gonschorek, T., and Ortmeier, F. Out-of- distribution detection with logical reasoning. In WACV, pp. 211 11122220, 2024.
Gautam, C., Kane, A., Ramasamy, S., and Sundaram, S. Unsupervised out-of-distribttion detection using few in- distribution samples. In ICASSP, pp. 1-5, IEEE, 2023.
Kirichenko, P., Izmailov, P., and Wilson, A. G. Why normal- izing flows fail detect 33:20578-2088 20589,, 2020.
Gu, Z., Zhu, B., Zhu, G., Chen, Y., Tang, M., and Wang, Anomalygpt: Detecting industrial anomalies using large vision-language models. AAAI, 2024.
data. NeurlPS,
Krizhevsky, A. Learning multiple layers of features from tiny images. 2009.
Hendrycks, D. and Gimpel, K. A baseline for detecting misclassified and out-of- distiiiirittionn examples in neural networks. In ICLR, 2016.
Lee, K., Lee, H., Lee, K., and Shin, J. Training confidence- calibrated classifiers for detecting ples. ICLR, 2018a.
sam-
Horn, G. V., Aodha, O. M., Song, Y., Cui, Y., Sun, C., Shepard, A., Adam, H., Perona, P., and Belongie, S. The inaturalist species classification and detection dataset. In CVPR, 2018
Lee, K., Lee, K., Lee, H., and Shin, J. A simple unified framework for detecting -uttt--ditti samples and adversarial attacks. NeurlPS, 31, 2018b.
Hsu, Y.-C., Shen, Y., Jin, H., and Kira, Generalized odin: Detecting ditt---distribttion image without learn- ing from out-of distri--ittiitttonn data. In CVPR, pp. 10951- 10960, 2020.
Lee, K., Lee, K., Min, K., Zhang, Y., Shin, J., and Lee, H. Hierarchical novelty detection for visual object recogni- tion. In CVPR, pp. 1034-1042, 2018c
Hu, K., Wang. Y., Zhang, Y., and Gao, X. Progressive learning strategy for few-shot class- iaas-inncemmntll learning. IEEE Transactions on Cybernetics, 2025.
Li, X., Zhang, Z., Tan, X., Chen, C., Qu, Y., Xie, Y., and Ma, L. Promptad: Learning prompts with only normal samples for few-shot anomaly detection. arXiv preprint wwXh:2244.005231 2024a.
Hu, M., Chang, H., Guo, Z., Ma, B., Shan, S., and Chen, X. Understanding sho- learning: Measuring task relat- edness and adaptation difficulty via attributes. Advances in Neural Information Processing Systems, 36, 2024.
Li, Y., Xiong, B., Chen, G., and Chen, Y. Setar: Out-of- distribution detection with selective low-rank approxima- tion. NeurlPS, 2024b.
10

---

Adaptive Multi-prompt Contrastive Network for Few-shot Out-of-distribation Detection
Liang, S., Li, Y., and Srikant, R. Enhancing the reliability of out-of-distribution image detection in neural networks. In ICLR, 2018a.
Nakamura, R., Tadokoro, R., Yamagata, E., Kondo, Y., Hara, K., Kataoka, H., and Inoue, N. Pseudo-outlier synthe- sis using q-gaussian distributions for out-of-distribution detection. In ICASSP, pp. 3120-3124 IEEE, 2024.
Liang, S., Li, Y., and Srikant, R. Enhancing the reliability of out-of-distribution image detection in neural networks. In ICLR, 2018b.
Park, J., Ko, J., and Kim, J. J. Prompt learning via meta- regularization. In Proceedings of the IEEE/CVF Confer- ence on Computer Vision and Pattern Recognition, pp. 26940-26950, 2024.
Liu, J., Shen, Z., He, Y., Zhang, X., Xu, R., Yu, H., and Cui, P. Towards out-of-distribution generalization: survey. arXiv preprint arXiv: 00..0/0....222 /3644, 2021.
Pouramini, A. and Faili, H. Matching tasks to objectives: Fine-tuning and prompt-tuning strategies for encoder- decoder pre-trained language models. Applied Intelli- gence, 54(20):9783 (4220)97733-810, 2024.
Liu, P., Yuan, W., Fu, J., Jiang. Z.,, Hayashi, H., and Neubig, G. Pre-train, prompt, and predict: A systematic survey of prompting methods in natural language processing. ACM Computing Surveys, 55(9):1-3) 2023.
Radford, A., Kim, J. W., Hallacy, C., Ramesh, A., Goh, G., Agarwal, S., Sastry, G., Askell, A., Mishkin, P., Clark, J., Krueger, G., and Sutskever, I. Learning transferable visual models from natural language supervision. In ICML, pp. 8748-8763, 2021.
Liu, W., Wang, X., Owens, J., and Li, Energy-based out-of-distribution detection. NeurlPS, 33:21464-21475, 2020.
Loshchilov, I. and Hutter, F. Decoupled weight decay regu- larization. In ICLR, 2019.
Raffel, C., Shazeer, N., Roberts, A., Lee, K., Narang, S., Matena, M., Zhou, Y., Li, W., and Liu, P. Exploring the limits of transfer learning with unified text-to-text transformer. Journal of machine learning research, 21 (140):1-67, 2020.
Lu, F. Zhu, K., Zhai, W. Zheng. K., and Cao, Y. Uncertainty-awwe aware optimal transport for semantically coherent out-of-distribution detection. arXiv preprint arXiv:2303. 10449, 2023.
Regmi, S., Panthi, B., Dotel, S., Gyawali, P. K., Stoyanov, D., and Bhattarai, B. T2fnorm: Train-time feature nor- malization for ood detection in image classification. In CVPR, pp. 153-162, 2024a.
Lu, H., Gong, D., Wang. S., Xue, J., Yao, L.,, and Moore, K. Learning with mixture of prototypes for out-of- distribution detection. The Twelfth International Con- ference Learning Representations, 2024.
Regmi, S., Panthi, B., Ming, Y., Gyawali, P. K., Stoyanov, D., and Bhattarai, B. Reweightood: Loss reweighting for distance-based ood detection. In CVPR, pp. 131-141, 2024b.
Mchta, N., Liang, K. J., Huang. J., Chu, F.J., Yin, L., and Hassner, T. Hypermix: Out-of-distribution detection and classification in few-shot settings. In CVPR, pp. 2410- 2420, 2024.
Serrà, J., Álvarez, D., Gómez, V., Slizovskaia, O., Núñez, J. F., and Luque, Input complexity and out-of- distribution detection with likelihood- generative models. In ICLR, 2019.
Ming, Y., Cai, Z., Gu, J., Sun, Y., Li, W., and Li, Delving into diitt--disttiuttion detection with vision- languaee representations. NeurlPS, 2022.
Ming, Y., Sun, Y.. Dia, O.,, and Li, Y. How to exploit hyper- spherical embeddings for -iit--iiiitiitttion detection? In The Eleventh ICLR, 2023.
Shen, X., Wang. Y., Zhou, K., Pan, S., and Wang, X. Op- timizing ood detection in molecular graphs: A novel approach with diffusion models. In SIGKDD, pp. 2640- 2650, 2024.
Miyai, A., Yu, Q., Irie, G., and Aizawa, K. Locoop: Few- shot out-of-distribution detection via prompt learning. NeurlPS, 2023.
Sun, Y. and Li, Dice: Leveraging sparsification for out-of- distribution detection. In ECCV, pp. 691-708. Springer, 2022.
Miyai, A., Yu, Q.. Irie, G., and Aizawa, K. Gl-mem: Global and local maximum concept matching for zero-shot out- of-distribution detection. International Journal of Com- puter Vision, pp. 1-11, 2025.
Sun, Y., Guo, C., and Li, Y. React: Out-of-distrrbutiin detection with rectified activations. NeurlPS, 34:144- 157, 2021.
Mohseni, S., Pitale, M., Yadawa, J., and Wang, Z. Self- supervised learning for generalizable out-of-diitribution detection, In AAAI, volume 34, pp. 5216-5223, 2020.
Sun, Y., Ming, Y., Zhu, X., and Li, Y. Out-of-ddittribttion detection with deep nearest neighbors. ICMI,, 2022.

---

Adaptive Multi-prompt Contrastive Network for Few-shot Out-of-distribution Detection
Tao, L.,, Du, X., Zhu, J., and Li, Y. Non-parametric outlier synthesis. In ICLR, 2023.
Zaeemzadeh, A., Bisagno, N., Sambugaro, Z.,, Conci, N., Rahnavard, N., and Shah, M. Out-of-distribttion detec- tion using union of I-dimensional subspaces. In CVPR, pp. 1452-9461 2021.
Techapanurak, E., Suganuma, M., and Okatani, T. Hyperparameter-ffee out-of-distribution detection using cosine similarity. In ACCV, 2020.
Zendel, O., Schörghuber, M., Rainer, B., Murschitz, M., and Beleznai, C. Unifying panoptic segmentation for autonomous driving. In CVPR, pp. 21351-21366 2022.
Vyas, A., Jammalamadaka, N., Zhu, X., Das, D., Kaul, B., and Willke, T. L. Out-of-distribution detection using an ensemble self supervised leave-out classifiers. ECCV, pp. 550-564, 2018.
Zhan, I..M., Liang, H., Fan, L.,, Wu, X.-M., and Lam, A. Y. A closer look at few-shot out-of-distribution intent detection. In COLING, pp. 451-460, 2022.
Wang, H., Li, Z., Feng, L., and Zhang, W. Vim: Out-of- distribution with virtual-logit matching. In CVPR, 2022.
Zhang, J., Chen, Y., Jin, C., Zhu, L.,, and Gu, Y. EPA: neural collapse inspired robust out-of-distribution detector. In ICASSP, pp. 6515-6519, IEEE, 2024a.
Wang, R., Zuo, H., Fang, Z., and Lu, J. Integrated image-text augmentation for few-shot learning in vision-language models. ACM Transactions on Intelligent Systems and Technology, 2025.
Zhang. J., Liu, L., Silvén, O., Pietikäinen, M., and Hu, D. Few-shot class-incremental learning for classification and object detection: A survey. IEEE Trunsactions on Pattern Analysis and Machine Intelligence. 2025.
Wu, S., Fei, H., Qu, L., Ji, W. and Chua, T.S.. NExT- GPT: Any-to-any multimodal L.M. In Proceedings of the International Conference on Machine Learning, pp. 53366-53397, 2024.
Zhang, Y., Zhu, W., He, C., and Zhang, L. Lapt: Label-driven automated prompt tuning for ood detec- tion with vision-language models. arXiv preprint arXhv:2407.08966 2024b.
Xiao, J., Hays, J., Ehinger, K. A., Oliva, A., and Torralba, A. SUN database: Large-scale scene recognition from abbey to zoo. In CVPR, 2010.
Zhou, B., Lapedriza, A., Khosla, A., Oliva, A., and Tor- ralba, A. Places: A 10 million image database for scene recognition. IEEE TPAMI, 40(6):1452-1466 2018
Xing, J., Liu, J., Wang, J., Sun, L., Chen, X., Gu, X., and Wang, Y. A survey of efficient fine-tuning methods for vision-language models- models-prompt & Graphics, 119:103885, 2024.
Zhou, K., Yang, J., Loy, C. C., and Liu, Z. Learning to prompt for vision-language models. IJV, 130(9):2337- 2348, 2022.
prompt and adapter. Computers
Xue. F., He, Z., Zhang, Y., Xie, C., Li, Z., and Tan, Enhancing the power of ood detection via sample-aware model selection. In CVPR. pp. 17148-17157, 2024.
Zhou, Y. Rethinking reconstruction autoencoder-based out- of-distribution detection. In CVPR, pp. 7379-7387, 2022.
Zhu, L., Yang, Y., Gu, Q., Wang. X., Zhou, C., and Ye, N. Croft: Robust fine-tuning with concurrent optimization for ood generalization and open-set ood detection. In Forty-first International Conference Machine Learn- ing, 2024.
Yang. J., Zhou, K., Li, Y., and Liu, Z. Generalized out-of- distribution detection: A survey. IJCV, pp. 1-28, 2024.
Yang. Y., Gao, R., and Xu, Q. Out-of-distribution detection with semantic mismatch under masking. In ECCV, pp. 373-390. Springer, 2022.
Ye, H., Hu, H., Zhan, D., and Sha, F. Few-shot learning via embedding adaptation with set-to-set functions. In CVPR, pp.
2020.
Yu, G., Zhu, J., Yao, J., and Han, B. Self-calibrated tuning of vision-languan models for out-of-distribution detec- tion. In The Thirty-eight Annual Conference on Neural Information Processing Systems, 2024.
Yu, Q. and Aizawa, K. Unsupervised -f-tiiitiiittionn detection by maximum classifier discrepancy. In ICCV, pp. 9518 99266 2019.
12

---

Adaptive Multi-prompt Contrastive Network for Few-shot Out-of-distribution Detection
A. More Details
Remark A.I. In our proposed AMCN, all final features are projected onto the unit hyper-sphere for cross-modal matching.
Proof. 1) Embedding computation: In our framework, we use a dual encoder architecture where an image encoder fimage (x) and text encoder Steat(y) (y) map images and texts into shared feature space. The image and text encoders generate feature vectors Zimage fimege (1) and Steat fient (3), respectively.
2) Feature normalization: After encoding, we apply L2 normalization to both image and text feature vectors. L2 normalization scales vector to have unit norm:
(19)
This normalization step ensures that all features lie on the surface of the unit hyper-sphere in the feature space.
3) Multi-modal contrastive loss mechanism: The contrastive loss is based cosine similarity:
Zimage Steart
cos( Zimage: Stext)
(20)
Zsmage
2 || l|2
Because the features Eimage and Êtent are normalized to unit norm, this reduces to the dot product:
cos( cos(Zimage: Rtext) Zsmage
Stent-
(21)
This formulation requires and enforces the projection of all feature vectors onto the unit hyper-sphere.
4) Unit Hyper-Sphere Condition: By the definition of 1.2 normalization, for any feature vector we have:
|| = 1.
(22)
This property confirms that the features are constrained the unit hyper-sphere. Therefore, the use of explicit L2 normalization in our architecture ensures that all features Esmage and Êtent lie on the unit hyper-sphere.
B. Discussion about the diversity of different classes
In the ImageNet-IK IK dataset, different classes indeed exhibit varying degrees of sample diversity. This diversity, which reflects how varied the images within class are, can be influenced by multiple factors, including the nature of the class, its semantic breadth, and the challenges of collecting representative samples. Here's breakdown of why and how this occurs:
1) Semantic breadth of classes. Fine-grained classes (e.g.. "Persian cat" vs. "Siamese cat") have low sample diversity because they represent very specific objects or subtypes. Images in these classes tend to have high visual similarity. Broad classes (e.g., "dog" or "tree"" encompass a wide range of subtypes and contexts, leading to high sample diversity. Example: The "dog" class might include different breeds, poses, environments, and lighting conditions, while "toaster" images primarily focus on the object itself with fewer variations.
2) Intrinsic variability of the object. Some objects inherently have more variability. For example, "clouds" can appear in countless shapes, colors, and settings, while "keyboard" is typically constrained small range of appearances and layouts. classes like "person" exhibit enormous diversity due to differences in age, ethnicity, clothing, posture, and activities.
3) Contextual variability. Classes that often appear in diverse contexts, such as "car" (urban streets, rural areas, different weather conditions), have higher diversity compared to objects like "microwave", which typically photographed indoors in controlled settings.
4) Collection bias.
The way data collected can introduce bias and affect diversity. For instance: Popular classes might include diverse images due to abundant online resources. Rare or niche classes may be underrepresented, with fewer images and less diversity. Example: Images of "golden retrievers" might be sourced from both professional and amateur photography, increasing diversity. Meanwhile, classes like "goldfish bowl" might rely on limited set of typical scenes.
5) Impact of ImageNet design choices. ImageNet was curated to balance the number of images per class (usually 1,000 images per class). However, this balancing doesn't 't guarantee uniform diversity. The emphasis on representativeness might lead to classes with limited diversity being artificially padded with near-duplicate images or slight variations.
13

---

Adaptive Multi-prompt Contrastive Network for Few-shot Out-of-distribution Detection
6) Challenges in diverse classes. High-diversity classes pose challenges for machine learning models, they must generalize across wide range of appearances and contexts. Conversely, low-diversity classes might lead to models that perform well on training data but lack robustness to real-world variations.
14


Reviews:
[{"review_id": "cbId084eEI", "reviewer": "Reviewer_J7Ff", "summary": "This paper proposes to address the novel and challenging task, multi-diversity few-shot OOD detection. Unlike the previous methods that ignore the distinct diversity between different classes in the few-shot OOD detection task, this paper presents a novel network AMCN. The proposed method first transposes ID prompts into OOD prompts by semantically concatenating ID prompts with OOD suffixes. The semantic concatenation can generate many negative prompts to guide prompt learning in the few-shot OOD detection task with multi-diversity setting. Finally, the paper develops an ID-OOD separation module to control the margin between ID  and OOD prompt features by a carefully-designed loss.", "questions": "", "limitations": "", "rating": 4, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We sincerely thank Reviewer J7Ff for the valuable comments and provide the following detailed responses to all weaknesses.\n\n---\n\n### **W1: Authors should move the definition of c to the third paragraph of Section 3.2.**\n\nThanks a lot for your valuable suggestion. We will revise it in our revised version.\n\n### **W2: In Eq. (7), $O \\cdot \\mathcal{M}_c^{pse}(t)$ should be $O \\cdot \\mathcal{M}_c^{pse}(t-1)$?**\n\nWe thank the reviewer for the insightful suggestions. Yes. It should be $O \\cdot \\mathcal{M}_c^{pse}(t-1)$. We will revise it in our revised version.\n\n### **W3: In Table 4, what is the fixed threshold?**\n\nWe appreciate the reviewer’s comments regarding the fixed threshold in Table 4. It is the initial threshold. In the fixed setting, we do not update the threshold during training. Since there are different diversities in different classes, we want to learn different thresholds for different classes. Different diversities correspond to different distributions. In Section 3.3, we learn the distribution of each class in \"Learning distribution\" to obtain the corresponding diversity information. In \"Intra-class distribution normalization\", to fully learn the intra-class distribution of ID samples for better classification, we independently normalize the distribution for each class by $L_I^1$. In \"Inter-class distribution normalization\", we balance the distributions of all the classes by $L_I^2$.\n\n### **W4: In Figure 4 and Figure 7, the sub-figures are too crowded.**\n\nWe thank the reviewer for the insightful suggestions. We will redesign them in our final version.", "claims_and_evidence": "The viewpoints are well verified. Specifically, the paper presents three modules to handle multi-diversity few-shot OOD detection. In the ablation study, this paper provides many ablation results to support the claims in Methodology.", "methods_and_evaluation_criteria": "Yes. Both the proposed method and evaluation criteria make sense for the problem of few-shot OOD detection at hand.", "theoretical_claims": "Yes, I have checked the correctness for theoretical claims. This paper clearly presents the motivation of the proposed multi-diversity few-shot OOD detection setting. Three modules in Figure 2 and the Methodology section make sense for solving three challenges: ID classification, adaptive ID alignment, and OOD detection.", "experimental_designs_or_analyses": "Yes, I have checked the soundness of any experimental designs and analyses.", "relation_to_broader_scientific_literature": "Authors make some progress and promote the field of few-shot OOD detection. Especially, authors solve the significant challenges about the distinct diversity between different classes. The experiment section demonstrates impressive performance of the proposed method.", "essential_references_not_discussed": "No.", "other_strengths_and_weaknesses": "Strengths:\n1. This paper proposes an expressive and novel Adaptive Multi-prompt Contrastive Network, especially in the few-shot OOD detection task. This paper utilizes a certain number of images with different diversity from each class for training, and conduct OOD detection on the whole testing dataset. Different from previous works that only learn ID prompts for training, this paper constructs ID and OOD prompts for each class to fully understand the images. The setting is very interesting, and the proposed method makes sense.\n2. The proposed method is effective. This paper first generates adaptive prompts (learnable ID prompts, label-fixed OOD prompts and label-adaptive OOD prompts). Also, this paper learns an adaptive class boundary for each class by introducing a class-wise threshold. Finally, this paper proposes a prompt-guided ID-OOD separation module to control the margin between ID and OOD prompts.\n3. Extensive comparisons with state-of-the-arts are conduct in the experiment section. Corresponding results demonstrate that the proposed approach can achieve significant performance on four benchmarks under the few-shot OOD detection setting.\n4. The motivation of exploring different distributions between different classes in the few-shot OOD detection task and the proposed method are impressive. It is very enlightening to the research community and will inspire more future research. The paper is well-prepared and easy to understand.\nWeaknesses:\n1. Authors should move the definition of c (“$c \\in \\{1,...,C\\}$ is the corresponding class of $f_x^i$”) to the third paragraph of Section 3.2.\n2. In Eq. (7), $O \\cdot \\mathcal{M}_c^{pse}(t)$ should be $O \\cdot \\mathcal{M}_c^{pse}(t-1)$?\n3. In Table 4, what is the fixed threshold?", "other_comments_or_suggestions": "In Figure 4 and Figure 7, the sub-figures are too crowded.", "questions_for_authors": "I don't have any other specific questions. Please answer the questions in the weaknesses.", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "UqOyurVZBm", "reviewer": "Reviewer_1bUn", "summary": "This work introduces a new method for few-shot out-of-distribution (OOD) detection. Unlike previous approaches that largely overlook the diverse characteristics among different classes, the proposed method constructs both in-distribution (ID) and OOD prompts and designs multiple contrastive losses to learn a better separation boundary. Experiments on multiple datasets demonstrate significantly improved performance compared to existing methods.", "questions": "", "limitations": "", "rating": 4, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We sincerely thank Reviewer 1bUn for the valuable comments and provide the following detailed responses to all weaknesses.\n\n---\n\n### **W1: Prompt learning is widely explored in the community. The idea of using learnable prompts for both ID and OOD classes is straightforward. However, the design of contrastive losses between different sets of prompts adds a meaningful contribution.**\n\nWe appreciate the reviewer’s comments regarding learnable prompts and contrastive losses. Firstly, we combine $P$ learnable ID prefixes and the label name to generate the learnable ID prompts (LIPs). Also, we generate $S$ labelfixed OOD prompts (LFOPs) by introducing OOD labels from other datasets that are disjoint with the ID label set. Since the introduced OOD labels are often limited, we explore $Z$ label-adaptive OOD prompts (LAOPs) for each ID prompt. Besides, we align the image features and ID prompt features by a prompt-guided contrastive loss for ID classification. \n\n### **W2: The authors should conduct a sensitivity analysis to understand the impact of these parameters on model performance.**\n\nThanks a lot for your valuable suggestion. Due to the page limitation, we have analyzed some significant parameter in Figure 5. \nWe are using hyperparameters $\\tau_0, \\ldots, \\tau_5$ in the tool. We are reporting here the sensitivity analysis towards these hyperparameters on of the benchmark SUN, in the eight-shot setting:\n\n|$\\tau_0$|FPR95($\\downarrow$)|AUROC($\\uparrow$)|\n|-|-|-|\n|0.1|23.46|95.71|\n|**0.2**|**23.17**|**95.89**|\n|0.3|23.32|95.82|\n\n|$\\tau_1$|FPR95($\\downarrow$)|AUROC($\\uparrow$)|\n|-|-|-|\n|0.40|23.32|95.83|\n|**0.45**|**23.17**|**95.89**|\n|0.50|23.53|95.74|\n\n|$\\tau_2$|FPR95($\\downarrow$)|AUROC($\\uparrow$)|\n|-|-|-|\n|0.4|23.29|95.72|\n|**0.5**|**23.17**|**95.89**|\n|0.6|23.35|95.83|\n\n|$\\tau_3$|FPR95($\\downarrow$)|AUROC($\\uparrow$)|\n|-|-|-|\n|0.50|23.40|95.58|\n|**0.55**|**23.17**|**95.89**|\n|0.60|23.29|95.74|\n\n|$\\lambda$|FPR95($\\downarrow$)|AUROC($\\uparrow$)|\n|-|-|-|\n|0.2|23.98|94.35|\n|**0.3**|**23.17**|**95.89**|\n|0.4|23.67|95.12|\n\n### **W3: In the methodology section, there is a lack of discussion regarding the rationale behind certain technical design choices. For example, it is unclear how class-wise thresholding addresses the issue of sample diversity—this should be further elaborated.**\n\nWe also appreciate the reviewer’s comments regarding the class-wise threshold. In the fixed setting, we do not update the threshold during training. Since there are different diversities in different classes, we want to learn different thresholds for different classes. Different diversities correspond to different distributions. In Section 3.3, we learn the distribution of each class in \"Learning distribution\" to obtain the corresponding diversity information. In \"Intra-class distribution normalization\", to fully learn the intra-class distribution of ID samples for better classification, we independently normalize the distribution for each class by $L_I^1$. In \"Inter-class distribution normalization\", we balance the distributions of all the classes by $L_I^2$. By learning the class-wise threshold and data distributions (intra-class distribution and inter-class distribution), we can obtain an adaptive classification decision boundary for each class, which effectively reduces the negative impact of different diversities on the challenging few-shot OOD detection task.\n\n### **W4: the equation following Equation 3 is not numbered. Based on the context in the later sections, it seems to represent $L_1$, not $L_C$.**\n\nWe thank the reviewer for the insightful suggestions.We will add the equation number in the final version. In fact, it is $L_C$, the $L_1$ is defined in Eq. (9).", "claims_and_evidence": "The claimed contributions are validated by ablation experiments.", "methods_and_evaluation_criteria": "The proposed method looks sound, and the evaluation metrics are proper.", "theoretical_claims": "There is no theoretical proof in this work.", "experimental_designs_or_analyses": "The experimental design is reasonable, and enough ablation analyses are provided.", "relation_to_broader_scientific_literature": "Out-of-distribution detection is of great interest to the wide computer vision community, it has much value in real-world scenarios, e.g., autonomous driving.", "essential_references_not_discussed": "No", "other_strengths_and_weaknesses": "Strengths:\nThe work is well-motivated, and a reasonable solution is presented to address the class diversity issue. \n\nThe experimental results are strong and clearly show the effectiveness of the proposed method.\n\nWeaknesses:\nPrompt learning is widely explored in the community. The idea of using learnable prompts for both ID and OOD classes is straightforward. However, the design of contrastive losses between different sets of prompts adds a meaningful contribution.\n\nThe proposed method involves a large number of hyperparameters. The authors should conduct a sensitivity analysis to understand the impact of these parameters on model performance.\n\nIn the methodology section, there is a lack of discussion regarding the rationale behind certain technical design choices. For example, it is unclear how class-wise thresholding addresses the issue of sample diversity—this should be further elaborated.", "other_comments_or_suggestions": "the equation following Equation 3 is not numbered. Based on the context in the later sections, it seems to represent 𝐿1, not 𝐿𝑐.", "questions_for_authors": "The authors should conduct a sensitivity analysis to understand the impact of these parameters on model performance.", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "ecV7pzJwYE", "reviewer": "Reviewer_8TNR", "summary": "Out-of-distribution (OOD) detection is an important machine learning task. Few-shot OOD detection is an important yet challenging setting in OOD detection task, where only a few labeled ID samples are available. This paper proposes a novel and clear few-shot OOD detection model that considers an interesting and practical multi-diversity setting. Authors first generate adaptive prompts for ID classification. Then, authors generate an adaptive class boundary for each class by introducing a class-wise threshold to conduct adaptive ID alignment. Finally, authors design a prompt-guided ID-OOD separation module to control the margin between ID and OOD prompts for OOD detection.", "questions": "", "limitations": "", "rating": 5, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We sincerely thank Reviewer 8TNR for the valuable comments and provide the following detailed responses to all weaknesses.\n\n---\n\n### **W1: A little typo in Figure 1 caption. “(c) Brief framework of our method.” should be “(d) Brief framework of our method.”**\n\nThanks a lot for your valuable suggestion. We will revise Figure 1 caption in our revised version.\n\n### **W2: T-SNE visualization in Figure 3 is based on which dataset?**\n\nWe appreciate the reviewer’s comments regarding T-SNE visualization in Figure 3. The dataset of T-SNE visualization in Figure 3 is based on the ImageNet-1k dataset. \n\n### **W3: The sentence “As shown in Figure 3, different classes have distinct diversity” should be removed to the first paragraph of Section 3.2.**\n\nThank you for your constructive suggestion. We will revise it in our revised version.\n\n### **W4: In the paragraph above Equation (7), “Based on (7)”, is this Equation (7) or Equation (6)? Is it a typo?**\n\nThanks a lot for your valuable comment. Yes. It should be Equation (6). We will revise it in our revised version.\n\n### **W5: It would be better if authors could provide some failure examples of few-shot OOD detection.**\n\nIn Few shot OOD, its paramount to generate ID and OOD prompts.\nTherefore, the dataset providing the labels (ID dataset) is key. It should be diverse enough.\nThis is the case of ImageNet1K which is used in the benchmarks.\n\nHowever, if we take a more specific dataset as ID, such as PLACES, which is less diverse, then the prompt engineering is less effective:\n\n|Shot|FPR95($\\downarrow$)|AUROC($\\uparrow$)|\n|-|-|-|\n|1|44.21|88.50|\n|8|43.75|89.74|\n\nHere, the Places dataset (less classes) is treated as ID set and the ImageNet-1k dataset as OOD set (reversed compared to the benchmarks). We can find that when we switch the Places dataset and the ImageNet-1k dataset, the performance improvement is reduced.", "claims_and_evidence": "Yes. The claims made in the submission supported by clear and convincing evidence.The experimental results can well show the effectiveness of the method.", "methods_and_evaluation_criteria": "Yes. The proposed multi-diversity few-shot OOD detection method is practical and novel.", "theoretical_claims": "N/A", "experimental_designs_or_analyses": "Yes. I checked the proof in the appendix, i.e., Section A. The proof is correct and reasonable. Authors show the superiority of their method in Table 1 and Figure 4.", "relation_to_broader_scientific_literature": "This paper considers various distributions between different classes in the few-shot OOD detection task. It might provide some inspiration for the task of few-shot learning.", "essential_references_not_discussed": "No", "other_strengths_and_weaknesses": "Strengths:\n\n1. The idea  is interesting. This paper considers various distributions between different classes in the few-shot OOD detection task. It might provide some inspiration for the task of few-shot learning. Besides, the proposed method is novel and sound. \n\n2. Based on one ID dataset (mageNet-1k) and four OOD datasets (Texture, Places, SUN and iNaturalist), authors conduct many experiments to verify the effectiveness of the proposed method. The performance of the proposed method AMCN is state-of-the-art. The corresponding ablation studies show the effectiveness of three modules (adaptive prompt generation, prompt-based multi-diversity distribution learning and prompt-guided OOD detection).\n\n3. The overall structure of the proposed method is clear and the paper is easy to follow. In the experimental section, this performance analysis is reasonable.\n\n4. Authors provide available codes, and the proposed method seems reproducible. Besides, the proposed method and uploaded code well match.\n\nWeaknesses:\n\n1. A little typo in Figure 1 caption. “(c) Brief framework of our method.” should be “(d) Brief framework of our method.”\n\n2. T-SNE visualization in Figure 3 is based on which dataset? The sentence “As shown in Figure 3, different classes have distinct diversity” should be removed to the first paragraph of Section 3.2.\n\n3.In the paragraph above Equation (7), “Based on (7)”, is this Equation (7) or Equation (6)? Is it a typo? I think it should be Equation (6).", "other_comments_or_suggestions": "It would be better if authors could provide some failure examples of few-shot OOD detection.", "questions_for_authors": "Please address the weakness. I am willing to raise the score", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {}}, {"review_id": "LAPqg8FXdH", "reviewer": "Reviewer_oFtr", "summary": "This paper proposes the Adaptive Multi-prompt Contrastive Network for few-shot out-of-distribution detection, aiming to improve OOD detection performance when only limited labeled in-distribution samples are available. The method introduces adaptive prompts to learn class distributions and enhance the separation between ID and OOD samples. It includes three main modules: Adaptive Prompt Generation, Prompt-based Multi-diversity Distribution Learning, and Prompt-guided OOD Detection. These modules address challenges such as background bias and diverse class distributions.", "questions": "", "limitations": "", "rating": 3, "confidence": null, "soundness": null, "presentation": null, "contribution": null, "strengths": "", "weaknesses": "", "quality": null, "clarity": null, "significance": null, "originality": null, "strengths_and_weaknesses": "", "was_revised": false, "final_justification": "", "rebuttal": "We sincerely thank Reviewer oFtr for the valuable comments and provide the following detailed responses to all weaknesses.\n\n---\n\n### **W1: Figure 1 is not referenced or discussed in the main text. The caption of Figure 7 contains a error: \"right\" and \"left\" are mistakenly reversed.**\n\nThanks a lot for your valuable suggestion. Figure 1 should be referenced in Introduction. Figure 1(a) should be placed in the first paragraph of Introduction. Figure 1(b) should be placed in the second paragraph of Introduction (Line 81). Figure 1(c) should be placed in the third paragraph of Introduction (Line 96). We will revise the caption of Figure 7 in our revised version.\n\n### **W2: The paper heavily relies on CLIP for feature extraction and prompt engineering. While this is a common choice, it raises the question of whether using alternative models for feature extraction could yield different results.**\n\nThanks a lot for your valuable suggestion. 1) Since all the compared methods utilize CLIP to extract features, we follow them to use CLIP for fair comparison. 2) For many other feature encoders, they include more complex calculations, which might make the designed OOD detector time-consuming. 3) The CLIP network can effectively extract the visual and textual features under the few-shot setting. Therefore, we utilize CLIP in our paper.\n\n ### **W3: The paper does not discuss the computational complexity or efficiency of the proposed method in comparison to existing methods.**\n\nWe appreciate the reviewer’s comments regarding the computational complexity and efficiency of the proposed method. Compared to other methods, the training time and memory consumption are similar:\n\n|Method|Time for one iteration (s)|GPU Memory (MiB)|\n|-|-|-|\n|CoOp|0.54|20865|\n|LoCoOp|0.82|24180|\n|SCT|0.87|25267|\n|Ours|0.80|23946|\n\nWe evaluate the time and memory consumption of our proposed method compared with other baselines in above table and the results show that our proposed method is relatively compute-efficient. The evaluation is conducted on a single GTX-4090\nGPU with a batch size as 64.", "claims_and_evidence": "The claims made in the submission are generally well-supported by clear and convincing evidence. The authors propose the Adaptive Multi-prompt Contrastive Network to address the challenges of few-shot out-of-distribution detection and claim that it outperforms existing methods. This claim is substantiated through extensive experiments on multiple benchmark datasets, including ImageNet-1k as the in-distribution dataset and various OOD datasets such as iNaturalist, Places, TEXTURE, and SUN. The results demonstrate significant improvements in key metrics like FPR95 and AUROC across different few-shot settings, with notable reductions in false positive rates and enhanced detection accuracy.", "methods_and_evaluation_criteria": "The authors introduce the Adaptive Multi-prompt Contrastive Network, which incorporates adaptive prompts and a multi-prompt contrastive learning framework to address the challenges of limited labeled in-distribution samples and the absence of OOD samples during training. This approach is innovative and tailored to the specific difficulties of few-shot OOD detection, such as the need to generalize from limited data and handle diverse class distributions. The evaluation criteria used in the paper, including FPR95, AUROC, and classification accuracy, are standard and appropriate for assessing OOD detection performance.", "theoretical_claims": "No issues were found in the proof. The paper includes a theoretical claim regarding the projection of all feature vectors onto the unit hyper-sphere for cross-modal matching, which is essential for the multi-modal contrastive loss mechanism. This claim is supported by a detailed proof in Appendix A. The proof demonstrates that the L2 normalization applied to both image and text feature vectors ensures that all features lie on the surface of the unit hyper-sphere, thereby enforcing the use of cosine similarity as a dot product in the contrastive loss. The steps of the proof are logically structured and correctly derived, confirming that the features are constrained to the unit hyper-sphere as claimed.", "experimental_designs_or_analyses": "The authors conducted extensive experiments across multiple benchmark datasets, including ImageNet-1k as the in-distribution dataset and various OOD datasets such as iNaturalist, Places, TEXTURE, and SUN. These datasets are widely recognized in the field and provide a diverse range of scenarios to test the robustness of the proposed method.\n\nThe experimental setup includes comparisons with several state-of-the-art methods, covering fully supervised, zero-shot, one-shot, and eight-shot settings. This comprehensive comparison allows for a clear evaluation of AMCN's performance relative to existing approaches under different conditions. The authors also provided detailed ablation studies to analyze the contributions of individual components of their framework, such as different prompt types (LIP, LFOP, LAOP) and the impact of adaptive thresholding.", "relation_to_broader_scientific_literature": "The key contributions of this paper are well-situated within the broader scientific literature on out-of-distribution detection and few-shot learning, building upon and advancing several important concepts in these fields. The proposed AMCN leverages adaptive prompts and contrastive learning, which are both active areas of research in machine learning. The idea of using prompts to guide model learning is inspired by recent advancements in natural language processing, particularly in the context of prompting large language models for downstream tasks. This paper extends the concept of prompt learning to the domain of OOD detection, specifically targeting the challenging few-shot scenario where only limited labeled in-distribution samples are available. This approach is novel and addresses a significant gap in the literature, as most existing OOD detection methods rely on large amounts of labeled data and do not account for the diversity and scarcity of samples in few-shot settings.", "essential_references_not_discussed": "There are no essential related works missing from the citations.", "other_strengths_and_weaknesses": "Strengths:\n1、 The paper introduces a novel approach combining adaptive prompts and contrastive learning, effectively addressing the challenges of few-shot OOD detection with limited labeled data.\n2、 Extensive experiments and ablation studies demonstrate the method's robustness and effectiveness across multiple datasets and few-shot settings.\n\nWeaknesses:\n\n1、 Figure 1 is not referenced or discussed in the main text. The caption of Figure 7 contains a error: \"right\" and \"left\" are mistakenly reversed.\n2、 The paper heavily relies on CLIP for feature extraction and prompt engineering. While this is a common choice, it raises the question of whether using alternative models for feature extraction could yield different results.\n3、 The paper does not discuss the computational complexity or efficiency of the proposed method in comparison to existing methods.", "other_comments_or_suggestions": "See Weakness.", "questions_for_authors": "See Weakness.", "summary_of_paper": "", "summary_of_recommendation": "", "technical_quality": "", "clarity_of_presentation": "", "potential_impact": "", "robotics_focus": "", "quality_of_limitations": "", "questions_for_rebuttal": "", "reasons_to_accept": "", "reasons_to_reject": "", "questions_to_authors": "", "extra_scores": {"ethical_review_flag": "Flag this paper for an ethics review.", "ethics_expertise_needed": ["Other expertise"]}}]

Author rebuttal:

Meta-review: This paper proposes Adaptive Multi-prompt Contrastive Network (AMCN) for few-shot out-of-distribution detection. It tackles class diversity and data scarcity by engineering ID/OOD prompts using CLIP and introducing contrastive learning losses to adaptively separate ID and OOD features.

All reviewer believe that the paper addresses a meaningful and challenging problem with a novel and well-motivated design. All reviewers affirm its sound methodology, strong experimental results, and contributions to few-shot OOD detection. The code is available, and the method is reproducible and well-executed.

Concerns are mostly minor from reviewers: partially lack of sensitivity analysis, insufficient discussion of design rationale, and dependency on CLIP. One reviewer questions generalization across backbones and notes some clarity and formatting issues, but none are critical flaws.
Decision: Accept (spotlight poster)