CLIP as RNN: Segment Countless Visual Concepts without Training Endeavor

Shuyang Sun, Runjia Li, Philip Torr, Xiuye Gu, Siyang Li

Introduction

Open-vocabulary image segmentation aims to identify and delineate any object in an image based on arbitrary text queries, ranging from common objects to specific entities like "Optimus Prime" or complex referring expressions. While large Vision-Language Models (VLMs) like CLIP possess vast knowledge, adapting them for high-quality segmentation typically requires fine-tuning on specific datasets.

This fine-tuning often leads to a "vocabulary bottleneck": the model "forgets" its broad pre-trained knowledge and becomes restricted to the limited categories present in the segmentation training data. Conversely, using CLIP in a zero-shot manner often yields noisy, low-resolution masks. To resolve this, researchers have introduced CaR (CLIP as RNN), a training-free framework that enables CLIP to perform high-quality segmentation while preserving its massive, "countless" vocabulary.

Methodology: The Recurrent Segmenter

CaR treats the segmentation process as a recurrent loop rather than a single feed-forward pass. The core of the system is a two-stage segmenter built on a frozen CLIP model, which acts as a recurrent unit.

The CaR pipeline treats segmentation as a recurrent process, iteratively refining mask proposals and text queries through a two-stage segmenter.

1. Mask Proposal and Classification

In the first stage, the model generates initial mask proposals using gradient-based Class Activation Maps (gradCAM) for every text query provided. Because these initial masks are often noisy, a second stage—the Mask Classifier—is used for verification. To help CLIP focus on the proposed area, the system uses "visual prompting" (such as background blurring or drawing red circles around the target) before feeding the image back into CLIP to calculate a similarity score.

2. The RNN Analogy

In a traditional Recurrent Neural Network (RNN), a hidden state is updated over time. In CaR, the "hidden state" is represented by the set of text queries. In each iteration, the model filters out queries that show low alignment with their corresponding masks. This process repeats—generating refined masks for the remaining queries and filtering again—until the set of queries and masks stabilizes. This recurrence acts as a powerful cleaner, progressively eliminating irrelevant concepts.

Experimental Results

CaR was evaluated across a wide range of benchmarks, including semantic segmentation (Pascal VOC, COCO), large-scale vocabulary tasks (ADE-847), and referring expression segmentation (Ref-COCO).

Qualitative results demonstrating CaR's ability to segment diverse and specific concepts, including fictional characters, landmarks, and brands, where traditional models often fail.

Performance Gains

The framework achieved state-of-the-art results for training-free methods. On the Pascal VOC benchmark, CaR improved the mean Intersection over Union (mIoU) by 28.8 points over previous training-free leaders. Remarkably, it even outperformed several fine-tuned models, such as TCL, by 12.6 mIoU, despite requiring zero additional training samples or mask annotations.

Preserving the Long Tail

Because CaR keeps the CLIP model frozen, it retains the ability to recognize and segment "long-tail" concepts that are absent from standard segmentation datasets. As shown in the qualitative results, the model successfully segments specific brands like Pepsi and Coca-Cola, landmarks like the Space Needle, and fictional characters like Pikachu and Iron Man.

Discussion and Limitations

While CaR is highly effective and memory-efficient, it is inherently dependent on the underlying VLM. For example, since CLIP is often trained with horizontal flipping, CaR can struggle to distinguish between "left" and "right" in text queries. Additionally, the recurrent nature of the pipeline and the use of Dense Conditional Random Fields (CRF) for post-processing result in a processing time of approximately 950ms per image, which may be a constraint for real-time applications.

In conclusion, CaR demonstrates that high-quality open-vocabulary segmentation does not always require more data or intensive fine-tuning. By structuring the inference process as a recurrent refinement loop, we can unlock the latent segmentation capabilities of existing vision-language models.

Summary updated

BibTeX
@inproceedings{sun2023clip,
  author = {Shuyang Sun and Runjia Li and Philip Torr and Xiuye Gu and Siyang Li},
  title = {{CLIP as RNN: Segment Countless Visual Concepts without Training Endeavor}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2023},
}
Figure