Abstract
Visual In-Context Learning (ICL) has historically struggled to match the performance of specialized meta-learning models due to the spatial complexity of visual data. This paper introduces prompt-SelF, a framework that optimizes prompt selection and fusion to achieve state-of-the-art results in one-shot segmentation and detection without any model fine-tuning.
Introduction
In Natural Language Processing (NLP), In-Context Learning allows models like GPT-4 to perform new tasks by observing a few text examples. In Computer Vision, achieving similar flexibility has been challenging. Unlike linear text, images are multi-dimensional, making the "format" of the prompt critical. Previous attempts were highly sensitive to image arrangement and example selection. This research identifies prompt selection and prompt fusion as the two primary factors determining the success of visual ICL.
Methodology: The prompt-SelF Framework
The authors propose prompt-SelF, a framework built on three core pillars designed to stabilize and enhance visual ICL:
- Pixel-Level Retrieval (Selection): The researchers discovered that prompts with high spatial similarity to the query image perform best. Instead of using global features, they employ a CLIP-based feature extractor to find examples in a database that match the query image at a granular, pixel-like level.
- Multi-Arrangement Fusion: Large-scale vision models (such as MAE-VQGAN) are sensitive to spatial positioning. There are eight logical ways to arrange a 2x2 grid containing the prompt image, its ground truth, and the query image. Different arrangements "activate" different aspects of the model's internal knowledge.
- Ensemble Inference: Rather than selecting one arrangement, prompt-SelF generates predictions for all eight and uses a majority voting strategy (ensembling) to produce a final, robust result.
Key Insights and Results
Spatial Similarity and Knowledge Activation
A critical finding is that the most effective prompt is not just one from the same category, but one that is spatially congruent. For example, if a query image features an object on the left, a prompt with an object in the same position yields superior results. The authors hypothesize that different arrangements act as unique "keys" to the model's pre-trained knowledge, with some better at identifying edges and others at textures.
Performance Benchmarks
The framework was evaluated on standard benchmarks including Pascal-5i for segmentation and PASCAL VOC 2012 for detection:
- Segmentation Breakthrough: prompt-SelF achieved a mean IoU (mIoU) of 41.02 on Pascal-5i, surpassing the specialized meta-learning model OSLSM (40.80) and vastly outperforming previous ICL methods like Visual Prompting (26.91).
- The Power of Ensembling: Moving from a single arrangement (~35.89 mIoU) to an ensemble of eight provided a massive performance boost to 41.02.
- Domain Robustness: The pixel-level selection method proved robust to domain shifts (e.g., using COCO prompts for Pascal images), with only a minor performance drop of 1.22 mIoU points.
Limitations and Future Work
While prompt-SelF marks a significant step forward, it remains dependent on the quality of the underlying large-scale vision model. Current resolution constraints (downsampling sub-images to 111x111) can hinder the segmentation of intricate objects. Additionally, the ensemble approach increases computational overhead. Future research may explore larger backbones and sophisticated reasoning steps, akin to Chain-of-Thought prompting in NLP, to further bridge the gap between visual and textual in-context learning.
Summary updated