Introduction
Meta-learning, or "learning to learn," has emerged as a powerful paradigm for few-shot classification. Most existing algorithms rely on an episodic training strategy where models are trained on a sequence of randomly sampled tasks. However, uniform random sampling often generates tasks that are trivial—for instance, distinguishing between a "dog" and a "laptop." Such easy tasks provide negligible gradients, leading to inefficient training and suboptimal generalization. This paper addresses this inefficiency by introducing Greedy Class-Pair (GCP) sampling, an adaptive method that prioritizes "hard" tasks involving visually similar classes to sharpen the model's decision boundaries.
Episodic Training with Adaptive Sampling
In few-shot classification, meta-learning models are repeatedly exposed to small, randomly generated tasks (episodes) to mimic the challenges of test-time inference. A standard episode consists of a support set $S$ for adaptation and a query set $Q$ for evaluation. The core contribution of this work is the replacement of uniform sampling with an adaptive feedback loop.
As shown in Figure 1, the "Adaptive Sampling" module uses the model's current state to identify class pairs that are difficult to distinguish. By focusing on these confusing pairs, the training process forces the model to learn finer, more robust features, such as those needed to differentiate between similar breeds of dogs rather than disparate categories.
Greedy Class-Pair (GCP) Sampling
The authors propose modeling task selection using a Markov Random Field (MRF) framework. Instead of evaluating classes in isolation, the method maintains a "class-pair potential" matrix $C^t$, where each entry represents the difficulty of distinguishing between two specific classes at training step $t$.
The probability of selecting a set of $K$ classes is proportional to the product of the pairwise potentials within that set. However, calculating this distribution globally is computationally prohibitive ($O(N^K)$). To overcome this, the authors developed the Greedy Class-Pair (GCP) algorithm, which constructs tasks iteratively.
As illustrated in Figure 2, the algorithm begins by selecting a difficult pair (e.g., classes 2 and 3 with a high potential of 9). It then iteratively adds the class that is most "confusing" relative to the classes already in the set. Remarkably, the authors provide a theoretical guarantee that this $O(K)$ greedy approach yields the same task distribution as the global $O(N^K)$ version, ensuring efficiency without sacrificing mathematical rigor.
Experimental Evaluation
The method was evaluated on two standard benchmarks: miniImageNet (100 classes) and CIFAR-FS (a few-shot variant of CIFAR-100).
Key Results
The integration of GCP sampling into popular meta-learning frameworks like Prototypical Networks (PN), MAML++, and MetaOptNet consistently yielded performance gains:
- Accuracy Improvements: On miniImageNet (5-way 1-shot), Prototypical Networks with GCP sampling reached 61.09% accuracy, up from 59.25% with random sampling.
- State-of-the-Art Performance: Combined with MetaOptNet-SVM, the method achieved 64.01% (1-shot) and 79.78% (5-shot) on miniImageNet, setting new benchmarks.
- Efficiency: The adaptive sampling adds only 4–7% overhead to total training time, making it highly practical for large-scale experiments.
Conclusion
The shift from class-based to class-pair based sampling represents a significant conceptual advancement in meta-learning. By focusing on contextual difficulty—how hard it is to distinguish class A from class B—GCP sampling ensures that every training episode provides meaningful signal. While the method requires tuning hyperparameters for update rates and shows some sensitivity during the initial "warm-up" phase, its consistent gains across various backbones and frameworks demonstrate its robustness as a "plug-and-play" enhancement for few-shot learners.
Summary updated