Detect Every Thing with Few Examples

Xinyu Zhang, Yuting Wang, Abdeslam BoulariasSubmission to ICLR 2024 · Rejected

TL;DR

DE-ViT is a few-shot object detector built on a frozen DINOv2 visual backbone that recognizes and localizes novel object categories at inference time without any fine-tuning. By recasting multi-class prediction into efficient one-vs-rest binary classifications and using a novel "region propagation" heatmap integral to refine bounding boxes, DE-ViT beats prior few-shot and open-vocabulary detection methods on COCO and LVIS by massive margins.

What Problem Does This Paper Address?

Traditional Few-Shot Object Detection (FSOD) enables models to detect unseen object categories given only a handful of example images. However, most contemporary FSOD approaches rely on complicated, multi-stage fine-tuning pipelines. Fine-tuning causes two major problems:

  1. Practical friction: Adapting to novel classes in production is slow and computationally cumbersome.
  2. Base-class overfitting: Models fixate heavily on visual patterns specific to the base classes seen during training, collapsing accuracy on novel classes.

Because of this performance ceiling, FSOD has recently been overshadowed by Open-Vocabulary Object Detection (OVD) powered by vision-language models like CLIP. DE-ViT revives example-based detection by asking: Can we build an accurate, fine-tuning-free detector by combining frozen self-supervised vision features with class-agnostic matching?

Methods

DE-ViT builds on top of an off-the-shelf, class-agnostic Region Proposal Network (RPN) and a frozen DINOv2 ViT backbone. Its core innovations include:

[Target Image] ---> [Frozen DINOv2] ---> [ROIAlign] ---+
                                                       |--> [Prototype Projection] ---> Similarity Maps
[Support Images] -> [Frozen DINOv2] ---> [Prototypes] -+                                    |
                                                                       +--------------------+--------------------+
                                                                       |                                         |
                                                                       v                                         v
                                                             [Class Pre-Selection]                   [Proposal Expansion]
                                                             [One-vs-Rest Binary Cls]                [Binary Segmentation]
                                                                       |                                         |
                                                                       v                                         v
                                                                 Class Scores                         [Spatial Integral Layer]
                                                                                                                 |
                                                                                                                 v
                                                                                                           Refined Boxes
  • Visual Prototype Projection: Support images are passed through frozen DINOv2 to build class-representative prototype vectors (by averaging region features). Fixed background prototypes are also mined from background classes (e.g., sky, road). The network never sees raw image features directly; it only consumes similarity maps calculated by the dot product of proposal features and prototypes, ensuring it learns generic matching rather than class-specific textures.
  • One-vs-Rest Classification with Pre-Selection: Instead of a fixed multi-class linear head that must be extended and retrained for new classes, DE-ViT uses a shared binary classifier. To avoid evaluating all possible classes per proposal, a Class Pre-Selection module filters proposals to the top-$K$ candidates (e.g., $K=3$) via a fast global dot product.
  • Localization via Region Propagation & Spatial Integral: Frozen ViT representations lack explicit coordinate information, and fine-tuning the backbone destroys novel-class generalization. DE-ViT solves this by:
  • Expanding the initial proposal box to ensure it covers the target object.
  • Running a lightweight segmentation network to propagate the initial box into a 2D object mask heatmap.
  • Applying a differentiable Spatial Integral Layer (calculating the center via spatial softmax and aggregating sorted row/column sums) to project the heatmap directly into refined bounding box coordinates.

Datasets

  • COCO 2014 & COCO 2017: Used for few-shot (10-shot, 30-shot), one-shot, and open-vocabulary detection benchmarks across standard base/novel splits.
  • COCO-Stuff: Used strictly to extract semantic masks for offline background prototypes.
  • LVIS v1: A challenging large-vocabulary benchmark (~1200 categories) where rare classes act as novel evaluation classes.
  • YCB Object Set: Used for a real-world qualitative demonstration on robotics manipulation categories without training on them.

Key Insights and Ideas

  • Vision-Only Features vs. Vision-Language: Visual embeddings from DINOv2 form tight, well-separated semantic clusters. In contrast, CLIP’s text and image embeddings exhibit a large cross-modal gap where text prompts overlap closely in feature space, making language-guided detection sensitive to noise.
  • Separating Matching from Semantics: Feeding similarity maps (rather than image feature embeddings) into the detection head forces the model to act as an invariant "pattern matcher." This prevents the detection head from overfitting to base classes.
  • Coordinate-Free Box Regression: Directly regressing bounding boxes on frozen ViT features usually fails. Reformulating localization as mask segmentation within an expanded proposal followed by integral-based coordinate recovery provides high-precision boxes without altering the ViT backbone.

Key Results

  • Few-Shot COCO: On 10-shot COCO, DE-ViT achieves 34.0 nAP / 53.0 nAP50, outperforming the previous state-of-the-art (LVC) by +15.0 mAP. It also matches or exceeds this performance without the 10+ multi-stage self-training steps prior methods required.
  • LVIS Few-Shot: Achieves 33.6 box APr (ViT-L), beating the previous best few-shot method (DiGeo) by +20.0 box APr.
  • Outperforming Open-Vocabulary Detectors:
  • On COCO 2017 novel classes, DE-ViT reaches 50.0 nAP50, beating OVD SOTA (CORA+) by +6.9 AP50 without using extra training sets like ImageNet-21k or COCO Captions.
  • On LVIS, DE-ViT hits 34.3 mask APr, surpassing top OVD methods like Ro-ViT and F-VLM.
  • Inference & Parameter Efficiency: DE-ViT contains only 23M trainable parameters (the 320M ViT backbone stays frozen) and achieves inference speeds of 0.25–0.33 seconds per image, running faster than competing few-shot models.

Limitations and Future Work

  • External Proposal Dependency: The model relies on an external RPN (a ResNet-50 trained on base classes) to supply initial candidate regions rather than generating proposals natively from DINOv2.
  • Hybrid Architecture: The framework currently grafts convolutional R-CNN heads onto a ViT backbone. Moving to a fully native, end-to-end transformer architecture could improve scalability.
  • Over-Expanded Proposal Merging: When multiple instances of the same class are clustered very close together (e.g., two cuddling cats), the propagation head can occasionally lump them into a single predicted bounding box.

Summary updated

Abstract

Open-set object detection aims at detecting arbitrary categories beyond those seen during training. Most recent advancements have adopted the open-vocabulary paradigm, utilizing vision-language backbones to represent categories with language. In this paper, we introduce DE-ViT, an open-set object detector that employs vision-only DINOv2 backbones and learns new categories through example images instead of language. To improve general detection ability, we transform multi-classification tasks into binary classification tasks while bypassing per-class inference, and propose a novel region propagation technique for localization. We evaluate DE-ViT on open-vocabulary, few-shot, and one-shot object detection benchmark with COCO and LVIS. For COCO, DE-ViT outperforms the open-vocabulary SoTA by 6.9 AP50 and achieves 50 AP50 in novel classes. DE-ViT surpasses the few-shot SoTA by 15 mAP on 10-shot and 7.2 mAP on 30-shot and one-shot SoTA by 2.8 AP50. For LVIS, DE-ViT outperforms the open-vocabulary SoTA by 2.2 mask AP and reaches 34.3 mask APr.
BibTeX
@inproceedings{zhang2024detect,
  author = {Xinyu Zhang and Yuting Wang and Abdeslam Boularias},
  title = {{Detect Every Thing with Few Examples}},
  booktitle = {Conference on Robot Learning},
  year = {2024},
  url = {https://openreview.net/forum?id=HlxRd529nG},
}
Figure