Improving Few-shot Learning with Weakly-supervised Object Localization

Inyong Koo, Minki Jeong, Changick KimarXiv 2021

Abstract

Few-shot learning often involves metric learning-based classifiers, which predict the image label by comparing the distance between the extracted feature vector and class representations. However, applying global pooling in the backend of the feature extractor may not produce an embedding that correctly focuses on the class object. In this work, we propose a novel framework that generates class representations by extracting features from class-relevant regions of the images. Given only a few exemplary images with image-level labels, our framework first localizes the class objects by spatially decomposing the similarity between the images and their class prototypes. Then, enhanced class representations are achieved from the localization results. We also propose a loss function to enhance distinctions of the refined features. Our method outperforms the baseline few-shot model in miniImageNet and tieredImageNet benchmarks.

Introduction: The GAP Bottleneck

Few-shot learning (FSL) aims to classify new objects given only a handful of examples (the "support set"). Most state-of-the-art FSL methods rely on metric learning: they map images into a feature space and classify a "query" image based on its distance to the average feature vector (prototype) of each class.

Standard few-shot learning models often struggle because Global Average Pooling (GAP) incorporates class-irrelevant background noise into image embeddings. In a standard CNN pipeline, the final layer averages all spatial information into a single vector. If a support image labeled "dog" also contains a person or a complex background, the resulting prototype is "impure"—it incorporates features of the person and the background rather than focusing solely on the dog. This noise leads to biased class representations and poor generalization when the model encounters a query image in a different setting.

Proposed Methodology

The authors introduce a framework that treats object localization as an intermediate step to "clean" class prototypes. The process involves five key stages:

  1. Initial Prototyping: A standard Prototypical Network (ProtoNet) generates initial class prototypes by averaging the feature maps of the support images.
  2. Similarity Mapping: Instead of just comparing vectors, the system computes a spatial similarity map. The class prototype is projected back onto the support image's feature map to identify regions correlating most strongly with the class average.
  3. Weakly-Supervised Localization: By upsampling this similarity map and applying a threshold ($\tau$), the largest connected component is identified as the Region of Interest (RoI).
  4. Feature Refinement: Using RoIAlign, features are extracted specifically from the localized bounding box. These "refined" features are averaged to create a new, cleaner class representation ($r_c$).
  5. Dual Loss Function: The model is trained using a combined loss: a base cross-entropy loss ($L_{base}$) on the whole image and a novel RoI loss ($L_{roi}$) that forces the model to make the localized, refined features more discriminative.
Overview of the proposed framework for feature refinement via weakly-supervised object localization.

Experimental Evaluation

The framework was evaluated on two standard few-shot learning benchmarks: miniImageNet (100 classes) and tieredImageNet (608 classes). The latter is particularly challenging as the split between training and testing is done at a higher categorical level to prevent memorization of similar sub-classes.

Key Results

The proposed method consistently outperformed baseline ProtoNet and other metric-learning competitors:

  • miniImageNet: In the 5-way 1-shot task, the model achieved 64.86% accuracy (nearly 2% improvement over baseline). In the 5-shot task, it reached 81.25%.
  • tieredImageNet: The model hit 85.07% in the 5-way 5-shot scenario, outperforming the Cross Attention Network (CAN) and Deep Subspace Networks (DSN).
Qualitative results showing the model's ability to localize class-relevant objects across diverse categories.

Discussion and Insights

  • Prototypes as Search Queries: A core innovation is using the class prototype itself as a "query" to find the object in support images. This creates a self-correcting loop where the average of the images helps isolate the "true" object in each individual image.
  • Localization without Labels: The system achieves object localization (WSOL) as a byproduct of classification. It requires no human-drawn bounding boxes to learn where the target object resides.
  • Limitations: In 1-shot scenarios, ambiguity remains a challenge; if an image contains two unknown objects, the model lacks context to distinguish the target. Additionally, similarity mapping and RoIAlign introduce computational overhead compared to simple GAP-based models.

Conclusion

By addressing the noise introduced by Global Average Pooling, this framework demonstrates that object localization is a powerful tool for improving few-shot classification. By refining class representations to focus on relevant regions, the model achieves state-of-the-art performance without the need for expensive bounding box annotations.

Summary updated

BibTeX
@misc{koo2021improving,
  author = {Inyong Koo and Minki Jeong and Changick Kim},
  title = {{Improving Few-shot Learning with Weakly-supervised Object Localization}},
  year = {2021},
  eprint = {2105.11715},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2105.11715},
}
Figure