Abstract
Referring Expression Comprehension (REC) typically relies on pre-trained object detectors, which limits localization to a fixed set of categories. We present Tune-An-Ellipse, a "Differentiable Visual Prompting" framework that leverages CLIP's inherent open-world vocabulary for zero-shot object localization. By iteratively optimizing the parameters of a red ellipse—center, axes, and rotation—using a combination of CLIP similarity and Grad-CAM-based losses, our method "finds" objects described in natural language without any bounding box supervision.
Introduction
The task of Referring Expression Comprehension (REC) involves locating a specific object in an image based on a natural language description (e.g., "the cat looking at us"). Traditional approaches utilize a two-stage pipeline: a pre-trained detector (such as Faster R-CNN) generates object proposals, and a vision-language model like CLIP selects the best match. However, this creates a significant bottleneck: the system is blind to any object not present in the detector's training set.
While CLIP possesses a massive, open-world vocabulary, it is primarily a global image-text matcher rather than a localizer. Recent findings suggest that drawing a red circle around an object can bias CLIP's attention toward that region—a phenomenon likely learned from human-annotated images on the web. Tune-An-Ellipse automates this process, transforming visual prompting into a precise, differentiable optimization problem.
Methods
The core of our approach is Differentiable Visual Prompting, which represents a visual prompt as a rotated ellipse.
Differentiable Ellipse Representation
To enable gradient-based optimization, we approximate the ellipse's edge using a Gaussian distribution and its interior mask using a modulated inverse tangent function. This allows the model to compute how infinitesimal changes in the ellipse's shape (center $x, y$, axes $a, b$, and rotation $\theta$) affect the final CLIP similarity score.
Optimization Pipeline
- Initialization: A grid of "anchor ellipses" is scattered across the image. The best starting point is selected based on a combination of CLIP scores and Grad-CAM activation maps.
- Tuning Loop: A small MLP takes learnable tokens and predicts transformations for the ellipse parameters.
- Loss Functions: The optimization is guided by a three-part loss:
- Matching Loss ($L_{sim}$): Maximizes the CLIP similarity between the prompted image and the target text.
- Inflation Loss ($L_{inf}$): Uses Grad-CAM to encourage the ellipse to expand and cover relevant object regions.
- Squeezing Loss ($L_{sqz}$): Acts as a regularizer, preventing the ellipse from becoming excessively large by encouraging a compact fit around the activation area.
Key Results and Insights
We evaluated Tune-An-Ellipse on standard REC benchmarks, including RefCOCO, RefCOCO+, and RefCOCOg.
Performance Gains
The impact of the tuning process is substantial. On the RefCOCO testA set, using raw, untuned anchor ellipses (P-Ellipses) resulted in a meager 6.56% accuracy. After applying the Tune-An-Ellipse optimization loop, accuracy increased significantly to 32.3%. While this zero-shot performance still trails behind supervised methods using high-quality detectors (which typically achieve 50-60%), it represents a major advancement for detector-free, open-vocabulary localization.
Qualitative Success
Visualizations demonstrate the model's ability to "shrink" or "stretch" a generic circle into a tight ellipse that encapsulates complex entities, such as specific people in a crowd or small objects like snails. The method successfully leverages CLIP's "highlighting" bias—the implicit understanding that a red circle denotes the primary subject of interest.
Discussion and Limitations
Despite its success, the method faces challenges inherent to CLIP's architecture:
- Background Interference: Vague prompts (e.g., "the big one") can lead CLIP to assign high scores to red circles on empty backgrounds like sky or grass.
- Partial Inclusion: CLIP is often satisfied by prompts covering only discriminative parts of an object (e.g., a giraffe's head), making it hard to get a perfect bounding box.
- Sub-word Sensitivity: The model may focus on a single noun in a complex phrase (e.g., "hat" in "man with a hat") rather than the entire referred entity.
Conclusion
Tune-An-Ellipse demonstrates that CLIP's global matching capabilities can be repurposed for localizing objects through automated visual prompting. By making the prompt differentiable, we bypass the need for fixed-category detectors, opening the door for truly open-world spatial reasoning in vision-language models. Future work involving the explicit training of models on visual prompts could further enhance this spatial understanding.
Summary updated