Source-linked AI summary

Boosting Few-Shot Learning With Adaptive Margin Loss

Aoxue Li, Weiran Huang, Xu Lan, Jiashi Feng, Zhenguo Li, Liwei Wang

arXiv:2005.13826v1cs.CVcs.LGstat.ML

TL;DR

Few-shot learning requires models to generalize from very few labeled examples, especially for novel classes. The paper introduces class-relevant and task-relevant adaptive margin losses based on semantic similarities and task context, then extends them to generalized FSL. Experiments report improved performance under both standard and generalized FSL settings.

  • Problem

    Few-shot learning must generalize to novel classes from only a few labeled examples, while conventional fixed-margin losses are not tailored to this setting.

  • Method

    The method generates adaptive margins from pairwise class semantics and sampled-task semantic context, integrating them into classification loss for metric-based meta-learning.

  • Results

    Experiments show improved performance under both standard FSL and generalized FSL, including best results across all reported generalized-FSL evaluation metrics.

  • Takeaways & Limitations

    Semantic relationships can guide margin selection to learn more discriminative embeddings for few-shot recognition across standard and generalized settings.

  • Takeaways & Limitations

    Fixed margins may cause mistakes for similar test classes, and the task-margin generator assumes input-similarity order has little performance impact.

Abstract

from arXiv · show

Few-shot learning (FSL) has attracted increasing attention in recent years but remains challenging, due to the intrinsic difficulty in learning to generalize from a few examples. This paper proposes an adaptive margin principle to improve the generalization ability of metric-based meta-learning approaches for few-shot learning problems. Specifically, we first develop a class-relevant additive margin loss, where semantic similarity between each pair of classes is considered to separate samples in the feature embedding space from similar classes. Further, we incorporate the semantic context among all classes in a sampled training task and develop a task-relevant additive margin loss to better distinguish samples from different classes. Our adaptive margin method can be easily extended to a more realistic generalized FSL setting. Extensive experiments demonstrate that the proposed method can boost the performance of current metric-based meta-learning approaches, under both the standard FSL and generalized FSL settings.

1. Introduction

Few-shot learning addresses recognition with scarce labeled examples, but generalization remains difficult. The paper proposes adaptive margin losses that use class semantics and task context to improve metric-based meta-learning in standard and generalized FSL.

  • Motivation: Few-shot learning seeks classifiers for novel classes using generic knowledge learned from base classes with sufficient labeled data.The setting is motivated by the difficulty of collecting many labeled samples for rare classes.
  • Metric-Based Meta-Learning: Metric-based meta-learning learns an embedding space where same-class samples cluster and different-class samples separate, enabling recognition through distance metrics.Its success depends on learning a discriminative embedding space.
  • Adaptive Margin Principle: Adaptive margins are generated from semantic similarities, with larger margins for similar classes, and integrated into classification loss to improve separability.The design targets samples from different, especially semantically similar, classes.
  • Adaptive Margin Losses: The method combines class-relevant and task-relevant margin generators, with the latter modeling semantic context among all classes in a sampled task.These losses are intended to learn more discriminative embeddings and stronger generalization to novel samples.
  • Generalized FSL: The approach extends to generalized FSL, where test labels include both base and novel classes, and reports state-of-the-art performance in both FSL settings.The paper presents this extension as a more realistic and challenging evaluation setting.

2. Related Work

Prior few-shot methods use meta-learning to transfer knowledge across episodic tasks, while conventional margin losses are not tailored to limited novel-class samples. This paper addresses that gap with semantic, task-aware adaptive margins.

  • Meta-Learning: Meta-learning trains on sampled classification tasks during meta-training and applies the learned model to novel classes during meta-testing.Metric-based approaches represent classes in an embedding space and classify using those representations.
  • Meta-Learning: Metric-based meta-learning is one prominent family of FSL methods, alongside gradient-based approaches that adapt parameters to new episodic tasks.The paper focuses on improving the metric-based family.
  • Margin Losses: Existing visual-recognition margin losses improve feature discrimination but are not designed for FSL with limited novel-class samples.The paper therefore introduces adaptive margins that use semantic context from sampled training tasks.
  • Adaptive Margin Losses: The proposed adaptive margin principle aims to improve cross-task generalization and recognition of novel classes by tailoring margins to semantic relationships.This extends margin-based feature separation to the few-shot setting.

3. Methodology

The method augments metric-based meta-learning with adaptive margins derived from class semantics, first pairwise and then task-contextual. It trains with these margins but uses ordinary softmax during testing, and extends to generalized FSL.

  • Metric-Based Meta-Learning: Metric-based meta-learning episodically embeds query and support samples, constructs class representations, measures query-to-class similarity, and back-propagates query classification loss.The embedding and metric modules are trained across sampled base-class tasks, then applied to novel-class episodes.
  • Naive Additive Margin Loss: Naive additive margin loss increases inter-class separation but applies one fixed margin to every class pair.Its equal-separation assumption can cause mistakes for similar classes when novel-class labels are scarce.
  • Class-Relevant Additive Margin Loss: Class-relevant additive margin loss uses word-embedding semantic similarity between each class pair to assign larger margins to similar classes.A class-relevant margin generator maps semantic information into pairwise penalties integrated with the classification loss.
  • Task-Relevant Additive Margin Loss: Task-relevant additive margin loss compares each class with all other classes in the sampled task to generate context-dependent pairwise margins.The task-relevant generator feeds semantic similarities into a fully connected network, producing more suitable margins for each class pair.
  • Meta-Testing: During meta-testing, the learned embedding and metric modules predict novel labels with ordinary softmax, without requiring novel-class semantic vectors.This allows the model to remain flexible for arbitrary novel classes.
  • Generalized Few-Shot Learning: The adaptive margin approach extends to generalized FSL by predicting among base and novel classes jointly, while reusing modules trained on base-class samples.The generalized setting includes test data from both base and novel classes and is described as more challenging and realistic than standard FSL.

4. Experiments and Discussions

The experiments evaluate the adaptive margin approach under standard and generalized few-shot learning settings, including ablations and comparisons with other margin losses.

  • Experiments cover standard FSL, generalized FSL, ablation studies, and comparisons with other margin losses.The generalized setting extends the test label space to both base and novel classes.
  • Table 1 reports averaged accuracy and 95% confidence intervals over 600 miniImageNet test episodes.The table distinguishes metric-based and gradient-based meta-learning approaches and identifies common feature-embedding modules.

4.1. Standard Few-Shot Learning

Under standard FSL, the method is evaluated on miniImageNet using top-1 accuracy across 600 test episodes and metric-based baselines. It significantly improves the baselines and outperforms the state-of-the-art model in both 5-way settings.

  • Datasets and Settings: miniImageNet contains 100 classes split into 64 training, 16 validation, and 20 testing classes, with 600 images per class.Evaluation uses randomly selected novel-class episodes and top-1 classification accuracy.
  • Datasets and Settings: Evaluation uses top-1 classification accuracy on 600 randomly selected test episodes with Prototypical Networks and AM3 as backbone approaches.Support and query images in test episodes are sampled from novel classes.
  • Experimental Results: The task-relevant additive margin loss significantly improves Prototypical Network and AM3 baselines on miniImageNet.The reported improvement is attributed to boosting metric-based meta-learning performance through the proposed loss.
  • Experimental Results: The approach outperforms the state-of-the-art FSL model in both 5-way 1-shot and 5-way 5-shot settings.The paper links this result to the discriminative feature embedding learned with the task-relevant additive margin loss.

4.2. Generalized Few-Shot Learning

The generalized FSL experiments evaluate the method on ImageNet2012, where test labels include both base and novel classes. The approach achieves the best results across metrics and consistently improves on Dynamic FSL across all evaluated shot settings.

  • Dataset and Settings: Generalized FSL extends the test label space to both base and novel classes and is evaluated on ImageNet2012.The benchmark contains 389 base and 611 novel classes, with separate cross-validation and final-evaluation splits.
  • Implementation Details: The implementation trains ResNet10 embeddings with task-relevant additive margin loss before training Dynamic FSL’s weight generator.The weight generator receives pre-computed features, and its original classification loss is replaced with the task-relevant additive margin loss.
  • Implementation Details: Evaluation reports mean top-5 accuracy on novel classes and all classes across five repeated runs.Each run samples a different set of training images for the novel classes.
  • Results: The approach achieves the best results on all generalized FSL evaluation metrics.The reported results are presented for the ImageNet2012 benchmark.
  • Results: The method consistently improves over Dynamic FSL in the 1-shot, 2-shot, 5-shot, 10-shot, and 20-shot settings.The paper presents this pattern as validation of the task-relevant additive margin loss under generalized FSL.

4.3. Further Evaluation

The evaluation shows that adaptive, semantically informed margins improve metric-based few-shot learning, with task-level semantic context outperforming simpler margin designs and competing margin losses.

  • Ablation Study on Key Components: Adaptive margin training significantly improves metric-based meta-learning over the original classification loss on miniImageNet standard FSL.The ablation attributes the improvement to the proposed adaptive margin loss rather than classification-loss training alone.
  • Ablation Study on Key Components: Fixed naive additive margins provide only slight improvement, indicating limited effectiveness for few-shot learning.The comparison isolates the limitation of simply adding a fixed margin to the classification loss.
  • Ablation Study on Key Components: Class-relevant margins improve embedding learning by adapting each class separation penalty to semantic similarity.The margin generator produces a separate margin for each class pair, pulling classes apart according to their semantic relationship.
  • Ablation Study on Key Components: Task-relevant additive margins outperform class-relevant margins by incorporating semantic context among classes within each meta-training task.The task-level generator compares each class with the other classes sampled in the task.
  • Comparison with Other Margin Losses: The proposed method is more effective than additive angular and additive cosine margin losses on miniImageNet standard FSL.Unlike those competing fixed-margin losses, the proposed method uses semantic similarity among classes in the meta-training task.

5. Conclusion

The paper proposes adaptive margin losses to enhance the discriminative power of embedding spaces for few-shot image recognition. It combines class-level semantic similarity with task-level semantic context and extends the approach to generalized FSL.

  • 5. Conclusion: The adaptive margin principle is designed to enhance the discriminative power of embedding spaces for few-shot image recognition.The conclusion presents this as the paper’s central proposal.
  • 5. Conclusion: The class-relevant additive margin loss combines standard classification loss with a margin generator based on semantic similarity between classes.This component targets pairwise class separation in the embedding space.
  • 5. Conclusion: The task-relevant additive margin loss uses semantic context among classes in a meta-training task to learn a more discriminative embedding space.The conclusion identifies task-level context as the further refinement of the class-relevant loss.
  • 5. Conclusion: The proposed model is extended to generalized FSL, and experiments demonstrate effectiveness under both standard and generalized FSL settings.The conclusion reports results across both settings without specifying numerical values.
Loading 2005.13826v1…