Exploring Large Language Models for Multi-Modal Out-of-Distribution Detection

Yi Dai, Hao Lang, Kaisheng Zeng, Fei Huang, Yongbin Li

Abstract

This paper explores the integration of Large Language Models (LLMs) with computer vision to enhance Out-of-Distribution (OOD) detection. While vision-language models like CLIP provide a baseline for zero-shot OOD detection using class names, they often lack the descriptive depth required for high-precision tasks. We propose a framework that leverages LLMs to generate detailed visual descriptors, which are then filtered through a novel consistency-based uncertainty calibration method to prevent performance degradation from LLM hallucinations. Our approach achieves a 5.03% reduction in FPR95 on ImageNet-1k, outperforming existing zero-shot and even some task-specific models.

Introduction: The Need for Descriptive Context

In real-world scenarios, machine learning models must reliably identify samples that do not belong to their training distribution. Standard zero-shot OOD detection methods using models like CLIP often rely on simple labels (e.g., "black swan"). However, these labels fail to capture the specific visual attributes that define a category.

Visualizing LLM-derived descriptors for a black swan, such as "long neck" and "webbed feet."

LLMs like GPT-3 possess extensive world knowledge and can provide these missing details. However, the challenge lies in the tendency of LLMs to "hallucinate"—generating plausible but incorrect features. Indiscriminately adding these noisy descriptions can actually harm OOD detection by creating "collisions" in the feature space where OOD samples accidentally match incorrect In-Distribution (ID) descriptors.

Methodology: Grounding and Calibration

To harness LLM knowledge safely, the authors developed a four-step framework centered on grounding text descriptions in visual data.

1. Descriptor Generation and Uncertainty Calibration

The process begins by prompting an LLM to generate multiple sets of visual descriptors for each ID class. To verify these descriptors, the framework uses them to retrieve the top-$k$ most similar images from a small set of unlabeled data.

A hen, representing a class where LLM hallucinations (e.g., "featherless head") must be filtered to maintain OOD detection accuracy.

Consistency is key: if different sets of descriptors for the same class retrieve the same images, the LLM is deemed "consistent" and the descriptors are retained. This "retrieval as grounding" technique effectively filters out hallucinations that would otherwise poison the OOD detection process.

2. Multi-Modal Scoring

The final OOD score is calculated by combining global image similarity with local object detection. By using a general object detector to identify specific concepts (e.g., "webbed feet") within the test image, the model can more robustly confirm if an image belongs to a specific class described by the LLM.

Key Results and Insights

The proposed method was tested on ImageNet-1k against various OOD datasets like iNaturalist and SUN.

  • State-of-the-Art Performance: The framework reduced the FPR95 by 5.03% compared to the previous best zero-shot method (MCM).
  • Zero-Shot vs. Trained Models: Remarkably, this zero-shot approach often outperformed models specifically trained for OOD detection, such as MOS.
  • Robustness: The method proved effective across multiple LLMs (GPT-4, Claude, Bard) and various object detection architectures, highlighting its generalizability.

Conclusion

By bridging the gap between the vast world knowledge of LLMs and the visual grounding of computer vision, this research provides a robust path forward for zero-shot OOD detection. The introduction of retrieval-based calibration offers a scalable solution to the problem of LLM hallucinations, ensuring that only reliable descriptive features are used to define the boundaries of known data.

Summary updated

BibTeX
@inproceedings{dai2023exploring,
  author = {Yi Dai and Hao Lang and Kaisheng Zeng and Fei Huang and Yongbin Li},
  title = {{Exploring Large Language Models for Multi-Modal Out-of-Distribution Detection}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.findings-emnlp.351},
}
Figure