AdaNeg: Adaptive Negative Proxy Guided OOD Detection with Vision-Language Models

Recent research has shown that pre-trained vision-language models are effective at identifying out-of-distribution (OOD) samples by using negative labels as guidance. However, employing consistent negative labels across different OOD datasets often results in semantic misalignments, as these text labels may not accurately reflect the actual space of OOD images. To overcome this issue, we introduce \textit{adaptive negative proxies}, which are dynamically generated during testing by exploring actual OOD images, to align more closely with the underlying OOD label space and enhance the efficacy of negative proxy guidance. Specifically, our approach utilizes a feature memory bank to selectively cache discriminative features from test images, representing the targeted OOD distribution. This facilitates the creation of proxies that can better align with specific OOD datasets. While task-adaptive proxies average features to reflect the unique characteristics of each dataset, the sample-adaptive proxies weight features based on their similarity to individual test samples, exploring detailed sample-level nuances. The final score for identifying OOD samples integrates static negative labels with our proposed adaptive proxies, effectively combining textual and visual knowledge for enhanced performance. Our method is training-free and annotation-free, and it maintains fast testing speed. Extensive experiments across various benchmarks demonstrate the effectiveness of our approach, abbreviated as AdaNeg. Notably, on the large-scale ImageNet benchmark, our AdaNeg significantly outperforms existing methods, with a 2.45\% increase in AUROC and a 6.48\% reduction in FPR95. Codes are available at \url{https://github.com/YBZh/OpenOOD-VLM}.

Paper

Similar papers

Peer review

Reviewer eV4A6/10 · confidence 5/52024-06-29

Summary

The paper "AdaNeg: Adaptive Negative Proxy Guided OOD Detection with Vision-Language Models" presents a novel approach to out-of-distribution (OOD) detection using pre-trained vision-language models (VLMs). The primary innovation is the introduction of adaptive negative proxies, which are dynamically generated during testing by exploring actual OOD images. This method addresses the semantic misalignment issues of previous approaches that use static negative labels. AdaNeg utilizes a feature memory bank to cache discriminative features from test images, creating task-adaptive and sample-adaptive proxies that better align with the specific OOD datasets. The approach combines static negative labels with adaptive proxies to enhance the performance of OOD detection, achieving significant improvements in benchmarks like ImageNet. The method is training-free, annotation-free, and maintains fast testing speeds.

Strengths

1. Innovative Approach: The introduction of adaptive negative proxies to address semantic misalignment is a significant advancement. This dynamic generation of proxies during testing offers a novel solution to improve OOD detection. 2. Effective Use of Vision-Language Models: Leveraging VLMs to integrate textual and visual knowledge enhances the robustness and accuracy of OOD detection. 3. Performance Improvement: The method shows substantial improvements in standard benchmarks, particularly a 2.45% increase in AUROC and a 6.48% reduction in FPR95 on the ImageNet dataset. 4. Training-Free and Annotation-Free: AdaNeg does not require additional training or manual annotations, making it highly efficient and practical for real-world applications. 5. Scalability and Efficiency: The method maintains fast testing speeds and can dynamically adapt to new OOD datasets without significant computational overhead. 6. Comprehensive Evaluation: Extensive experiments and analyses demonstrate the effectiveness and robustness of the proposed approach across various benchmarks.

Weaknesses

1. Potential Overhead in Memory Management: The implementation of a memory bank for caching features may introduce significant overhead in memory management, especially when dealing with large-scale datasets or high-dimensional feature spaces. 2. Generalization to Other Domains: Although the approach demonstrates promising results on existing public datasets, its effectiveness in other domains or with different types of data remains uncertain and requires further investigation. 3. Testing Phase Dependency: It is unclear whether the approach can maintain the same level of reliable performance when only a small number of images are tested in practical applications. This dependency on the number of test images warrants additional examination.

Questions

See weakness.

Rating

6

Confidence

5

Soundness

3

Presentation

4

Contribution

4

Limitations

1. Generalization to Other Domains 2. Dependency on test data.

Reviewer Pmx95/10 · confidence 5/52024-07-10

Summary

In this paper, the authors propose AdaNeg, a test-time adaption method for CLIP-based post-hoc OOD detection. AdaNeg is an extension of NegLabel and introduces a class-wise memory bank for each ID and negative labels. The memory bank is gradually filled with ID and OOD features during the model deployment. The author design a margin-based approach to select positive and negative samples with high confidence. And they propose a cache elimination mechanism to update the memory bank. Besides, AdaNeg uses cross attention between the input sample and the memory bank to reweight the cached features. The experimental results show the proposed method outperforms the baseline methods under various benchmarks.

Strengths

<1> AdaNeg uses dynamic OOD proxies instead of the static design of NegLabel, achieving SOTA performance in CLIP-based zero-shot OOD detection. <2> The multi-modal score is an interesting design and explanation that demonstrates the improvement brought by using both text and image encoding capabilities in a multi-modal model. <3> The paper is well organized and easy to follow.

Weaknesses

**Major concerns** <1> AdaNeg is a test-time adaption approach that caches features w.r.t. ID labels and negative labels by maintaining a class-wise memory bank. For OOD detection, the biggest problem of the test-time adaptation method is that the arrival time of the OOD sample is uncertain. Compared with non-TTA methods, AdaNeg has greater uncertainty in its performance during the deployment phase and may even risk causing model collapse. For example, when the model is deployed to a close-world environment, almost all input samples are ID samples (I believe this is a very common scenario). In this case, the memory banks of negative labels will gradually be filled with ID samples (in long-term deployment, there will always be misclassified ID samples that enter the negative memory banks). Since the number of negative labels is much greater than that of ID labels, more and more ID samples will be misclassified as OOD over time. I suggest the author conduct an experiment using the 1.28M training set images of ImageNet-1k as input (this still meets the zero-shot setting of CLIP) and observe how the proportion of samples misclassified as OOD changes with the number of input samples. If 1.28M images are repeatedly input into multiple rounds, will the misclassification rate increase further? In contrast, the other case is that the OOD samples are far more than the ID samples. Will this cause a greater false positive risk? I hope the authors can test their method with different ID and OOD sample mixture ratios, such as 1:100, 1:10, 1:1, 10:1, 100:1. In summary, I suggest the authors to further study the setting of TTA in OOD detection to improve the motivation of the work, since the input samples may come from two different distributions, ID and OOD. How to ensure the stability of TTA OOD detection algorithm when the input stream is a non-stationary process is a problem worth studying. <2> The negative labels provide the initial memory bank slots for AdaNeg, but it seems to me that the negative labels are not necessary. This suggests that we need to rethink AdaNeg's motivation for negative labels. Why do samples that are judged as negative need to be placed in the memory bank w.r.t. the negative label? What if the authors directly use the MCM score to judge negative samples and then let them organize themselves into OOD proxies? The authors need to provide a more detailed analysis (preferably theoretical analysis) to prove that the **negative label-based** memory bank design is necessary. Further, negative labels simply select words that are semantically far from ID labels. For some OOD samples, they may be far away from both ID labels and negative labels. According to the mechanism of AdaNeg, they cannot enter the memory bank of negative labels. Is this a negative impact of designing a memory bank based on negative labels? **Minor concerns** <1> The authors need to provide more detailed experimental settings. The paper mentions that memory banks are task specific. When evaluating the model, taking the ImageNet-1k benchmark as an example, do the authors maintain an independent memory bank for each OOD dataset (precisely, each ID-OOD pair), or did the four OOD datasets share one memory bank? <2> There seem to be some typos and symbol issues in the paper. a) L247: temperature $\tau = 100$ seems to be $\tau = 0.01$ because $\tau$ is in the denominator. b) The subscript NL is not case-inconsistent, e.g., Eq. (4) and Eq. (8).

Questions

see Cons

Rating

5

Confidence

5

Soundness

3

Presentation

3

Contribution

3

Limitations

Yes

Reviewer yxd95/10 · confidence 3/52024-07-12

Summary

This paper introduces a new algorithm for Out-Of-Distribution (OOD) sample detection. First, it analyzes the shortcomings of previous Vision-Language OOD detection methods and proposes improvements based on these findings. Specifically, the paper presents a scheme for online updating of the memory bank during testing to design better negative proxies. The authors conducted experiments on datasets such as ImageNet and CIFAR. According to the experimental results, the newly proposed method can enhance OOD detection performance.

Strengths

1. Currently, vision-language models are developing rapidly, and using them for OOD sample detection is a promising direction. Approaching from this perspective may yield better results. 2. The experiments in this paper are relatively thorough, encompassing both large datasets based on ImageNet and smaller datasets based on CIFAR. According to the authors' experimental results, the newly proposed method can improve the accuracy of OOD detection.

Weaknesses

1. The motivation in this paper is not very clear. Specifically, in Figure 1(a), it is not evident why the newly proposed AdaNeg is better than NegLabel. On the contrary, the distribution of OOD samples seems to be closer to NegLabel. 2. The method proposed in this paper is based on the features and results of test samples during testing, which limits the upper bound of the method. In my opinion, the effectiveness of the proposed method relies on the vision-language model's strong inherent OOD detection capability, meaning that most test samples can be correctly processed. Based on these correctly processed samples, the method can further improve the detection accuracy of other samples. However, if in a certain scenario, the model itself cannot correctly estimate most of the samples, this method might actually make the results worse. 3. This paper merely performs optimizations based on the NegLabel framework, without many innovative points. The novelty of this improvement is insufficient to support a NeurIPS paper.

Questions

As shown in weakness. What is the meaning of Figure 1, and is the proposed method effective when the base model predicts most samples incorrectly?

Rating

5

Confidence

3

Soundness

2

Presentation

2

Contribution

2

Limitations

Potential negative societal impact is not applicable.

Reviewer ACdF8/10 · confidence 5/52024-07-12

Summary

The authors introduce a new approach to leverage the pre-trained vision-language model for identifying out-of-distribution (OOD) samples. Compared to prior works that employ consistent negative labels across different OOD datasets, they introduce adaptive negative proxies to dynamically generate text labels during testing by exploring actual OOD images, thereby aligning more closely with the underlying OOD label space. Empirically, the proposed method demonstrates state-of-the-art performance across various OOD detection benchmarks especially on the large-scale ImageNet benchmark.

Strengths

- Dynamically generating negative proxies is a simple and effective strategy. - The setting studied is very natural and this paper can easily stimulate further research in the area. - The proposed approach performs well, particularly on large-scale datasets such as ImageNet, effectively demonstrating its scalability. - The paper is nicely written.

Weaknesses

- While the proposed AdaNeg shows clear improvements over training-free baselines, its overall performance on ImageNet still lags behind training-based methods. This raises the question of whether there are opportunities for complementarity between the two approaches. - Can the dynamic update of the memory bank and refinement of OOD proxies during the testing stage be considered a form of test-time training? The authors are requested to clarify the inherent connections and distinctions, especially from the perspectives of training versus training-free approaches. - If negative proxies can directly identify true out-of-distribution (OOD) test images during the testing phase, is it possible to use the identified OOD samples to update the model parameters online?

Questions

Please refer to the weakness.

Rating

8

Confidence

5

Soundness

3

Presentation

4

Contribution

4

Limitations

yes

Authorsrebuttal2024-08-09

We sincerely thank this reviewer for the positive feedback! Authors of paper 9248

Reviewer Pmx92024-08-09

Thank you for the detailed responses. The authors have addressed most of my issues. I think sample imbalance is an important challenge for TTA. Therefore, I suggest that the authors may add an adaptive module to AdaNeg to alleviate the ID-OOD imbalance. I will keep my score.

Authorsrebuttal2024-08-11

Dear Reviewer Pmx9, Thank you for highlighting the issue of model instability due to ID-OOD imbalance. **Following your suggestion**, we have implemented an adaptive gap (AdaGap) strategy to adjust the memorization selection criteria dynamically. This approach builds on the observation that as the score $S_{nl}$ increases/decreases, the probability that a sample is ID/OOD also increases accordingly. By enforcing a stringent selection criterion, we can effectively minimize the inclusion of misclassified samples in our memory. Specifically, we first online estimate the ratio of ID to OOD samples in the test data using a First-In-First-Out queue, which caches the ID/OOD estimation (cf. Eq. 8) of the most recent N samples: **MR = (Estimated ID Number) / (Estimated ID Number + Estimated OOD Number)**, where the ID and OOD numbers are calculated within the queue. Leveraging the estimated mix ratio (MR), we can dynamically adjust the gap g in memory caching to minimize the presence of misclassified samples within the memory. For instance, if ID samples predominate in the test samples (i.e., MR > 0.5), this could lead to an increased proportion of ID samples in the OOD memory. To counteract this, we refine the selection criterion for OOD memorization to cache only those OOD samples with higher confidence. This refinement involves modifying the selection criterion for memorization in Equation (8) as follows: **Negative:** From $S_{nl}$(v) < $\gamma$ - g$\gamma$ **to** $S_{nl}$(v) < $\gamma$ - max(g, MR)$\gamma$ **Positive:** From $S_{nl}$(v) $\geq$ $\gamma$ + g(1-$\gamma$) **to** $S_{nl}$(v) $\geq$ $\gamma$ + max(g, 1-MR)(1-$\gamma$) where g =0.5 is the default gap analyzed in Figure 3(b). In this way, our method remains consistent with our original version under balanced ID/OOD conditions (e.g., MR = 0.5). However, if the proportion of ID samples is higher in the test sample estimation (e.g., MR > 0.5), we increase the threshold for storing negative samples in the memory. In the extreme case where MR = 1, we estimate that there are no OOD samples among the test samples; thus, we stop storing test samples in the negative memory and only selectively cache test samples into the positive memory. We adjust our approach conversely when the MR value is lower than 0.5. This strategy enhances the robustness of our method against ID-OOD imbalance, as demonstrated in the table below: | ID:OOD Ratio | 1:100 | 1:10 | 1:1 | 10:1 | 100:1 | 1000:1 | |--------------|-------|------|-------|-------|-------|-------| | NegLabel | 22.42 | 21.11| 20.99 | 20.92 | 21.48 | 23.69 | | AdaNeg | 21.00 | 12.49| 9.81 | 15.61 | 20.71 | 26.28 | | AdaNeg (With AdaGap) | **20.50** | **12.22** | **9.73** | **12.98** | **15.61** | **18.43** | **Table Caption:** FPR95 (↓) with different mixture ratios of ID and OOD samples. Please kindly note that the MR is estimated with the most recent N test samples, allowing for dynamic online adjustment of the selection criterion. We set N=10,000 by default. This dynamic adjustment ensures that our memory caching strategy remains responsive to the evolving nature of the test sample distribution, thereby optimizing memory utilization and enhancing the accuracy of our domain distinction process. We will include these analyses and the AdaGap module in the revision.

Reviewer ACdF2024-08-11

Thank you for the responses. My previous concerns have been well addressed. After carefully reviewing the other reviewers' comments and the authors' replies, I believe the paper has no significant flaws, and therefore, I choose to maintain my score.

Reviewer yxd92024-08-13

Thanks for your reply. The authors have addressed most of my concerns. I will raise my score.

Program Chairsdecision2024-09-25

Decision

Accept (poster)

© 2026 NYSGPT2525 LLC