Towards Generalized and Incremental Few-Shot Object Detection

Yiting Li, Haiyue Zhu, Jun Ma, Chek Sing Teo, Cheng Xiang, Prahlad Vadakkepat, Tong Heng LeearXiv 2021

TL;DR

This paper introduces a novel framework for Class-Incremental Few-Shot Object Detection (CI-FSOD), enabling models to learn new object categories from just a few examples without forgetting previously learned ones. By decoupling base and novel class representations through a Double-Branch Framework and stabilizing the learning process with Stable Moment Matching, the authors achieve state-of-the-art performance on challenging benchmarks like MS-COCO and Pascal VOC.

What Problem Does This Paper Address?

Modern object detectors are data-hungry. While they perform exceptionally well when trained on thousands of images, they struggle with two major issues in real-world, dynamic environments:

  1. Data Scarcity: Learning a new category (e.g., a specific type of delivery robot) from only 5 or 10 images often leads to dramatic overfitting.
  2. Catastrophic Forgetting: When a model is updated to recognize new classes, it often "forgets" how to detect the original "base" classes it was initially trained on.

Existing Few-Shot Object Detection (FSOD) methods often rely on re-training with a balanced buffer of old and new data. However, in Class-Incremental settings, we often cannot store or replay old data due to privacy concerns or memory constraints. The challenge is to maintain stability (retaining old knowledge) while providing enough plasticity (adapting to new tasks).

Methods

The authors propose three core components to tackle these challenges:

1. Double-Branch Framework (DBF)

Instead of using a single shared classification head, the DBF splits the task into two parallel paths:

  • Static Learning Branch: This branch freezes the backbone and original classification weights to preserve the feature distributions of the base classes.
  • Dynamic Learning Branch: This branch unfreezes the RoI feature extractor to better adapt to the nuances of new, few-shot classes. The final prediction is a concatenation of scores from both branches, ensuring the model remains unbiased toward new classes.
Figure 1: Illustration of the proposed Double Branch Framework. 1) The static learning branch only updates its new-added weights on the box classifier in the current task, responsible for preserving the original base-class feature distributions. 2) The dynamic learning branch jointly updates its RoI feature extractor, box regressor, and the new-added box classifier weights, designed to model the new-coming classes better. Finally, corresponding parts of the prediction confidence vectors from two branches are sliced and concatenated for the overall prediction scores.

2. Stable Moment Matching (SMM)

Few-shot learning often leads to "sharp" local minima in the loss landscape, which are fragile and prone to forgetting. SMM addresses this by restricting parameter updates to stay within the "flat" region of the original base model. It uses an iterative linear interpolation between the current weights and a "knowledge base" model, effectively smoothing the optimization trajectory.

Figure 2: (a) In data-rare cases, the low-error surface around each local minima is sharp and narrow. Thus, the likelihood for these low-error surface overlapping becomes very small when the learning continues, dramatically increasing the difficulty of finding optimal solutions that perform well on different tasks. (b) Our intuition is that by restricting the magnitude of parameter displacement for each task, the obtained local minima can stay closer, allowing more ellipsoids to overlap. (c) Linear interpolation with the knowledge base model is performed in each iteration with an adaptive ratio in SMM.

3. Inter-Task Separation Loss

In incremental learning, the model never sees old and new classes together. This leads to feature drift, where new classes might overlap with old ones in the embedding space. The authors propose a margin-based loss that uses stored feature embeddings (not raw images) of old classes to push the decision boundaries of new classes further away, promoting better discrimination.

Figure 4: (a) Category confusion caused by feature drift. Samples of old tasks are well separated from new tasks initially. However, when a model is biased towards new-task classes during the fine-tuning, features of old classes are drifted and may be mixed up with those new classes. (b) Category confusion is caused by similar visual classes, such as different categories of dogs. (c) The proposed inter-task separation loss assigns more decision margins for the drifted old classes and promotes a more compact representation for current-task new classes.

Datasets

The researchers evaluated their method on two industry-standard benchmarks:

  • MS-COCO: Used for large-scale evaluation, splitting 80 categories into 60 base and 20 novel classes. They tested a challenging "per-class incremental" setting where novel classes are added one by one.
  • Pascal VOC: Used to test cross-domain generalization. The model was pre-trained on COCO base classes and then adapted to VOC categories.

Key Insights and Ideas

  • Fine-tuning deeper is a double-edged sword: The authors found that unfreezing the RoI feature extractor significantly helps novel class detection (improving AP from 9.9 to 12.3) but destroys base class performance. This motivated the Double-Branch architecture.
  • The Geometry of Forgetting: The paper argues that the "large-batch training dilemma" in few-shot scenarios leads to sharp minima. By using SMM to enforce "flatness," they prove that the parameter displacement becomes upper-bounded and independent of the number of iterations, leading to much higher stability.
  • Embeddings over Images: Storing representative feature vectors from the last layer is a privacy-secure and memory-efficient alternative to storing raw images for replay, yet it provides enough signal to maintain inter-class margins.

Key Results

The proposed method significantly outperformed existing baselines:

  • MS-COCO (10-shot): The full framework (DBF+SMM+Inter-Sep) achieved 8.5 Novel AP, a substantial jump over the standard TFA baseline (5.6 AP) and the previous state-of-the-art IMTFA (6.1 AP).
  • Base Class Retention: Unlike many methods that see base performance tank, DBF maintained a 28.1 Base AP, nearly matching the performance of models that don't learn new classes at all.
  • Cross-Domain: In the COCO-to-VOC transfer task, the method achieved 23.7 AP for 10-shot, more than doubling the performance of TFA (10.6 AP).

Limitations and Future Work

While the paper presents a robust solution for CI-FSOD, a few areas remain open for exploration:

  • Feature Storage: Although more efficient than storing images, the model still requires storing a set of feature embeddings for every old class. As the number of classes grows to the thousands, this could still present a scaling challenge.
  • Hyperparameter Sensitivity: The adaptive interpolation ratio ($\alpha$) and the margin ($m$) in the separation loss likely require careful tuning for different domains.
  • Future Work: The authors suggest that exploring semi-supervised pseudo-labeling (SSOM) could further improve results by leveraging unannotated objects in the background of new images.

Summary updated

BibTeX
@misc{li2021towards,
  author = {Yiting Li and Haiyue Zhu and Jun Ma and Chek Sing Teo and Cheng Xiang and Prahlad Vadakkepat and Tong Heng Lee},
  title = {{Towards Generalized and Incremental Few-Shot Object Detection}},
  year = {2021},
  eprint = {2109.11336},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2109.11336},
}
Figure