TL;DR
This paper introduces a fast, entirely training-free framework for reference-based instance segmentation by pairing two frozen foundation models: DINOv2 for semantic representations and SAM2 for instance mask generation. By combining a prototype memory bank with a novel semantic-aware soft merging strategy, the method achieves state-of-the-art results on few-shot benchmarks without updating a single weight.
What Problem Does This Paper Address?
While foundation models like the Segment Anything Model (SAM / SAM2) produce remarkably accurate segmentation masks, they are semantic-agnostic—they find object boundaries without knowing what the object is. Consequently, running SAM on new images requires either tedious manual prompts (points, boxes) or brittle, hand-crafted rules.
Reference-based instance segmentation aims to replace manual prompts with a few annotated example images. However, conventional methods typically require fine-tuning on novel classes, making them susceptible to overfitting, domain shifts, and high training costs. Existing training-free attempts (such as Matcher) rely on computationally prohibitive distance metrics like Earth Mover’s Distance (taking upwards of two minutes per image) and are geared toward semantic rather than instance-level segmentation.
Methods
The authors propose an efficient, three-stage training-free pipeline that uses off-the-shelf SAM2-L and DINOv2-L:
- Memory Bank Construction: For each novel category, reference images are passed through frozen DINOv2. The ground-truth instance masks crop the dense feature maps to isolate category-specific visual embeddings.
- Two-Stage Feature Aggregation:
- Instance-level Prototypes: Masked feature embeddings are average-pooled for each annotated instance.
- Class-level Prototypes: Instance prototypes within a class are averaged to produce a clean, representative class prototype ($P_i$).
- Inference & Semantic-Aware Soft Merging:
- SAM2 generates candidate instance masks across the target image using a uniform grid of query points.
- For each candidate mask, pooled DINOv2 features are matched against the memory bank via cosine similarity to assign category labels and confidence scores.
- Semantic-Aware Soft Merging: To eliminate redundant overlapping predictions without dropping distinct touching instances, the authors modify Non-Maximum Suppression (NMS). Candidate scores are decayed using an Intersection-over-Self (IoS) penalty scaled by feature cosine similarity between mask representations: $$S_t^m \leftarrow S_t^m \cdot \sqrt{1 - \text{IoS}(M_t^m, M_t^{m'}) \cdot w_{m,m'}}$$
Datasets
The approach is evaluated entirely without retraining across:
- COCO-FSOD (COCO-$20^i$): Standard 10-shot and 30-shot settings on novel classes.
- PASCAL VOC Few-Shot: Evaluated across three standard class splits under 1, 2, 3, 5, and 10-shot setups.
- Cross-Domain Few-Shot Object Detection (CD-FSOD): Evaluates out-of-distribution transfer across six distinct target datasets: ArTaxOr (insects), Clipart1k (cartoons), DIOR (aerial imagery), DeepFish (underwater fish), NEU-DET (microscopic surface defects), and UODD (underwater objects).
- COCO-$20^i$ Few-Shot Semantic Segmentation: Evaluated by aggregating instance predictions into class semantic maps.
(No new datasets were introduced.)
Key Insights and Ideas
- Prototype Averaging Overcomes Patch Noise: Matching a single patch vector tends to highlight only isolated sub-parts (e.g., an animal's neck). Averaging embeddings across instance masks yields spatially coherent, object-level prototypes.
- DINOv2 Robustness to Blur: The semantic features extracted by DINOv2 remain robust and discriminative even when reference examples suffer from significant Gaussian blurring.
- Reference Selection Matters in Low-Shot Regimes: Performance variance across random seeds is high at 1–3 shots but stabilizes by 5+ shots. Analysis showed that reference images featuring large, centered, and un-cropped instances consistently yield superior prototypes.
- Backbone Limits (Feature Entanglement): Testing DINOv3 and larger models showed diminishing returns. Semantic errors (e.g., confusing couch with chair or car with truck) stem from underlying embedding entanglement in the self-supervised representations rather than prompt construction.
Key Results
- COCO-FSOD: Achieves 36.6% nAP (10-shot) and 36.8% nAP (30-shot), surpassing prior fine-tuned models such as CD-ViTO (35.9%) and DE-ViT (34.0%).
- PASCAL VOC Few-Shot: Achieves an average 71.2% $\text{nAP}_{50}$ across novel splits, substantially outperforming fine-tuned state-of-the-art approaches like NIFF (59.4%) and DE-ViT (60.2%).
- CD-FSOD Benchmark: Sets a new state-of-the-art among training-free methods (22.4% mAP at 5-shot vs. DE-ViT's 5.1% and Detic's 2.2%), demonstrating remarkable generalization to cartoon, aerial, and underwater domains.
- Inference Speed: Processes a target image across 20 classes in 0.93 seconds on an A100 GPU—roughly $130\times$ faster than Matcher (120.0s) and nearly $4\times$ faster than SAM’s default Automatic Mask Generator baseline (3.51s).
Limitations and Future Work
- Fine-Grained Semantic Confusion: The model struggles to separate semantically adjacent categories (e.g., bread vs. hot dog, armchairs vs. couches) due to DINOv2's representation overlap.
- Crowded Scenes & Small Objects: Densely packed, heavily occluded objects or very small targets are occasionally missed during candidate proposal generation.
- Future Directions:
- Developing automated, active-selection algorithms to select optimal reference images for 1-to-5-shot setups.
- Improving spatial feature localization and semantic disentanglement in foundation backbones.
- Lightweight memory bank adaptation/fine-tuning tailored specifically for extreme low-shot settings.
Summary updated