Large Margin Few-Shot Learning

Yong Wang, Xiao-Ming Wu, Qimai Li, Jiatao Gu, Wangmeng Xiang, Lei Zhang, Victor O. K. LiarXiv 2018

TL;DR

This paper introduces a "large margin" principle to enhance the generalization capabilities of metric-based few-shot learning methods. By augmenting existing classification losses with a large margin distance loss, they create a more discriminative feature space, leading to significant performance improvements on benchmark datasets with minimal computational overhead.

What Problem Does This Paper Address?

Few-shot learning (FSL) is a challenging problem where models must learn to generalize from very few labeled examples. Traditional supervised learning models often overfit in such scenarios. While meta-learning has emerged as a promising direction, particularly metric-based approaches, a key challenge remains: learning a discriminative metric space that allows for effective generalization to unseen classes. Existing metric-based methods, while effective, struggle to learn robust representations due to the inherent data scarcity in few-shot tasks, leading to potential overfitting and suboptimal performance. This paper aims to address this by enforcing a larger separation between classes in the learned feature space.

Methods

The core contribution of this paper is the proposal of a large margin principle for few-shot learning. This principle is realized through a unified framework that augments the standard classification loss function with a large margin distance loss function. Specifically, they propose using the triplet loss as the large margin component. The triplet loss encourages samples from the same class to be closer together while pushing samples from different classes further apart in the embedding space, with an explicit margin to enforce separation.

The framework is designed to be general and can be applied to various metric-based FSL methods. The authors demonstrate its effectiveness by integrating it with two state-of-the-art methods:

  • Graph Neural Networks (GNNs): GNNs learn class relationships by constructing graphs from samples. The large margin principle is applied to the embeddings generated by the GNN.
  • Prototypical Networks (PNs): PNs classify samples based on their distance to class prototypes (average embeddings of support samples). The large margin principle is applied to the embeddings before prototype computation.

The paper also explores alternative loss functions for enforcing the large margin constraint, including normalized triplet loss, normalized contrastive loss, normface loss, cosface loss, and arcface loss, and compares their performance.

Datasets

The paper evaluates its proposed method on two standard benchmark datasets for few-shot learning:

  • Omniglot: A dataset of handwritten characters from various alphabets.
  • Mini-Imagenet: A subset of ImageNet containing images of everyday objects.

The paper also mentions experiments on semi-supervised few-shot learning, utilizing unlabeled samples in addition to labeled ones.

Key Insights and Ideas

  • The "Large Margin" Principle is Key: The fundamental insight is that enforcing a larger separation between classes in the embedding space, beyond just making them distinct, significantly improves generalization in few-shot learning. This directly combats overfitting by creating more robust decision boundaries.
  • Unified Framework for Broad Applicability: The proposed framework is designed to be modular and can be easily integrated with existing metric-based FSL methods, making it a versatile tool for improving performance.
  • Triplet Loss as a Powerful Margin Enforcer: The triplet loss, when applied correctly, effectively pulls embeddings of the same class together and pushes embeddings of different classes apart, creating the desired large margin.
  • Balanced Decision Boundaries: The large margin principle leads to more balanced decision boundaries, which is crucial for handling the inherent class imbalance and small sample sizes in FSL.
  • Computational Efficiency: The proposed method adds minimal computational overhead, making it practical for real-world applications.

Key Results

  • Significant Performance Gains: The large margin approach consistently improved the performance of both GNN and Prototypical Networks on both Omniglot and Mini-Imagenet datasets across various few-shot settings (e.g., 5-way 1-shot, 5-way 5-shot).
  • On Mini-Imagenet, L-GNN improved GNN by up to 2.3% in absolute accuracy for 10-way classification tasks.
  • For PN with cosine distance, L-PN showed a substantial improvement, making it competitive with Euclidean PN.
  • Robustness: The method demonstrated robustness to the choice of hyperparameters (balancing parameter $\lambda$ and margin $m$).
  • Minimal Computational Overhead: The additional computational cost for training with the large margin loss was found to be very small (e.g., 3.9% for L-GNN on Mini-Imagenet).
  • Comparison of Loss Functions: While various large margin losses were explored, the unnormalized triplet loss was found to be more general and robust compared to others like normalized triplet loss, normalized contrastive loss, normface loss, cosface loss, and arcface loss, especially for few-shot learning.

Limitations and Future Work

  • Limitations:
    • The paper notes that the effectiveness of the triplet loss relies on the assumption that embedded points are linearly separable in the metric space. If points lie on a nonlinear manifold, Euclidean distance might not accurately reflect similarity.
  • Some alternative large margin loss functions (normface, cosface, arcface) were found to be not directly applicable to non-parametric classifiers like those used in Prototypical Networks.
  • The arcface loss was found to be very sensitive to its margin parameter and often failed to converge.
  • Future Work:
    • The authors suggest developing theoretical guarantees for large margin few-shot learning.
  • Applying the proposed method to solve real-world problems is also mentioned as a future direction.

Summary updated

BibTeX
@misc{wang2018large,
  author = {Yong Wang and Xiao-Ming Wu and Qimai Li and Jiatao Gu and Wangmeng Xiang and Lei Zhang and Victor O. K. Li},
  title = {{Large Margin Few-Shot Learning}},
  year = {2018},
  eprint = {1807.02872},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1807.02872},
}
Figure