Towards Discriminative and Transferable One-Stage Few-Shot Object Detectors

Karim Guirguis, Mohamed Abdelsamad, George Eskandar, Ahmed Hendawy, Matthias Kayser, Bin Yang, Juergen Beyerer

TL;DR

One-stage few-shot object detectors typically lag behind their two-stage counterparts due to poor "discriminability"—the ability to tell classes apart. This paper introduces Few-Shot RetinaNet (FSRN), which bridges this gap using a multi-way training strategy and early multi-scale feature fusion, outperforming existing one-stage models while remaining twice as fast as two-stage alternatives.

What Problem Does This Paper Address?

Few-Shot Object Detection (FSOD) is the challenge of teaching a model to detect new categories using only a handful of annotated examples. While two-stage detectors (like Faster R-CNN) have seen success in this area, they are often too slow or computationally heavy for real-time embedded applications. One-stage detectors (like YOLO or RetinaNet) are faster and lighter, but their performance in few-shot scenarios has been significantly worse.

The authors identify two main reasons for this performance gap:

  1. Narrow Receptive Fields: In many one-stage meta-detectors, the fusion of "query" (the image to search) and "support" (the example object) features happens too late in the network. This results in a post-fusion receptive field that is smaller than the actual anchors, preventing the model from learning instance-level features effectively.
  2. Weak Learning Signals: Standard meta-learning training often uses a "binary" strategy, looking for only one class per task. This leads to a scarcity of foreground samples, making the training signal weak and prone to vanishing gradients.

Methods

The authors propose Few-Shot RetinaNet (FSRN), which introduces three key architectural and strategic changes:

  • Multi-Way Support Training Strategy (MWST): Instead of training the model to find just one class at a time, MWST constructs tasks featuring multiple positive and negative classes per query image. This increases the number of foreground anchors and provides a more robust contrastive learning signal.
  • Early Multi-Scale Feature Fusion (MSF): FSRN fuses support and query features immediately after the Feature Pyramid Network (FPN). By doing this "early," the subsequent detection subnets have enough layers to develop a wide receptive field that fully covers the anchor areas.
  • Gaussian Prototyping (GP) & Multi-Scale Data Augmentation (MSDA): To improve how the model generalizes to new classes (transferability), the authors use MSDA to jitter image sizes during testing. They also introduce GP, which samples class prototypes from a Gaussian distribution rather than just taking a simple average of support features, helping to prevent overfitting on limited data.
Figure 1. Overview of the our FSRN architecture. First, the multi-way support training strategy (MWST) constructs multi-way tasks per training episode, featuring multiple positive and negative classes. Thereby, more foreground anchors are sampled, resulting in improved discriminability. Next, a multi-scale feature fusion (MSF) module is used on top of the FPN that enables a wide receptive field covering the whole anchor area post-fusion. During meta-testing, an introduced multi-scale data augmentation scheme (MSDA) enriches the scale-space improving the discriminability for novel classes. Additionally, the proposed Gaussian Prototyping (GP) for improved class prototypes.

Datasets

The model was evaluated on two standard benchmarks:

  • MS-COCO: A challenging dataset where 60 classes are used for base training and 20 novel classes are used for few-shot evaluation (5, 10, and 30-shot settings).
  • PASCAL VOC: Evaluated across three different splits of 15 base and 5 novel classes (1, 2, 3, 5, and 10-shot settings).

Key Insights and Ideas

  • Discriminability is the Bottleneck: The authors argue that the primary failure of dense (one-stage) meta-detectors isn't their inability to transfer knowledge, but their low discriminability on base classes. If a model can't distinguish between common classes well, it has no hope of doing so for rare ones.
  • Receptive Field Geometry: Figure 2 illustrates a crucial "aha moment": if your post-fusion receptive field is $3 \times 3$ but your anchor is $13 \times 13$, the model is essentially trying to identify an object while looking through a straw. FSRN ensures the "view" ($11 \times 11$) is large enough to see the whole anchor.
  • The Power of Multi-Way Tasks: Moving from binary classification (is this a cat?) to multi-way classification (is this a cat, dog, or car?) within a single training episode significantly stabilizes the backbone's feature representations.
Figure 2. A depiction of the post-fusion network receptive field (RF) impact. To illustrate, we use an example query image from the MS-COCO [18] dataset with an annotated bounding box of size 400 × 400. The upper part shows that a YOLOv2-based dense meta- detector [13] suffers from a narrow receptive field that is is unable to cover the whole anchor area (i.e., RF = 3 × 3 < 13 × 13). On the other hand, the proposed FSRN exploits the FPN [16] via the introduced MSF along with both deeper and wider post-fusion network to process the whole anchor area (i.e., RF = 11 × 11 > 7 × 7).

Key Results

  • State-of-the-Art for One-Stage: On MS-COCO (10-shot), FSRN achieved 15.8 nAP, nearly tripling the performance of the previous one-stage leader, MetaYOLO (5.6 nAP).
  • Competitive with Two-Stage: FSRN outperforms several well-known two-stage meta-detectors (like Meta-RCNN and FSOD-RPN) while being significantly more efficient.
  • Efficiency: FSRN is roughly 2x faster (0.49s vs 0.92s per image) and requires ~44% fewer FLOPS than the two-stage FSOD-RPN.

Limitations and Future Work

  • Training Cost: The MWST strategy, while effective, increases computational overhead during the training phase because the model must process more support images per episode.
  • Hyperparameter Sensitivity: The authors note that meta-learning training remains sensitive to hyperparameter choices, which can affect stability.
  • Future Directions: The authors suggest that their contributions (like MSF and MWST) could potentially be adapted to improve the region proposal stages of two-stage detectors as well.

Summary updated

Abstract

Recent object detection models require large amounts of annotated data for training a new classes of objects. Few-shot object detection (FSOD) aims to address this problem by learning novel classes given only a few samples. While competitive results have been achieved using two-stage FSOD detectors, typically one-stage FSODs underperform compared to them. We make the observation that the large gap in performance between two-stage and one-stage FSODs are mainly due to their weak discriminability, which is explained by a small post-fusion receptive field and a small number of foreground samples in the loss function. To address these limitations, we propose the Few-shot RetinaNet (FSRN) that consists of: a multi-way support training strategy to augment the number of foreground samples for dense meta-detectors, an early multi-level feature fusion providing a wide receptive field that covers the whole anchor area and two augmentation techniques on query and source images to enhance transferability. Extensive experiments show that the proposed approach addresses the limitations and boosts both discriminability and transferability. FSRN is almost two times faster than two-stage FSODs while remaining competitive in accuracy, and it outperforms the state-of-the-art of one-stage meta-detectors and also some two-stage FSODs on the MS-COCO and PASCAL VOC benchmarks.
BibTeX
@inproceedings{guirguis2023towards,
  author = {Karim Guirguis and Mohamed Abdelsamad and George Eskandar and Ahmed Hendawy and Matthias Kayser and Bin Yang and Juergen Beyerer},
  title = {{Towards Discriminative and Transferable One-Stage Few-Shot Object Detectors}},
  booktitle = {IEEE/CVF Winter Conference on Applications of Computer Vision},
  year = {2023},
  url = {https://openreview.net/forum?id=J1wd0osBib},
}
Figure