Few-Shot Learning as Domain Adaptation: Algorithm and Analysis

Zhiwu LuarXiv 2020 · arXiv

TL;DR

This paper introduces DAPNA, a novel approach that frames Few-Shot Learning (FSL) as a Domain Adaptation (DA) problem. By explicitly addressing the domain shift caused by different class distributions between seen and unseen classes, DAPNA achieves state-of-the-art performance on several FSL benchmarks, demonstrating the importance of integrating DA into FSL.

What Problem Does This Paper Address?

Humans are remarkably adept at learning new concepts from just a few examples. Few-Shot Learning (FSL) aims to replicate this ability in artificial intelligence, enabling models to recognize new classes with minimal training data by leveraging prior knowledge from previously seen classes. However, a significant challenge in FSL is that the distribution of unseen classes often differs from that of the seen classes. This "class-difference-caused distribution shift" is akin to a domain shift problem, where a model trained on one domain (seen classes) struggles to generalize to another (unseen classes), even if the underlying task remains the same. Existing FSL methods often overlook this crucial aspect, leading to suboptimal performance. This paper argues that FSL should be tackled jointly with Domain Adaptation (DA) to overcome this limitation.

Methods

The authors propose DAPNA (Domain Adaptation Prototypical Network with Attention), a unified framework that integrates FSL and DA.

  • Prototypical Network (ProtoNet) Baseline: DAPNA builds upon ProtoNet, a popular FSL method that represents each class by a "prototype" (the mean of its support samples) and classifies query samples based on their distance to these prototypes.
  • Attention Mechanism: To improve class representation, especially with limited samples, DAPNA incorporates a Set Transformer based attention module. This module learns to better combine support samples to form a more robust class prototype.
  • Meta-Domain Adaptation: The core innovation is the introduction of a meta-DA strategy. During meta-training, each episode is split into two sub-episodes with disjoint classes. These sub-episodes are treated as source and target domains for DA. The model is trained to align the feature distributions of these two sub-episodes in a shared embedding space.
  • Feature Transfer Network: To facilitate domain alignment, an encoder-decoder network is employed on top of the backbone. This network transforms features into a domain-confused space while preserving discriminative information.
  • Loss Functions: DAPNA uses a combination of losses:
  • FSL Loss (Lp): Standard cross-entropy loss for classification on both sub-episodes.
  • Domain Adaptation Loss (Lda): This includes a margin loss and a margin disparity discrepancy (MDD) loss to minimize the domain gap between the source and target sub-episodes.

Datasets

The paper evaluates DAPNA on several standard FSL benchmarks:

  • miniImageNet: A widely used dataset for FSL, derived from ImageNet.
  • tieredImageNet: A larger subset of ImageNet with a hierarchical class structure.
  • CUB (Caltech-UCSD Birds-200-2011): A fine-grained dataset for bird species recognition.
  • miniImageNet → CUB: A cross-domain FSL setting, where models are trained on miniImageNet and tested on CUB, explicitly testing generalization across different domains.

Key Insights and Ideas

  • FSL as a Special Case of Domain Shift: The paper compellingly argues that the class-difference-induced distribution shift in FSL is a specific form of domain shift, which has been largely overlooked.
  • Meta-DA for Enhanced Transferability: By treating FSL episodes as mini domain adaptation tasks during meta-training, DAPNA significantly improves the model's ability to transfer knowledge to unseen classes.
  • The Power of Two Sub-Episodes: Creating two disjoint class sets within a single meta-training episode is a clever way to simulate the source-target domain relationship needed for DA without requiring entirely separate datasets.
  • Theoretical Guarantees: The paper provides theoretical analysis, including learning bounds for both DA and FSL, and for the combined DAPNA model, offering a solid mathematical foundation for their approach.

Key Results

  • State-of-the-Art Performance: DAPNA achieves new state-of-the-art results on miniImageNet, tieredImageNet, and CUB datasets across both 5-way 1-shot and 5-way 5-shot settings. For instance, it reaches over 71% accuracy on miniImageNet in the 5-way 1-shot setting, a significant improvement.
  • Strong Cross-Domain Performance: DAPNA demonstrates superior performance on the challenging miniImageNet → CUB cross-domain FSL task, outperforming existing methods by substantial margins.
  • Faster Convergence: Ablation studies and visualizations show that DAPNA converges faster than models without the explicit DA component, indicating that the meta-DA strategy accelerates learning.
  • Component Contributions: Ablation studies confirm the effectiveness of each component: the attention mechanism improves ProtoNet, and the meta-DA module (specifically the MDD loss) provides substantial gains.

Limitations and Future Work

  • Hyperparameter Tuning: While the paper mentions optimal hyperparameter settings (α=1, β=1, γ=4), finding these optimal values might still require careful tuning for new datasets or tasks.
  • Computational Cost: The introduction of an encoder-decoder network and the dual sub-episode structure likely increases computational complexity compared to standard FSL methods.
  • Generalizability of Meta-DA: The paper suggests that the meta-DA strategy can be easily deployed in any existing episodic-training based FSL model, hinting at future work in applying this strategy more broadly.
  • Further Exploration of Training Strategies: The paper briefly touches upon the influence of different training "ways" (e.g., 10-way, 20-way, 30-way) on performance, suggesting that further research into optimal training configurations could be beneficial.

Summary updated

Abstract

To recognize the unseen classes with only few samples, few-shot learning (FSL) uses prior knowledge learned from the seen classes. A major challenge for FSL is that the distribution of the unseen classes is different from that of those seen, resulting in poor generalization even when a model is meta-trained on the seen classes. This class-difference-caused distribution shift can be considered as a special case of domain shift. In this paper, for the first time, we propose a domain adaptation prototypical network with attention (DAPNA) to explicitly tackle such a domain shift problem in a meta-learning framework. Specifically, armed with a set transformer based attention module, we construct each episode with two sub-episodes without class overlap on the seen classes to simulate the domain shift between the seen and unseen classes. To align the feature distributions of the two sub-episodes with limited training samples, a feature transfer network is employed together with a margin disparity discrepancy (MDD) loss. Importantly, theoretical analysis is provided to give the learning bound of our DAPNA. Extensive experiments show that our DAPNA outperforms the state-of-the-art FSL alternatives, often by significant margins.
BibTeX
@misc{lu2020few,
  author = {Zhiwu Lu},
  title = {{Few-Shot Learning as Domain Adaptation: Algorithm and Analysis}},
  year = {2020},
  eprint = {2002.02050},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.02050},
}
Figure