Abstract
Few-shot image classification requires models to recognize new categories from a handful of examples. A primary challenge is the presence of "distractor" entities in training images, which can lead to supervision collapse. This paper presents Class-Aware Patch Embedding Adaptation (CPEA), a novel framework that enhances patch-level discriminative power by integrating global class context. Using self-supervised pretraining and a transformer-based adaptation mechanism, CPEA achieves state-of-the-art performance on benchmarks like miniImageNet and tieredImageNet while being significantly faster than existing methods.
The Challenge of Few-Shot Learning
In few-shot learning (FSL), models must generalize from extremely limited data. A significant hurdle is that real-world images are often "noisy," containing multiple objects besides the target class. For instance, an image labeled "ox" might also feature a barn, a fence, and trees.
Standard models trained on large datasets eventually learn to ignore these distractors. However, in FSL, the lack of data makes it hard for the model to discern which features are truly representative of the class. This often results in supervision collapse, where the model over-fits to specific training patterns that fail to generalize to novel classes.
The CPEA Framework
The authors propose a three-stage approach to refine patch embeddings:
- Self-Supervised Pretraining: Instead of standard supervised learning, CPEA utilizes Masked Image Modeling (MIM) to pretrain a Vision Transformer (ViT). By reconstructing missing patches, the model develops a robust semantic understanding of image structures without the bias of specific class labels.
- Class-Aware Adaptation: A learnable "class-agnostic embedding" interacts with image patches through ViT attention layers, becoming class-aware. This global context is then injected into local patch embeddings: $\bar{z}_i = z_i + \lambda z_{class}$. This ensures that every patch reflects the global object of interest.
- Dense Similarity Measure: Rather than comparing global vectors, CPEA calculates a dense score matrix between adapted patches of query and support images. A small MLP then processes this matrix to determine the final similarity score.
Key Insights
- Contextual Awareness: Blending local features with global class-aware information allows the model to effectively "mask out" irrelevant background elements.
- MIM Superiority: Self-supervised pretraining prevents the feature space from collapsing around training classes, preserving richer features for unseen test categories.
- Efficiency: Unlike methods requiring expensive online optimization (fine-tuning during inference), CPEA is a feed-forward model. It is approximately 100x faster than competing high-performance methods like FewTURE.
Experimental Results
CPEA was evaluated on four standard benchmarks: miniImageNet, tieredImageNet, CIFAR-FS, and FC-100. It established new state-of-the-art records across the board:
- miniImageNet: 71.97% (1-shot) and 87.06% (5-shot).
- tieredImageNet: 76.93% (1-shot) and 90.12% (5-shot).
- Inference Speed: CPEA processes a query in just 1.35ms on an NVIDIA 2080Ti, compared to 168.6ms for FewTURE.
Conclusion and Future Work
CPEA demonstrates that integrating global context into local patch embeddings significantly improves few-shot classification. While highly effective, the authors suggest that exploring scale-invariant metrics like the Mahalanobis distance could further enhance robustness. Future research may also focus on improving performance in extremely cluttered scenes where the target object is disproportionately small.
Summary updated