Bayesian Meta-Learning for the Few-Shot Setting via Deep Kernels

Massimiliano Patacchiola, Jack Turner, Elliot J. Crowley, Michael O’Boyle, Amos Storkey · DOI

Abstract

Recently, different machine learning methods have been introduced to tackle the challenging few-shot learning scenario—learning from a small labeled dataset related to a specific task. Common approaches take the form of meta-learning: learning to learn on a new problem given the old. Recognizing that meta-learning implements learning in a multi-level model, we present a Bayesian treatment for the meta-learning inner loop through the use of deep kernels. This allows us to learn a kernel that transfers to new tasks, a method we call Deep Kernel Transfer (DKT). DKT is straightforward to implement as a single optimizer, provides uncertainty quantification, and does not require estimation of task-specific parameters. We empirically demonstrate that DKT outperforms several state-of-the-art algorithms in few-shot classification and is the state of the art for cross-domain adaptation and regression.

Introduction: The Few-Shot Challenge

Standard deep learning models are notoriously data-hungry, often requiring thousands of examples to master a single concept. In contrast, humans exhibit "few-shot learning," the ability to learn from just one or a few examples. Meta-learning, or "learning to learn," aims to bridge this gap by using previous experience to accelerate learning on new tasks.

Popular meta-learning frameworks like Model-Agnostic Meta-Learning (MAML) utilize a bi-level optimization strategy: an "inner loop" adapts to a specific task, while an "outer loop" optimizes the general initialization. However, these methods can be computationally expensive, unstable, and often lack principled uncertainty quantification. This paper proposes that these complex optimization loops can be replaced by a simpler, more robust Bayesian hierarchical model.

Methods: Deep Kernel Transfer (DKT)

The authors introduce Deep Kernel Transfer (DKT), which combines the representational power of deep neural networks with the principled uncertainty of Gaussian Processes (GPs).

  1. Deep Kernels: A neural network ($F_\phi$) acts as a feature extractor. Its output is passed into a kernel function ($k$), allowing the model to learn complex, non-linear covariance structures directly from data.
  2. The Bayesian Shortcut: Instead of gradient-based adaptation in an inner loop, DKT leverages the GP marginal likelihood. For regression tasks, the "learning" for a specific task occurs analytically through Bayesian inference, providing a closed-form solution.
  3. Classification via Label Regression: To maintain computational efficiency in classification, the authors treat class labels as continuous targets (label regression) and pass predictions through a sigmoid function. This avoids the need for approximate inference methods like MCMC.
  4. Training: The model is trained by maximizing the Log Marginal Likelihood (ML-II) across various tasks, effectively learning a transferable prior.

Key Insights: Uncertainty and Kernel Selection

A significant advantage of DKT is its built-in uncertainty quantification. In few-shot settings, where data is scarce, knowing when a model is uncertain is critical. Furthermore, DKT allows for the incorporation of domain knowledge through the choice of kernel.

Qualitative comparison of regression performance and uncertainty estimation. (a) DKT with a Spectral kernel generalizes far better on periodic functions than RBF or MAML. (b) DKT provides meaningful uncertainty (shaded area) when inputs are corrupted (red box), unlike standard feature transfer.

As shown in Figure 2, using a Spectral Mixture kernel enables the model to generalize significantly better outside the training range for periodic functions compared to standard RBF kernels. Additionally, when input data is corrupted (e.g., a blacked-out image in a head-pose trajectory), DKT correctly increases its predictive variance, whereas non-Bayesian methods may produce confidently incorrect results.

Experimental Results

The authors evaluated DKT across regression (periodic functions, head pose), classification (CUB-200, mini-ImageNet), and cross-domain tasks.

Quantitative comparison of regression methods on periodic functions and head pose trajectories. DKT with Spectral kernels achieves state-of-the-art performance.

Regression Performance

In periodic function estimation, DKT with a Spectral kernel achieved an MSE of 0.08, vastly outperforming MAML (2.76) and other Bayesian competitors like ALPaCA (0.14). Similar gains were observed in head pose trajectory estimation.

Classification and Cross-Domain Adaptation

DKT proved highly competitive in few-shot classification. On the CUB dataset (1-shot), DKT reached 63.37% accuracy, surpassing ProtoNets (52.52%) and MatchingNets (60.19%). It particularly excelled in cross-domain scenarios; when transferring from mini-ImageNet to CUB, DKT achieved 40.22% accuracy, outperforming the previous state-of-the-art Baseline++ (39.19%).

Conclusion and Future Work

DKT demonstrates that complex bi-level optimization is not strictly necessary for effective meta-learning. By marginalizing task-specific parameters, the model simplifies to a single optimizer problem that is more stable and provides reliable uncertainty estimates.

While powerful, the label regression heuristic for classification is theoretically less rigorous than standard GP classification. Additionally, the $O(N^3)$ scaling of GPs may limit the method if the number of support points grows significantly. Future work could explore DKT in continual learning settings, leveraging the GP's ability to preserve and update prior knowledge over time.

Summary updated

BibTeX
@misc{patacchiola2019bayesian,
  author = {Massimiliano Patacchiola and Jack Turner and Elliot J. Crowley and Michael O’Boyle and Amos Storkey},
  title = {{Bayesian Meta-Learning for the Few-Shot Setting via Deep Kernels}},
  year = {2019},
  eprint = {1910.05199},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.05199},
}
Figure