tSF: Transformer-based Semantic Filter for Few-Shot Learning
Jinxiang Lai, Siqian Yang, Wenlong Liu, Yi Zeng, Zhongyi Huang, Wenlong Wu, Jun Liu, Bin-Bin Gao, Chengjie Wang
TL;DR
Few-shot learning suffers from weak representations for novel classes due to limited data. The authors propose a light transformer-based Semantic Filter (tSF) that redefines the Transformer inputs as $Q=f$ and $K,V=\theta$, enabling dataset-attention to encode base-set semantics into a learnable filter and transfer them to novel samples via $f' = FFN(f + \sigma(f \theta^T) \theta)$. tSF serves as a universal neck and is integrated with PatchProto for few-shot classification, while also generalizing to segmentation and detection, delivering about 2–3% gains on benchmarks with a parameter footprint under 1M. This approach demonstrates robust base-to-novel transfer and task-agnostic improvements, offering a practical, scalable solution for cross-task few-shot learning.
Abstract
Few-Shot Learning (FSL) alleviates the data shortage challenge via embedding discriminative target-aware features among plenty seen (base) and few unseen (novel) labeled samples. Most feature embedding modules in recent FSL methods are specially designed for corresponding learning tasks (e.g., classification, segmentation, and object detection), which limits the utility of embedding features. To this end, we propose a light and universal module named transformer-based Semantic Filter (tSF), which can be applied for different FSL tasks. The proposed tSF redesigns the inputs of a transformer-based structure by a semantic filter, which not only embeds the knowledge from whole base set to novel set but also filters semantic features for target category. Furthermore, the parameters of tSF is equal to half of a standard transformer block (less than 1M). In the experiments, our tSF is able to boost the performances in different classic few-shot learning tasks (about 2% improvement), especially outperforms the state-of-the-arts on multiple benchmark datasets in few-shot classification task.
