Few-Shot Learning via Embedding Adaptation With Set-to-Set Functions

Han-Jia Ye, Hexiang Hu, De-Chuan Zhan, Fei Sha

Introduction

Standard few-shot learning (FSL) methods typically rely on a fixed, task-agnostic embedding function. While effective, this "one-size-fits-all" approach is often suboptimal because the features required to distinguish between classes vary depending on the specific task context. For instance, the visual cues needed to differentiate a "house cat" from a "golden retriever" differ significantly from those needed to distinguish a "house cat" from a "tiger." This paper introduces FEAT (Few-shot Embedding Adaptation with Transformer), which adapts image embeddings to be task-specific, making them more discriminative for the particular classes in a given episode.

Methodology: The FEAT Pipeline

The core innovation of FEAT is the transition from instance-level embeddings to set-level adapted embeddings using a set-to-set function.

Comparison between standard instance embedding and the proposed embedding adaptation approach.

As shown in the figure above, standard methods (a) map images directly to a feature space. FEAT (b) introduces an adaptation module—specifically a Transformer—that processes the entire support set. The Transformer's self-attention mechanism allows each instance's embedding to be updated based on its relationship to all other instances in the set. This ensures the resulting embeddings are contextualized and permutation-invariant. To further enhance discriminative power, a contrastive loss term is employed to cluster same-class instances while pushing different classes apart.

Key Results and Visualization

FEAT established new state-of-the-art benchmarks on MiniImageNet and TieredImageNet at the time of its release. On MiniImageNet (1-shot, 5-way), FEAT achieved 66.78% accuracy using a ResNet backbone, a notable improvement over the task-agnostic ProtoNet baseline of 62.39%.

The effectiveness of this adaptation is qualitatively visible through PCA visualizations of the embedding space.

PCA visualizations showing how embeddings co-adapt within different few-shot tasks, often leading to clearer class separation and higher accuracy.

In these plots, support embeddings that appear cluttered or overlapping before adaptation (triangles) are transformed into distinct, well-separated clusters (squares) after the set-to-set function is applied. This "push-and-pull" effect directly correlates with the observed accuracy gains in most tasks, demonstrating how the model learns to emphasize the most relevant features for the current set of classes.

Conclusion

FEAT demonstrates that "discriminative" is a relative term in few-shot learning. By leveraging Transformers as general-purpose set processors, the model successfully captures the global structure of a task's support set. This approach is not only parameter-efficient but also robust across different task configurations, highlighting the importance of context-aware feature extraction in low-data regimes.

Summary updated

BibTeX
@inproceedings{ye2020few,
  author = {Han-Jia Ye and Hexiang Hu and De-Chuan Zhan and Fei Sha},
  title = {{Few-Shot Learning via Embedding Adaptation With Set-to-Set Functions}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2020},
  doi = {10.1109/cvpr42600.2020.00883},
}
Figure