Realistic evaluation of transductive few-shot learning

Olivier Veilleux, Malik Boudiaf, Pablo Piantanida, Ismail Ben Ayed

TL;DR

Current benchmarks for transductive few-shot learning often rely on an unrealistic assumption: that unlabeled query sets are perfectly class-balanced. This regularity is rarely found in the real world. This paper introduces a realistic evaluation protocol using Dirichlet-distributed class proportions to simulate natural imbalance. Furthermore, it proposes $\alpha$-TIM, a novel loss function based on $\alpha$-divergences that remains robust even when the distribution of unlabeled data is unknown and highly skewed.

The Problem: The "Balance Bias" in Few-Shot Learning

In Few-Shot Learning (FSL), models are tasked with recognizing new classes from just a handful of labeled examples (the "support set"). Transductive methods have recently dominated this field. Instead of classifying unlabeled test samples (the "query set") one by one (inductive inference), transductive methods look at the entire query set at once to find underlying patterns and structure.

However, the authors point out a massive blind spot in how these models are evaluated. Current FSL benchmarks, such as mini-ImageNet, consistently provide query sets where every class has exactly the same number of samples. Consequently, most state-of-the-art transductive methods have "baked in" this assumption of perfect balance.

In a real-world scenario—for instance, a drone identifying rare wildlife—there is no guarantee that a given batch of images will contain an equal number of every species. This paper asks a critical question: Do transductive methods actually generalize well, or are they merely exploiting an artificial class-balance artifact?

Methods

The authors tackle this issue in two parts: by introducing a new evaluation protocol and by proposing a new, robust algorithm.

1. Realistic Task Sampling

Instead of forcing query sets to be perfectly balanced, the authors model class proportions using a Dirichlet distribution. By varying a concentration parameter, they can generate query sets ranging from perfectly balanced to extremely skewed (where one or two classes might dominate the entire set).

Dirichlet distributions over a 3-class simplex for varying concentration parameters. Lower values yield highly skewed query sets, while higher values force class balance.

This approach effectively removes the artificial balance artifact, allowing for a principled and realistic sampling of class marginal probabilities within the simplex.

2. $\alpha$-TIM (Alpha-Transductive Information Maximization)

Standard transductive methods often use Shannon entropy to regularize their predictions, which strongly pushes the model toward a uniform (balanced) output. To combat this, the authors propose a generalization using $\alpha$-divergences (specifically Tsallis $\alpha$-entropy).

The effect of the α parameter on the α-entropy function and its derivative. Higher α values relax the strict penalty against non-uniform distributions.

By choosing an $\alpha > 1$, the loss function becomes significantly more flexible. It still prevents the model from assigning every sample to a single class (a trivial solution), but it does not penalize the model as harshly for deviating from a perfectly uniform distribution. This changes the "barrier" in the optimization landscape, allowing the model to accept that some classes are naturally more frequent than others while maintaining the benefits of transductive reasoning.

Datasets

The researchers evaluated their approach on three standard few-shot classification benchmarks, modifying the testing phase to include their Dirichlet-based imbalanced sampling:

  • mini-ImageNet: A widely used subset of the massive ImageNet dataset.
  • tiered-ImageNet: A larger, more hierarchical subset of ImageNet.
  • CUB (Caltech-UCSD Birds 200): A fine-grained dataset of bird species.

Key Insights and Results

  • The "Balance Bias" is Real: Top-performing methods like PT-MAP use hard constraints (via the Sinkhorn-Knopp algorithm) to force the model to output balanced predictions. When tested on imbalanced data under the new protocol, these methods collapse because they are mathematically forbidden from predicting the true, skewed distribution. The previous state-of-the-art (PT-MAP) suffered a massive accuracy drop of 18% to 20%.
  • Transductive vs. Inductive: Surprisingly, in the realistic imbalanced setting, many famous transductive methods actually perform worse than simple inductive baselines. This suggests that the performance "gains" reported in recent years might be partially illusory, driven by benchmark design rather than algorithmic superiority.
  • Robustness of $\alpha$-TIM: The proposed $\alpha$-TIM method consistently outperformed all other transductive methods across all datasets and shot-counts (e.g., 1-shot, 5-shot). It was the only transductive method that consistently stayed above the inductive baselines in the imbalanced setting, proving it is actually learning robust features rather than just exploiting the test set's structure.
  • Consistency: On the CUB dataset (1-shot), $\alpha$-TIM achieved 75.7% accuracy, significantly higher than the standard TIM (74.8%) and the inductive baseline (70.6%).

Limitations and Future Work

  • Support Set Imbalance: This paper focuses exclusively on imbalance in the unlabeled query set. However, in many real-world cases, the labeled support set might also be imbalanced (e.g., having 5 pictures of a common bird but only 1 of a rare species). The authors suggest this "mixed imbalance" is a vital area for future study.
  • Meta-Training: The authors used a standard transfer-learning backbone. They note that "episodic" meta-training strategies often bake in the balance assumption during the training phase itself. Future work should investigate how to train models to be "imbalance-aware" from the very beginning of the meta-training pipeline.

Summary updated

BibTeX
@inproceedings{veilleux2021realistic,
  author = {Olivier Veilleux and Malik Boudiaf and Pablo Piantanida and Ismail Ben Ayed},
  title = {{Realistic evaluation of transductive few-shot learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2021},
  url = {https://openreview.net/forum?id=MhPzbqTdmrK},
}
Figure