Semantic Enhanced Few-Shot Object Detection

Zheng Wang, Yingjie Gao, Qingjie Liu, Yunhong Wang

Introduction

Object detection has achieved remarkable success through deep learning, yet it remains constrained by a significant "data hunger." While humans can recognize a novel object after seeing a single instance, state-of-the-art models typically require thousands of annotated examples to achieve high accuracy. Few-Shot Object Detection (FSOD) aims to bridge this gap by enabling models to learn new (novel) classes from a handful of examples. However, FSOD models often struggle with "class confusion," where novel classes are misidentified as similar base classes (e.g., mistaking a cow for a horse due to shared silhouettes).

This paper proposes a novel framework that integrates semantic information—derived from natural language—to guide the visual detector. By aligning visual features with linguistic embeddings, the approach significantly reduces classification ambiguity and improves performance in data-scarce scenarios.

The Challenges of Few-Shot Learning

In the FSOD paradigm, a model is first trained on a set of "base classes" with abundant data and then fine-tuned on "novel classes" with limited samples (typically 1 to 30 shots). The authors identify two primary hurdles in this process:

  1. Biased Representations: With extremely limited data, a model may overfit to irrelevant features, such as the background or lighting conditions, rather than the object itself.
  2. Feature Overlap: Novel classes often share visual characteristics with base classes. Without a robust discriminative boundary, the model tends to map novel objects into the well-established feature spaces of base categories.

While meta-learning and simple fine-tuning are common strategies, they often fail to create distinct "territories" for new categories within the feature space.

Proposed Methodology

The proposed framework enhances a standard Faster R-CNN architecture with three key components designed to leverage semantic knowledge:

1. Semantic Similarity Classifier (SSC)

Instead of utilizing a standard linear classifier initialized from scratch, the SSC employs fixed semantic embeddings as anchors. These embeddings, generated by pre-trained models like CLIP, represent the linguistic essence of a class name. By projecting visual features into this semantic space, the model gains an "unbiased" center for each class, providing a stable target even when only one visual example is available.

2. Multimodal Feature Fusion (MFF)

The MFF module utilizes a cross-attention mechanism to facilitate interaction between visual features and text embeddings. This process enriches the visual representation with linguistic context, effectively teaching the model which visual parts of a proposal are most relevant to the class definition.

3. Semantic-aware Max-margin (SAM) Loss

To address the "cow vs. horse" confusion, the authors introduced the SAM loss. This function adaptively calculates a "buffer zone" (margin) between classes based on their semantic similarity. If two classes are linguistically close (e.g., "cat" and "dog"), the loss function forces the model to work harder to separate them in the visual feature space, ensuring more distinct class boundaries.

Experimental Results

The framework was evaluated on two primary benchmarks: Pascal VOC and MS COCO. Integrated into the state-of-the-art DeFRCN baseline, the semantic enhancement yielded significant improvements:

  • Pascal VOC: In the 1-shot scenario, the method improved mean Average Precision (mAP) by up to 7.2% over previous state-of-the-art methods.
  • MS COCO: The model demonstrated robust scalability, outperforming the baseline by 5.3% in 10-shot tasks and 1.8% in 30-shot tasks.
  • Qualitative Analysis: Confusion matrices indicated a substantial reduction in misclassifications between novel classes and visually similar base classes, confirming the effectiveness of the SAM loss and semantic anchoring.

Discussion and Future Work

The core insight of this research is that language acts as a stabilizer. While visual data may be scarce or noisy, the semantic meaning of a word remains constant, providing a reliable prior for the model.

However, the authors noted a limitation: as the number of training shots increases, the benefit of fixed semantic information occasionally plateaus or slightly dips. This suggests that when visual data becomes abundant, the fixed linguistic priors may become overly restrictive. Future work may explore dynamic semantic weights, allowing the model to transition from a language-heavy reliance in low-shot scenarios to a vision-heavy reliance as more data becomes available. Additionally, moving beyond simple class names to more descriptive prompts could further refine the model's discriminative capabilities.

Summary updated

Abstract

Few-shot object detection (FSOD), which aims to detect novel objects with limited annotated instances, has made significant progress in recent years. However, existing methods still suffer from biased representations, especially for novel classes in extremely low-shot scenarios. During fine-tuning, a novel class may exploit knowledge from similar base classes to construct its own feature distribution, leading to classification confusion and performance degradation. To address these challenges, we propose a fine-tuning based FSOD framework that utilizes semantic embeddings for better detection. In our proposed method, we align the visual features with class name embeddings and replace the linear classifier with our semantic similarity classifier. Our method trains each region proposal to converge to the corresponding class embedding. Furthermore, we introduce a multimodal feature fusion to augment the vision-language communication, enabling a novel class to draw support explicitly from well-trained similar base classes. To prevent class confusion, we propose a semantic-aware max-margin loss, which adaptively applies a margin beyond similar classes. As a result, our method allows each novel class to construct a compact feature space without being confused with similar base classes. Extensive experiments on Pascal VOC and MS COCO demonstrate the superiority of our method.
BibTeX
@inproceedings{wang2024semantic,
  author = {Zheng Wang and Yingjie Gao and Qingjie Liu and Yunhong Wang},
  title = {{Semantic Enhanced Few-Shot Object Detection}},
  booktitle = {ICIP},
  year = {2024},
  url = {https://openreview.net/forum?id=GTvkg596lo},
}
Figure