Abstract
Existing foreground-background (FG-BG) decomposition methods for few-shot out-of-distribution (FS-OOD) detection often suffer from low robustness due to over-reliance on local class similarity and a fixed background patch extraction strategy. To address these challenges, we propose Mambo, a new FG-BG decomposition framework for FS-OOD detection. Mambo learns a background prompt to obtain local background similarity containing both background and image semantic information, then refines it using local class similarity. Furthermore, we introduce patch self-calibrated tuning to flexibly select background patches based on sample diversity. Extensive experiments demonstrate that Mambo achieves state-of-the-art performance in OOD and near-OOD detection settings.
Introduction: The Challenge of Few-Shot OOD Detection
Out-of-Distribution (OOD) detection is a critical safety component in computer vision, enabling models to identify inputs that fall outside their training distribution. Performing this task in a few-shot setting—where only a few labeled examples per class are available—is particularly challenging.
Current state-of-the-art methods leverage Vision-Language Models like CLIP to decompose images into foreground and background. However, these approaches typically face two major limitations:
- Over-reliance on class similarity: They assume that regions with low similarity to known classes must be background, which fails when image quality is poor or classes are complex.
- Rigid extraction strategies: They often use a fixed "top-K" strategy, extracting the same number of background patches for every image regardless of scene complexity.
The Mambo Framework
Mambo addresses these limitations by treating the background as a learnable semantic category and introducing adaptive extraction mechanisms.
The architecture consists of three core components:
- Background Prompt Learning: Instead of defining background by the absence of foreground, Mambo learns a specific "background prompt" in the CLIP text space. This allows the model to capture semantic information like grass, sky, or water independently of the target objects.
- Local Similarity Refinement: The model fuses the background similarity map with the local class similarity map. This refinement step creates a more accurate mask, reducing the dependence on potentially noisy class similarity scores.
- Patch Self-Calibrated Tuning: This dynamic strategy adjusts the number of background patches extracted based on the model's prediction confidence. High-confidence predictions lead to more aggressive background suppression, while low-confidence ones result in a more conservative approach.
Experimental Evaluation
The researchers evaluated Mambo against a rigorous suite of benchmarks, using ImageNet-1K and ImageNet-100 as In-Distribution (ID) datasets and iNaturalist, SUN, Places, and Texture as OOD datasets.
Key Results
Mambo consistently outperforms existing state-of-the-art methods such as LoCoOp and SCT across various few-shot settings.
As shown in the results, Mambo achieves superior performance:
- 1-Shot Performance: On the ImageNet-1K benchmark, Mambo achieved an average FPR95 of 30.38%, a significant improvement over LoCoOp's 32.27%.
- Near-OOD Scenarios: In harder tasks where unknown images are semantically similar to known ones, Mambo showed substantial gains, improving AUROC by up to 6.33% over competitors.
- Efficiency: Despite its adaptive components, Mambo remains efficient, requiring less training time and memory than "negative prompt" methods.
Conclusion and Future Work
Mambo demonstrates that treating the background as a semantic category and employing self-calibrated extraction significantly enhances few-shot OOD detection. While the framework is robust, it faces challenges in cases of extreme semantic similarity, such as camouflaged objects. Future research will focus on finer differentiation between highly similar foreground and background features and extending Mambo to specialized domains like medical imaging and autonomous driving.
Summary updated