VRG CTU University of Crete Athena Research Center FORTH

Retrieve and Segment

Are a Few Examples Enough to Bridge the Supervision Gap in Open-Vocabulary Segmentation?
1 VRG, FEE, Czech Technical University in Prague · 2 University of Crete · 3 Archimedes, Athena RC · 4 IACM-FORTH
CVPR 2026 · Highlight Best Oral Presentation, Greeks in AI Symposium 2026
RnS gives an open-vocabulary segmenter a memory of a few pixel-annotated examples: for every test image it retrieves the relevant ones, fuses them with the class names, and trains a tiny per-image classifier in under a second, closing most of the gap to fully supervised segmentation without giving up the open vocabulary.

The idea

Zero-shot open-vocabulary segmentation labels pixels with class names alone. Image-level pre-training and the ambiguity of language leave a large gap to supervised models. RnS closes most of it with a visual support set: a handful of images with pixel masks.

Retrieval, not fine-tuning

The backbone stays frozen. Each support image contributes one compact feature per class it contains, and at test time k-nearest-neighbour retrieval picks only the support features that matter for the image at hand.

Learned fusion of text and images

Class names and visual features are blended into fused class features, and a lightweight linear classifier is trained per test image on both, weighting each class by its relevance. No hand-crafted late fusion of two predictions.

Open world by design

Support can be partial: classes without images fall back to zero-shot pseudo-labels, classes without a name get a neutral text prior. The memory grows at any time, and a few examples of one particular object are enough to segment that object.

Read the abstract

Open-vocabulary segmentation (OVS) extends the zero-shot recognition capabilities of vision–language models (VLMs) to pixel-level prediction, enabling segmentation of arbitrary categories specified by text prompts. Despite recent progress, OVS lags behind fully supervised approaches due to two challenges: the coarse image-level supervision used to train VLMs and the semantic ambiguity of natural language. We address these limitations by introducing a few-shot setting that augments textual prompts with a support set of pixel-annotated images. Building on this, we propose a retrieval-augmented test-time adapter that learns a lightweight, per-image classifier by fusing textual and visual support features. Unlike prior methods relying on late, hand-crafted fusion, our approach performs learned, per-query fusion, achieving stronger synergy between modalities. The method supports continually expanding support sets, and adapts seamlessly to fine-grained tasks such as personalized segmentation. Experiments show that we significantly narrow the gap between zero-shot and supervised segmentation while preserving open-vocabulary ability.

Method

Two stages: build a compact support memory once, then adapt to every test image with a few gradient steps on frozen VLM features.

1 · BUILD THE SUPPORT MEMORY  (once; grows at any time)2 · ADAPT PER TEST IMAGE  (under a second)support images+ masksper-imageclass features vci visual supportset V(k-NN index)visual classfeatures vc (summed per class)trainbackgroundairplaneboattextual classfeatures tc (class names, text encoder)1 − λλ⊕fused classfeatures Ffor several λOne compact vector per class and support image; a new support image just appends to the index.test imagepatch or regionfeatures xj (SAM 2.1 regions optional)k-NN(V, xj )retrieved visualfeatures Vr their classes Cr retrieved fusedfeatures Fr train a linearclassifier gθ cross-entropy onVr ∪ Fr each sample weightedby class relevance wc backbone frozen,a few hundred stepson one GPUsame features xj apply gθ predictiontrained weights

Left: every support image is pooled under its masks into per-image visual class features; their union is the visual support set V. Summing per class and blending with the text feature of the class name, fcλ = λ tc + (1 − λ) vc, gives the fused class features F. Right: for a test image, the nearest support features of its patch or region features are retrieved, and a linear classifier gθ is trained on them and on the fused features of the retrieved classes with cross-entropy, each sample weighted by a class relevance weight wc. The classifier then labels the same features. With SAM 2.1 proposals, region-pooled features are labelled instead of patches.

1
Support features

Pool patch features of each support image under each class mask into vci. Sum per class into vc and blend with the text feature tc at several mixing ratios λ. Adding an image only appends to the memory.

2
Retrieve

For every patch (or SAM region) feature of the test image take its k nearest neighbours in V. Their union Vr, and the fused features Fr of the retrieved classes, are the training set for this image.

3
Train per image

Fit a linear classifier gθ with cross-entropy on Vr ∪ Fr. Each class is weighted by wc, the softmax similarity between the image-level feature and the class names, which suppresses retrieved classes that are irrelevant here.

4
Predict

Apply gθ to the same features and upsample, or paint the labels of SAM regions back at full resolution. Classes without visual support are handled by a pseudo-label loss on zero-shot predictions, so nothing outside the memory is lost.

Results

Average mIoU over six OVS benchmarks (VOC, Pascal Context, COCO Object, COCO-Stuff, Cityscapes, ADE20K). Support images are sampled from each training split; four random seeds.

+34.3
mIoU over zero-shot
DINOv3.txt + SAM 2.1, 20 images per class, average of VOC, Cityscapes, ADE20K, Context-59, FoodSeg103 and CUB
11.2
points to fully supervised
against the best supervised model per dataset, which trains on up to 20k annotated images instead of 964
+14.4
over the best trained OVS method
CAT-Seg trains on 118k COCO-Stuff annotations; the gain is largest on fine-grained data like CUB and FoodSeg103
< 1 s
per test image
test-time training of the linear classifier on one A100 (patch level, one image per class)

OpenCLIP ViT-B/16 + SAM 2.1

25303540455012351020Support images per class (log scale)mIoU (%)zero-shot: 33.7 mIoUzero-shotRnS: 42.13 mIoU at 1RnS: 45.48 mIoU at 2RnS: 46.85 mIoU at 3RnS: 47.80 mIoU at 5RnS: 48.97 mIoU at 10RnS: 49.98 mIoU at 20RnS w/o text: 35.09 mIoU at 1RnS w/o text: 40.93 mIoU at 2RnS w/o text: 43.85 mIoU at 3RnS w/o text: 45.71 mIoU at 5RnS w/o text: 47.86 mIoU at 10RnS w/o text: 49.08 mIoU at 20kNN-CLIP: 40.43 mIoU at 1kNN-CLIP: 42.15 mIoU at 2kNN-CLIP: 42.87 mIoU at 3kNN-CLIP: 43.68 mIoU at 5kNN-CLIP: 44.64 mIoU at 10kNN-CLIP: 45.38 mIoU at 20kNN-CLIP w/o text: 27.11 mIoU at 1kNN-CLIP w/o text: 36.74 mIoU at 2kNN-CLIP w/o text: 40.51 mIoU at 3kNN-CLIP w/o text: 43.67 mIoU at 5kNN-CLIP w/o text: 46.42 mIoU at 10kNN-CLIP w/o text: 47.88 mIoU at 20FreeDA: 36.76 mIoU at 1FreeDA: 40.73 mIoU at 2FreeDA: 42.02 mIoU at 3FreeDA: 42.76 mIoU at 5FreeDA: 43.36 mIoU at 10FreeDA: 43.56 mIoU at 20FreeDA w/o text: 34.80 mIoU at 1FreeDA w/o text: 39.45 mIoU at 2FreeDA w/o text: 40.99 mIoU at 3FreeDA w/o text: 41.76 mIoU at 5FreeDA w/o text: 42.49 mIoU at 10FreeDA w/o text: 42.73 mIoU at 20RnSRnS w/o textkNN-CLIPkNN-CLIP w/o textFreeDAFreeDA w/o text

DINOv3.txt ViT-L/16

253035404550556012351020Support images per class (log scale)mIoU (%)zero-shot · SAM regions: 31.1 mIoUzero-shot · SAM regionszero-shot · patches: 28.7 mIoUzero-shot · patchesRnS · SAM regions: 50.25 mIoU at 1RnS · SAM regions: 53.26 mIoU at 2RnS · SAM regions: 54.85 mIoU at 3RnS · SAM regions: 55.70 mIoU at 5RnS · SAM regions: 56.90 mIoU at 10RnS · SAM regions: 57.79 mIoU at 20RnS · patches: 44.20 mIoU at 1RnS · patches: 47.06 mIoU at 2RnS · patches: 48.65 mIoU at 3RnS · patches: 49.68 mIoU at 5RnS · patches: 50.81 mIoU at 10RnS · patches: 51.41 mIoU at 20RnS w/o text · SAM: 41.21 mIoU at 1RnS w/o text · SAM: 48.17 mIoU at 2RnS w/o text · SAM: 51.66 mIoU at 3RnS w/o text · SAM: 53.74 mIoU at 5RnS w/o text · SAM: 55.89 mIoU at 10RnS w/o text · SAM: 57.03 mIoU at 20kNN-CLIP · SAM regions: 42.57 mIoU at 1kNN-CLIP · SAM regions: 45.36 mIoU at 2kNN-CLIP · SAM regions: 46.77 mIoU at 3kNN-CLIP · SAM regions: 48.15 mIoU at 5kNN-CLIP · SAM regions: 49.07 mIoU at 10kNN-CLIP · SAM regions: 49.97 mIoU at 20kNN-CLIP · patches: 33.74 mIoU at 1kNN-CLIP · patches: 38.18 mIoU at 2kNN-CLIP · patches: 40.65 mIoU at 3kNN-CLIP · patches: 42.52 mIoU at 5kNN-CLIP · patches: 44.15 mIoU at 10kNN-CLIP · patches: 45.02 mIoU at 20RnS · SAM regionsRnS · patchesRnS w/o text · SAMkNN-CLIP · SAM regionskNN-CLIP · patches

With a single image per class, RnS improves zero-shot by +8.4 (OpenCLIP) and +19.1 (DINOv3.txt) mIoU, and keeps improving as the support grows. kNN-CLIP and FreeDA fuse text by hand and saturate early; the gap widens on the stronger backbone. Text matters most when support is scarce (compare with the w/o-text variants). Hover a legend entry to isolate a curve.

Some classes have no visual examples

010203040500.00.10.30.50.70.9Fraction of classes without visual support (3 images / class for the rest)mIoU (%)zero-shot: 33.7 mIoUzero-shotRnS: 46.86 mIoU at 0.0RnS: 44.43 mIoU at 0.1RnS: 40.60 mIoU at 0.3RnS: 37.67 mIoU at 0.5RnS: 35.38 mIoU at 0.7RnS: 33.84 mIoU at 0.9RnS w/o pseudo-label loss: 46.86 mIoU at 0.0RnS w/o pseudo-label loss: 41.83 mIoU at 0.1RnS w/o pseudo-label loss: 32.34 mIoU at 0.3RnS w/o pseudo-label loss: 23.49 mIoU at 0.5RnS w/o pseudo-label loss: 14.64 mIoU at 0.7RnS w/o pseudo-label loss: 5.31 mIoU at 0.9RnS w/o text: 43.85 mIoU at 0.0RnS w/o text: 39.41 mIoU at 0.1RnS w/o text: 30.86 mIoU at 0.3RnS w/o text: 22.91 mIoU at 0.5RnS w/o text: 14.27 mIoU at 0.7RnS w/o text: 5.27 mIoU at 0.9kNN-CLIP: 42.87 mIoU at 0.0kNN-CLIP: 40.80 mIoU at 0.1kNN-CLIP: 36.88 mIoU at 0.3kNN-CLIP: 32.98 mIoU at 0.5kNN-CLIP: 28.10 mIoU at 0.7kNN-CLIP: 22.44 mIoU at 0.9FreeDA: 42.02 mIoU at 0.0FreeDA: 38.84 mIoU at 0.1FreeDA: 32.22 mIoU at 0.3FreeDA: 26.08 mIoU at 0.5FreeDA: 19.63 mIoU at 0.7FreeDA: 12.07 mIoU at 0.9RnSRnS w/o pseudo-label lossRnS w/o textkNN-CLIPFreeDA

Some classes have no name

253035400.00.10.30.50.70.9Fraction of classes without a class name (1 image / class)mIoU (%)RnS w/o any text: 35.1 mIoURnS w/o any textFreeDA w/o any text: 34.8 mIoUFreeDA w/o any textkNN-CLIP w/o any text: 27.1 mIoUkNN-CLIP w/o any textRnS: 42.13 mIoU at 0.0RnS: 41.09 mIoU at 0.1RnS: 40.21 mIoU at 0.3RnS: 39.33 mIoU at 0.5RnS: 38.08 mIoU at 0.7RnS: 37.25 mIoU at 0.9kNN-CLIP: 40.43 mIoU at 0.0kNN-CLIP: 38.83 mIoU at 0.1kNN-CLIP: 35.33 mIoU at 0.3kNN-CLIP: 32.60 mIoU at 0.5kNN-CLIP: 30.07 mIoU at 0.7kNN-CLIP: 28.28 mIoU at 0.9FreeDA: 36.93 mIoU at 0.0FreeDA: 36.49 mIoU at 0.1FreeDA: 36.03 mIoU at 0.3FreeDA: 35.78 mIoU at 0.5FreeDA: 35.51 mIoU at 0.7FreeDA: 35.35 mIoU at 0.9RnSkNN-CLIPFreeDA

Left: as more classes lose their visual support, RnS degrades gracefully thanks to the pseudo-label loss on zero-shot predictions, while kNN-CLIP and FreeDA soon drop below zero-shot. Right: when class names are missing, RnS stays best over the whole range and never falls below its own text-free variant. OpenCLIP ViT-B/16 with SAM 2.1.

MethodTraining setAnnot. imagesVOCCityADEC-59FoodCUBAvg.
SAN †COCO-Stuff118k––32.157.724.519.3–
CAT-SegCOCO-Stuff118k82.547.0*37.963.333.322.947.8
LPOSS+——62.437.922.338.626.112.033.2
CorrCLIP——76.449.928.847.9–––
DINOv3.txt + SAM (zero-shot)——31.339.327.736.327.25.827.9
+ RnS, 1 image / classdomain6675.061.037.452.343.633.850.5
+ RnS, 20 images / classdomain96481.364.448.262.352.864.362.2
Fully supervised (best per dataset)domain20k90.487.063.070.345.184.673.4

mIoU (%). Bold: best per column, purple: second best. RnS uses DINOv3.txt ViT-L/16 with SAM 2.1 regions. domain: support sampled from each dataset's own training split; the annotated-image count is for ADE20K, the largest. † numbers from CAT-Seg, * self-evaluated. Fully supervised: best published model per dataset.

Try it yourself

Pick a test image and see the zero-shot prediction. Then click support images in and out of the visual support set and watch the segmentation and its mIoU change instantly. Every one of the 28 support combinations per image was precomputed with the real model (DINOv3.txt ViT-L/16 + SAM 2.1).

  • ADE20K, Pascal VOC, COCO-Stuff: 16 test images each, with a pool of 8 support images covering the classes the zero-shot model predicts.
  • Ground-truth masks of the test image and of the support images can be overlaid, and the mIoU is reported for every combination.
3 datasets48 test imagesruns in the browserprecomputed, nothing is simulated
Open the interactive demo
single page, about 14 MB, no installation

BibTeX

@InProceedings{Aravanis_2026_CVPR,
    author    = {Aravanis, Tilemachos and Stojni\'c, Vladan and Psomas, Bill and Komodakis, Nikos and Tolias, Giorgos},
    title     = {Retrieve and Segment: Are a Few Examples Enough to Bridge the Supervision Gap in Open-Vocabulary Segmentation?},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2026},
    pages     = {27621-27632}
}