Meta-Learning with Domain Adaptation for Few-Shot Learning under Domain Shift

1 INTRODUCTION . Few-Shot Learning aims to learn a prediction model from very limited amount of labelled data ( Lake et al. , 2015 ) . Specifically , given a K−shot , N−class data for a classification task , the aim is to learn a multi-class classification model for N− classes , with K−labeled training examples for each class . Here K is usually a small number ( e.g . 1 , or 5 ) . Considered as one of the hallmarks of human intelligence ( Lake et al. , 2011 ) , this topic has received considerable interest in recent years ( Lake et al. , 2015 ; Koch et al. , 2015 ; Vinyals et al. , 2016 ; Finn et al. , 2017 ) . Modern techniques solve this problem through meta-learning , using an episodic learning paradigm . The main idea is to use a labeled training dataset to effectively acquire prior knowledge , such that this knowledge can be transferred to novel tasks where few-shot learning is to be performed . Different from traditional transfer learning ( Pan et al. , 2010 ; Yosinski et al. , 2014 ) , here few-shot tasks are simulated using the labeled training data through episodes , in order to acquire prior knowledge that is specifically tailored for performing few-shot tasks . For example , given a set of labeled training data with a finite label space Ytrain , the epsiodic paradigm is used to acquire prior knowledge which is stored in a model . Each episode is generated i.i.d from an unknown task distribution τtrain . This model is then used to do a novel few shot classification task which is drawn from an unknown task distribution τtest . The test task comprises small amount of labeled data with a finite label space Ytest , and the sets Ytrain and Ytest are ( possibly ) mutually exclusive . Using this labeled data , and acquired prior knowledge , the goal is to predict the labels of all unlabeled instances in the test task . A very restrictive assumption of existing meta-learning approaches for few-shot learning is that train and test tasks are drawn from the same distribution , i.e. , τtrain = τtest . In this scenario , the metalearner ’ s objective is to minimize its expected loss over the tasks drawn from the task distribution τtrain . This assumption prohibits the use of meta-learning strategies for real-world applications , where training tasks with ample labeled data , and drawn from the same distribution as the test tasks are very unlikely to be available . Consider the case of a researcher or practitioner who wishes to train a prediction model for their own dataset where labeled data is very limited . It is unreasonable to assume that they would have a large corpus of labeled data for a set of related tasks in the same domain . Without this , they are not able to train effective few-shot models for their task . A more desirable option is to use the training tasks where ample training data is available , and adapt the model to be effective on test tasks in a different domain . A possible way to tackle this problem could be through the use of domain adaptation techniques ( Ganin et al. , 2016 ; Hoffman et al. , 2018 ) that address the domain shift between the training and test data . However , all of these approaches address the single-task scenario , i.e. , Ytrain = Ytest , where the training data and test data are sampled from the same task but there is a domain shift at a data-level . This is in contrast to the meta-learning setting where the training data contains multiple tasks and the goal is to learn new tasks from test data , i.e. , domain shift exists at a task-level and Ytrain ∩ Ytest = ∅ . As a result , these domain adaptation approaches can not be directly applied . We show an overview of different problem settings in Table 1 . In order to solve the few-shot learning problem under a domain shift we propose a novel meta-learning paradigm : Meta-Learning with Domain Adaptation ( MLDA ) . Existing meta-learning approaches for few-shot learning use only the given training data to learn a model , and as a result they do not account for any domain shift between the training tasks and the few-shot test tasks . In contrast , we assume that the model has access to the unlabeled instances in the domain of the few-shot test tasks prior to the training procedure , and utilize these instances for incorporating the domain-shift information . We train the model under the episodic-learning paradigm , but in each episode we aim to train a model which achieves two goals : first the model should be good at few-shot learning , and second the model should be unaffected by a possible domain shift . The first goal is achieved by updating the model based on the few-shot learning loss suffered by the model for a given episode . The second goal is achieved by an adversarial domain adaptation approach , where a mapping is used which styles the training task to resemble the test task . In this way , the trained model can perform few-shot predictions on the test tasks , and achieve what we term task-level domain adaptation . The episodic update is done via Prototypical Networks ( Snell et al. , 2017 ) ( as a specific instantiation , though other approaches can be applied ) , where on a simulated few-shot task ( a small support set behaves as training , and a query set behaves as test data ) , an embedding is produced for both support and query instances . The mean of support embedding of each class is the prototype , and query instances are labeled based on their distance to these prototypes . Based on the loss on these query instances , the embedding function is updated . For achieving invariance to domain shift , we follow the principle of adversarial domain adaptation , but we differ from the traditional approaches in that we are performing task-level domain adaptation , whereas they performed data-level domain adaptation . The early approaches to adversarial domain adaptation aimed at obtaining a feature embedding that was invariant to both the training domain and the test domain , as well as learning a prediction model in the training domain ( Ganin et al. , 2016 ) . However , these approaches possibly learnt a highly unconstrained feature embedding ( particularly when the embedding was very high dimensional ) , and were outperformed by GAN-based approaches ( often used for image translation ) ( Taigman et al. , 2017 ; Zhu et al. , 2017 ; Hoffman et al. , 2018 ) . As a result we use a mapping function to style the training tasks to resemble test tasks , and optimize it using a GAN loss . The overall framework delivers a model that uses training tasks from one distribution to meta-learn a few-shot model for a task from another distribution . We perform extensive experiments to show the efficacy of the proposed method . 2 RELATED WORK . 2.1 META-LEARNING FOR FEW-SHOT LEARNING . Few-Shot Learning refers to learning a prediction model from small amount of labeled data ( Fei-Fei et al. , 2006 ; Lake et al. , 2011 ) . Early approaches used a Bayesian model ( Fei-Fei et al. , 2006 ) , or hand-designed priors ( Lake et al. , 2015 ) . More recently , meta-learning approaches have become extremely successful for addressing few-shot learning ( Vinyals et al. , 2016 ; Finn et al. , 2017 ) . Instead of training a model directly on the few-shot data , meta-learning approaches use a corpus of labeled data , and simulate few-shot tasks on them to learn how to do few-shot learning . Some approaches follow the non-parametric principle , and develop a differentiable K−nearest neighbour solution ( Vinyals et al. , 2016 ; Shyam et al. , 2017 ; Snell et al. , 2017 ) . The main concept is to learn an embedding space that is tailored for performing effective K-nearest neighbour . Oreshkin et al . ( 2018 ) extend these approaches with metric scaling to condition the embedding based on the given task . Another category of meta-learning aims to learn how to quickly adapt a model in few gradient steps for a few-shot learning task ( Finn et al. , 2017 ; Ravi & Larochelle , 2017 ; Li et al. , 2017 ) . These optimization based approaches aim to learn an initialization from a set of training tasks , which can be quickly adapted ( e.g . one-step gradient update ) when presented with a novel few-shot task . Some other approaches consider using a `` memory '' -based approach ( Santoro et al. , 2016 ; Munkhdalai & Yu , 2017 ) . There have also been approaches that try to enhance meta-learning performance through use of additional information . For example , Ren et al . ( 2018 ) use unlabeled data to develop semi supervised few-shot learning . Zhou et al . ( 2018 ) use external data to generate concepts , and performs meta-learning in the concept space . However , all of these approaches assume that the training tasks and testing tasks are drawn from the same distribution ( τtrain = τtest ) . If there is a task-level domain shift , the above approaches will fail to perform few-shot learning on novel test tasks . Our approach of meta-learning with domain adaptation overcomes this domain shift , to perform few-shot learning on tasks in a different domain . 2.2 DOMAIN ADAPTATION . Domain adaptation has been studied extensively in recent years , particularly for computer vision applications ( Saenko et al. , 2010 ) . The idea is to exploit labeled data in one domain ( called source domain ) to perform a prediction task in another domain ( called the target domain ) , which does not have any labels ( unsupervised domain adaptation ) . Most approaches employed two objectives : one to learn a prediction model in the source domain , and second to find an embedding space between the two domains that achieves domain invariance , thus making the model trained on the source domain applicable to the task in the target domain . In the era of deep learning , some early approaches aimed to align feature distribution in some embedding space using statistical measures ( e.g . Maximum Mean Discrepancy ) ( Tzeng et al. , 2014 ; Long et al. , 2015 ) . This was followed by several successful efforts for domain adaptation using an adversarial loss ( Goodfellow et al. , 2014 ) . Ganin & Lempitsky ( 2015 ) ; Ganin et al . ( 2016 ) aimed to learn a feature embedding such that a domain classifier would not be able to distinguish whether the instance was drawn from the source or target domain . Consequent efforts tried to learn an embedding on the source data , from which an instance in the target domain could be reconstructed ( Ghifary et al. , 2016 ) . Tzeng et al . ( 2017 ) proposed to train a model in the source domain , and using a GAN loss try to embed the target domain to the same feature distribution ( using a GAN loss ) as the ( now fixed ) source domain . Another line of work using GAN-loss is for image-toimage translation , where images in one domain are mapped to appear like images in another domain ( Taigman et al. , 2017 ; Liu et al. , 2017 ) . Most of these approaches have demonstrated application to domain adaptation tasks as well . Another recently introduced concept is cycle consistency which first maps an instance from the source to target , and then maps this synthetic instance back to the source to get back to original instance ( Zhu et al. , 2017 ; Kim et al. , 2017 ; Yi et al. , 2017 ) , and this concept has been extended for domain adaptation as well ( Hoffman et al. , 2018 ) . All of these approaches aim to solve the same task in both domains ( i.e. , the label space is the same in both domains ) . They perform domain adaptation at the data-level ( and not the task level ) . This means that they can not solve a new task with a different label space . In contrast our approach performs a task-level domain adaptation , and can solve new tasks . There have been some efforts at the intersection of few-shot ( and meta-learning ) and domain adaptation . Motiian et al . ( 2017 ) consider supervised domain adaptation , which is similar to unsupervised domain adaptation setting , except that few labeled instances in the target domain are available . Like the previous approaches , it can not be used for a novel task with a different label space . Kang & Feng ( 2018 ) ’ s problem setting resembles traditional unsupervised domain adaptation , except that the model training is done using a meta-learning principle . Li et al . ( 2018 ) use meta-learning to address domain generalization where a single trained model for a given task , can be applied to any new domain with a different data distribution . They too consider solving the same task in a new domain , and do not consider the few-shot setting . A closely related work is Domain Adaptive Meta Learning ( Yu et al. , 2018 ) , but their problem setting is different ( which is more suitable for the problem they address : imitation learning ) from what we address in this paper . They consider the scenario where a task has training data drawn from one domain and test data drawn from another domain ( independent of whether it has been drawn from τtrain or τtest ) . Thus , they do not violate τtrain = τtest . In their simulated task , ample labeled training data is available for both the source and target domains . In contrast , we consider the scenario where the training tasks and test tasks are drawn from different distributions , and we have very limited labeled data for test tasks ( tasks in the target domain ) .

Summary: The authors consider the few-shot / meta-learning scenario in which the test set of interest is drawn from a different distribution from the training set. This scenario is well-motivated by the "researcher example" given throughout the paper. The authors assume access to a large unlabelled set in test (target) domain, and a large labelled (few-shot) set in the source domain. Thus, the paper is concerned with unsupervised version of the meta-learning problem under domain shift (i.e., a large amount of data unlabelled are available from the target domain).