MetaKernel: Learning Variational Random Features With Limited Labels

Yingjun Du, Haoliang Sun, Xiantong Zhen, Jun Xu, Yilong Yin, Ling Shao, Cees G. M. Snoek

Introduction

Deep learning models typically require vast amounts of labeled data to achieve high performance. In contrast, humans can learn new concepts from just a few examples. This discrepancy defines the few-shot learning (FSL) challenge. Meta-learning addresses this by extracting prior knowledge from various tasks to enable rapid adaptation to new, unseen tasks. However, balancing model capacity with the risk of overfitting in low-data regimes remains a significant hurdle.

MetaKernel proposes a novel solution by combining the efficiency of classical kernel methods with the flexibility of deep meta-learning. By treating the kernel as a learnable, task-specific component, MetaKernel adapts its internal representations to the specific geometry of each new task.

Methodology

The MetaKernel framework leverages Kernel Ridge Regression (KRR) as its base learner due to its closed-form solution and robustness in low-data settings. To make the kernel adaptive, the authors employ Variational Random Fourier Features (RFFs). Instead of using fixed random bases, these bases are treated as latent variables within a variational inference framework.

MetaKernel architecture overview showing the integration of LSTM context and task-specific kernel adaptation.

The architecture incorporates a Long Short-Term Memory (LSTM) network to accumulate "meta-knowledge" across tasks. This context informs the selection of effective kernel bases for new tasks. To represent complex data distributions beyond simple Gaussians, MetaKernel utilizes Conditional Normalizing Flows (CNFs). These flows transform simple distributions into expressive posterior distributions, allowing the model to generate discriminative kernels tailored to the specific task at hand.

Key Insights: The Power of Adaptive Kernels

A central finding of this work is that the "shape" of the kernel's spectral distribution is critical for performance. Traditional kernels like RBF are "universal" and do not change, which can be limiting. MetaKernel's ability to "warp" its spectral distribution allows it to capture nuances that fixed kernels miss.

Evolution of the learned spectral distributions $\omega$ across different tasks, demonstrating the model's ability to warp kernels.

Ablation studies highlight that the inclusion of Normalizing Flows provides a significant performance boost, confirming that expressive posterior distributions are vital for complex image tasks. Furthermore, the LSTM memory allows the model to leverage "wisdom" from previous tasks, improving the prior for current kernel selection.

Experimental Results

MetaKernel was evaluated across a diverse set of benchmarks, including Omniglot, CIFAR-FS, and the large-scale Meta-Dataset.

  • miniImageNet: On the 5-way, 1-shot task, MetaKernel achieved 66.9% accuracy using a ResNet-12 backbone, significantly outperforming established methods like MAML and ProtoNets.
  • Meta-Dataset: In this challenging benchmark involving 10 distinct datasets (e.g., Birds, Fungi, MS-COCO), MetaKernel outperformed "fo-Proto-MAML" on all sub-datasets and surpassed the previous state-of-the-art (RFS) on 7 out of 10.
  • Efficiency: Despite the use of normalizing flows, the model remains computationally efficient because the core KRR step is solved analytically.

Conclusion

MetaKernel demonstrates that kernels are a "sweet spot" for few-shot learning. By meta-learning the kernel through variational inference and normalizing flows, the model achieves state-of-the-art performance while maintaining the stability of classical methods. Future research will focus on enhancing cross-domain generalization, particularly for tasks where the gap between training and testing distributions is extreme.

Summary updated

BibTeX
@article{du2024metakernel,
  author = {Yingjun Du and Haoliang Sun and Xiantong Zhen and Jun Xu and Yilong Yin and Ling Shao and Cees G. M. Snoek},
  title = {{MetaKernel: Learning Variational Random Features With Limited Labels}},
  journal = {IEEE Trans. Pattern Anal. Mach. Intell.},
  year = {2024},
  doi = {10.1109/tpami.2022.3154930},
}
Figure