TL;DR
This paper tackles the challenge of out-of-distribution (OOD) detection in vision-language models (VLMs) by addressing the "modality gap" – the inherent difference between image and text representations. They introduce SUPREME, a novel few-shot tuning framework that leverages both image and text prototypes, along with a new OOD scoring mechanism (SGMP), to significantly improve OOD detection performance without requiring additional training data.
What Problem Does This Paper Address?
The deployment of AI models in real-world scenarios hinges on their ability to identify and flag unfamiliar or out-of-distribution (OOD) data. Recently, vision-language models (VLMs) like CLIP have shown promise for OOD detection by comparing image embeddings to text embeddings of class names (text prototypes). However, a significant challenge, known as the "modality gap," arises because images and text naturally reside in different representational spaces. This gap can lead to OOD images being mistakenly classified as in-distribution (ID) if they exhibit superficial similarity to ID text prototypes, resulting in high false positive rates. This paper investigates the impact of this modality gap and proposes a method to mitigate it, particularly in a few-shot learning setting where only a limited number of ID examples are available.
Methods
The authors propose a novel framework called SUPREME (mUlti-modal PrototypE-based Method for OOD detection with CLIP). SUPREME consists of two main modules and a new scoring mechanism:
- Biased Prompt Generation (BPG): This module aims to improve image-text fusion and generalization. It generates text prototypes that are conditioned not only on learnable contexts and image embeddings but also on a Gaussian-based image domain bias. This bias is estimated from the distribution of ID image embeddings and helps to prevent overfitting to the limited training data.
- Image-Text Consistency (ITC): This module directly tackles the modality gap by minimizing the distances between image and text representations. It uses two mappings: an image-to-text mapping and a text-to-image mapping. By applying intra-modal (reconstruction consistency) and inter-modal (alignment) losses, ITC encourages better alignment between modalities.
- Generalized Multi-modal Prototypes OOD score (SGMP): This new scoring mechanism extends existing methods by incorporating similarities from both modalities. It considers the maximum similarities between multi-modal input embeddings (both original and mapped image embeddings) and both ID text and ID image prototypes. This multi-modal approach aims to provide a more robust OOD score.
The paper also empirically demonstrates that simply incorporating multi-modal prototypes (both image and text) can improve OOD detection performance even without any additional training or fine-tuning, addressing their first research question (RQ1).
Datasets
The experiments were conducted using the following datasets:
- ID Datasets: ImageNet-1k, ImageNet-100, ImageNet-10, ImageNet-20.
- OOD Datasets: iNaturalist, SUN, Places, Texture.
- Benchmark: OpenOOD benchmark.
The paper does not introduce any new datasets but utilizes established benchmarks for evaluating OOD detection performance.
Key Insights and Ideas
- Modality Gap is a Major Hurdle: The paper strongly emphasizes that the inherent difference between image and text representations (modality gap) significantly hinders the performance of VLM-based OOD detection, leading to increased false positives.
- Multi-modal Prototypes Offer a Simple Boost: Even without complex fine-tuning, using both image and text prototypes for OOD detection leads to improved performance, suggesting that leveraging information from both modalities is crucial.
- BPG and ITC Work Synergistically: The BPG module enhances image-text fusion by incorporating image domain bias, while the ITC module directly reduces the modality gap. Together, they form a powerful framework for few-shot OOD detection.
- Gaussian Bias is Effective: The use of a Gaussian distribution to estimate image domain bias in BPG is shown to be effective in improving generalization and reducing false positives.
- SGMP is More Robust: The proposed SGMP score, which aggregates information from multi-modal prototypes and embeddings, provides better separation between ID and OOD samples compared to existing methods like SMCM.
Key Results
- SUPREME consistently outperforms existing VLM-based OOD detection methods across various benchmarks.
- On ImageNet-1k (ID) with four OOD datasets, SUPREME achieved an average FPR95 of 20.70 and AUROC of 95.38. When using the full training split for prototypes, these improved to an average FPR95 of 20.28 and AUROC of 95.54.
- On ImageNet-100 (ID) with four OOD datasets, SUPREME achieved an average FPR95 of 8.47 and AUROC of 98.08.
- In challenging near/far OOD scenarios (ImageNet-10 vs. ImageNet-20), SUPREME achieved the lowest FPR95 and highest AUROC.
- Ablation studies show that excluding BPG or ITC modules significantly degrades performance, highlighting their importance.
- SUPREME also demonstrates improved Top-1 accuracy on ID data compared to other OOD detection methods, indicating its ability to maintain ID performance.
Limitations and Future Work
- Dependency on ID Data: The current approach relies on having access to ID data for training prototypes and fine-tuning. The authors suggest that future work could explore methods that don't require ID data, such as image generation or retrieval from web-scale datasets.
- Gaussian Distribution Assumption: While effective, the use of a Gaussian distribution for image domain bias is an assumption. Exploring more advanced distribution models could potentially further improve performance.
- Generalization to Other VLMs: The current work focuses on CLIP. Investigating the applicability of SUPREME to other VLMs would be a valuable extension.
Summary updated