Abstract
We propose a method for learning embeddings for few-shot learning that is suitable for use with any number of shots (shot-free). Rather than fixing the class prototypes to be the Euclidean average of sample embeddings, we allow them to live in a higher-dimensional space (embedded class models) and learn the prototypes along with the model parameters. The class representation function is defined implicitly, which allows us to deal with a variable number of shots per class with a simple constant-size architecture. The class embedding encompasses metric learning, that facilitates adding new classes without crowding the class representation space. Despite being general and not tuned to the benchmark, our approach achieves state-of-the-art performance on the standard few-shot benchmark datasets.
Introduction
Few-shot learning (FSL) aims to recognize new objects after seeing only one or a few examples ("shots"). Most existing methods suffer from three main constraints:
- Rigidity: They are often "tuned" for a specific number of shots (e.g., a model trained for 1-shot tasks performs poorly on 5-shot tasks).
- Simplistic Prototypes: Many models represent a class as the simple Euclidean average of its samples' features. This assumes classes are unimodal and live in the same space as the data features, which isn't always true.
- Closed Settings: They struggle with "open-universe" scenarios where the number of classes grows over time.
This paper addresses these issues by proposing a flexible framework that treats class representation as an optimization problem rather than a fixed formula.
Methods
The core innovation is the Implicit Class Representation. In standard Prototypical Networks, a class representative is just the mean of the feature vectors of its samples. In this work, class models are treated as parameters to be learned.
- Data Embedding: Standard deep backbones (C64 or ResNet-12) map images to a feature space, followed by normalization onto a unit hypersphere.
- Implicit Function: Instead of a fixed "mean" function, the class representation is defined implicitly. During training, an optimization problem is solved to find the class embeddings that best represent the data. This allows class identities to reside in a higher-dimensional space than the features themselves.
- Metric Learning: A distance metric is learned to determine how data points associate with class models.
- Shot-Free Training: Because the class representation is found via optimization, the architecture remains constant regardless of the number of shots. This makes the model "shot-free."
Experiments and Results
The approach was evaluated on three standard benchmarks: miniImageNet, tieredImageNet, and CIFAR-FS.
Key Results
- State-of-the-Art Performance: On miniImageNet, the ResNet-12 variant achieved 59.00% (1-shot) and 77.46% (5-shot), outperforming many complex meta-learners like MAML and Prototypical Networks.
- Robustness in 1-Shot Scenarios: The method showed particularly strong improvements in 1-shot scenarios, likely due to the learned metric and implicit prototypes being more robust than simple averaging when data is scarce.
- Shot-Free Consistency: Unlike Prototypical Networks, which see performance drops if the shot count changes between training and testing, this model maintains high accuracy across various scenarios using a single set of weights.
Conclusion
By decoupling data features from class representations and defining class prototypes implicitly through optimization, this framework achieves state-of-the-art performance while remaining flexible to the number of available samples. Future work could explore the computational overhead of the iterative solver at inference time and the model's performance in sequential lifelong learning settings.
Summary updated