[Paper Review] Matching Feature Sets for Few-Shot Image Classification
This paper proposes SetFeat, a few-shot image classification method that represents images as sets of feature vectors instead of single vectors, using lightweight self-attention modules (mappers) inserted into existing backbones. By applying set-to-set matching metrics, SetFeat achieves state-of-the-art performance with minimal parameter increase, outperforming prior methods by up to 1.83% in 1-shot accuracy on miniImageNet, tieredImageNet, and CUB datasets.
In image classification, it is common practice to train deep networks to extract a single feature vector per input image. Few-shot classification methods also mostly follow this trend. In this work, we depart from this established direction and instead propose to extract sets of feature vectors for each image. We argue that a set-based representation intrinsically builds a richer representation of images from the base classes, which can subsequently better transfer to the few-shot classes. To do so, we propose to adapt existing feature extractors to instead produce sets of feature vectors from images. Our approach, dubbed SetFeat, embeds shallow self-attention mechanisms inside existing encoder architectures. The attention modules are lightweight, and as such our method results in encoders that have approximately the same number of parameters as their original versions. During training and inference, a set-to-set matching metric is used to perform image classification. The effectiveness of our proposed architecture and metrics is demonstrated via thorough experiments on standard few-shot datasets -- namely miniImageNet, tieredImageNet, and CUB -- in both the 1- and 5-shot scenarios. In all cases but one, our method outperforms the state-of-the-art.
Motivation & Objective
- To improve few-shot image classification by replacing single feature vectors with sets of feature vectors for richer, more transferable representations.
- To develop a method that adapts existing deep backbones to extract multiple feature vectors per image without significantly increasing model size.
- To design effective set-to-set distance metrics that outperform traditional centroid-based matching in few-shot scenarios.
- To demonstrate generalization across domains, including zero-shot and cross-dataset few-shot transfer.
Proposed method
- Integrates lightweight self-attention modules (mappers) at multiple scales within existing encoder architectures (e.g., Conv4-64, ResNet12) to generate sets of feature vectors.
- Pre-trains the network with classification loss at each mapper, followed by meta-training using episodic learning similar to Prototypical Networks.
- Employs set-to-set matching metrics—specifically sum-min, Hausdorff, and others—for comparing query images against support sets of novel classes.
- Uses a two-stage training procedure: first standard transfer learning with cross-entropy loss at each mapper, then meta-learning with set-based classification.
- Adapts three backbones (Conv4-64, Conv4-256, ResNet12) by replacing global pooling with mapper-based feature set extraction.
- Applies gradient saliency and t-SNE visualization to analyze how different mappers attend to distinct image regions and learn class-structured representations.

Experimental results
Research questions
- RQ1Can representing images as sets of feature vectors improve few-shot generalization compared to single vector representations?
- RQ2Does inserting lightweight self-attention modules into existing backbones enhance feature diversity and transferability without increasing model size?
- RQ3Can set-to-set matching metrics outperform traditional centroid-based matching in few-shot classification?
- RQ4How does the proposed method generalize across domains, such as from miniImageNet to CUB?
- RQ5Do individual mappers learn to focus on distinct image regions and preserve class structure in the latent space?
Key findings
- SetFeat achieves state-of-the-art performance on miniImageNet, tieredImageNet, and CUB in both 1-shot and 5-shot settings, outperforming prior methods in almost all cases.
- On miniImageNet, SetFeat12 with the sum-min metric achieves 82.71% accuracy in 5-shot 5-way classification, surpassing the previous SOTA (MixtFSL at 82.04%) by 0.67%.
- In 1-shot 5-way classification, SetFeat12 improves by 1.83% over the baseline on CUB, 1.42% on tieredImageNet, and 1.83% on miniImageNet.
- The method maintains model efficiency: SetFeat12 has only 12.349M parameters, close to the 12.424M of ResNet12, with minimal parameter increase.
- Cross-domain evaluation shows SetFeat12 ∗ achieves 67.85% accuracy on CUB after pre-training on miniImageNet, ranking second and within 0.92% of the best method (MixtFSL).
- Ablation studies confirm that the sum-min metric consistently outperforms Hausdorff and other set-to-set metrics, with gains of 1.11% on miniImageNet and 1.89% on CUB in 1-shot settings.
![Figure 2 : Illustration of 1-shot image classification using (a) three existing methods and (b) our approach with the sum-min metric. (a) Given a query and support, existing methods either directly match the query to support (ProtoNet (PN) [ 50 ] ), apply a single embedding function over both suppor](https://ar5iv.labs.arxiv.org/html/2204.00949/assets/x3.png)
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.