Meta-Learning with Context-Agnostic Initialisations

Toby Perrett, Alessandro Masullo, Tilo Burghardt, Majid Mirmehdi, Dima DamenarXiv 2020

TL;DR

Standard meta-learning often overfits to "context"—auxiliary properties like a specific font or a user's identity—that are irrelevant to the actual task. This paper introduces a context-adversarial framework that forces models to ignore these distractors, resulting in network initializations that generalize significantly better to entirely novel contexts.

What Problem Does This Paper Address?

Meta-learning, or "learning to learn," aims to find a network initialization that can be quickly fine-tuned to new tasks with very little data. However, the authors identify a major pitfall: training data often contains "context"—distractor signals that are correlated with the task but not essential to it.

For example, in character recognition, the specific alphabet is context. If a meta-learner overfits to the alphabets seen during training, it may struggle when asked to recognize characters from a completely new, unseen alphabet. Current meta-learning algorithms (like MAML or Reptile) don't explicitly account for this, often leading to poor performance when there is a "context gap" between training and testing.

Fig. 1. Visualisation of how context (e.g. alphabets, shown as different colours) can contribute to train/target splits. In commonly-used split (a), a classifier could overfit on context with no ill effects. If there is novel context, as in (b), this will prove problematic. In this paper, we show how context-agnostic meta-learning can benefit performance on few-shot target tasks without shared context.

Methods

The authors propose Context-Agnostic Meta-Learning, a framework that can be integrated into existing adaptation-based meta-learning algorithms. The core idea is to introduce a context-adversarial objective during the meta-learning phase.

  1. Dual Objectives: During each training iteration, the model optimizes for two things: task specialization (learning to solve the specific few-shot task) and context-agnosticism (learning features that cannot be used to identify the context).
  2. Adversarial Training: They use a context-adversarial network that tries to predict the context label from the model's internal features. Through a Gradient Reversal Layer (GRL), the main network is encouraged to learn representations that actively fool this adversary.
  3. Weight Merging: The framework maintains two sets of weights during the inner loop: one updated for the task ($\hat{\phi}$) and one updated to be context-agnostic ($\bar{\phi}$). These are then merged back into the primary model weights ($\phi$) using a weighted update rule.
Fig. 2. A visualisation of the proposed context-agnostic meta-learning approach through a character classification example (context shown as character colours) us- ing an alphabet-based split (Fig. 1(b)). The method is detailed in Algorithm 1, where (a) to (e) corresponds to one outer loop iteration, which is repeated on random training tasks. (f) shows fine-tuning to target.

Datasets

The researchers evaluated their approach across four diverse case studies:

  • Omniglot: Few-shot character classification. The authors introduced a new "alphabet-based split" to ensure training and testing alphabets are disjoint.
  • Mini-ImageNet: General image classification, using manually assigned superclass labels (e.g., "dog", "bird") as context.
  • CUB (Caltech-UCSD Birds-200-2011): Fine-grained bird classification, using the bird's primary color as context.
  • SPHERE Calorie Dataset: A regression task for estimating energy expenditure from video, where the identity of the participant serves as the context.

Key Insights and Ideas

  • Context as a Distractor: The paper formalizes the idea that auxiliary metadata can act as a "shortcut" for models, preventing them from learning truly generalizable features.
  • Adversarial Invariance: By explicitly training against context, the model is forced to discard "nuisance" information, leading to a more robust initialization for fine-tuning.
  • The "Context Gap" Matters: The benefits of this approach are most significant when the training set has a limited variety of contexts, creating a larger discrepancy when moving to novel test-time contexts.
  • Algorithm Agnostic: The method is a "plug-in" that works with various popular meta-learners, including MAML, MAML++, and Reptile, showing consistent improvements across the board.

Key Results

  • Omniglot: Achieved an average improvement of 4.3% when classifying characters from unseen alphabets. The gain was even higher (up to 6.2%) when the number of training alphabets was very small.
  • Calorie Estimation: This regression task saw the most dramatic impact, with a 30% reduction in Mean Square Error (MSE) compared to standard meta-learning. This highlights the method's effectiveness in "individual-agnostic" personalization.
  • Mini-ImageNet & CUB: Showed steady improvements of 2.8% and 1.9% respectively when using context-based splits, while maintaining comparable performance on standard splits.

Limitations and Future Work

  • Metadata Dependency: The approach requires explicit context labels (like alphabet ID or user ID) during the training phase, which may not always be available.
  • Computational Cost: Incorporating the adversarial loop increases training time by approximately 20%.
  • Hyperparameter Sensitivity: The weighting factor $\lambda$ (which balances task vs. context objectives) requires careful tuning; if set too high, the model might prioritize being context-agnostic over actually learning the task.
  • Future Directions: The authors suggest exploring more complex or continuous contexts and applying the framework to other domains like reinforcement learning.

Summary updated

BibTeX
@misc{perrett2020meta,
  author = {Toby Perrett and Alessandro Masullo and Tilo Burghardt and Majid Mirmehdi and Dima Damen},
  title = {{Meta-Learning with Context-Agnostic Initialisations}},
  year = {2020},
  eprint = {2007.14658},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2007.14658},
}
Figure