DINO-KNN: Training-Free Multiclass In-Context Segmentation via Nearest Neighbors
Abstract
In-context segmentation (ICS) segments a target image given a few annotated reference images. Recent training-free methods built on frozen foundation models segment one class at a time and gain little from additional references. We study the multiclass, multi-reference setting and ask how far a simple joint decision rule can go. We introduce DINO-KNN, which stores every labeled reference patch of a frozen DINOv3 encoder in a single memory and labels each target patch by a distance-weighted vote of its k nearest neighbors. All classes are predicted in a single pass, with one label per pixel, without training or a mask decoder. We evaluate on eight datasets, four natural and four medical, with R=1 to 15 reference images and three reference seeds. DINO-KNN achieves the best average mIoU at every R; it is the best method on six of the eight datasets from R=3 and on seven of the eight from R=7. Its accuracy continues to grow with the number of references, from 37.8 mIoU at R=1 to 56.2 at R=15, while the strongest baseline, INSID3, rises from 36.1 to 42.9. DINO-KNN is also 2.1x faster than INSID3. The code will be made public.
Create a lesson
Related papers
What the Background Hides: Thresholds, Vocabularies and Collisions in Training-Free Open-Vocabulary Segmentation
Shared title terminologycs.CVWendong Yao, Binhua Huang, Soumyabrata Dev
Training-Free 3D Editing via Feature-Divergence Localization and Trajectory Correction
Shared title terminologycs.CVTri Ton, Siwoo Lim, Joshua Tian Jin Tee et al.
ViewAgent3D: A Training-Free Multi-View Pipeline for 3D Scene Understanding
Shared title terminologycs.CVSarosij Bose, Arindam Dutta, Konstantinos Karydis et al.
Frequency-Synchronized Boundary Coupling for Training-Free Multi-Prompt Long Video Generation
Shared title terminologycs.CVYipan Xu, Shuyong Gao, Jiyuan Fu et al.
Query-Aware vs. Query-Agnostic Training-Free Video Token Pruning in Multimodal LLMs
Shared title terminologycs.CVDivya Kothandaraman, Timo Kumkel, Jaclyn Pytlarz
Training-free motion statistics match self-supervised behavior encoders
Shared title terminologycs.CVZiwen Chen