Text Augmented Spatial Aware Zero-shot Referring Image Segmentation

Yucheng Suo, Linchao Zhu, Yi Yang

Introduction

Referring Image Segmentation (RIS) is the task of identifying and segmenting a specific object in an image based on a natural language description, such as "the woman holding a red umbrella on the left." While supervised methods have made significant strides, they rely on massive, manually annotated datasets that are costly to produce. Zero-shot RIS aims to eliminate this dependency by leveraging pre-trained vision-language models like CLIP.

However, standard vision-language models face three critical hurdles in RIS: global bias, where the model struggles with fine-grained local regions; domain gap, caused by the difference between natural training images and the masked/cropped inputs used during inference; and spatial blindness, an inherent inability to reliably interpret directional cues like "left" or "right."

Comparison of the CLIP-only baseline versus the TAS framework. TAS correctly identifies the target by leveraging captions and negative text, whereas CLIP-only fails due to spatial and fine-grained matching limitations.

The TAS Framework

To address these limitations, we present the Text Augmented Spatial-aware (TAS) framework, a training-free pipeline that achieves state-of-the-art zero-shot performance. The framework operates in three distinct stages: mask proposal, triple-scoring, and spatial rectification.

1. Mask Proposal

Rather than relying on CLIP’s coarse heatmaps, TAS utilizes the Segment Anything Model (SAM) to generate high-quality, instance-level mask proposals. This ensures that the final segmentation boundaries are precise and object-centric.

2. Text-Augmented Triple-Scoring

To select the most accurate mask from SAM's proposals, TAS calculates a combined score ($S_m$) using three complementary components:

  • Visual Score ($S^v$): The standard CLIP similarity between the masked image and the query expression.
  • Positive Score ($S^p$): To bridge the domain gap, TAS uses BLIP-2 to generate a natural language caption for each mask. This "translates" the visual region into text, allowing for a more robust text-to-text comparison with the user's query.
  • Negative Score ($S^n$): TAS mines "distracting" phrases from the overall scene (e.g., identifying a "car" or "tree" when the query is "man"). The model is penalized if a mask matches these negative phrases, effectively filtering out incorrect instances.
The TAS framework architecture, illustrating the integration of SAM for mask generation, BLIP-2 for captioning, and the triple-scoring system ($S^p, S^v, S^n$) followed by a Spatial Rectifier.

3. Spatial Rectifier

To overcome CLIP’s spatial blindness, TAS incorporates a rule-based Spatial Rectifier. This module uses the spaCy library to parse orientation words from the query. If a spatial constraint is detected (e.g., "on the left"), the system calculates the center points of all mask proposals and restricts the selection to the corresponding region of the image.

Key Results and Insights

The TAS framework was evaluated on four major benchmarks: RefCOCO, RefCOCO+, RefCOCOg, and PhraseCut. It significantly outperformed previous zero-shot methods, achieving a 39.91 mIoU on RefCOCO—a substantial improvement over the 34.16 mIoU achieved by a CLIP-only baseline.

A key insight of this work is the descriptive power of Large Language Models (LLMs) in the segmentation loop. By treating images as text (via the P-score), the model leverages the reasoning capabilities of LLMs to understand complex scenes. Furthermore, the N-score demonstrates that explicitly identifying what an object is not is as crucial for robustness as identifying what it is.

Conclusion and Future Work

TAS provides a powerful, training-free solution for zero-shot RIS, effectively combining the segmentation precision of SAM with the descriptive intelligence of vision-language models. While the method is currently limited by the inference speed of its multi-stage pipeline and its dependency on SAM’s initial proposals, it sets a new standard for zero-shot performance. Future work may involve integrating even larger reasoning models, such as GPT-4, to handle increasingly abstract and metaphorical language.

Summary updated

BibTeX
@inproceedings{suo2023text,
  author = {Yucheng Suo and Linchao Zhu and Yi Yang},
  title = {{Text Augmented Spatial Aware Zero-shot Referring Image Segmentation}},
  booktitle = {Conference on Empirical Methods in Natural Language Processing},
  year = {2023},
  doi = {10.18653/v1/2023.findings-emnlp.73},
}
Figure