Adversarial Task Up-sampling for Meta-learning
Abstract
The success of meta-learning on existing benchmarks is predicated on the assumption that the distribution of meta-training tasks covers meta-testing tasks.
Frequent violation of the assumption in applications with either insufficient tasks or a very narrow meta-training task distribution leads to memorization or learner overfitting.
Recent solutions have pursued augmentation of meta-training tasks, while it is still an open question to generate both correct and sufficiently imaginary tasks.
In this paper, we seek an approach that up-samples meta-training tasks from the task representation via a task up-sampling network.
Besides, the resulting approach named
Adversarial Task Up-sampling (ATU) suffices to generate tasks that can maximally contribute to the latest meta-learner by maximizing an adversarial loss.
On fewshot sine regression and image classification datasets, we empirically validate the marked improvement of ATU over state-of-the-art task augmentation strategies in the meta-testing performance and also the quality of up-sampled tasks.
Introduction
The past few years have seen the burgeoning development of meta-learning, a.k.a. learning to learn, which draws upon the meta-knowledge learned from previous tasks (i e., meta-training tasks ) to expedite the learning of novel tasks (i e., meta-testing tasks ) with a few examples.
A sufficient number and diversity of meta-training tasks are pivotal for the generalization capability of the meta-knowledge, so that (1) they cover the true task distribution (i e., environment [4]) from which meta-testing tasks are sampled, discouraging learner overfitting [23] and (2) the meta-knowledge empowers fast adaptation via the support set for each task, avoiding memorization overfitting [44].
Notwithstanding up to millions of meta-training tasks in benchmark datasets [24, 31], real-world applications such as drug discovery [40] and medical image diagnosis [14] usually have access to only thousands or hundreds of tasks, which puts the meta-knowledge at high risk of learner and memorization overfitting.
While early attempts towards improving the generalization capability of the meta-knowledge revolve around regularization methods that limit the capacity of the meta-knowledge [11, 44], recent works on augmentation of meta-training tasks have shown a marked improvement [20, 40, 43].
The objective of task augmentation is to draw the empirical task distribution which is formed by assembling Dirac delta functions located in each meta-training task closer to the true task distribution.
Consequently, achieving this objective requires a qualified task augmentation approach to simultaneously possess the following three properties: (1) task-aware : the augmented tasks comply with the true task distribution, being not erroneous to lead the meta-knowledge astray (tasks A and B in Figure 1a); (2) task-imaginary : the augmented tasks cover a substantial portion of the true distribution, embracing task diversity which task-awareness is nonetheless inadequate to guarantee (tasks C, D, and E in
Figure 1b); (3) model-adaptive : the augmented tasks are timely in improving the current metaknowledge, to which the meta-knowledge before augmentation struggles to generalize (task F in
Figure 1c).
[Figure]
Unfortunately, developing such a qualified task augmentation approach remains challenging.
First, the task-aware methods sacrifice task diversity for task-awareness – they establish task-awareness by injection of the same random noise to labels of the support and query set [23], rotation of both support and query images [20], or mix-up of support and query examples within each task [40], all of which result in augmented tasks that are within the immediate vicinity of sampled meta-training tasks as shown in Figure 1a.
Second, the task-imaginary method [43] that mixes up both support examples of two distinct tasks and their query examples in the feature space compromises on task-awareness – the resulting examples are even multi-modal in Figure 1e and constitute an erroneous task that fails to comply with the task distribution.
Third, how to adaptively augment tasks that maximally improve the meta-knowledge and thereby the performance on meta-testing tasks remains unexplored.
To this end, we propose the Adversarial Task Up-sampling (ATU) framework to augment tasks that are aware of the task distribution, imaginary, and adaptive to the current meta-knowledge.
Grounded on gradient-based meta-learning algorithms that are generally applicable to either regression or classification problems, ATU takes the initialization of the base learner as the meta-knowledge.
Concretely, ATU consists of a task up-sampling network whose input is a task itself and outputs are augmented tasks.
To ensure that the augmented tasks are imaginary and meanwhile faithful to the underlying task distribution, we train the up-sampling network to minimize the Earth Mover
Distance between augmented tasks and the local task distribution characterized by a set of sampled tasks.
Besides, we enforce the up-sampling network to produce challenging tasks that complement the current initialization, by maximizing the loss of the model adapted from the initialization on their query examples and minimizing the similarity between the gradient of the initialization with respect to their support examples and that of their query examples.
In summary, our main contributions are three-fold: (1) we present the first task-level augmentation network that learns to generate tasks that simultaneously meet the qualifications of being taskaware, task-imaginary, and model-adaptive; (2) we provide a theoretical analysis to justify that the proposed ATU framework indeed promotes task-awareness; (3) we conduct comprehensive experiments covering both regression and classification problems and a total of five datasets, where the proposed ATU improves the generalization ability of gradient-based meta-learning algorithms by up to 3.81%.
Related Work
[Table]
As a paradigm that effectively adapts the meta-knowledge learned from past tasks to accelerate the learning of new ones, meta-learning has sparked considerable interest in many scenarios [38, 26, 36, 35], especially for few-shot learning.
It falls into four major strands based on what the meta-knowledge is, i.e., optimizer-based methods [3, 37], feed-forward methods [24, 10, 39], metric-based methods [27, 29, 33] and gradient-based meth- ods [9, 15, 42, 12, 6], where the inner optimizer, the mapping function from the support set to the task-specific model, the distance metric measuring the similarity between samples, and the parameter initialization are formulated as the meta-knowledge that enables quick adaptation to a task within a small number of steps.
Our method is primarily evaluated on gradient-based methods which enjoy wide adoption and applicability in either classification or regression problems.
Within-task Overfitting.
Few-shot learning puts meta-learning, especially gradient-based methods which require optimization of high-dimensional parameters within each task, at risk of within-task overfitting.
Some works tackle the problem with various ways of reducing the number of parameters to adapt in the inner loop: only updating the head [22] or the feature extractor [21], learning datadependent latent generative embeddings of parameters [25] or context parameters [48] to adapt, imposing gradient dropout [32], and generating stochastic input-dependent perturbations [13].
The other bunch of works alleviates the problem through data augmentation within each task.
Ni et al.
[20] applies standard augmentation like Random Crop and CutMix onto support samples.
Sun et al.
[28] and Zhang et al.
[47] proposed to generate more data within a class via a ball generator and generative adversarial networks, respectively.
These techniques designed for within-task overfitting, however, have been proved to lend little support to meta-overfitting which we focus on.
Meta-overfitting.
Distinguished from traditional overfitting within a task, two types of metaoverfitting including memorization and learner overfitting have been pinpointed in [44, 23].
Despite meta-regularization techniques [11, 44] that limit the capacity of the meta-learner, task augmentation strategies [23, 19, 20, 16, 43, 40] have emerged as more effective solutions to meta-overfitting.
Tablepresents a summary of these strategies, except the strategies of large rotation [16] being part of MetaMaxup [20] and DReCa [19] applicable to natural language inference tasks only.
MetaAug [23] augments a task by adding a random noise on labels of both support and query sets, and MetaMix [40] mixes support and query examples within a task.
Such within-task augmentation guarantees the validity of augmented tasks, i.e., being task-aware, though it almost does not alter the mapping from the support to the query set, i.e., generating limited imaginary tasks beyond meta-training tasks.
Meta-Maxup [20] and MLTI [43] approach this problem via the cross-task mixup method, unfavorably at the expense of erroneous tasks.
Our work seeks a novel task augmentation framework capable of generating tasks that not only meet the task-awareness and task-imagination needs but also adapt to maximally benefit the up-to-the-minute meta-learner.
Preliminaries 3.1 Meta-Learning Problem and Gradient-Based Meta-Learning
Meta-Learning model f are trained and evaluated on episodes of few-shot learning tasks.
Assume the task distribution is p ( T ) .
A few-shot learning task T i
i.i.d.
sampled from p ( T ) consists of a support set D si =
( X si , Y si )
= { ( x si,j , y si,j ) } K s j =1 and a query set D qi =
( X qi , Y qi ) =
{ ( x qi,j , y qi,j ) } K q j =1 , where
X si and Y si , ( X qi and Y qi ) are the collection of inputs and labels in support (query) set, and K s ( K q ) is the size of support (query) set.
The most representative gradient-based meta-learning algorithm is MAML [9].
MAML aims to learn an initialization parameter θ 0 of the model f
that can be adapted to any new task after a few steps of gradient update.
Concretely, given a specific task D si , D qi and a parametric model f θ , MAML initializes the model parameter θ by θ 0 and updates θ by performing gradient descent on the support set D si .
It then optimizes the initialization parameter θ 0 by minimizing the loss L estimated on the query set D qi .
The objective of MAML can be formulated as
[Equation]
3.2 Earth Mover’s Distance
To estimate the distance between two tasks, we use Earth-Mover Distance (EMD).
Earth-Mover
Distance, a.k.a.
Wasserstein metric, is a distance measure of two probability distributions or two sets of points, and is widely used in image retrieval and point cloud up-sampling works [46, 45].
Given two sets S 1 and S 2 with the same size, EMD calculates their distances as:
[Equation]
𝑇𝑇𝑇𝑇𝑇𝑇 3 Task Patch 𝓣𝓣 𝒑𝒑
Latent task manifold
Set Encoder
MetaLearner
Coarse Tasks 𝓣𝓣 𝒄𝒄
Ground-Truth Task 𝓣𝓣 𝒈𝒈 𝒉𝒉 𝒔𝒔 = 𝒈𝒈 𝒔𝒔 𝓣𝓣 𝒑𝒑 Patch Feature
Decoder 𝒈𝒈 𝒅𝒅 ( ⋅ )
Perturbations 𝓩𝓩 CoarseGenerator 𝒅𝒅 𝑬𝑬𝑬𝑬𝑬𝑬 ( 𝓣𝓣 𝒖𝒖𝒑𝒑 , 𝓣𝓣 𝒈𝒈 )
(EMD Loss) 𝟏𝟏 𝒯𝒯 𝒖𝒖𝒑𝒑 ∑ 𝑻𝑻 𝒊𝒊 ∈𝒯𝒯 𝒖𝒖𝒑𝒑 ℒ 𝒂𝒂𝒅𝒅𝒂𝒂 ( 𝑻𝑻 𝒊𝒊 ) (Adversarial Loss)
Up-sampled Task 𝓣𝓣 𝒖𝒖𝒑𝒑 ⋅⋅⋅ ⋅⋅⋅ 𝒈𝒈 𝒔𝒔 ( ⋅ ) 𝒈𝒈 𝒄𝒄 ( ⋅ )
Stage-I
Stage-II where ϕ is a bijective projection mapping S 1 to S 2 .
The value of EMD in (2) can be obtained by solving the linear programming problem w.r.t.
ϕ .
Adversarial Task Up-sampling
In practice, the task distribution p ( T ) is unknown and we optimize the meta parameter θ 0 with an empirical estimation of Eq.
(1) over of meta-training tasks { T i } N T i =1 as
[Equation]
Given a finite set of meta-training tasks, the empirical task distribution may deviate from the true task distribution.
The meta-model trained on such a finite set of tasks will cause memorization or learner overfitting [44, 23], which hurts the generalization to new tasks.
To alleviate this problem, we propose a new task up-sampling network to generate a sufficient number of diverse tasks such that the empirical task distribution formed by the original meta-training tasks and the augmented tasks together is closer to the true task distribution.
To achieve this, the tasks generated by the task up-sampling network should match the true task distribution and cover a large fraction of it.
However, since the true task distribution and its underlying manifold are unknown, we cannot provide the task up-sampling network with explicit information about it.
Instead, we generate new tasks by performing Task Up-sampling (TU) from a set of training tasks that implicitly comprise the latent task manifold information.
The idea of Task Up-sampling is inspired by point cloud up-sampling methods [46, 45], which generate up-sampled points lying on the latent distribution (i.e., the shape) of the given local point patch.
Similar to the point cloud up-sampling algorithm, our augmentation network receives a task patch consisting of a set of tasks T p
= { T i } N p
i
=1 where N p is the set size, and generates up-sampled tasks T up
= { ˆ D s , ˆ D q } that are uniformly distributed over the same underlying task distribution as the task patch.
Due to the high complexity of task generation, it is infeasible to directly generate up-sampling tasks without sacrificing the quality of the tasks.
Inspired by [46], we propose a two-stage generation strategy to generate the up-sampled tasks.
In the first stage, we produce a sparse set of tasks, aiming at recovering the global task distribution of the task patch.
The tasks obtained in the first stage are called coarse tasks.
In the second stage, we generate multiple tasks for each coarse task, aiming to characterize the local task distribution around each coarse task.
To guide the second generation stage, we use the patch features of the input task set as input to provide global task information and also multiple random noise vectors as input to provide directional perturbations to generate diverse tasks around the coarse task.
The generation process is summarized in Fig.
Our proposed task up-sampling network consists of 3 components, namely, a coarse task generator g c ( · ) , a set encoder g s ( · ) , and a decoder g d ( · ) .
The coarse task generator is similar to a set autoencoder.
It first encodes the information of the whole input task set and then decodes it to generate r c N p coarse tasks T c =
{ T ci } .
The set encoder, denoted by g s ( · ) , extracts the set information of the input task patch as a patch feature h s to provide global information in the second-stage generation.
For each task T ci in T c , the decoder g d ( · ) generates r d tasks located around T ci in the task manifold by taking as input r d random perturbations { z i } ri =1 that are i.i.d.
noise sampled from a uniform distribution and the set feature
h s as input.
In general, we use the same perturbations for each coarse task T ci in T c .
Finally, we obtain the up-sampled task set T up consisting of rN p tasks as
T up = g d ( T c , Z , h s ) , where r = r c × r d is the up-sampling ratio.
We denote the task augmentation network by G θ g ( T p , Z ) where θ g is the trainable parameters of the task augmentation network.
In each iteration of the training phase, we construct rN p tasks to form the ground truth tasks set T g (e.g., randomly select from the meta training task set).
Then we sample N p tasks from T g to form the task patch T p and randomly sample r perturbation noise vectors to form the perturbation set
Z = { z i } ri =1 .
By feeding T p and Z to the task augmentation network, we obtain the up-sampled task set T up =
G θ g ( T p , Z ) .
To train the task augmentation network, we apply EMD loss between the up-sampled task set T up and the ground-truth task set T g to encourage the generated task set to have the same distribution as the true task distribution.
However, it may still be insufficient to make the up-sampled tasks cover a significant fraction of the true task distribution.
In this case, the up-sampling tasks provide limited additional information compared with the original meta-training tasks, and thus the meta-learner has restricted benefit from the generated tasks.
To generate more informative tasks for the meta-learner, we want the generated tasks to be difficult for the current meta model θ 0 .
Following [41], we measure the difficulty of the a task for θ 0 by the loss estimated on query set w.r.t.
to ϕ i , i.e. L ( ϕ i , ˆ D qi ) , and the gradient similarity between the support and query sets w.r.t.
θ 0 , i.e. ⟨∇ θ
L ( θ 0 , ˆ D si ) , ∇ θ 0 L ( θ 0 , ˆ D qi ) ⟩ .
The large loss and small gradient similarity indicate a difficult task.
Therefore, we want to maximize the following objective function to generate informative tasks:
[Equation]
where η 1 and η 2 are two hyperparameters that control the strength of the two terms in L adv .
We call this loss adversarial loss because it aims to increase the difficulty of the up-sampling tasks for the meta-learner while the meta-learner is trained to minimize the loss on the generated difficult tasks.
And we named the proposed algorithm as Adversarial Task Up-sampling (ATU).
Together with the EMD loss, we obtain the objective to train the task up-sampling network:
[Equation]
Note that the gradient of Eq.
(5) will not be backpropagated to the meta model θ 0 and the meta model will be updated by minimizing the meta loss in Eq.
(3) on the up-sampled tasks T up .
We summarize the proposed ATU in Algorithm 1 in Appendix A.
4.1 ATU on Regression and Classification Problem
Before introducing the details of regression and classification tasks, let us first review the Eq.
(2), where S 1 and S 2 can be understood as the set of up-sampled tasks T up and the set of ground-truth tasks T g , respectively.
Each point s in either set represents the embedding of a task.
Regression Tasks.
We consider a simple regression problem: sinusoidal regression, which is widely used to evaluate the effectiveness of the meta-learning methods.
In sinusoidal regression problem, before feeding a task T i =
( D si , D qi ) to the task up-sampling network, we need to present the embedding of a sine regression task at first.
In this paper, we combine all samples of the support set and query set as the embedding of a sine regression task, i.e., s =
[ x s 1 , y s 1 , x s 2 , y s 2 , ..., x sK s , y sK s , x q 1 , y q 1 , x q 2 , y q 2 , ...,
x qK q , y qK q ] ∈ R 2( K s + K q ) , where we sort the support set and query set such that x s 1 ≤ x s 2 ≤ ... ≤ x sK s and x q 1 ≤ x q 2 ≤ ... ≤ x qK q .
This sorting could make the task input is invariant to the permutation of data in support and query sets and thus the extracted feature of each task is permutation-invariant, which simplifies the design of the task up-sampling network.
To generate the coarse tasks, we first use the set encoder g s ( · ) to extract the set feature h s and directly generate the coarse tasks from the set feature h s .
Then we generate the up-sampled tasks T up utilizing the decoder g d ( · ) with perturbations z .
Consequently, the dimension of generated tasks T up is ( rN p , 2( K s , K q )) , and that of ground truth tasks T g is also ( rN p , 2( K s , K q )) , where r is the up-sampling ratio and N p is the set size of a task patch.
For the regression problem, we add an extra EMD loss on the support and query set for each generated task ˆ T i ∈
T up to encourage the points in the generated support set and query set to follow the same sinusoidal distribution, and the objective is shown in Eq.
[Equation] ATU
[Equation]
ˆ
[Equation] i [Equation]
ˆ T
i ∈T up
L adv ( [Equation] si [Equation]
qi [Equation] (6) where ˆ T i = ( ˆ D si , ˆ D qi ) is obtained by transforming each of T up back to a support set and a query set.
Classification Tasks.
Dissimilar to regression tasks, classification tasks’ labels of each class are randomly given under the mutually-exclusive setting [44].
For example, for an N -way K s -shot classification problem with K q query samples for each class, the label y in episodic-based metatraining is a randomly chosen value from { 0 , 1 , ..., N − 1 } .
In light of the fact that the label y is not semantically meaningful, we only use the images x to represent the embedding of an N -way classification task.
Concretely, we reshape each task into a task pool of ( K s + K q ) tasks, each of which is N -way 1-shot and represented as s =
[ x 1 , x 2 , ..., x N ] ∈ R Nd where d is the dimension of each image.
Then, we can split the task into ( K s + K q ) N -way 1 -shot classification tasks without query examples.
We represent the task by concatenating the input from N classes in a fixed order (based on classes).
We treat the ( K s + K q ) tasks as a task patch and feed them to the task up-sampling network.
Since the task distribution of the image classification problem is extremely complex, it is impractical to generate the coarse tasks from a set feature.
Instead, we use the original tasks as the coarse tasks and generate the up-sampled tasks by a more informative perturbance around the original tasks.
To achieve this, we generate the perturbation by randomly sampling extra K M images from N different classes in the base set.
Then for the image x i in a class of a task in the coarse tasks T c , we subtract it from the K M images to obtain K M residual images and their corresponding set features (i.e., obtained from g s ( · ) ), concatenate the set features with a noise vector, and use an attention network to obtain a residual images feature x resi for the image x
i given K M residual images.
Finally, we generate the image as x ui = x i + x resi for the augmented task.
We repeat this process for all images in a coarse task to get an augmented task and apply the r noise vector to get r up-sampled tasks.
The dimension of generated tasks T up and ground truth tasks T g are both ( r ( K s + K q ) , Nd ) , where T g is obtained by mixing up with images in the memory bank.
The whole training objective function is
Eq.
More details of network structures and training details are shown in Appendix B.
Theoretical Analysis
We will introduce the formal definition of an up-sampled task that conforms to task-awareness, based on which we present the essential property of our proposed ATU framework in maximizing the task-awareness, compared to previous task augmentation approaches.
Definition 1 (Task-aware Up-sampling) .
Suppose that we are given a set of N p tasks { X i , Y i } N p
i = from which we up-sample a new task T up .
For each i -th task, its ground-truth parameter that map the input X i to the output Y
i is θ i , i.e., Y i =
f θ i
( X i ) .
The up-sampled task T up = { X u , Y u } is defined to be task-aware, if and only if θ u
= g ( θ 1 , · · · , θ N u ) and Y u
= f θ u ( X u ) where g is the up-sampling function and θ u is the up-sampled parameter.
This definition states two prerequisites a task-aware up-sampling has to meet: (1) the up-sampling is performed in the functional space, which is to relate N u parameters via g ; (2) the mapping between the input and the output of an up-sampled task satisfies f θ u .
Property 1 (Task-awareness Maximization) .
Consider N u = 2 , g ( θ 1 , θ 2 )
=
(1 − λ )
θ 1 + λθ 2 , f θ 1 ( · ) =
W 1 , and f θ 2 ( · )
=
W 2 .
The proposed ATU algorithm that pursues an up-sampled task
T up = { X u , Y u } via minimizing the EMD loss between T 1 and T 2 maximizes the task-awareness, i.e., minimizing the distance between Y u and f θ u ( X u ) .
Proof.
According to the definition of EMD (Eq.
, it solves: ϕ ∗ = arg min
ϕ ∈ Φ (cid:80) j
∥ x 1 ,j − x 2 ,ϕ ( j ) ∥ 2 , where Φ = {{ 1 , · · · , n 1 }(cid:55)→{ 1 , · · · ,n 2 }} denotes the set containing all possible bijective assignments, each of which gives one-to-one correspondence between T 1 and T 2 .
Based on the optimal assignments ϕ ∗ , the EMD is known to be defined as d EMD =
[Equation]
In light of the difficulty in mathematically formulating a possible up-sampled task ˜ T u that lies in the local manifold of { T 1 , T 2 } , we reasonably assume a simplified way of characterizing an up-sampled task
˜
T u to be ˜ y u,j = α T 1 ,j Y 1 + α T 2 ,j Y 2 , ˜ x u,j = α T 1 ,j X 1 + α T 2 ,j X 2 , ∀ j, where each sample is a convex combination of samples from both T 1 and T 2 .
The combination coefficients α 1 ,j , α 2 ,j ∈ R
( K s + K q ) × 1 ,
(cid:80) K s + K q k α 1 ,jk =1 , (cid:80) k
α 2 ,jk =1 , α 1 ,jk , α 2 ,jk ≥ 0 , ∀ k .
Different combination coefficients lead to a set of up-sampled task candidates { ˜ T u } .
We evaluate the task-awareness property of each candidate ˜ T u , i.e., the distance between ˜ Y u and f θ u ( ˜ X u ) , to be ∥
˜ Y u − f θ u ( ˜ X u ) ∥ 2 = (cid:80) j ∥ ˜ y u,j − f θ u (˜ x u,j ) ∥ 2 = (cid:80) j ∥ ( W 1 − W 2 )
[ λα T 1 ,j X 1 − (1 − λ )
α T 2 ,j X 2 ] ∥ 2 = LHS .
(See Appendix E.)
Note that LHS ≤ (cid:80) j ∥ W 1 − W 2 ∥ 2 ( λ ∥ ˜ x u,j − x 2 ,ϕ 2 ( j ) ∥ 2 + ∥ X 2 ∥ 2 ) and
LHS ≤ (cid:80) j ∥ W 1 −
W 2 ∥ 2 ((1 − λ )
∥ x 1 ,ϕ 1 ( j ) − ˜ x u,j ∥ 2 + ∥ X 1 ∥ 2 ) .
(See Appendix E.)
By combining the two inequalities above, we have
[Equation]
λ )
∥ λ x
[Equation]
− ˜ x u
[Equation]
∥ 2 + ∥ X 1 ∥ 2 } .
In practice, it is easy to normalize all the tasks in the feature space, which leads to ∥ X 1 ∥ 2 = ∥
X 2 ∥ 2 .
Therefore, by minimizing the EMD loss d EMD = min { min ϕ 2 (cid:80) j ∥ ˜ x u,j − x 2 ,ϕ 2 ( j ) ∥ 2 , min ϕ 1 (cid:80) j ∥ ˜ x u,j − x 1 ,ϕ 1 ( j ) ∥ 2 } , the proposed task upsampling network identifies from the candidate set { ˜ T u } the task T u that has the minimal distance between Y u and f θ u ( X u ) ; in other words, the task-awareness is maximized.
Previous task augmentation approaches directly mix up two tasks without minimizing the EMD loss, i.e., y u,j = (1 − λ )
y 1 ,j + λ y 2 ,j , x u,j =
(1 − λ ) x 1 ,j + λ x 2 ,j .
In this case, the task-awareness is unwarranted as we have illustrated in Section 1, provided that ∥ Y u − f θ u ( X u ) ∥ 2 = (cid:80) j
∥ (1 − λ )
y 1 ,j + λ y 2 ,j − [(1 − λ ) W 1 + λ W 2 ]
[(1 − λ ) x 1 ,j + λ x 2 ,j ] ∥ 2 = (cid:80) j λ 2 (1 − λ ) 2 ∥ ( W 1 − W 2 )( x 1 ,j − x 2 ,j ) ∥ 2 .
Experiments
To evaluate the effectiveness of ATU, we conduct extensive experiments to answer the following questions: Q1:
How does ATU perform compared to state-of-the-art task-augmentation-based and regularization meta-learning methods?
Q2:
Whether can the proposed ATU consistently improve performance for different meta-learning methods?
Q3:
What does up-sampled task by ATU looks like?
Q4:
What is the influence of increasing the task number within meta-training data on the performance improvement of ATU?
Benchmarks.
We compared ATU with state-of-the-art task augmentation strategies for meta-learning, including MetaAug [23], MetaMix [40], MetaMaxup [20], MLTI [43], and regularization methods, including MetaDropout [13], TAML [11], and
Meta-Reg [44]for both regression and classification problems.
We also consider a variant of ATU which removes the adversarial loss L adv and trains the task augmentation network only through the
EMD loss.
We denote this variant by TU.
To validate the consistent effect of ATU in improving different meta-learners, we apply ATU and AU on MAML [15], MetaSGD [15] and ANIL [22].
We also consider cross-domain settings where the meta-testing tasks are from different domains.
[Table]
[Table]
[Table]
Experimental Setup.
Following [15]
[Table]
we construct the K-shot regression task by sampling from the target sine curve y ( x ) =
Asin ( ωx + b )
[Table] where the amplitude A ∈ [ [Table] 1 , 5 . 0] , the frequency ω ∈ [0 . 8 , 1 . 2] , the phase b ∈ [0 , π ] and x is sampled from [ − 5 . 0 , 5 . 0] .
In the meta-training phase, each task contains K support and K target (K=10) examples.
We adopt mean squared error (MSE) as the loss function.
For the base model f θ , we adopt a small neural network, which consists of an input layer of size 1, 2 hidden layers of size 40 with ReLU and an output layer of size 1.
We use one
4    6XSSRUW4XHU\ (
[Figure]
4    0L[HG4XHU\6XSSRUW4XHU\ (b) MetaMix    4  6XSSRUW4XHU\ (c) TU    4  6XSSRUW4XHU\
[Figure]
gradient update with a fixed step size α = inner loop, and following [9, 15].
Moreover, the meta-learner is trained on 240,000 tasks with meta batch-size being 4.
In meta-testing stage , we randomly sample 100 sine curves as meta-test tasks, each task containing
K support samples and 100 query examples.
The data points x in query set are evenly distributed on [ − 5 . 0 , 5 . 0] .
The averaged MSE with 95 % confidence intervals upon these 100 sine curves with K=10, 20, 30 are reported in Table 2.
We also perform cross-domain experiments by sampling 100 sine curves which have different frequencies, amplitudes or phases from the tasks in meta-training set and report the results in Table 3.
More settings about the up-sampling networks are listed in Appendix C.
Performance.
The results in Table 2 and Table 3 show that ATU consistently outperforms the baseline methods MAML, MetaMix, and MLTI in different K-shot (K ∈ { 10 , 20 , 30 } ) settings and various domain settings.
These results validate that the tasks generated by ATU can better approximate the true task distribution and provide more information to the meta-learner than MetaMix and MLTI, thus enabling better generalization of the model.
We further verify the superiority of the proposed methods by visualizing the augmented tasks generated by the proposed methods and the baseline methods.
The visualization results in Fig.
3 show that the points in the tasks generated by TU and ATU fit the sine curve well, while the points in the tasks generated by MLTI and MetaMix deviate from the sine curve.
This indicates that augmented tasks generated by TU and ATU match the true task distribution.
It is noteworthy that the support set and query set generated by ATU differ significantly from those generated by TU, which indicates that the task generated by ATU is more difficult .
This, together with the results that ATU outperforms TU in most experiments, demonstrates the effectiveness of the adversarial losses in generating informative tasks to improve generalization of the meta-learner.
In Fig.
4, we also visualize the adaptation of meta-learner trained by different task augmentation methods for a 10-shot meta-test regression task.
Compared to the MAML trained on original meta-training tasks, the MAML trained on tasks generated by TU fits the ground-truth sinusoid after only one update.
And ATU performs even better than TU.
This again validates that the augmented tasks generated by TU and ATU are more informative for the meta-learner to learn the meta knowledge from the true task distribution.
[Figure]
6.2 Classification
Experimental setup.
We follow MLTI to evaluate the performance of task augmentation algorithms for few-shot classification problem with limited number of base classes in meta-training set under non-label-sharing settings.
We consider four datasets (base classes number): miniImagenet-S (12),
ISIC [18] (4), Dermnet-S (30), and Tabular Murris [5] (57) covering classification tasks on general natural images, medical images, and gene data.
Note that the miniImagenet-S and Dermnet-S are constructed by limiting the base classes of miniImangenet [33] and Dermnet [1], respectively.
We construct N -way K -shot tasks, setting N = 5 for miniImagenet-S, Derment-S, Tabular Murris and
N = 2 for ISIC dataset due to its limited number of base classes and setting K = 1 or K = 5 .
Recall that TAU relies on extra K M images to generate augmented tasks in image classification problem.
To make the training process more efficient, we set K M to 3 and the upsampling rate r be 2.
More details of these datasets and the settings of the task augmentation networks are listed in Appendix D.
[Table]
Performance.
We show the performance on the four datasets in Table 4.
On all four datasets, the proposed ATU consistently outperforms the baseline methods, including the augmentation-based methods (i
[Table]
e. MetaMix, Meta-Maxup and MLTI) and regularization-based methods (Meta-Reg,
TAML and Meta-Dropout).
And TU achieves the second best performance on all experiments.
We also observe that our method achieves a large improvement on the ISIC dataset which consists of only 4 base classes, indicating the effectiveness of our method in limited tasks scenarios.
We further evaluate the effectiveness of the proposed ATU on improving the generalization for different backbone meta-learner by conducting experiments under 1-shot setting to compare the performance of MLTI and ATU in improving the performance of the backbone meta-learner
MetaSGD and ANIL.
The results are presented in Table 5.
ATU again consistently outperforms
MLTI.
All these results validate the superiority of the proposed ATU and TU over the existing baselines in generating informative tasks to improve the performance of different backbone metalearners.
We also evaluate the performance of ATU in cross-domain adaptaion settings.
In Table 6, we present the results of the experiment that apply the meta-model trained on miniImageNet-S to Dermnet-S, and vice versa.
ATU improves the generalization performance of MAML (the backbone meta-learner in this experiment) by a large margin.
This indicates ATU can consistently improve the backbone meta-model’s generalization ability under the challenging cross-domain settings.
[Table]
[Figure] [Figure]
Effect of the number of meta-training tasks.
We conduct experiments to analyze the change in the performance improvement of ATU over MAML with the number of meta-training tasks in 1-shot and 5-shot settings.
The results presented in Fig.
5 show that ATU significantly improves the performance of MAML by about 4.5%-5% when the number of base classes is 12, while the improvement decreases with the number of base classes increasing on both 1-shot and 5-shot settings.
When the number of base classes increases, the number of training tasks increases rapidly and the empirical task distribution constructed from the meta-training tasks becomes closer and closer to the true latent task distribution.
Therefore, the extra information provided by tasks generated by
ATU becomes less.
However, even if all available base classes are used in the meta-training (i.e.,meta-training classes), our proposed ATU could still help to improve the performance of MAML.
Visualization of the generated tasks.
We visualize the up-sampled tasks by t-SNE to evaluate their generation quality for MAML under the 1-shot miniImagenet-S setting.
Concretely, we up-sample 100 tasks for 5 original tasks via ATU by using different perturbations for each task.
In order to visualize the relationship between generated tasks and original tasks using t-SNE, we represent each task by concatenating the vector of the support and query sets.
The results presented in Fig.
6 show that the up-sampled tasks stay near the original tasks, which means they are matching the true task distribution.
This indicates the generated tasks are task-aware.
Besides, we can observe that the augmented tasks are diverse and cover a substantial portion of the original tasks.
This demonstrates the task imaginary property of the augmented tasks.
These two observations suggest that the proposed
ATU is a qualified task augmentation algorithm.
6XSSRUW4XHU\
Effect of the extra d EMD ( ˆ D si , ˆ D qi ) in regression tasks.
As presented in Section 4.1, we propose to apply an extra
EMD loss d EMD ( ˆ D si , ˆ D qi ) on the support and query set for each generated task to encourage the points in the generated support set and the query set to follow the same sine curve.
In Fig.
3, we have visualized the tasks generated by the Task
Up-sampling Network trained with the extra EMD loss.
Here we provide additional visualization result for tasks generated by the Task Up-sampling Network trained without the extra
EMD loss in Fig.
It can be seen that the support set and the query set are not on the same sinusoid, indicating that the generated tasks need additional supervision to avoid them being too difficult or not even valid tasks.
Conclusion and Limitation
In this paper, we propose the first task-level up-sampling network that learns to generate tasks that simultaneously meet the qualifications of being task-aware, task-imaginary, and model-adaptive.
The proposed Adversarial Task Up-sampling (ATU) takes a set of tasks as input and learn to up-sample tasks complying with the true task distribution while being informative to improve the generalization of the meta-learner.
We theoretically justify that ATU promotes task-awareness and empirically verify that ATU improves the generalization of various backbone meta-learner for both regression and classification tasks on five datasets.
Limitations.
Our theoretical results are obtained under some strong assumptions, but all the experiments and visualization outcomes validate our method’s effectiveness in real settings.
Acknowledgement
This work is sponsored by the Tencent AI Lab Gift Fund (Project 9229073) and CityU Strategic
Interdisciplinary Research Grant (Project 7020064)x.
Checklist
The checklist follows the references.
Please read the checklist guidelines carefully for information on how to answer these questions.
For each question, change the default [TODO] to [Yes] , [No] , or [N/A] .
You are strongly encouraged to include a justification to your answer , either by referencing the appropriate section of your paper or providing a brief inline description.
For example:
• Did you include the license to the code and datasets?
[Yes] See Section ?? .
• Did you include the license to the code and datasets?
[No] The code and the data are proprietary.
• Did you include the license to the code and datasets?
[N/A]
Please do not modify the questions and only use the provided macros for your answers.
Note that the
Checklist section does not count towards the page limit.
In your paper, please delete this instructions block and only keep the Checklist section heading above along with the questions/answers below.
For all authors... (a) Do the main claims made in the abstract and introduction accurately reflect the paper’s contributions and scope?
[Yes] .
(b) Did you describe the limitations of your work?
[Yes] .
See Section(c)
Did you discuss any potential negative societal impacts of your work?
[N/A] (d) Have you read the ethics review guidelines and ensured that your paper conforms to them?
[Yes] . 2.
If you are including theoretical results... (a) Did you state the full set of assumptions of all theoretical results?
[Yes] .
See Section(b)
Did you include complete proofs of all theoretical results?
[Yes] .
See Section3.
If you ran experiments... (a) Did you include the code, data, and instructions needed to reproduce the main experimental results (either in the supplemental material or as a URL)?
[Yes] .
We exploit the open-source datasets and will release the code.
(b) Did you specify all the training details (e.g., data splits, hyperparameters, how they were chosen)?[Yes] .
See Section 6.2 and Appendix C/D. (c) Did you report error bars (e.g., with respect to the random seed after running experiments multiple times)?[Yes] .
See Section 6.2.
(d) Did you include the total amount of compute and the type of resources used (e.g., type of GPUs, internal cluster, or cloud provider)?
[Yes] .
See Appendix. 4.
If you are using existing assets (e.g., code, data, models) or curating/releasing new assets... (a) If your work uses existing assets, did you cite the creators?[Yes] .
See Section 6.2.
(b) Did you mention the license of the assets?[N/A] .
(c) Did you include any new assets either in the supplemental material or as a URL?
[No] (d) Did you discuss whether
and how consent was obtained from people whose data you’re using/curating?
[N/A] .
(e) Did you discuss whether the data you are using/curating contains personally identifiable information or offensive content?
[N/A] .
If you used crowdsourcing or conducted research with human subjects... (a) Did you include the full text of instructions given to participants and screenshots, if applicable?
[N/A] .
(b) Did you describe any potential participant risks, with links to Institutional Review Board (IRB) approvals, if applicable?
[N/A] .
(c) Did you include the estimated hourly wage paid to participants and the total amount spent on participant compensation?
[N/A] .
A Pseudo-codes
We present the pseudo-codes for the task upsampling network g ( · ) (Algorithm 1), and the metatraining algorithm for the regression task (Algorithm 2) and the classification task (Algorithm 3) in 1-step MAML with ATU.
For regression task, we randomly sample a batch of tasks as the groundtruth task set T g and construct the task patch by down-sampling (FPS sampling).
For classification tasks, we construct ( K s + K q ) tasks in one shot to obtain a task patch from a K s -shot classification task with K q query samples.
We assume the local task distribution to be smooth, and construct the ground-truth tasks by perform mixup for each image in each task with a nearest image in K M images.
We name the set of K M images by memory bank and denote it by I M .
The K M images are randomly sampled from classes different from those in the input tasks.
It worth note that ATU is only applied in the meta-training phase and, therefore, the meta-testing phase remains the same as the original 1-step MAML.
It is direct to extend 1-step MAML to multi-step MAML and extend MAML to ANIL,
Meta-SGD without modifying ATU.
batch size size
1: Randomly initialize the parameters θ 0 of the meta-model.
2: while not converge do 3:
Randomly sample a batch of tasks as T g with batch size rN p 4:
Perform down-sampling (FPS sampling) on T g to construct the local task patch T p 5:
Generate the augmented task set through our Task Up-sampling Network as T up =
g ( T p ) 6:
Randomly split the up-sampled task set T up into n batches {T batch } , each with B tasks (i.e., n = |T up | /B )
7: for each task batch T batch in T up do 8: for each task T i ∈ T batch do 9:
Perform inner-loop update of MAML as ϕ i = θ 0 − α ∇ θ 0 L ( f θ 0 , D si ) 10: end for 11:
Calculate L ( f ϕ i , D qi ) and L adv ( θ 0 , D si , D qi ) 12:
Update the meta-model parameter θ 0 as θ 0 ← θ 0 − β 1 B (cid:80) ni
=1 ∇ θ 0 L ( f ϕ i , D qi ) 13: end for 14:
Calculate the objective function in Eq.
(6) and perform backpropagation to update the Task
Up-sampling Network 15: end while
B Network Architecture of the Task Up-sampling Network
In this section, we provide the network architectures for the Task Up-sampling Network for both regression and classification tasks.
As shown in Fig.
8, the set encoder g s ( · ) of the Task Up-Sampling
Network for regression tasks consists of 2 convolution layers followed by a max-pooling layer to extract the permutation-invariant feature for the input task patch.
The dimension of the set feature is 1024 .
The coarse task generator g c ( · ) consists of a set encoder to extract the set feature for the input patch, followed by 3 linear layers to generate coarse tasks from the set feature.
The set encoder in coarse generator is the same as g s ( · ) .
The output of the last layers is reshaped into r c N p coarse tasks.
By concatenating the coarse task and a r d -dimension noise vector, we obtain the input of the
Require: distribution over meta-training tasks p ( T ) ; inner-loop and outer-loop learning rates α, β ; hyperparameters η 1 , η 2 in Eq.
(4); batch size of tasks B ; task patch size N p ; Beta distribution
Beta ( δ 1 , δ 2 ) ; up-sampling ratio r ( r = r c × r d , r c = 1 ) 1: Randomly initialize the parameters θ 0 of the meta model 2: while not converge do 3:
Randomly sample a batch of tasks T batch with B tasks.
4: for each task T i ∈ T batch do 5:
Reshape T i as the task patch T p 6:
Randomly sample extra K M images which consists of images not belong to any class in T i 7:
Construct the T g =
( ˆ C 0 , ..., ˆ C N ) :
Sample λ ∼ Beta ( δ 1 , δ 2 ) .
For the image in each class
C j in T i , generate a new image as ˆ C j = λ × C j
+ (1 − λ )
× X j , where X j is the nearest image (measured by euclidean distance) to the image in the class C j .
Generate up-sampling task set through Task Up-sampling Network as T up =
g ( T p ) 9:
Randomly sample one task
ˆ T
i from T up 10:
Perform inner-loop update of MAML as ϕ i = θ 0 − α ∇ θ 0 L ( f θ 0 , ˆ D si ) 11: end for 12:
Calculate L ( f ϕ i , D q i ) and L adv ( θ 0 , D s i , D q i ) 13:
Update the meta model parameter θ 0 as θ 0 ← θ 0 − β 1 B (cid:80) ni
=1 ∇ θ 0 L ( f ϕ i , ˆ D qi ) 14:
Calculate the objective function in Eq.
(5) and perform backpropagation to update the Task
Up-sampling Network 15: end while
I npu t
S e t F e a t u re
C o n c a t Noise
O u t pu t C o n v 512 R e L U C o n v 512 R e L U C o n v 𝐾𝐾 𝒈𝒈 𝒄𝒄 ( ⋅ ) 𝒈𝒈 𝒔𝒔 ( ⋅ ) 𝒈𝒈 𝒅𝒅 ( ⋅ )
C o n v 128 R e L U C o n v
C o n v 512 R e L U C o n v 1024 M ax P oo li n g
M ax P oo li n g (Shared weights)
Stage-II
Stage-I
L i n e a r L i n e a r
R e L U
R e L U L i n e a r 𝑟𝑟 𝑐𝑐 𝐾𝐾
C oa r s e T a s k
C o n v 128 R e L U C o n v
C o n v 512 R e L U C o n v 1024 M ax P oo li n g
M ax P oo li n g decoder g d ( · ) .
The decoder consists of 3 convolution layers.
We then use the output of the last layer as residual added to the coarse tasks to obtain the up-sampling tasks.
The network structure of Task Up-sampling Network for classification tasks is presented in Fig.
We directly use the input task patch as the coarse tasks and, therefore, the coarse task generator g c ( · ) is an identity function.
The set encoder g s ( · ) consists of 2 convolution layers, each followed by a
Batch Norm layer.
We use the K M images in the memory bank as the perturbation, concatenating with a ( N p × K M ) -dimension noise vector to obtain the input to the decoder.
The decoder consists of a attention module and a mapping module.
The attention module is constructed by 3 convolution layers, followed by 3 linear layers.
The attention block generates the attention scores.
The mapping module, which consists of 3 convolution layers with xxx filters, maps the K M perturbation to K M residual features.
We perform weighted sum of the K M residual features with the attention scores to generate r final residual features and add them to the coarse tasks to obtain the up-sampling 1-shot tasks.
We then construct r augmented tasks
C Setups and Additional Experiment Results for Regression Tasks C.1 Setups of Hyperparameter
The hyperparameters of the ATU are listed in Table 8.
I npu t
C oa r s e T a s k 𝑲𝑲 𝑴𝑴 I m ag e s
3 ✖ 3 C o n v
B a t c h N o r m 3 ✖ 3 C o n v
B a t c h N o r m
C o n c a t
S e t F e a t u re
Noise 3 ✖ 3 C o n v
B a t c h N o r m c 3 ✖ 3 C o n v B a t c h N o r m 3 ✖ 3 C o n v
L i n e a r
L i n e a r 64 L i n e a r3 ✖ 3 C o n v
B a t c h N o r m 3 ✖ 3 C o n v B a t c h N o r m 3 ✖ 3 C o n v
O u t pu t
Attention
Stage-II
-I
[Figure]
C.2 Effect of Augmentation Ratio
In the regression task, we assume the combination of the augmented and original tasks will better approximate the real task distribution and, therefore, update the meta-model not only with the augmented tasks generated by the Task Up-sampled Network, but also with the original meta-training tasks.
We define the augmentation ratio as the proportion of augmented tasks among all the tasks.
Note that the experiment results shown in Table 2 are obtained by setting the augmented ratio as 0 .
We present the results with other ratios in Table 7.
It can be observed that the performance with positive ratio is better than the performance with ratio = 0 , which means the meta-model is trained without augmented tasks.
These results indicates that the augmented tasks are more informative than the original tasks in training a better meta-model.
[Table] [Table]
D Setups and Additional Experiment Results for Classification Tasks D.1 Introduction and Hyperparameters of the Four Datasets
We provide the detailed information of the datasets and hyperparameters of the classification tasks for obtaining the results in Tabel 4 in this section.
We construct the 4 datasets following the settings in MLTI [43].
miniImagenet-S.
Compared with miniImagenet, miniImagenet-S has fewer meta-training classes so as to limit the task number.
The specific meta-training classes of miniImagenet-S include: n03017168, n07697537, n02108915, n02113712, n02120079, n04509417,n02089867, n03888605, n04258138, n03347037, n02606052, n
We use four convolutional blocks and a classifier as the base learner [43, 9], and each convolutional block contains a convolutional layer, a batch normalization layer and a ReLU activation layer.
In order to analyze the effect of the number of meta-training tasks, we add more classes for meta-training according to the following sequence: n03476684, n02966193, n13133613, n03337140, n03220513, n03908618,n01532829, n04067472, n02074367, n03400231, n02108089, n01910747, n02747177, n02795169, n04389033, n04435653, n02111277, n02108551,n04443257, n02101006, n02823428, n03047690, n04275548, n04604644, n02091831, n01843383, n02165456, n03676483, n04243546, n03527444, n01770081, n02687172, n09246464, n03998194, n02105505, n01749939, n04251144, n07584110, n07747607, n04612504, n01558993, n03062245, n04296562, n04596742, n03838899, n02457408, n13054560, n03924679, n03854065, n01704323, n04515003, n
ISIC.
ISIC skin dataset [18] was provided by ISIC2018 Challenge, in which 7 disease classes and 10015 dermoscopic images are included.
Following [43, 14], Nevus, Malanoma, Benign Keratoses,
Basal Cell Carcinoma , the four categories with the largest number of images, are as meta-training classes; the rest Dermatofibroma, Pigmented Bowen’s, Benign Keratoses are as meta-testing classes.
We re-scale the size of each medical image to 84 × 84 × 3 and adopt the same 4-layer convolutional as the base model like miniImagenet-S.
DermNet-S. Dermnet-S are part of the public Dermnet Skin Disease Altas, in which 625 different fine-grained categories are included.
Dermnet-S chooses the top-30 classes for meta-training.
The concrete meta-training classes and meta-testing classes are:
• Meta-training classes: Seborrheic Keratoses Ruff, Herpes Zoster, Atopic Dermatitis Adult Phase, Psoriasis Chronic Plaque, Eczema Hand, Seborrheic Dermatitis, Keratoacanthoma, Lichen Planus, Epidermal Cyst, Eczema Nummular, Tinea (Ringworm) Versicolor, Tinea (Ringworm) Body, Lichen Simplex Chronicus, Scabies, Psoriasis Palms Soles, Malignant Melanoma, Candidiasis large Skin Folds, Pityriasis Rosea, Granuloma Annulare, Erythema Multiforme, Seborrheic Keratosis Irritated, Stasis Dermatitis and Ulcers, Distal Subungual Onychomycosis, Allergic Contact Dermatitis, Psoriasis, Molluscum Contagiosum, Acne Cystic, Perioral Dermatitis, Vasculitis, Eczema Fingertips.
• Meta-testing classes: Warts, Ichthyosis Sex Linked, Atypical Nevi, Venous Lake, Erythema Nodosum, Granulation Tissue, Basal Cell Carcinoma Face, Acne Closed Comedo, Scleroderma, Crest Syndrome, Ichthyosis Other Forms, Psoriasis
Inversus, Kaposi Sarcoma, Trauma, Polymorphous Light Eruption, Dermagraphism, Lichen Sclerosis Vulva,
Pseudomonas, Cutaneous Larva Migrans, Psoriasis Nails, Corns, Lichen Sclerosus Penis,
Staphylococcal Folliculitis, Chilblains Perniosis, Psoriasis Erythrodermic, Squamous Cell
Carcinoma Ear, Basal Cell Carcinoma Ear, Ichthyosis Dominant, Erythema Infectiosum, Actinic Keratosis Hand, Basal Cell Carcinoma Lid, Amyloidosis, Spiders, Erosio Interdigitalis
Blastomycetica, Scarlet Fever, Pompholyx, Melasma, Eczema Trunk Generalized, Metastasis,
Warts Cryotherapy, Nevus Spilus, Basal Cell Carcinoma Lip, Enterovirus, Pseudomonas
Cellulitis, Benign Familial Chronic Pemphigus, Pressure Urticaria, Halo Nevus, Pityriasis
Alba, Pemphigus Foliaceous, Cherry Angioma, Chapped Fissured Feet, Herpes Buttocks,
Ridging Beading.
Tabular Murris.
The Tabular Murris is a gene dataset (i.e., 2866-dim features) including 105,960 cells of 124 cell types extracted from 23 organs.
Following [43, 5], the concrete training/validation/testing split is:
• Meta-training classes: BAT, MAT,Limb Muscle, Trachea, Heart, Spleen, GAT, SCAT, Mammary Gland, Liver, Kidney, Bladder, Brain Myeloid, Brain Non-Myeloid, Diaphragm.
• Meta-validation classes: Skin, Lung, Thymus,
Aorta • Meta-testing organs: Large Intestine, Marrow, Pancreas, Tongue
Unlike the base model for the other 3 datasets, we use two fully connected blocks and a linear layer as the backbone network, where each fully connected block includes a linear layer, a batch normalization layer, a ReLu activation layer, and a dropout layer.
The dropout ratio and the feature channels of the linear layer are set 0.2, 64, which is the same as the settings of [43, 5].
For a fair comparison with MLTI, we adopt the same MetaMix strategy as MLTI to augment the query set for the four datasets.
We set the augmentation ratio as 1 in classification tasks and do not use the original sampled tasks in meta-training because we empirically find that ATU obtains better performance with higher augmentation ratio.
The other settings are the same with MLTI.
More details about the hyperparameters are listed in Table 9.
[Table] [Table]
[Table]
D.2 Ablation Study
Effect of K M .
As shown in Table
[Table]
the classification performance increases as the memory bank size K M increases.
But the performance gain is not very significant for a large K M .
Considering the training efficiency, we set K M = 3 in all classification experiments.
[Table]
Effect of η 1 , η 2 .
We choose different ( η 1 , η 2 ) to explore the sensitivity of model performance to adversarial loss weights.
It can be observed from the results in Table 11 that the adversarial loss weights have a large influence on the performance of the model and it achieves the best performance when setting η 1 = η 2 = 3 .
Effect of Augmented Task Generation Strategies.
Due to the high complexity of the classification tasks’ distribution, we assume its latent task distribution is smooth and construct the ground-truth task manifold T g via mixing all image in each class of T i with its corresponding nearest image in the memory bank (the sampled K M images) (see Algorithm 3).
Under this assumption, one naive method is to generate augmented tasks in the same way as the generation of ground-truth tasks where we can directly mix the images in the tasks with the K M images in the memory bank.
To verify the effectiveness and necessity of training a Task Up-sampling Network, we compare TU with 3 naive methods in Table 12: (1) Naive Baseline 1 :for each image of task
T i , we randomly choose one image in the memory bank to mix; (2) Naive Baseline 2 : for all images in a class of task
T i , we randomly choose one image in the memory bank to mix; (3) Naive Baseline 3 : for all images in a class of task
T i , we choose the nearest image in the memory bank to mix.
The Naive Baseline 3 is the method that we used to construct T g .
The results in Table 12 show that TU outperforms the other 3 baselines by a large margin.
TU outperforms Naive Baseline 3 because the tasks generated by TU match the local task distribution better than those generated by just mixing with the images in the memory bank.
Moreover, the tasks generated by TU is more diverse and informative.
Taking this into consideration, we set the augmentation ratio to be 1 and do not use the original tasks in the meta-training.
D.
3 Visualization of the generated Classification tasks of T p .
We visualize part of the images in a generated classification task in Fig.
The three images in the top row are the selected extra K M images and ˆ T 1 , ˆ T 2 , ˆ T 3 are three 5-way 1-shot tasks generated by
ATU.
[Figure]
[Table]
D.4 Complete Results with Confidence Interval
We list the complete results with 95% confidence interval in Table 14,15,13, which are corresponding to the Tabel 4, 5, 6 in Section 6.2.
E Proof of Property 1.
Property 1 (Task-awareness Maximization).
Consider N u = 2 , g ( θ 1 , θ 2 )
=
(1 − λ )
θ 1 + λθ 2 , f θ 1 ( · ) =
W 1 , and f θ 2 ( · )
=
W 2 .
The proposed ATU algorithm that pursues an up-sampled task
T u = { X u , Y u } via minimizing the EMD loss between T 1 and T 2 maximizes the task-awareness, i.e., minimizing the distance between Y u and f θ u ( X u ) .
Proof.
According to the definition of EMD (Eq.
, it solves: ϕ ∗ =
arg min
ϕ ∈ Φ (cid:80) j
∥ x 1 ,j − x 2 ,ϕ ( j ) ∥ 2 , where Φ = {{ 1 , · · · , n } (cid:55)→ { 1 , · · · , n }} denotes the set containing all possible bijective assignments, each of which gives one-to-one correspondence between T 1 and T 2 .
Based on the optimal assignments ϕ ∗ , the EMD is known to be defined as d EMD = 1 n (cid:80)
j ∥ x 1 ,j − x 2 ,ϕ ∗ ( j ) ∥ 2 .
In light of the difficulty in mathematically formulating a possible up-sampled task ˜ T u that lies in the local manifold of { T 1 , T 2 } , we reasonably assume a simplified way of characterizing an
[Table]
[Table]
12 ± 0.98% 47.03 ± 0.85% 77.23 ± 0.99% up-sampled task ˜
T u to be ˜ y u,j = α T 1 ,j Y 1 + α T 2 ,j Y 2 , ˜ x u,j = α T 1 ,j X 1 + α T 2 ,j X 2 , ∀ j, where each sample is a convex combination of samples from both T 1 from T 2 .
The combination coefficients α T 1 ,j , α T 2 ,j ∈ R ( K s + K q ) × 1 , (cid:80) K s + K q k α 1 ,jk = 1 , and (cid:80) K s
+ K q k α 2 ,
jk = 1 .
Different combination coefficients lead to a set of up-sampled task candidates { ˜ T u } .
We evaluate the task-awareness property of each candidate ˜ T u , i.e., the distance between ˜ Y u and f θ u ( ˜ X u ) , to be
[Equation]
Note that
[Equation]
where the last inequality follows the triangle inequality and the fact that 0 ≤ λ ≤ 1 .
Similarly, we have
[Equation]
In practice
[Equation]
it is easy to normalize all the tasks in the feature space, which leads to ∥ X 1 ∥ 2 = ∥
X 2 ∥
Therefore, by minimizing the EMD loss
[Equation]
the proposed task up-sampling network identifies from the candidate set { ˜ T u } the task T u that has the minimal distance between Y u and f θ u ( X u ) ; in other words, the task-awareness is maximized.
Previous task augmentation approaches directly mix up two tasks without minimizing the EMD loss,
i
[Equation]
e., y u,j = (1 − λ )
y 1 ,j + λ y 2 ,j , x u,j =
(1 − λ ) x 1 ,j + λ x 2 ,j .
In this case, the task-awareness is unwarranted as we have illustrated in Section 1, provided that ∥
Y u −
[Equation]
1 ,j + λ
[Equation] [Equation]
[Table] [Table]
[Table] [Table]
[Table] [Table]
F
More experiments under the cross-domain setting.
For a more detailed analysis of how the model behaves in a cross-domain setting
[Table]
we conduct more experiments meta-tested on meta-datasets
[Table]
as shown in Table 16, 17, 18, 19.
G Computational cost for the method
The tasks are generated on the fly during meta-training.
Our method includes two stages: (1) pretraining the augmentation network and (2) meta-training of the meta-learner and the augmentation network jointly.
For fair comparison with MAML which trains for 50k iterations, we pre-train the augmentation network for 10k iterations
[Table]
and meta-train for 40k iterations.
In summary
[Table]
our method’s (TU) computation cost is 1.65x of the vanilla MAML.
The breakdown of the computation cost is listed in Table 20.
H Experiments on the limited meta-datasets.
In order to further valid the effectiveness of the proposed method, we have conducted experiments to evaluate the three suggested baselines (including Baseline++ [7], RFS [30], and ProtoNet [27]) on the setting of limited tasks, and show the comparison results in Table 21.
We construct the dataset CUB-S,
Fungi-S, Aircraft-S, and Texture-S similarly to miniImagenet-S.
The details of their construction are listed as follows.
CUB-S. CUB [34] is a bird image dataset including 11,788 photos of 200 bird species.
In this paper, we randomly select 48 species with 60 images in each species.
We devide them into metatraining/meta-validation/meta-testing sets as 12/16/20 species.
• Meta-training classes: Savannah Sparrow, Dark eyed Junco, Black footed Albatross, Henslow Sparrow, Cape Glossy Starling, Black throated Sparrow, Northern Waterthrush, Hooded Warbler, Baltimore Oriole, Scarlet Tanager, Cerulean Warbler, Downy Woodpecker.
• Meta-validation classes: Mockingbird, Vermilion Flycatcher, Cape May Warbler, Prothonotary Warbler, White crowned Sparrow, Ovenbird, Pomarine Jaeger, Indigo Bunting, Blue winged Warbler, Chipping Sparrow, Horned Grebe, Fox Sparrow, Green Violetear, Nashville Warbler, Least Tern, Marsh Wren.
• Meta-testing classes:
Rose breasted Grosbeak, Nighthawk, Long tailed Jaeger, Bronzed Cowbird, California Gull, Ivory Gull, Northern Fulmar, Brown Pelican, Ring billed Gull, Great Grey Shrike, White breasted Nuthatch, Mourning Warbler, Sage Thrasher, Horned Puffin, Pied Kingfisher, Shiny Cowbird, Scott Oriole, Red eyed Vireo, Song Sparrow, Winter Wren.
[Table]
+
[Table]
Fungi-S. Fungi [2] dataset contains 1,500 wild mushroom species with over 100,000 fungi images.
We select the sepcies with greater than 150 images and then randomly choose 100 species
[Table]
where each species contains 150 images.
We split them into meta-training/meta-validation/meta-testing sets with 12/16/20 species.
• Meta-training classes: Suillus granulatus, Phaeolus schweinitzii, Cystoderma amianthinum, Pycnoporellus fulgens, Psathyrella candolleana, Meripilus giganteus, Phellinus pomaceus, Laccaria laccata, Laccaria proxima, Amanita excelsa, Ganoderma pfeifferi, Clitopilus prunulus.
• Meta-validation classes: Agaricus impudicus, Daedaleopsis confragosa, Fomitopsis pinicola, Cortinarius anserinus, Mucidula mucida, Trametes versicolor, Stropharia cyanea, Ramaria stricta, Radulomyces confluens, Gliophorus psittacinus, Psathyrella spadiceogrisea, Coprinopsis lagopus, Daedalea quercina, Amanita muscaria, Armillaria lutea, Vuilleminia comedens.
• Meta-testing classes:
Hygrocybe ceracea, Trametes hirsuta, Polyporus tuberaster, Lacrymaria lacrymabunda, Fistulina hepatica, Gymnopus dryophilus, Amanita rubescens, Fuscoporia ferrea, Craterellus undulatus, Tricholoma scalpturatum, Mycena pura, Russula depallens, Bjerkandera adusta, Trametes gibbosa, Tremella mesenterica, Cerioporus varius, Amanita fulva, Xylodon paradoxus, Cuphophyllus virgineus, Cortinarius flexipes.
Aircraft-S. Aircraft [17] is a fine-grained image dataset that contains 102 categories of aircraft.
We randomly choose 100 variants with 100 images in each variant and split them into meta-training/metavalidation/meta-testing with 12/16/20 categories respectively.
• Meta-training classes: MD-90, 737-600, A310, An-12, DR-400, Falcon-900, DC-3, Challenger-600, Fokker-70, Cessna-172, 747-400, ERJ-145.
• Meta-validation classes: 737-900, A340-600, 737-800, 737-400, L-1011, A330-200, Gulfstream-V, 737-500, A340-200, ATR-72, MD-11, CRJ-700, EMB-120, Fokker-100, DC-6, 737-700.
• Meta-testing classes: 707-320, PA-28, Cessna-208, F-A-18, DHC-8-300, ERJ-135, Tornado, BAE-146-200, A321, ATR-42, Saab-2000, Tu-134, Fokker-50, A380, MD-80, Gulfstream-IV, Yak-42, 747-100, 767-400, Embraer-Legacy-600.
Texture-S. Texture [8] dataset contains 47 classes with 5640 images in total, where each class has 120 images.
We randomly split them into meta-training/meta-validation/meta-testing with 12/7/ classes respectively.
• Meta-training classes: pitted, woven, crosshatched, crystalline, sprinkled, lacelike, bubbly, marbled, dotted, bumpy, striped, zigzagged.
• Meta-validation classes: wrinkled, grid, perforated, cobwebbed, honeycombed, cracked, blotchy.
• Meta-testing classes: fibrous, matted, scaly, chequered, flecked, paisley, braided, polkadotted, interlaced, meshed.