Skip to main content
QUICK REVIEW

[Paper Review] Image Segmentation Using Text and Image Prompts

Timo Lüddecke, Alexander S. Ecker|arXiv (Cornell University)|Dec 18, 2021
Multimodal Machine Learning ApplicationsComputer Science36 citations
TL;DR

CLIPSeg extends CLIP with a lightweight transformer decoder to perform image segmentation conditioned on free-text or image prompts, enabling zero-shot, one-shot, and referring-expression tasks with a single trained model.

ABSTRACT

Image segmentation is usually addressed by training a model for a fixed set of object classes. Incorporating additional classes or more complex queries later is expensive as it requires re-training the model on a dataset that encompasses these expressions. Here we propose a system that can generate image segmentations based on arbitrary prompts at test time. A prompt can be either a text or an image. This approach enables us to create a unified model (trained once) for three common segmentation tasks, which come with distinct challenges: referring expression segmentation, zero-shot segmentation and one-shot segmentation. We build upon the CLIP model as a backbone which we extend with a transformer-based decoder that enables dense prediction. After training on an extended version of the PhraseCut dataset, our system generates a binary segmentation map for an image based on a free-text prompt or on an additional image expressing the query. We analyze different variants of the latter image-based prompts in detail. This novel hybrid input allows for dynamic adaptation not only to the three segmentation tasks mentioned above, but to any binary segmentation task where a text or image query can be formulated. Finally, we find our system to adapt well to generalized queries involving affordances or properties. Code is available at https://eckerlab.org/code/clipseg.

Motivation & Objective

  • Enable segmentation conditioned on arbitrary text or image prompts at test time without retraining.
  • Develop a unified model that covers referring expression, zero-shot, and one-shot segmentation with a single training process.
  • Leverage CLIP embeddings as a backbone and train a compact transformer decoder for dense prediction.
  • Investigate text versus image prompts and visual prompt engineering to enhance generalization to affordances and properties.

Proposed method

  • Use frozen CLIP ViT-B/16 as backbone and attach a lightweight transformer decoder with skip connections.
  • Extract CLIP activations from layers S=[3,7,9] and project them to the decoder's token space; combine via FiLM conditioning.
  • Train a binary foreground/background segmentation objective, adaptable to multi-label settings.
  • Extend PhraseCut with visual prompts and negatives (PhraseCut+), and employ image-text interpolation as training data augmentation.
  • Systematically evaluate various visual prompt designs (e.g., cropping, background dimming, blurring) to optimize prompt–image alignment.

Experimental results

Research questions

  • RQ1Can a single model segment based on arbitrary text or image prompts at inference time without task-specific retraining?
  • RQ2How do text prompts versus image prompts influence performance across referring expression, zero-shot, and one-shot segmentation tasks?
  • RQ3What is the impact of visual prompt engineering on segmentation quality and generalization to unseen prompts?
  • RQ4To what extent can the model generalize to affordance- or property-based prompts beyond standard object labels?

Key findings

  • CLIPSeg (PC+) achieves competitive referring expression segmentation: mIoU 43.4 with t=0.3, IoUFG 54.7, AP 76.7; with D=128, mIoU 48.2, IoUFG 56.5, AP 78.2; with PC, mIoU 46.1, IoUFG 56.2, AP 78.2.
  • In generalized zero-shot segmentation on Pascal-VOC, CLIPSeg (PC+) achieves higher unseen-class balance (e.g., unseen-10: mIoU S 35.7, mIoU U 43.1) and, for unseen-4, mIoU U 47.3.
  • In one-shot segmentation on Pascal-5i, CLIPSeg (PC+) with ViT(CLIP) achieves mIoU 59.5, IoU_BIN 75.0, AP 82.3; competitive with state-of-the-art methods like HSNet.
  • Visual prompt engineering significantly affects performance; the best design combines steps that lower background influence (cropping, background darkening, blur) to improve CLIP alignment.
  • Ablation shows critical dependence on CLIP pre-training and decoder capacity; reducing D to 16 or removing visual/text prompts markedly degrades performance, while keeping CLIP pre-training intact yields strong results.
  • Generalized prompts involving affordances and properties are demonstrably workable, with PC+-trained models outperforming baselines and showing broader generalization.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.