Deep Kernel Transfer in Gaussian Processes for Few-shot Learning

Massimiliano Patacchiola, Jack Turner, Elliot J. Crowley, Amos J. Storkey

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 new problems 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

Few-shot learning—the ability to learn a new task from just a handful of examples—is a hallmark of human intelligence but remains a significant hurdle for deep learning. Most current solutions rely on "meta-learning," such as Model-Agnostic Meta-Learning (MAML), which uses a nested optimization strategy. However, these nested loops are computationally expensive, prone to instability, and often fail to provide reliable uncertainty estimates. This paper proposes skipping the complex inner-loop optimization by treating meta-learning as a hierarchical Bayesian inference problem using Gaussian Processes (GPs).

Methodology: Deep Kernel Transfer

The core of our approach is Deep Kernel Transfer (DKT). We utilize a Deep Kernel—a standard kernel function (like a Radial Basis Function or Spectral Mixture kernel) that operates on features extracted by a deep neural network $F_\phi$.

Instead of optimizing task-specific parameters, DKT leverages the analytical properties of GPs to marginalize out task-specific details. This results in a closed-form marginal likelihood that can be optimized directly. The model is trained in a single loop, updating both the neural network weights and the kernel hyperparameters simultaneously to maximize this marginal likelihood across various tasks. For classification, we adopt a "label regression" approach (Least Squares Classification) to maintain the efficiency and analytical tractability of the GP framework.

Experimental Evaluation

We evaluated DKT across regression, few-shot classification, and cross-domain adaptation tasks.

Qualitative Analysis and Uncertainty

A key advantage of the Bayesian framework is built-in uncertainty quantification. In experiments where input images were corrupted (e.g., using "Cutout" in head pose estimation), DKT's predictive variance increased significantly, signaling its lack of confidence. In contrast, standard feature transfer methods often remained overconfident.

Qualitative comparison of regression performance and uncertainty estimation.

As shown in the qualitative comparisons, DKT with a Spectral Mixture kernel captures periodic patterns far more effectively than MAML or standard RBF kernels. Furthermore, the uncertainty estimation plots illustrate how DKT correctly identifies high uncertainty (the shaded red region) when a face image is obscured, whereas feature transfer models produce precise but incorrect predictions.

Quantitative Results

DKT demonstrates dominance in regression tasks, particularly when domain-appropriate kernels are used. For periodic function estimation, DKT with a Spectral kernel achieved a Mean Squared Error (MSE) of 0.08, vastly outperforming MAML's 2.76.

Quantitative comparison of MSE for regression tasks.

In few-shot classification, DKT remains highly competitive. On the CUB-200 1-shot task, DKT reached 63.37% accuracy, surpassing ProtoNet (52.52%) and MatchingNet (60.19%). Furthermore, DKT excels in cross-domain adaptation; for the mini-ImageNet $\rightarrow$ CUB transfer task, DKT achieved 40.22% accuracy, significantly higher than MAML's 34.01%.

Discussion and Conclusion

DKT proves that complex meta-optimization routines can be replaced by a simpler Bayesian model without loss of accuracy. By learning a latent space where relationships become simpler, the GP can perform highly effective inference. While GPs scale cubically with the number of support points, this is rarely an issue in few-shot settings. Ultimately, DKT offers a robust, probabilistic, and easy-to-implement alternative for few-shot learning and domain transfer.

Summary updated

BibTeX
@misc{patacchiola2019deep,
  author = {Massimiliano Patacchiola and Jack Turner and Elliot J. Crowley and Amos J. Storkey},
  title = {{Deep Kernel Transfer in Gaussian Processes for Few-shot Learning}},
  year = {2019},
  eprint = {1910.05199},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1910.05199},
}
Figure