All models

clipseg (zero shot image classification)

Frozen CLIP ViT-B/16 plus a tiny FiLM-conditioned transformer decoder that segments whatever a text or image prompt names.

Segmentation · 622 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (16 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
CLIPSeg
Parameters
149.6M
Operations
622
Framework
PyTorch
Recurrent
No
Published
CVPR 2022
Cited by
38 (as of 5 October 2026)
Authors
Timo Lüddecke, Alexander S. Ecker
Name in source
clipseg:zero-shot-image-classification
License
MIT
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m3788
Graph hash
f939175b9c00f0b4ac9119c4599cadb66998445ed07b0a76440492f60d6da510
Skeleton hash
740a0dc56f735697d3b2c57bd2c5d93fbfc7fc209c2537dcd0c2eacb58c04aeb
Architecture hash
13324da970f1262b0cd699a8ee4e833bb55c98d5eabab34a4c32c8c716d39fc0
Diagram SHA-256
b5c7bdbb51ff821831d68b4b73b0b6339d17a2ce987a42933a2fb7b694bca1ea
TorchLens version
2.36.0
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

What it is

The bare CLIPSeg model without the segmentation decoder: its outputs are the scaled dot product scores between image_embeds and text_embeds, the image-text similarity scores.

About this model's family

CLIPSeg is Timo Lüddecke and Alexander S. Ecker's prompt-driven segmenter: instead of a fixed set of object classes, it can generate image segmentations based on arbitrary prompts at test time, and a prompt can be either a text or an image. That flexibility lets one model, trained once, cover three segmentation tasks with distinct challenges: referring expression segmentation, zero-shot segmentation and one-shot segmentation. The authors also find the system adapts well to generalized queries involving affordances or properties.

The backbone is the visual transformer-based (ViT-B/16) CLIP model, extended with a small, parameter-efficient transformer decoder, and CLIP itself is not trained, but only used as a frozen feature extractor. The decoder is a simple, purely-transformer based decoder, which has U-Net-inspired skip connections to the CLIP encoder that allow the decoder to be compact (in terms of parameters). To tell the decoder what to segment, the authors modulate the decoder's input activation by a conditional vector using FiLM, a vector that comes either from the CLIP text-transformer embedding of a text query or from the CLIP visual transformer on a feature engineered prompt image. CLIP activations are read out at layers S = [3, 7, 9], so the decoder has only three layers, and with a projection dimension of D = 64 CLIPSeg has only 1,122,305 trainable parameters. Training was on PhraseCut+, an extended version of the PhraseCut dataset, after which the system generates a binary segmentation map for an image based on a free-text prompt or on an additional image expressing the query.

Both members here are the transformers port of the authors' rd64-refined weights, which the Hub card describes as the CLIPSeg model with reduce dimension 64, refined (using a more complex convolution), intended for zero-shot and one-shot image segmentation. The segmentation member returns per-pixel classification scores for each pixel at the 352 px the paper used throughout its experiments, while the second member is the bare CLIPSeg model whose outputs are the scaled dot product scores between image_embeds and text_embeds, the CLIP-style similarity without the decoder. The original CLIP is constrained to a fixed image size due to the learned positional embedding, so the authors interpolate those embeddings to allow other sizes, and for ViT-B/16 performance only decreases for images larger than 350 pixels. CLIPSeg was integrated into the HuggingFace Transformers library in November 2022, and the paper was accepted to CVPR 2022.

Key idea. A compact transformer decoder with U-Net-style skips into a frozen CLIP ViT-B/16, FiLM-conditioned on a text or image prompt, producing a binary mask for any query.

  • clipseg
  • clip seg
  • clipdensepredt
  • clipseg-rd64-refined
  • image segmentation using text and image prompts
  • text-guided segmentation
  • zero-shot segmentation
  • one-shot segmentation
  • referring expression segmentation
  • luddecke ecker
  • clip segmentation

AI-written summary, checked automatically against its sources; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{lüddecke2022imagesegmentationusingtext,
      title={Image Segmentation Using Text and Image Prompts}, 
      author={Timo Lüddecke and Alexander S. Ecker},
      year={2022},
      eprint={2112.10003},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2112.10003}, 
}