Abstract
Traditional image classification models typically compress an entire image into a single, monolithic feature vector. While effective for large-scale supervised learning, this approach often acts as a bottleneck in few-shot learning (FSL) scenarios, where fine-grained details are essential for distinguishing novel classes from limited examples. This paper introduces SetFeat, a method that extracts a set of feature vectors per image using lightweight attention modules. By matching these feature sets directly using a set-to-set metric, SetFeat achieves state-of-the-art performance across multiple benchmarks while maintaining a parameter count comparable to standard baseline models.
Introduction
Few-shot learning (FSL) challenges models to recognize novel categories after seeing only one or five examples. To succeed, a model must leverage knowledge from a large "base" dataset and transfer it to unseen classes. The standard paradigm involves using a deep backbone (e.g., ResNet) to extract a single global feature vector for an image. However, a single vector often fails to capture the multi-scale, diverse characteristics necessary to distinguish between highly similar or previously unseen categories.
This paper argues that representing an image as a set of features is intrinsically better for transfer learning. The proposed SetFeat framework departs from the single-vector norm by extracting multiple vectors that capture features at various scales and levels of abstraction, providing a richer representation for the matching process.
The SetFeat Framework
SetFeat introduces three key innovations to the standard few-shot classification pipeline:
1. Shallow Self-Attention Mappers
Instead of relying solely on the final layer of a backbone network, SetFeat embeds multiple shallow self-attention modules, referred to as "mappers," at different depths of the architecture. These mappers are lightweight and designed to probe the backbone at various stages, capturing both low-level textures and high-level semantic parts.
2. Parameter Neutrality
A common pitfall in architectural innovation is increasing the parameter count, which can lead to overfitting in few-shot settings. To ensure a fair comparison with existing methods, the authors slightly reduce the number of filters in the convolutional backbone. This adjustment allows for the inclusion of the attention mappers while keeping the total parameter count approximately equal to standard ResNet12 baselines (e.g., ~12.3M for SetFeat vs ~12.4M for ResNet12).
3. Set-to-Set Matching Metrics
Because each image is represented by a set of $M$ vectors, traditional Euclidean distance is no longer applicable. The authors evaluated several set-matching strategies and identified Sum-min as the most effective. The Sum-min metric works by finding the closest match in the support set for every vector in the query set and then summing those minimum distances. This allows the model to "pick and choose" which specific features from different scales are most relevant for a new class.
Experimental Evaluation
The researchers evaluated SetFeat on three gold-standard few-shot benchmarks: miniImageNet, tieredImageNet, and the CUB (Caltech-UCSD Birds-200-2011) dataset for fine-grained classification. Training followed a two-stage process: a standard classification pre-training phase where each mapper was trained independently, followed by a meta-training phase to optimize the model for the set-matching task.
Key Results
SetFeat outperformed previous state-of-the-art (SOTA) methods in nearly every scenario:
- miniImageNet: Achieved a 1.83% accuracy gain in 1-shot and a 1.4% gain in 5-shot scenarios over previous leaders like MELR.
- tieredImageNet: Demonstrated a 1.42% improvement in 1-shot accuracy.
- CUB: Improved 1-shot accuracy by 1.83%, highlighting its effectiveness in fine-grained tasks.
Insights and Discussion
Analysis of the model provided several insights into why set-based representations are superior:
- Multi-scale Diversity: Visualizations of saliency maps showed that different mappers focus on different parts of the image. While a standard model might focus only on the most prominent feature, SetFeat’s mappers jointly identify multiple distinctive parts of an object.
- The Importance of Low-level Features: The study found that mappers attached to early, low-level convolutional blocks are consistently active and useful for final classification. This contradicts the common practice in FSL of using only high-level global features.
- Efficiency: The performance gains were achieved without the computational overhead of significantly larger models, proving that the bottleneck in FSL is often the representation format rather than the raw number of parameters.
Conclusion and Future Work
SetFeat demonstrates that representing images as sets of features significantly improves the adaptability of models to novel classes. By capturing multi-scale details and employing a flexible matching metric, the framework sets a new standard for few-shot image classification. Future research directions include dynamically weighting mappers based on the specific task and adapting the set-based approach to self-supervised learning, where multiple feature "anchors" could improve the robustness of learned representations.
Summary updated