Meta-Learning for Semi-Supervised Few-Shot Classification

Mengye Ren, Eleni Triantafillou, Sachin Ravi, Jake Snell, Kevin Swersky, Joshua B. Tenenbaum, Hugo Larochelle, Richard S. Zemel

TL;DR

This paper introduces a framework for semi-supervised few-shot classification, where a model learns to classify new categories using a tiny labeled "support set" supplemented by a larger pool of unlabeled data. By extending Prototypical Networks with a "soft k-means" refinement mechanism and a learned masking system, the authors show that models can successfully ignore "distractor" noise and significantly boost accuracy using unlabeled examples.

The Challenge of Few-Shot Learning with Unlabeled Data

Deep learning typically requires mountains of labeled data. Few-shot learning aims to bridge the gap between machine and human intelligence by training models to recognize new objects from just one or a few examples. This is usually achieved via "episodic training," where the model solves many small tasks (episodes) to learn a general strategy for rapid learning.

Episodic training setup with support, unlabeled, and query sets

However, standard few-shot learning ignores a massive, often readily available resource: unlabeled data. In real-world scenarios, we might have five labeled photos of a rare bird and a hundred unlabeled photos that might be that bird—or might be squirrels and trees (distractors). This paper tackles how to leverage that "messy" unlabeled data to improve classification without being led astray by irrelevant images.

Refining Prototypes: The Methods

The authors build upon Prototypical Networks (ProtoNets). In a standard ProtoNet, the average embedding of labeled examples for a class is used to create a "prototype" (a centroid). New images are then classified based on which prototype they are closest to in the embedding space.

To incorporate unlabeled data, the authors propose three ways to "refine" these prototypes:

Prototype refinement using unlabeled data
  1. Soft $k$-Means: The model treats the initial prototypes as cluster centers. It evaluates the unlabeled data, assigns them partially to the nearest prototypes based on distance, and then recalculates the prototypes as a weighted average of both labeled and unlabeled points.
  2. Soft $k$-Means with a Distractor Cluster: To handle "outliers" (images that don't belong to any of the target classes), a special "catch-all" cluster centered at the origin is added. This gives distractor images a designated place, preventing them from pulling the real class prototypes out of alignment.
  3. Soft $k$-Means with Masking: This advanced version uses a small neural network (MLP) to learn a "soft mask" for each prototype. Based on the statistics of the unlabeled data, the MLP decides which unlabeled points are reliable enough to include in the refinement and which should be ignored.

Crucially, this entire process is end-to-end differentiable, meaning the model learns how to best utilize the unlabeled data during the meta-learning phase itself.

Datasets and Evaluation

The researchers evaluated their methods on three benchmarks:

  • Omniglot: A dataset of handwritten characters.
  • miniImageNet: A standard few-shot benchmark derived from ImageNet.
  • tieredImageNet (New): Introduced in this paper, this is a larger version of ImageNet (608 classes) with a hierarchical structure. It ensures that training and test classes are taxonomically distinct (e.g., if "Labrador" is in training, "Golden Retriever" won't be in the test set), providing a more rigorous and realistic challenge.

Key Insights

  • Meta-Learning the Refinement: The model doesn't just perform semi-supervised learning at test time; it is explicitly trained to do so. By seeing unlabeled data during training episodes, it learns an embedding space specifically optimized for this clustering-based refinement.
  • Tackling the Distractor Problem: Unlabeled data is a double-edged sword. Assuming all unlabeled data belongs to target classes allows "distractor" images to ruin prototypes. The Masking mechanism proved highly robust here, allowing the model to be "skeptical" of noisy unlabeled points.
  • Extrapolation Capabilities: Even when trained with only 5 unlabeled images per class, the model continues to improve when provided with 20 or 50 unlabeled images at test time, demonstrating it has learned a generalizable "refinement" skill.

Key Results

The semi-supervised variants consistently outperformed purely supervised baselines across all datasets:

  • miniImageNet (1-shot): The supervised baseline achieved ~43.6% accuracy. The Masked Soft $k$-Means version jumped to 50.4% (without distractors) and maintained a strong 49.0% even when distractors were present.
  • tieredImageNet (1-shot): Accuracy improved from 46.5% (supervised) to 52.4% (masked semi-supervised).
  • Robustness: In scenarios with distractors, the "Masked" version was significantly more stable than basic soft $k$-means, proving that learning to ignore noise is just as critical as learning to use valid data.

Limitations and Future Work

  • Single Step Refinement: The authors found that performing multiple iterations of $k$-means didn't significantly help. This suggests the model might be "collapsing" the refinement into a single step, or that the learned embedding space is already doing most of the heavy lifting.
  • Fixed Class Count: The current setup assumes a fixed number of classes ($N$-way) per episode.
  • Future Directions: The authors suggest incorporating "fast weights" (Hebbian learning) to allow the model to adapt its embeddings even more dynamically within a single episode.

Summary updated

BibTeX
@inproceedings{ren2018meta,
  author = {Mengye Ren and Eleni Triantafillou and Sachin Ravi and Jake Snell and Kevin Swersky and Joshua B. Tenenbaum and Hugo Larochelle and Richard S. Zemel},
  title = {{Meta-Learning for Semi-Supervised Few-Shot Classification}},
  booktitle = {International Conference on Learning Representations},
  year = {2018},
  url = {https://openreview.net/forum?id=HJcSzz-CZ},
}
Figure