Transfer Learning by Learning Projections from Target to Source

. Using transfer learning to help in solving a new classiﬁcation task where labeled data is scarce is becoming popular. Numerous experiments with deep neural networks, where the representation learned on a source task is transferred to learn a target neural network, have shown the beneﬁts of the approach. This paper, similarly, deals with hypothesis transfer learning. However, it presents a new approach where, instead of transferring a representation, the source hypothesis is kept and this is a translation from the target domain to the source domain that is learned. In a way, a change of representation is learned. We show how this method performs very well on a classiﬁcation of time series task where the space of time series is changed between source and target.


Introduction
While transfer learning has a long history, dating back at least to the study of analogy reasoning, it has enjoyed a spectacular rise of interest in recent years, thanks largely to its use and effectiveness in learning new tasks with deep neural networks using an architecture learned on a source task. This approach is called Hypothesis Transfer Learning [6]. The justification for this strategy is that, in the absence of enough data in the target domain to learn anew a good hypothesis, it might be effective to transfer the intermediate representations learned on the source task. This is indeed the case, for instance, in face analysis when the source task is to guess the age of the person, and the target task is to recognize the gender. Technically, with neural networks, this amounts to keeping the first layers of the source neural network in the target network and learning only the last layers, the ones that combine intermediate representations of the examples in order to make a prediction.
Let X , Y and Z be the input, output and feature spaces respectively. Let F be a class of representation functions, where f ∈ F : X → Z. Let G be a class of decision functions that use descriptions of the examples in the feature space: g ∈ G : Z → Y. Then, in the context of deep neural networks, the hypothesis class is H := {h : ∃f ∈ F, g ∈ G st. h = g • f } and while f is kept (at least approximately) from the source problem to the target one, only g remains to be learned to solve the target problem.
In this paper, we adopt a dual perspective: we propose to keep the decision function g fixed, and learn translation functions from the target input space to the source input space, π : X T → X S , such that the target hypothesis space becomes H T := {h T : ∃π ∈ Π, f ∈ F, g ∈ G st. h T = g • f • π}, which, given that h S = g • f might be considered as the source hypothesis, may be re-expressed as: Indeed, for some problems, it might be much more easy to learn a translation (also called projections in this paper) from the target input space X T to the source input space X S than to learn a new target decision function. Furthermore, this allows one to tackle problems with different input spaces X S and X T .
In the following, Sect. 2 presents TransBoost a new algorithm for transfer learning. The theoretical analysis of Sect. 3 provides a PAC-learning bound on the generalization error on the target domain. Controlled experiments are described in Sect. 4 together with an analysis of the results. The new approach is put in perspective in Sect. 5 before we conclude in Sect. 6.

A New Algorithm for Transfer Learning
Suppose that we have a system that is able to recognize poppy fields in satellite images. We might imagine that knowing how to translate a biopsy image into a satellite image, we could, using the recognition function defined on satellite image, decide if there is cancerous cells in the biopsy.
Ideally then, one could translate a target query: "what is the label of x T ∈ X T " into a source query "what is the label of π(x T ) ∈ X S " where h S is the source hypothesis which, applied to π(x T ) ∈ X S , provides the answer we are looking for. Notice here that we suppose that Y S = Y T , but not X S = X T .
The goal is then to learn a good translation π : X T → X S . However, defining a proper space of candidate projections Π might be problematic, not to mention the risk of overfitting if the space of functions h S • Π has too high a capacity. It might be more easy and manageable to discover "weak projections" from X T to X S using a boosting learning scheme. Definition 1. A weak projection w.r.t. source decision function h S is a function π : X T → X S such that the decision function h S π(x T ) has better than random classification performance on the target training set S T .
In this setting, the training set S T = {(x T i , y T i )} 1≤i≤m is used to learn weak projections (Fig. 1).
Once the concept of weak projection is assumed, it is natural to use a boosting algorithm in order to learn a set of such weak projections and to combine them to get a final good classification on elements of T . This is what does the Fig. 1. The principle of prediction using TransBoost. A given target example x T i is projected in the source domain using a set of identified weak projections π j and the prediction for x T i is computed as: TransBoost algorithm (see Algorithm 1). It does rely on the property of the boosting algorithm to find and combine weak rules to get a strong(er) rule.

Theoretical Analysis
Here, we study the question: can we get guarantees about the performance of the learned decision function H T in the target space using TransBoost?
We tackle this question in two steps. First, we suppose that we learn a single projection function π ∈ Π : X T → X S so that h T = h S • π, and we find bounds on the generalization error on the target domain given the generalization error on the source domain. Second, we turn to the TransBoost algorithm in order to justify the use of a boosting approach.

Generalization Error Bounds When Using a Single Projection
For this analysis, we suppose the existence of a source input distribution P X S in addition to the target input distribution P X T . We consider the binary classification setting Y = {− 1, +1}, and we noteh S andh T respectively the source and the target labelling functions. We note R S (h) (resp. R T (h)) the risk of a hypothesis h on the source (resp. target) domain: . Let R S (h) and R T (h) be the corresponding empirical risks, with m S training points for S and m T training points for T . Let d H be the VC dimension of the hypothesis space H.
In the following, what is learned is a projection π ∈ Π : X T → X S in order to get a target hypothesis of the form h T = h S • π, where h S = ArgMin h∈H S R S (h) is the source hypothesis. Our aim is to upper-bound R T ( h T ), the risk of the learned hypothesis on the target domain in terms of:

Algorithm 1. Transfer learning by boosting
: the target training set Initialization of the distribution on the training set: D 1 (i) = 1/m for i = 1, . . . , m ; for n = 1, . . . , N do Find a projection π i : X T → X S st. h S (π i (·)) performs better than random on D n (S T ) ; Let ε n be the error rate of h S (π i (·)) on D n (S T ) : where Z n is a normalization factor chosen so that D n+1 be a distribution on S T ; end Output: the final target hypothesis H T : X T → Y T : -the empirical risk R S ( h S ) of the source hypothesis, -the generalization error of a hypothesis h S in H S learned from m S examples, which depends on d H S , -the generalization error of a hypothesis , -a term that expresses the "proximity" between the source and the target problems.
For the latter term, we adapt the theoretical study of McNamara and Balcan [9] on the transfer of representation in deep neural networks. We suppose that , h S and Π have the property: where ω : IR → IR is a non-decreasing function. Equation (2) means that the best target hypothesis expressed using the learned source hypothesis has a true risk bounded by a non-decreasing function of the true risk on the source domain of the learned source hypothesis.
We are now in position to get the desired theorem.

Theorem 1.
Let ω : IR → IR be a non-decreasing function. Suppose that P S , , h S and Π have the property given by Eq. (2 ). Let π := ArgMin π∈Π R T ( h S • π), be the best apparent projection. Then, with probability at least 1 − δ (δ ∈ (0, 1)) over pairs of training sets for tasks S and T : . With probability at least 1 − δ: This follows from the fact that [10] (p. 48) using m training points and a hypothesis class of VC dimension d, with probability at least 1 − δ, for all hypotheses h simultaneously, the true risk R(h) and empirical risk R(h) satisfy For h S • Π, this yields the first and third inequalities with probabilities at least 1 − δ/2. For H S , this yields the fifth inequality with probability at least 1 − δ/2. Applying the union bound archives the desired results. The second inequality follows from the definition of π, and the fourth inequality is where we inject our assumption about the transferability (or proximity) between the source and the target problem.
We can thus control the generalization error on the transfer domain by controlling d h S•Π , m S and ω which measures the link between the domain and the target domain. The number of target training data m T is typically supposed to be small in transfer learning and thus cannot be employed to control the error.

Boosting Projections from Target to Source
The above analysis bounds the generalization error of the learned target hypothesis h S • π in terms, among others, of the VC dimension of the space h S • Π. The problem of controlling the capacity of such a space of functions in order to prevent under or over-fitting is the same as in the traditional supervised learning setting. The difficulty lies in choosing the right space Π of projection functions from X T to X S .
The space of hypothesis functions considered is: where Π B is a space of weak projections satisfying definition (1). Now, from [11] (p. 109), the VC dimension of the space h S • Π B satisfies: can also be much less than d h S • Π , and theorem (1) provides tighter bounds.
Using the TransBoost method, we can thus gain both on the theoretical bounds on the generalization error and on the ease of finding an appropriate space of projections X T → X S .

The Main Dimensions of Experiments in Transfer Learning
There are two dimensions that can be expected to govern the efficiency of transfer learning: 1. The level of signal in the target data. 2. The relatedness between the source and the target domains.
Regarding the first dimension, one can expect that if there is no signal in the target data (i.e. the examples are labelled randomly), then no regularity can be extracted, directly or using transfer. In fact, only overfitting of the training data can potentially occur. If, on the contrary, the target learning task is easy, then there cannot be much advantage in using transfer learning. A question therefore arises as to whether there might be an optimal level of signal in the target data so as to maximally benefit from transfer learning.
The second dimension is tricky. Here, we intuitively expect that the closer the source and target domains (and problems), the more profitable transfer learning should be. However, how should we measure the "relatedness" of the source and target problems? In the domain adaptation setting, closeness can be measured through a measure of the divergence between the source distribution and the target one, since they are defined on the same input space. In transfer learning, the input spaces can be different, so that it is much more difficult to define a divergence between distributions. This is why we resorted to the function ω in our theoretical analysis. In our experiments, we control relatedness through the information shared between source and target (see below).

Experimental Setup
In our study, we devised an experimental setup that would allow us to control the two dimensions above.
In the target domain, the learning task is to classify time series of length t T into two classes: h T : IR t T → {− 1, +1}. By controlling the level of noise and the difference between the distributions governing the two classes, we can control the signal level, that is the difficulty of extracting information from the target training data. We control the amount of information by varying the size m T of the target training set.
Likewise, the source input space is the space of sequences of real measurements of length t S . Therefore, we have h S : IR t S → {− 1, +1}.
Varying |t S − t T | is a way of controlling the information potentially shared in the two domains. With t S = t T , the two input domains are the same.
Note that learning to classify times series is not a trivial task. It has many applications, some of them involving to classify time series of length different from the length for which exists a classifier.

Description of the Experiments
Time series were generated according to the following equation: The fact that the noise factor is generated according to a Gaussian distribution induces a distribution over the data (class ∈ {− 1, +1}). The level of signal in the training data is governed by: 1. the slope factor : the higher the value of the slope factor, the easier the discrimination between the two classes at each additional time step 2. the number of different shapes in each class of sequences, each shape controlled by ω i and φ j , and the importance of this factor in the equation being weighted by x max 3. the noise factor η(t) 4. the length of the time series, that is the number of measurements 5. the size of the training set In our experiments, the noise factor is generated according to a Gaussian distribution of mean = 0 and standard deviation in {0.001, 0.002, 0.02, 0.2, 1}. Figure 2 illustrates what can be obtained with slope = 0.01 with 3 subclasses in the +1 class, and 2 subclasses in the − 1 class. In the experiments reported here, we kept the size of the training set constant. In each experiment, 900 times series of length 200 were generated according to the equation described above: 450 times series in each class − 1 or +1. We varied the difficulty of learning by varying the slope from almost non existent: 0.001 to significant: 0.01. Similarly, we varied the length t T of the target training set in {20, 50, 70, 100} thus providing increasing levels of signal.
A target training data set of 300 time series was drawn equally balanced between the two classes. Note that this relatively small number corresponds to transfer learning scenarios where the training data is limited in the target domain. The remaining 600 time series were used as a test set. The source hypothesis was learned using the complete time series generated as explained above.
In these experiments, the set of projections Π was chosen as a set of "hinge functions", defined by three parameters, the slope of the first linear part, the time t where the hinge takes place, and the slope of the second linear part. The set is explored randomly by the algorithm and a projection is retained if its error rate on the current weighted data is lower than 0.45. We explored other, richer, spaces of projections without gaining superior performances. This simple set seems to be sufficient for this learning task.
In order to better assess the value of TransBoost, its performance was compared (1) to a classifier (Gaussian SVM as implemented in Scikit Learn) acting directly on the target training data, (2) to a boosting algorithm operating in the target domain with base classifiers being Gaussian SVMs, and (3) to a baseline transfer learning method that consists in finding a regression from the target input space to the source input space using a SVR regression. In this last method the regression acts as a translation from X T to X S and the class of an example x T is given by h S regression(x T ) . Table 1 provides representative examples of the results obtained. Each cell of the table shows the average performance (and the standard deviations) computed from 100 experiments repeated under the same conditions. The experimental conditions are organized according to the level of signal in the training data. In the experiments corresponding to this table, the source hypotheses were learned according to the first protocol defined above.
Several lessons can be drawn. First of all, in most situations, TransBoost brings very significant gains over learning without transfer or using transfer learning with regression. Figures 3 and 4 that sum up a larger set of experimental Table 1. Comparison of the error rate (lower is better) between: learning directly in the target domain (columns h T (train) and h T (test)), using TransBoost (columns H T (train) and H T (test)), learning in the source domain (column h S (test)) and, finally, mapping the time series with a SVR regression and using h S (na¨ıve transfer, column H ′ T (test)). Test errors are highlighted in the orange columns. Bold numbers indicate where TransBoost significantly dominates both learning without transfer and learning with na¨ıve transfer. conditions make this even more striking. In both tables, the x-axis reports the error rate obtained using TransBoost, while the y-axis reports the error rate of the competing algorithm: either the hypothesis h T learnt on the target training data alone (Fig. 3), or the hypothesis H ′ T learned on the target data projected on the source input space using a SVR regression (Fig. 4). The remarkable efficiency of TransBoost in a large spectrum of situations is readily apparent.
Secondly, as expected, Transboost is less dominant when either the data is so noisy that no method can learn from the data (high level of noise or low slope): this is apparent on the right part of the graphs 3 and 4 (near the diagonal), or when the task is so easy (large slope and/or low noise) that nothing can be gained from transfer learning (left part of the two graphs).
We did not report here the results obtained with boosting directly in the target input space X T since the learning performance was almost the same as the performance as the one of the SVM classifier. This shows that this is not boosting in itself that brings a gain.

Additional Experiments
We show here, in Figs. 5, 6 and 7 qualitative results obtained on the classical half-moon problem. It is apparent that Transboost brings satisfying results.

Comparison to Previous Works
In the theoretical analysis of Ben-David et al. [1,2], one central idea is that a common representation space should be found in which the projections of the source data {(x S i )} 1≤i≤m and of the target data {(x T i )} 1≤i≤m should be as undistinguishable as possible using discriminative functions from the hypothesis space H. The intuition is that if the domains become indistinguishable, a classifier constructed for the source domain should work also for the target domain. It has been at the core of many proposed methods so far [3,5,7,12].
In [8] a scenario in which multiple sources are available for a single target domain is studied. For each source i ∈ {1, . . . , k}, the input distribution D i is known as well as a hypothesis h i with loss bounded by ε on D i . It is further assumed that the target input distribution is a mixture of the k source distributions D i . The adaptation problem is thus seen as finding a combination of the hypotheses h i . It is shown that guarantees on the loss of the combined target hypothesis can be given for some forms of combinations. However, the authors do not show how to learn the parameters of these combinations. In [4], the authors present a system called TrAdaboost, which uses a boosting scheme to eliminate data points that seem irrelevant for the new task defined over the same space X . Despite the use of boosting, the scope is quite different from ours.
Finally, the authors in [6] study a scheme seemingly very close to ours. They define Hypothesis Transfer Learning algorithms as algorithms taking as input a training set in the target domain and a source hypothesis in the source domain, and producing a target hypothesis: One goal of the paper is to identify the effect of the source hypothesis on the generalization properties of A htl . However, the scope of the analysis is limited in several ways. First, it focusses on linear regression with the Regularized Least Square algorithm. Second, the formal framework necessitates that in fact X T = X S and Y T = Y S . It is thus more an analysis of domain adaptation than of transfer learning. Third, the transfer learning algorithm in effect tries to find a weight vector w T as close as possible to the source weight vector w S while fitting the target data set. There is therefore a parameter λ to set. More importantly, the consequence is that the analysis singles out the performance of the source hypothesis on the target domain as the most significant factor controlling the expected error on the target problem. Again, therefore, the target hypothesis cannot be much different from the source one, which seems to defeat the whole purpose of transfer learning.

Conclusion
This paper has presented a new transfer learning algorithm, TransBoost, that uses the boosting mechanism in an original way by selecting and combining weak projections from the target domain to the source domain. The algorithm inherits some nice features from boosting. There is only one parameter to set: the number of boosting steps, and guarantees on the training error an on the test error are easily derived from the ones obtained in the theory of boosting.
Open Access This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.
The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.