Learning Task-aware Local Representations for Few-shot Learning
Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence. Main track. Pages 716-722.
https://doi.org/10.24963/ijcai.2020/100
Keywords
- Computer Vision: Recognition: Detection, Categorization, Indexing, Matching, Retrieval, Semantic Interpretation
Abstract
Few-shot learning for visual recognition aims to adapt to novel unseen classes with only a few images. Recent work, especially the work based on low-level information, has achieved great progress. In these work, local representations (LRs) are typically employed, because LRs are more consistent among the seen and unseen classes. However, most of them are limited to an individual image-to-image or image-to-class measure manner, which cannot fully exploit the capabilities of LRs, especially in the context of a certain task. This paper proposes an Adaptive Task-aware Local Representations Network (ATL-Net) to address this limitation by introducing episodic attention, which can adaptively select the important local patches among the entire task, as the process of human recognition. We achieve much superior results on multiple benchmarks. On the miniImagenet, ATL-Net gains 0.93% and 0.88% improvements over the compared methods under the 5-way 1-shot and 5-shot settings. Moreover, ATL-Net can naturally tackle the problem that how to adaptively identify and weight the importance of different key local parts, which is the major concern of fine-grained recognition. Specifically, on the fine-grained dataset Stanford Dogs, ATL-Net outperforms the second best method with 5.39% and 9.69% gains under the 5-way 1-shot and 5-shot settings.
- [Cai et al., 2018] Qi Cai, Yingwei Pan, Ting Yao, Cheng- gang Yan, and Tao Mei. Memory matching networks for one-shot image recognition. In CVPR, pages 4080-4088, 2018.
- [Chu et al., 2019] Wen-Hsuan Chu, Yu-Jhe Li, Jing-Cheng Chang, and Yu-Chiang Frank Wang. Spot and learn: A maximum-entropy patch sampler for few-shot image clas- sification. In CVPR, pages 6251-6260, 2019.
- [Deng et al., 2009] Jia Deng, Wei Dong, Richard Socher, Li- Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In CVPR, pages 248-255.
- [Finn et al., 2017] Chelsea Finn, Pieter Abbeel, and Sergey Levine. Model-agnostic meta-learning for fast adaptation of deep networks. In ICML, pages 1126-1135. JMLR. org, 2017.
- [He et al., 2016] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recog- nition. In CVPR, pages 770-778, 2016.
- [Huang et al., 2019] Huaxi Huang, Junjie Zhang, Jian Zhang, Jingsong Xu, and Qiang Wu. Low-rank pairwise alignment bilinear network for few-shot fine-grained im- age classification. arXiv preprint arXiv:1908.01313, 2019.
- [Khosla et al., 2011] Aditya Khosla, Nityananda Jayadevap- rakash, Bangpeng Yao, and Fei-Fei Li. Novel dataset for fine-grained image categorization: Stanford dogs. In Proc. CVPR Workshop on Fine-Grained Visual Categorization (FGVC), 2011.
- [Kingma and Ba, 2015] Diederik P. Kingma and Jimmy Ba. Adam: A method for stochastic optimization. In Yoshua Bengio and Yann LeCun, editors, ICLR, 2015.
- [Koch et al., 2015] Gregory Koch, Richard Zemel, and Rus- lan Salakhutdinov. Siamese neural networks for one-shot image recognition. In ICML deep learning workshop, vol- ume 2, 2015.
- [Krause et al., 2013] Jonathan Krause, Michael Stark, Jia Deng, and Li Fei-Fei. 3d object representations for fine- grained categorization. In ICCV Workshops, pages 554- 561, 2013.
- [Krizhevsky et al., 2012] Alex Krizhevsky, Ilya Sutskever, and Geoffrey E Hinton. Imagenet classification with deep convolutional neural networks. In NeurIPS, pages 1097- 1105, 2012.
- [Li et al., 2017] Zhenguo Li, Fengwei Zhou, Fei Chen, and Hang Li. Meta-sgd: Learning to learn quickly for few-shot learning. arXiv preprint arXiv:1707.09835, 2017.
- [Li et al., 2019a] Aoxue Li, Tiange Luo, Tao Xiang, Weiran Huang, and Liwei Wang. Few-shot learning with global class representations. In ICCV, pages 9715-9724, 2019.
- [Li et al., 2019b] Wenbin Li, Lei Wang, Jinglin Xu, Jing Huo, Yang Gao, and Jiebo Luo. Revisiting local descrip- tor based image-to-class measure for few-shot learning. In CVPR, pages 7260-7268, 2019.
- [Li et al., 2019c] Wenbin Li, Jinglin Xu, Jing Huo, Lei Wang, Yang Gao, and Jiebo Luo. Distribution consistency based covariance metric networks for few-shot learning. In AAAI, volume 33, pages 8642-8649, 2019.
- [Mishra et al., 2018] Nikhil Mishra, Mostafa Rohaninejad, Xi Chen, and Pieter Abbeel. A simple neural attentive meta-learner. In ICLR, 2018.
- [Paszke et al., 2019] Adam Paszke, Sam Gross, Francisco Massa, Adam Lerer, James Bradbury, Gregory Chanan, Trevor Killeen, Zeming Lin, Natalia Gimelshein, Luca Antiga, et al. Pytorch: An imperative style, high- performance deep learning library. In NeurIPS, pages 8024-8035, 2019.
- [Santoro et al., 2016] Adam Santoro, Sergey Bartunov, Matthew Botvinick, Daan Wierstra, and Timothy Lill- icrap. Meta-learning with memory-augmented neural networks. In ICML, pages 1842-1850, 2016.
- [Satorras and Estrach, 2018] Victor Garcia Satorras and Joan Bruna Estrach. Few-shot learning with graph neural networks. In ICLR, 2018.
- [Snell et al., 2017] Jake Snell, Kevin Swersky, and Richard Zemel. Prototypical networks for few-shot learning. In NeurIPS, pages 4077-4087, 2017.
- [Sun et al., 2018] Ming Sun, Yuchen Yuan, Feng Zhou, and Errui Ding. Multi-attention multi-class constraint for fine- grained image recognition. In ECCV, pages 805-821, 2018.
- [Sung et al., 2018] Flood Sung, Yongxin Yang, Li Zhang, Tao Xiang, Philip HS Torr, and Timothy M Hospedales. Learning to compare: Relation network for few-shot learn- ing. In CVPR, pages 1199-1208, 2018.
- [Vinyals et al., 2016] Oriol Vinyals, Charles Blundell, Timo- thy Lillicrap, Daan Wierstra, et al. Matching networks for one shot learning. In NeurIPS, pages 3630-3638, 2016.
- [Wang et al., 2018] Yu-Xiong Wang, Ross Girshick, Martial Hebert, and Bharath Hariharan. Low-shot learning from imaginary data. In CVPR, pages 7278-7286, 2018.
- [Welinder et al., 2010] P. Welinder, S. Branson, T. Mita, C. Wah, F. Schroff, S. Belongie, and P. Perona. Caltech- UCSD Birds 200. Technical Report CNS-TR-2010-001, California Institute of Technology, 2010.
- [Zhang et al., 2018] Ruixiang Zhang, Tong Che, Zoubin Ghahramani, Yoshua Bengio, and Yangqiu Song. Meta- gan: An adversarial approach to few-shot learning. In NeurIPS, pages 2365-2374, 2018.
References were extracted automatically from the PDF and may contain errors.
Full text extracted automatically from the PDF; figures, tables and equations may differ. The PDF is the version of record.
1 Introduction
Deep learning based methods [Krizhevsky et al., 2012; He et al., 2016] have achieved state-of-the-art performance on a variety of visual recognition tasks. These supervised methods need a lot of labeled data with diverse visual variations to effectively train a network. However, collecting a large amount of labeled data is time-consuming and laborious. In contrast, humans can recognize classes with extremely few labeled examples. Therefore, for machine learning algorithms, how to recognize classes with extremely few labeled examples, i.e., few-shot learning, has attracted a lot of interests. Few-shot learning attempts to transfer the knowledge like humans, for generalizing to novel classes with very few supervisions.
∗Contact Author
To address few-shot learning tasks, a lot of methods have been proposed. However, most of these methods [Vinyals et al., 2016; Snell et al., 2017] adopt an image-level feature for classification and make an assumption that the image-level deep embedding space for the seen classes is extensively effective for the unseen classes, which is somewhat idealistic in practice. Fortunately, although the image-level embedding space is not equally effective for the seen and unseen classes, the low-level information, i.e., the local representations (LRs) of semantic patches, among the seen and unseen classes, generally remain similar. Some recent methods [Li et al., 2019c; Li et al., 2019b; Sung et al., 2018] have taken feature representations of semantic patches (i.e., LRs) into consideration, but they do not fully exploit the capabilities of LRs in the context of the entire task. Recall the way that humans recognize an instance (object) into one of several unseen classes. It is quite natural that he/she will look for the distinct semantic patches which are only shared between the certain class and the query image. In other words, the semantic patches commonly shared by all classes are not truly important for recognizing a novel instance. For example, the way we recognize a "bird" among the "dog" and "cat" is quite different from the one among the "airplane" and "dragonfly". For the former one, the wings are important but are not the key concern for the latter one. Similarly, the fur and feather are more important for the latter one than the former. In other words, the importance of the semantic patches changes with the tasks.
As described above, the existing LRs based few-shot methods have not yet made full use of the information provided by the LRs mainly in two aspects: (1) the LRs are only considered inside one image or one class individually (i.e., imageto-image or image-to-class manner), rather than the entire task; (2) the semantic local patches are weighted equally, rather than the more discriminative patches enjoy the higher weights. To overcome these two limitations, we design a episodic attention mechanism, which can select and weight the key patches without paying too much attention to the common parts among the entire task. Note that, in the work of [Li et al., 2019b], a rank-based selection, i.e., k-nearest neighbor (k-NN) selection, is utilized to select k (e.g., k = 3) most related patches in each class for a query local instance. However, the number of related semantic patches for a query local instance shall be dynamically changed according to the context of the current task. It means that we may need more discriminative patches to recognize an object in one task, but just need much fewer patches to recognize the same object in another task. By contrast, the value range of the relationship between the related semantic patches mainly depends on semantic patches' nature, and remains relatively stable in changing tasks, so that we propose a value-based selection with a threshold to replace the rank-based selection. And then, we name the network with the above episodic attention mechanism as Task-aware Local Representations Network (TL-Net).
Although the above mentioned value-based selection is appealing, it roughly sets a global manual threshold for all the semantic patches of tasks, which is hard to be effective for different semantic patches at the same time. To this end, we develop a trainable module to adaptively learn this threshold for each semantic patch, i.e., adaptive value-based selection. In this way, for each certain semantic patch, we can obtain its own relation threshold according to its nature. Typically, we call the extended TL-Net with learnable thresholds as ATLNet, Adaptive Task-aware Local Representations Network, to show the additional adaptive ability relative to TL-Net.
Our contributions can be summarized as follows:
- We propose a novel episodic attention mechanism by exploring and weighting discriminative semantic patches inside the entire task, aiming to learn task-aware local representations for few-shot learning. Moreover, instead of the rank-based selection, a feasible value-based selection strategy is proposed.
- We further develop a trainable module to design an adaptive value-based selection strategy, making it possible to dynamically and adaptively select discriminative semantic patches for different tasks.
- We conduct comprehensive experiments on the challenging miniImagenet and three fine-grained datasets to verify that the proposed ATL-Net achieves superior performance over the state-of-the-art methods.
2 RelatedWork
The recent literature of few-shot learning mainly comes from the following two categories: meta-learning based methods and metric-learning based methods.
2.1 Meta-learning basedMethods
Meta-learning based methods learn the learning algorithm itself. [Santoro et al., 2016] proposes an LSTM-based metalearner to interact with an external memory module. The proposed framework in [Santoro et al., 2016] adopts an LSTMbased meta-learner to learn a distinct optimization algorithm to train a classifier as well as learning a task-aware initialization for this classifier. MAML and its variants [Finn et al., 2017] train a meta-leaner to provide suitable parameter initialization, so that they can be quickly adapted to a novel task. Similarly, [Li et al., 2017] adjusts the update direction and learning rate for quickly adapting to a novel task. [Cai et al., 2018] introduces the memory slots to construct a contextual learner for predicting the parameters of an embedding module for unlabeled images.
Nevertheless, these methods often need costly higher-order gradients or need another complicated memory structure, making these methods difficult to train and may lead to failure when scaling to deeper network architectures [Mishra et al., 2018]. Compared with methods in this branch, the proposed ATL-Net can achieve competitive results with a much simpler network architecture, which is trained from scratch without fine-tuning.
2.2 Metric-learning basedMethods
Metric-learning based methods address the few-shot classification problem by "learning to compare". [Koch et al., 2015] proposes a Siamese neural network to learn generic image representations, which is conducted as a binary classification network and trained by a regularized cross-entropy loss. [Vinyals et al., 2016] introduces an episodic training mechanism into few-shot learning and proposes the Matching Net by using attention and memory together. [Snell et al., 2017] proposes a Prototypical Net by measuring the Euclidean distance between the class-mean feature and the query feature.
However, the above methods usually adopt an image-level global feature to represent each image based on a somewhat ideal assumption that the seen and unseen classes sharing a relatively consistent embedding space. In contrast, the lowlevel information, i.e., the local representations (LRs) of semantic patches, is more consistent and transferable than the high-level global features among the seen and unseen classes, which has been verified in some recent work. For example, [Sung et al., 2018] measures the distances between the query images and the support images by applying convolution layers on the concatenated feature maps, which implicitly uses the LRs. [Li et al., 2019b] proposes DN4 to explicitly utilize the LRs through a k-nearest neighbor selection and enlarges the image-to-image search space to a more effective imageto-class one. However, these methods only consider the relationship between query images and classes at an image-level or a class-level without adequately mining the important information hidden behind the LRs at the task-level.
Different from the methods above, our ATL-Net can explore richer information of the LRs at the task-level and can adaptively select the key semantic patches for a specific task, as the progress of the human beings. Experiments on the challenging general and fine-grained datasets show the superiority of our method compared with other state-of-the-art methods.
3 The ProposedMethod
3.1 ProblemDefinition
In this paper, we follow the common settings of few-shot learning methods. Given a small support set S which consists of N unseen classes with K samples per class, our goal is to classify a query sample q ∈ Q into one of the N support classes, which is called an N-way K-shot task. To achieve this goal, an auxiliary set A is employed to learn transferable knowledge using the episodic training mechanism [Vinyals et al., 2016]. We divide A into many N-way K-shot tasks {T }, where each T contains an auxiliary support set AS and an auxiliary query set AQ. In the training stage, hundreds of tasks are fed into the model, encouraging the model to learn Support Set Query Image Feature Maps transferable knowledge that can be used in new N-way Kshot tasks (i.e., S and Q) with unseen classes. Note that S and A own different label spaces with no intersection.

Figure 1: The overview of the proposed method under 5-way 1-shot setting. The model mainly consists of two parts: the embedding module FΘ to learn local representations and the adaptive episodic attention module FA to generate adaptive episodic attention for selecting discriminative patches for a special task. The score with the red circle indicates the predicted label. (Best viewed in color.)
Our overall framework is illustrated in Figure 1. All the images are first embedded into feature representations by an embedding module FΘ. A local relation map MR is then calculated to capture the local relationship between the query image and the support set. Meanwhile, the adaptive episodic attention module FA learns an episodic attention map MA, which can adaptively select the discriminative local patches among the support set for a certain query patch, as the process of human recognition. Note that the episodic attention focuses on the relations between the local patches, not isolated individuals. After that, we apply the attention mapMA onto the relation matrix MR through an element-wise multiplication to eliminate noise, i.e., the relation constructed by the commonly shared patches among the task, and then enhance the discriminative information. Finally, we can directly get the final score for classification from the processed relation matrix through naive methods, like addition.
3.2 Task-aware Local Representations
Let x ∈ S ∪ Q denote an input image, we first feed it into the embedding module FΘ to obtain a feature representation FΘ(x) ∈ RC×H×W . Typically, we can get HW C-dimensional LRs for each input image, making up a total number of NKHW support LRs, i.e., LS = FΘ(S) ∈ RC×NKHW and HW query LRs, i.e., Lq =FΘ(q)∈RC×HW . Then we calculate the relation matrix of these LRs as below:
where i ∈ {1, . . . ,HW}, j ∈ {1, . . . ,NKHW} and g(·, ·) is a similarity metric, which is implemented as cosine similarity in this paper. In contrast to previous methods that build image-level [Sung et al., 2018] or class-level [Li et al., 2019b] relationship, we aim to build a task-level relationship while maintaining discriminative relations at the same time.

Further more, we apply a transformation layer FΨ (i.e., the 1 × 1 conv layer in Figure 2) on the original LRs, and then learn another relation matrixMΨ for subsequent operations:
(2) where i ∈ {1, . . . ,HW}, j ∈ {1, . . . ,NKHW}. Each row in this matrix represents the adaptive subspace relationship of each position in the query image to all positions of all images in the support set. Moreover, we eliminate the noises (i.e., the trivial relations) in the relation matrixMΨ by a threshold Vc, and then produce an episodic attention map MA as below:
As Eq. (3) shown, the common patches shared by multiple classes among the entire task will "dilute" the attention, and thus they will enjoy relatively small attention values. Meanwhile, we find that although the influence of each noise (i.e., each trivial relation) is slight, it still greatly affects the distribution of the episodic attention due to the large number. For this reason, we apply Eq. (4) to construct a sparse episodic attention. In fact, this sparse episodic attention is more similar to a selection process or a hard attention rather than a soft attention. Next, we perform an element-wise multiplication between MA and MR to obtain a weighted relation matrix MA ⊙MR, and then collect the weighted relation between query q and the n-th class to obtain the score for n-th class:
where Vs is a temperature for the following cross-entropy loss, and Z n k indicates the k-th relation of KHW relations belong to the n-th class in the NKHW relations of the entire support set S. Finally, we can obtain the classification probability P q of query q by a softmax function. Note that based on the above process, we can develop the Task-aware Local Representations Network (TL-Net), which can be easily implemented by two matrix multiplications, an element-wise multiplication as well as some convolution operations.
| Dataset | Stanford Dogs | Stanford Cars | CUB-200 |
|---|---|---|---|
| Nall | 120 | 196 | 200 |
| Ntrain | 70 | 130 | 130 |
| Nval | 20 | 17 | 20 |
| Ntest | 30 | 49 | 50 |
3.3 Adaptive Threshold for Episodic Attention
In the sections above, we introduce the TL-Net, where a fixed threshold Vc (i.e., a global scalar) is used to select the most informative relationships. However, such kind of selection is sensitive to the value of Vc and not flexible for different query patches, which is shown in Figure 3. To handle this problem, we propose a novel adaptive episodic attention module FA, which can learn different thresholds for different patches.
Figure 2 shows the framework of our adaptive episodic attention module. Different from the method mentioned in Eq. (4), we use a Multi-Layer Perceptron (MLP) FΓ to adaptively predict the threshold for each LR of the query image. Specifically, FΓ takes the query LRs as input and outputs a threshold V ∗ c :
where σ is a sigmoid function. Beyond that, to narrow the search space for V ∗ c , we change the output range of sigmoid function σ. However, the step function used in Eq. (4) is indifferentiable. So we approximate it using a variant I ∗ (·) of sigmoid function with a hyperparameter k:
where V ∗ c is the corresponding threshold value for x, and x denotes one of the values in MA. Theoretically, when k is large enough, the I ∗ (·) can be considered as I(·). Moreover, we call the extended TL-Net with learnable thresholds as ATL-Net, Adaptive Task-aware Local Representations Network, to show its additional adaptive ability. The training process of the proposed ATL-Net is shown in Algorithm 1.
4 Experiments
4.1 Datasets
miniImageNet [Vinyals et al., 2016] is a subset of ImageNet [Deng et al., 2009], which consists of 100 classes and 600 images per class. Following the commonly used strategy, we divide the dataset into training (auxiliary)/validation/test set with a percentage of 64/16/20 respectively.
We also evaluate our method on three fine-grained image classification datasets. Stanford Dogs [Khosla et al., 2011] contains 120 categories with a total number of 20, 580 images. Stanford Cars [Krause et al., 2013] contains 196 classes of cars and 16, 185 images. CUB-200 [Welinder et al., 2010] contains 200 bird species with a total number of 6, 033 images. For fair comparisons, we use the data splits of [Li et al., 2019b; Li et al., 2019c; Huang et al., 2019], as Table 1 shows.
Algorithm 1 Training of ATL-Net
Input: Episodic task T = {AS,AQ} 1: while no converge do 2: LS ←FΘ(AS) 3: LQ ←FΘ(AQ) 4: for Lq in LQ do 5: Get relation matrixMR by Eq. (1) 6: Calculate adaptive threshold V ∗ c for Lq by Eq. (6) 7: Construct adaptive episodic attention MA by Eq. (2), Eq. (3) and Eq. (7) 8: Calculate probability P q for Lq by Eq. (5) 9: end for 10: L←- ∑ Y log(P) 11: Mini-batch Adam to minimize L, update Θ, Ψ and Γ 12: end while
4.2 Implementation Details
Network architecture. We follow the basic feature extraction network which is used in previous works [Li et al., 2019b; Li et al., 2019c]. The feature extraction network FΘ consists of 4 convolution blocks, each of which contains a convolutional layer, batch normalization and LeakyReLU activation. The transformation layer FΨ consists a 1 × 1 convolutional layer followed by batch normalization and LeakyReLU activation. The MLP module FΓ is implemented by two fully connected layers. In fact that only a few parameters are introduced by FΨ and FΓ, which will be discussed in Section 5.
Training and testing detail. We implement our experiments using PyTorch [Paszke et al., 2019]. All the images are resized to 84 × 84. During the training stage, we randomly construct 250, 000 episodes from the training (auxiliary) set for the miniImagenet dataset and the Stanford Car dataset, and 150, 000 for the other two datasets to avoid overfitting. In each episode, we collect 15 query images per class. For example, under 5-way 1-shot setting, we have 5 support images and 75 query images in each task. We use Adam [Kingma and Ba, 2015] optimizer with a cross-entropy loss to train the network. The initial learning rate is set to 0.001. During the test, we evaluate the proposed ATL-Net on 600 randomly sampled tasks. The mean accuracy, as well as the 95% confidence interval will be reported after being repeated five times. Note that the whole model is trained from scratch in an end-to-end manner without any data augmentation and weight decay, neither do fine-tune in the test stage 1 .
4.3 Baselines
To evaluate the proposed ATL-Net on the miniImagenet, we make comparisons with eleven state-of-the-art models, including Matching Net [Vinyals et al., 2016], MAML [Finn et al., 2017], Prototypical Net [Snell et al., 2017], GNN [Satorras and Estrach, 2018], Relation Net [Sung et al., 2018], MetaGAN [Zhang et al., 2018], MM-Net [Cai et al., 2018], MEPS [Chu et al., 2019], CovaMNet [Li et al., 2019c], DN4 [Li et al., 2019b] and GCR [Li et al., 2019a].
1 The source code can be available from https://github.com/ LegenDong/ATL-Net
| Model | Backbone | Additional Stage | 5-way 1-shot | 5-way 5-shot |
|---|---|---|---|---|
| Matching Net [Vinyals et al., 2016] | Conv-64F | N | 43.56±0.84 | 55.31±0.73 |
| MAML [Finn et al., 2017] | Conv-32F | Y | 48.70±1.84 | 63.11±0.92 |
| Prototypical Net [Snell et al., 2017] | Conv-64F | N | 49.42±0.78 | 68.20±0.66 |
| GNN [Satorras and Estrach, 2018] | Conv-256F | N | 50.33±0.36 | 66.41±0.63 |
| Relation Net [Sung et al., 2018] | Conv-64F | N | 50.44±0.82 | 65.32±0.70 |
| MetaGAN [Zhang et al., 2018] | Conv-64F | N | 52.71±0.64 | 68.63±0.67 |
| MM-Net [Cai et al., 2018] | Conv-64F | N | 53.37±0.48 | 66.97±0.35 |
| MEPS [Chu et al., 2019] | Conv-64F | N | 51.03±0.78 | 67.96±0.71 |
| CovaMNet [Li et al., 2019c] | Conv-64F | N | 51.19±0.76 | 67.65±0.63 |
| DN4 [Li et al., 2019b] | Conv-64F | N | 51.24±0.74 | 71.02±0.64 |
| GCR [Li et al., 2019a] | Conv-64F | Y | 53.21±0.40 | 72.34±0.32 |
| ATL-Net (Ours) | Conv-64F | N | 54.30±0.76 | 73.22±0.63 |
| Model | Stanford Dogs | Stanford Cars | CUB-200 | |||
|---|---|---|---|---|---|---|
| 5-way 1-shot | 5-way 5-shot | 5-way 1-shot | 5-way 5-shot | 5-way 1-shot | 5-way 5-shot | |
| Matching Net | 35.80±0.99 | 47.50 ±1.03 | 34.80 ±0.98 | 44.70±1.03 | 45.30 ±1.03 | 59.50 ±1.01 |
| Prototypical Net | 37.59±1.00 | 48.19 ±1.03 | 40.90 ±1.01 | 52.93±1.03 | 37.36 ±1.00 | 45.28 ±1.03 |
| GNN | 46.98±0.98 | 62.27 ±0.95 | 55.85 ±0.97 | 71.25±0.89 | 51.83 ±0.98 | 63.69 ±0.94 |
| DN4 | 45.41±0.76 | 63.51 ±0.62 | 59.84±0.80 | 88.65±0.44 | 46.84±0.81 | 74.92 ±0.64 |
| CovaMNet | 49.10±0.76 | 63.04±0.65 | 56.65 ±0.86 | 71.33 ±0.62 | 52.42±0.76 | 63.76±0.64 |
| PABN+cpt | 45.65±0.71 | 61.24 ±0.62 | 54.44±0.71 | 67.36 ±0.61 | - | - |
| LRPABNcpt | 45.72±0.75 | 60.94±0.66 | 60.28 ±0.76 | 73.29±0.58 | - | - |
| ATL-Net (Ours) | 54.49±0.92 | 73.20±0.69 | 67.95±0.84 | 89.16±0.48 | 60.91±0.91 | 77.05±0.67 |
For fine-grained image classification datasets, we compare our method with six few-shot methods, Matching Net [Vinyals et al., 2016], Prototypical Net [Snell et al., 2017], GNN [Satorras and Estrach, 2018], DN4 [Li et al., 2019b] and CovaMNet [Li et al., 2019c], and the fine-grained methods PABN+cpt/LRPABNcpt [Huang et al., 2019].
4.4 Comparisons with the SOTAMethods
We make comparisons with several state-of-the-art methods under 5-way 1-shot and 5-way 5-shot settings.
Results on miniImagenet. The results on miniImagenet are summarized in Table 2. It can be seen that our method significantly outperforms other methods under both settings. We achieve 54.30% under the 5-way 1-shot setting, with an improvement of 0.93% from the second best [Cai et al., 2018]. Moreover, compared with [Cai et al., 2018], the proposed ATL-Net introduces simpler additional structures (i.e., FΨ and FΓ) than the complex memory-addressing architectures. Similarly, our ALT-Net also gets higher performance, 0.88% improvement than previous methods [Li et al., 2019a] that uses data augmentation, data hallucination [Wang et al., 2018] and pretrains the feature extractor on the whole training set. Note that the proposed ATL-Net achieves an improvement of 3.06%/2.20% under 5-way 1-shot/5-shot settings than the most relevant work [Li et al., 2019b], which exploits the relation at the class-level by k-NN selection.
Such a great improvement further proves the superiority of our method that select the distinct patches, which are only shared between a certain class and query images.
Results on fine-grained datasets. The results on the three fine-grained datasets are summarized in Table 3. Due to the results for [Huang et al., 2019] on the CUB-200 [Welinder et al., 2010] dataset is not provided, we leave them blank. It can be observed that our method achieves the best performance compared with both general and fine-grained-specific fewshot learning methods. Compared with the general few-shot learning methods, our method is 5.39%, 8.11% and 8.49% better than the second best under the 5-way 1-shot setting. The results compared with the fine-grained few-shot learning methods are similar, we obtain 7.67% improvements at least. The reason for these great improvements is that ATLNet can naturally tackle the major challenge of identifying and weighting the importance of the key parts [Sun et al., 2018]. The proposed method will not be fooled by the similar global geometry and appearances, and thus pay more attention to their subtle differences behind the key parts.
4.5 Ablation Study
To further verify the effectiveness of the proposed ATL-Net, we conduct ablation studies on miniImagenet, the results are reported in Table 4. We remove FΨ and FΓ from the network respectively to confirm that each part of the model is indispensable, and them both as the baseline for comparison. It can be observed that the main improvement comes from the adaptive threshold module FΓ, without it about 1.06% and 1.35% performance loss occurring. Intuitively, FΨ can somewhat alleviate the effects of an unsuitable threshold for a certain relation, by measuring in an adaptive subspace without harming the original features. In contrast, FΓ tries to directly assign an adaptive threshold, making it more effective than FΨ. However, FΓ still cannot handle all changeable cases, so both FΓ and FΨ are indispensable. Moreover, even for the TL-Net (i.e., ATL-Net without FΓ), we also obtain competitive results with only 0.13% and 0.47% lower than [Cai et al., 2018] and [Li et al., 2019a] under 5-way 1-shot and 5-shot settings, but much better than the other methods.
| Factor | 5-way 1-shot | 5-way 5-shot |
|---|---|---|
| (i) baseline | 50.94±0.79 | 65.16 ±0.72 |
| (ii) w/o FΓ (TL-Net) | 53.24±0.80 | 71.87 ±0.65 |
| (iii) w/o FΨ | 53.80±0.81 | 72.95±0.64 |
| ATL-Net (Ours) | 54.30±0.76 | 73.22±0.63 |
| Model | Params | 5-way 5-shot |
|---|---|---|
| Prototypical Net | 0.113M | 68.20 |
| Relation Net | 0.229M | 65.32 |
| GNN | 1.619M | 66.41 |
| DN4 | 0.113M | 71.02 |
| GCRw/o Hallucinator | 1.755M | 72.34 |
| ATL-Net (Ours) | 0.117M | 73.22 |

5 Discussion
5.1 Value-based v.s. Rank-based Selection
To verify the superiority of value-based selection than rankbased one [Li et al., 2019b], we replace the adaptive attention module by a k-NN selection, the peak and surrounding results under 5-way 5-shot setting are reported in the Figure 3. The results of the value-based selection are generally better than the results of the rank-based selection. Meanwhile, we observe that it's difficult for the rank-based method to select enough corresponding LRs without too much noise at the task-level. For example, the rank-based methods cannot select enough corresponding LRs for k = 3 or 8 , while the corresponding LRs contain numerous noise when k = 32 or 64.
5.2 Influence of the Threshold Vc
The results of the threshold Vc are reported in Figure 3, which shows that the choice of the threshold Vc has a mild impact on performance, and we observe that the performance degradation due to information loss is more severe than the noise introduced. To verify the importance of episodic attention's sparsity, we replace the hard attention by a soft attention. The result shows that the trivial relations, even with relatively small attention values, still greatly affect the distribution of episodic attention. Beyond that, the proposed adaptive episodic attention module FA outperforms 1.35% than the best result with a manual selection for Vc. Such a great improvement shows that the global manually set Vc can only achieve a suboptimal solution, but the adaptive threshold V ∗ c is more robust in complex situations.
5.3 Number of Trainable Parameters
We also compare the number of trainable parameters to verify the efficiency of the proposed ATL-Net, as the Table 5 shows. Since no other trainable parameters are introduced except for the embedding module FΘ, [Snell et al., 2017; Li et al., 2019b] become the most light-weight models. [Satorras and Estrach, 2018] adopts a larger embedding module (i.e., the filter number is 256), which draws a great contribution from the number of parameters. [Sung et al., 2018; Li et al., 2019a] adopt additional architectures to boost the result, which also introduce a huge number of trainable parameters. However, the proposed ATL-Net only introduces a small number of the trainable parameters, while achieves a better result than the methods above.
6 Conclusions
In this paper, we propose an Adaptive Task-aware Local Representation Network (ATL-Net) for few-shot learning, aiming to learn more discriminative local representations by taking a view of the entire task. Specifically, an adaptive episodic attention mechanism is designed to adaptively select the key semantic patches for a special task, without distracting attention by the common parts shared by most classes. Extensive experimental results on the benchmarks verify the effectiveness and superiority of the proposed ATL-Net.
Acknowledgements
This work is supported by National Key R&D Program of China (2018YFB1402600), NSFC (61806092) and Jiangsu Natural Science Foundation (No. BK20180326).
@inproceedings{ijcai2020p100,
title = {Learning Task-aware Local Representations for Few-shot Learning},
author = {Dong, Chuanqi and Li, Wenbin and Huo, Jing and Gu, Zheng and Gao, Yang},
booktitle = {Proceedings of the Twenty-Ninth International Joint Conference on
Artificial Intelligence, {IJCAI-20}},
publisher = {International Joint Conferences on Artificial Intelligence Organization},
editor = {Christian Bessiere},
pages = {716--722},
year = {2020},
month = {7},
note = {Main track},
doi = {10.24963/ijcai.2020/100},
url = {https://doi.org/10.24963/ijcai.2020/100},
}
TY - CPAPER TI - Learning Task-aware Local Representations for Few-shot Learning AU - Dong, Chuanqi AU - Li, Wenbin AU - Huo, Jing AU - Gu, Zheng AU - Gao, Yang T2 - Proceedings of the Twenty-Ninth International Joint Conference on Artificial Intelligence, IJCAI-20 PB - International Joint Conferences on Artificial Intelligence Organization PY - 2020 SP - 716 EP - 722 DO - 10.24963/ijcai.2020/100 UR - https://doi.org/10.24963/ijcai.2020/100 ER -Copied
Machine-readable versions of this paper, for tools and AI agents: