Introduction
Object detection has seen significant advancements with deep learning, yet these models typically require vast amounts of labeled data to achieve high accuracy. In scenarios where only a few examples are available—known as Few-Shot Object Detection (FSOD)—performance often degrades significantly. The primary challenge lies in learning feature representations that are both general enough to recognize novel objects and specific enough to distinguish between similar classes.
Existing FSOD methods often lean towards one of two extremes. Some focus on learning general features, such as basic shapes or "objectness," which transfer well to unseen classes but lack discriminative power. Others emphasize specific features that capture fine-grained details, which can lead to overfitting on the limited novel data. This paper introduces T-GSEL (Transformer-based General and Specific Embedding Learning), a module designed to adaptively balance these two types of information.
The T-GSEL Framework
T-GSEL is a plug-and-play module that can be integrated into standard detection architectures like Faster R-CNN. Its core innovation is a three-stage progressive pipeline that explicitly learns and combines general and specific feature embeddings using a Transformer-based architecture.
Three-Stage Progressive Pipeline
The learning process is divided into three distinct stages, each guided by specific supervision:
- Stage 1 (General): This stage uses learnable tensors supervised by a binary detection loss (foreground vs. background). This forces the network to capture category-invariant characteristics common to all objects.
- Stage 2 (Intermediate): Serving as a bridge, this stage is supervised by both binary and class-aware losses. It helps smooth the transition from broad objectness to fine-grained details.
- Stage 3 (Specific): The final stage is supervised entirely by class-aware detection loss, focusing on the highly discriminative features necessary for precise classification.
In each stage, a lightweight 2-layer Transformer employs cross-attention. Here, the Region of Interest (RoI) features from the input image act as queries, while the learnable embedding tensors serve as keys and values. This mechanism allows the model to dynamically refine object features based on the learned embeddings.
Key Insights
A critical component of T-GSEL is the use of cross-stage connections. Similar to residual connections, these project learned embeddings from earlier stages into subsequent ones, ensuring that specific feature learning is grounded in general object knowledge.
Furthermore, the authors found that freezing the Stage 1 (general) embeddings during the few-shot fine-tuning phase is essential. This prevents the model from losing its broad generalization capabilities while it adapts to the specific nuances of a small novel dataset. Analysis of attention variance confirmed that Stage 1 embeddings react consistently across different objects, while Stage 3 embeddings are highly sensitive to class-specific details.
Experimental Results
The T-GSEL module was evaluated on standard FSOD benchmarks, including PASCAL VOC and MS COCO.
PASCAL VOC
On the PASCAL VOC dataset, T-GSEL demonstrated superior performance over existing baselines. When integrated into a single-branch detector, it achieved a Novel Average Precision (nAP50) of 47.2. A two-branch variant, T-GSEL'T, further pushed this performance to 52.7 nAP50, outperforming methods like FSCE and UP-FSOD.
MS COCO
On the more challenging MS COCO benchmark, T-GSEL'T achieved state-of-the-art results with a Novel AP of 18.0 for the 10-shot split and 22.3 for the 30-shot split.
Computational Efficiency
Despite the added complexity of the Transformer modules, T-GSEL is highly efficient. Because the Transformers are lightweight and operate only on region proposals, the module adds only about 1 GFLOP of computation to a standard ResNet-101 Faster R-CNN, which typically requires 287 GFLOPs.
Conclusion
T-GSEL addresses a fundamental bottleneck in few-shot object detection by explicitly modeling the hierarchy of general and specific features. By utilizing a progressive Transformer-based refinement process, it achieves state-of-the-art performance with minimal computational overhead. Future work may explore deeper integration with meta-learning optimization techniques to further enhance robustness in extremely low-shot scenarios.
Summary updated