AdptGL-CA: Adaptive Global-Local Metric Fusion With Contrastive Attention for Few-Shot Learning
Zhiying Song, Pengfei Wang, Xiaokang Wang, Nenggan Zheng · IEEE Transactions on Emerging Topics in Computational Intelligence · 2025
Few-shot learning (FSL) aims to learn novel concepts with very limited labeled data. The popular FSL methods typically rely on metric learning to measure image similarity in a learned feature space. However, existing approaches often overlook the synergy between the similarity metric and feature representation, and fail to fully exploit the combination of global and local features for effective similarity measurement. In this work, we propose a novel FSL method, AdptGL-CA, which adaptively uses global and local features to boost the discrimination capability of similarity metric, while improving feature representation and generalization through attention mechanism and contrastive learning, respectively. Specifically, we design a learnable adaptive fusion strategy that uses global similarity to represent task-specific status to adaptively determine the fusion weight of local similarity, thus effectively fusing the dual similarities for better classification. Besides, the salient parts of features are highlighted using channel and spatial attentions to improve feature representation while adjusting the importance of local descriptors. As the input to the similarity metric, these more informative features further boost its discriminative ability. Moreover, a contrastive learning loss is introduced to overcome the potential overfit to base classes and learn more generic features. Additionally, we extend the PAC-Bayes-Bernstein bound to FSL setting, introducing a theoretically grounded measure for assessing generalization. Theoretical analysis validates the generalization improvement of AdptGL-CA. Comprehensive experiments indicate that AdptGL-CA achieves competitive performance with few extra parameters on multiple standard and fine-grained few-shot benchmarks, showing the effectiveness.