Abstract
Vision-Language Models (VLMs) like CLIP have revolutionized zero-shot learning, yet they often struggle to focus on specific objects within complex scenes. Traditional visual prompting techniques—such as drawing red circles or blurring backgrounds—guide the model but inadvertently "contaminate" the input data, potentially destroying fine-grained details. We introduce Foveal-Attention CLIP (FALIP), a train-free approach that steers CLIP’s internal attention mechanism using biologically inspired "foveal masks." By modifying the attention scores rather than the image pixels, FALIP preserves original content while effectively highlighting regions of interest. Our method achieves state-of-the-art results across referring expression comprehension, image classification, and 3D recognition tasks.
The Visual Prompt Paradox
While CLIP excels at general image-text alignment, directing its "gaze" to a specific sub-region usually requires visual prompts. However, existing methods face a fundamental trade-off: adding a red circle or a blur mask modifies the very features the model needs to analyze. For instance, a red circle might be misinterpreted as a color feature of the object, while blurring might erase textures critical for fine-grained classification.
FALIP resolves this "visual prompt paradox" by moving the prompting mechanism from the pixel space to the internal attention space of the Vision Transformer (ViT). This approach ensures that the model's focus is guided without altering a single pixel of the input data.
Methodology: Foveal Attention Injection
The core of FALIP is the modification of the Multi-head Self-Attention (MSA) module within CLIP’s encoder. Instead of altering the input, FALIP generates a 2D Gaussian-weighted mask based on a provided region of interest (ROA).
1. Foveal Attention Generation
Inspired by the human fovea, which provides high-resolution central vision, FALIP creates a mask ($M$) that assigns higher weights to tokens within the target region. This mask is added directly to the attention score calculation: $$\text{Attention}(Q, K, V) = \text{Softmax}\left(\frac{QK^T}{\sqrt{d}} + M\right)V$$ This "boosts" the importance of relevant tokens during the model's internal processing, effectively mimicking selective focus.
2. Unleashing Sensitive Heads
The authors identified that spatial steering is most effective in the final layers of the ViT. By "unleashing" specific attention heads that are naturally more sensitive to spatial cues, FALIP further amplifies the focus on the target object. Because it only modifies the inference logic, FALIP is entirely train-free and plug-and-play.
Experimental Evaluation
FALIP was evaluated across three diverse domains to demonstrate its robustness:
- Referring Expression Comprehension (REC): On RefCOCOg, FALIP outperformed RedCircle and ReCLIP by approximately 3%, achieving 60.7% accuracy.
- Fine-Grained Image Classification: While traditional prompts like RedCircle dropped performance on the StanfordDogs dataset (from 56.5% to 52.4%), FALIP improved it to 58.3%, proving that preserving pixels is vital for classification.
- 3D Point Cloud Recognition: Applied via the PointCLIP framework, FALIP provided a 1.4% average accuracy boost, showing the generalizability of foveal attention to projected 3D data.
Discussion and Insights
The success of FALIP highlights two key findings. First, attention is the primary driver of visual prompting; manipulating the attention matrix directly is a cleaner, more effective alternative to pixel-level editing. Second, spatial sensitivity is hierarchical; the researchers found that modifying the last four layers of the ViT is critical for steering, whereas early layers focus more on establishing global context.
Conclusion
FALIP offers a powerful, train-free method for enhancing CLIP’s zero-shot capabilities. By shifting the focus from external image modification to internal attention steering, it avoids data contamination and sets a new standard for visual prompting. Future work will explore automated region-of-interest generation to make FALIP fully autonomous.
Summary updated