How to Train Your MAML to Excel in Few-Shot Classification

Han-Jia Ye, Wei-Lun Chao
6/30/2021
cs.LGcs.AIcs.CV

Official code: Han-Jia/UNICORN-MAML (45 stars, Python, last commit 2024-06-29).

Abstract

Model-agnostic meta-learning (MAML) is arguably one of the most popular meta-learning algorithms nowadays. Nevertheless, its performance on few-shot classification is far behind many recent algorithms dedicated to the problem.

Show full abstract

In this paper, we point out several key facets of how to train MAML to excel in few-shot classification. First, we find that MAML needs a large number of gradient steps in its inner loop update, which contradicts its common usage in few-shot classification. Second, we find that MAML is sensitive to the class label assignments during meta-testing. Concretely, MAML meta-trains the initialization of an $N$-way classifier. These $N$ ways, during meta-testing, then have "$N!$" different permutations to be paired with a few-shot task of $N$ novel classes. We find that these permutations lead to a huge variance of accuracy, making MAML unstable in few-shot classification. Third, we investigate several approaches to make MAML permutation-invariant, among which meta-training a single vector to initialize all the $N$ weight vectors in the classification head performs the best. On benchmark datasets like MiniImageNet and TieredImageNet, our approach, which we name UNICORN-MAML, performs on a par with or even outperforms many recent few-shot classification algorithms, without sacrificing MAML's simplicity.

View on arXivView PDF

Code Implementations(1)

PyTorch implementation of "How to Train Your MAML to Excel in Few-Shot Classification"

458PythonJun 3, 20212 years ago
few-shot-learningiclr2022mamlmeta-learning

Similar Papers

Cite this paper

@article{ye2021train,
  title  = {How to Train Your MAML to Excel in Few-Shot Classification},
  author = {Han-Jia Ye and Wei-Lun Chao},
  year   = {2021},
  eprint = {2106.16245},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2106.16245}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2106.16245.svg)](https://codeofpaper.com/paper/2106.16245)

Discussion