[Paper Review] LoCoOp: Few-Shot Out-of-Distribution Detection via Prompt Learning
LoCoOp introduces local-regularized context optimization to perform few-shot OOD detection using CLIP prompts, improving OOD separation by treating CLIP local features as OOD cues during training. It outperforms zero-shot, fully supervised, and prior prompt-learning methods on ImageNet-based benchmarks, even with one shot per class.
We present a novel vision-language prompt learning approach for few-shot out-of-distribution (OOD) detection. Few-shot OOD detection aims to detect OOD images from classes that are unseen during training using only a few labeled in-distribution (ID) images. While prompt learning methods such as CoOp have shown effectiveness and efficiency in few-shot ID classification, they still face limitations in OOD detection due to the potential presence of ID-irrelevant information in text embeddings. To address this issue, we introduce a new approach called Local regularized Context Optimization (LoCoOp), which performs OOD regularization that utilizes the portions of CLIP local features as OOD features during training. CLIP's local features have a lot of ID-irrelevant nuisances (e.g., backgrounds), and by learning to push them away from the ID class text embeddings, we can remove the nuisances in the ID class text embeddings and enhance the separation between ID and OOD. Experiments on the large-scale ImageNet OOD detection benchmarks demonstrate the superiority of our LoCoOp over zero-shot, fully supervised detection methods and prompt learning methods. Notably, even in a one-shot setting -- just one label per class, LoCoOp outperforms existing zero-shot and fully supervised detection methods. The code will be available via https://github.com/AtsuMiyai/LoCoOp.
Motivation & Objective
- Motivate and address the limitations of existing zero-shot and fully supervised OOD detection methods in a few-shot regime.
- Leverage CLIP's local features to identify and regularize ID-irrelevant regions during prompt learning.
- Develop a simple, efficient OOD regularization technique compatible with CoOp-style prompts that improves ID/OOD separation.
- Demonstrate strong performance gains on large-scale ImageNet OOD benchmarks across various shot settings.
Proposed method
- Adopt LoCal regularized Context Optimization (LoCoOp) to perform OOD regularization using CLIP local features as OOD cues.
- Identify ID-irrelevant (background) regions by evaluating region-wise alignment between local CLIP features and ID class text embeddings (ranking-based top-K approach).
- Apply entropy maximization as the OOD regularization loss on predicted region scores to push ID-irrelevant regions away from ID text embeddings.
- Combine the standard CoOp loss on full images with the OOD regularization term (L = L_CoOp + lambda * L_OOD).
- During testing, use MCM and GL-MCM scores (global and local features) for final OOD detection.
Experimental results
Research questions
- RQ1Can LoCoOp improve few-shot CLIP-based OOD detection by regularizing ID-irrelevant regions using local features?
- RQ2How does the rank-based identification of ID-irrelevant regions impact OOD discrimination compared to other thresholding strategies?
- RQ3What is the impact of the hyperparameters K (top-K regions) and lambda (OOD loss weight) on OOD performance?
- RQ4How does LoCoOp perform against zero-shot, fully supervised, and other prompt-learning baselines on ImageNet-based OOD benchmarks?
Key findings
- LoCoOp with GL-MCM achieves superior OOD detection performance, outperforming competitive methods on ImageNet OOD benchmarks.
- In 16-shot settings, LoCoOp GL reaches AUROC of 93.52%, outperforming all others (no method surpasses 92%).
- In one-shot settings, LoCoOp GL achieves strong average FPR95 and AUROC (33.52 and 92.14, respectively), surpassing zero-shot and some fully supervised methods.
- LoCoOp maintains performance across a range of K values (not highly sensitive except at extremes like 0 or 1000).
- LoCoOp demonstrates faster inference than per-image prompt methods (e.g., CoCoOp) and better ID-accuracy trade-offs than some baselines.
- Using GL-MCM with LoCoOp yields notable gains over MCM, especially in combination with local-feature regularization.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.