Decomposition-Based Transfer Distance Metric Learning for Image Classification

Yong Luo, Tongliang Liu, Dacheng Tao, Chao Xu

I Introduction

The performance of computer vision, data mining and multimedia systems is heavily dependent on the distance metric between samples. For example, the simple kk-nearest neighbor (kkNN) classifier that uses a proper distance metric can be very competitive, and is sometimes superior to other well designed classifiers in many applications such as face recognition, image annotation, etc. In , the authors learn a distance metric for nearest neighbor classification so that the nearest neighbors tend to belong to the same class and the samples from different classes are separated by a large margin. The kkNN classifier based on the learned metric was shown to be comparable to the state-of-the-art multiclass support vector machine (SVM) in several applications including face recognition and text categorization. A weighted nearest neighbor model was proposed in for image annotation that learned a discriminative distance metric. This model was demonstrated empirically to significantly out-perform the state-of-the-art annotation methods on three challenge datasets. Actually, distance metric learning (DML)is also critical to many other popular algorithms, e.g., kk-means clustering and kernel machines such as SVM.

It is therefore essential to learn a robust distance metric to reveal the data relationships. To achieve this goal, we need a large amount of side information such as the constraints that indicate whether a pair of samples is similar or not. Real-world applications, e.g. image annotation , usually have few training samples in the instance space of the target learning task due to the high labeling cost. However, we can easily obtain a large number of labeled samples from the instance spaces of different, but related learning tasks, or from the same instance space with different distribution. Therefore, we can leverage the samples from the related tasks for the target task learning. This is known as transfer learning, and the related tasks are usually called source tasks. This article focuses on utilizing the large quantity of side information in the source tasks to discover a reliable distance metric for the target task.

A number of existing metric learning algorithms can be utilized to learn a useful distance metric for the source task with adequate training data. The training criterion is usually to minimize the distance between two samples if they are from the same class, and otherwise maximize their distance. However, directly applying the learned source metric to the target task may not result in good performance because it may be biased to the sample distribution of the source task, while the data distributions between the source task and target task maybe quite different. More sophisticated methods should therefore be developed to tackle the metric learning problem in the transfer scenario.

This paper proposes a decomposition-based method for transfer distance metric learning (DTDML) by assuming that the target metric (distance metric of the target task) lies in the space spanned by the eigenvectors of the source metrics, or other randomly generated bases. The target metric is represented as a combination of “base metrics” that are derived from the decomposition of the source metrics, or simply computed using the random bases. In particular, DTDML learns a sparse combination of the “base metrics” to construct the target metric by forcing the target metric to be close to an integration of the source metrics. The optimization is performed by alternating between the calculation of the “base metric” coefficients and source metric integration weights, and both of the two sub-problems can be solved efficiently.

Recent research on transfer metric learning includes the following. In , the target metric is learned by minimizing the log-determinant divergence between the source metrics and target metric. Zhang and Yeung proposed to learn the task relationships in transfer metric learning, and therefore, allow modeling of negative and zero transfer. These two methods are also optimized using the alternating strategy. However, in each iteration of their alternating procedures, both rely on direct estimation of the target metric and have a large number of d2d^{2} variables to be learned. Here, dd is the feature dimensionality, which is usually very high for an image, while in DTDML, the number of variables is only mdmd if we use the eigenvectors of mm source metrics to construct the ¡°base metrics¡±, and it is common for m≪dm\ll d. Therefore, we can obtain more reliable solutions, given the limited side information in the target task, and the optimization tends to be faster because we have far fewer variables to be estimated. We adopt Nesterov’s optimal method for optimization, so do not require costly semi-definite programming in the learning of the target metric, and have a rapid convergence rate. We performed extensive experiments on two popular handwritten image datasets and the challenge NUS-WIDE Web image dataset. The results confirmed the effectiveness and efficiency of DTDML.

The article is organized as follows. We summarize closely related works in Section II. Section 3 includes the description, formulation, and some theoretical analysis of the proposed DTDML. Extensive experiments are presented in Section 4 and we conclude this paper in Section 5.

II Related Work

The goal of distance metric learning (DML) is to learn an appropriate distance function for a given problem.DML is very important for many learning models, e.g., the kNN rule and SVMs. A popular categorization of the DML methods is: supervised DML and unsupervised DML , according to the underlying learning paradigm. There are also some semi-supervised works that combine these two paradigms . Our research is built on supervised metric learning, so we only review some representative works in this category.

A classical algorithm for supervised DML was presented in , where the authors proposed a constrained convex optimization problem for the metric learning. Relevant component analysis (RCA) utilizes the so-called chunklets to learn a metric by reducing the weights of irrelevant dimensions and amplifying the weights of the relevant dimensions. In , the relative comparison constraints that can be easily obtained using the query feedbacks were introduced for DML. The formulation is a quadratic programming problem, which was solved by adapting the standard SVM solver. Neighborhood component analysis (NCA) learns a metric that directly maximizes the nearest neighbor (NN) classification performance. This is achieved by optimizing the leave-one-out classification error on the training set with stochastic neighborhood selection. Large margin nearest neighbor (LMNN) is also based on NN classification, but using a large margin strategy. From the perspective of information theoretic, Davis et al. proposed to learn a Mahanobis matrix that is close to a given prior distance metric in the sense of differential relative entropy, and simultaneously satisfies the distance constraints s. In , an efficient online algorithm was presented for regularized DML, in which it was proved that the generalization error can be independent from the feature dimensionality if appropriate constraints are utilized.

II-B Transfer learning

Transfer learning aims to utilize the knowledge obtained from source domains to help the target domain learning, because the training samples in the target domain are insufficient to train a robust model. Dozens of transfer learning algorithms have been proposed in the literature and can be roughly grouped into homogeneous and heterogeneous transfers. The former refers to samples in target and source domains that are drawn from the same instance space but different distributions , and the latter refers to samples in target and source domains that are drawn from different, but related instance spaces . This research considers the homogeneous setting, and omits are view of the heterogeneous works.

According to , transfer learning can be grouped into instance transfer , feature representation transfer , parameter transfer and relational knowledge transfer , based on “what to transfer”. A kernel mean matching (KMM) method was presented in to match the data distribution of the target domain using the source domain samples. TrAdaboost extends AdaBoost to leverage the abundant source data for the target task learning by iteratively filtering out “bad” source data. Argyriou et al. presented a sparse representation based learning algorithm that learns (or selects) some common features shared across related tasks by using a L1L_{1}-norm regularizer. In , an unsupervised approach called self-taught learning was proposed to learn features for transfer from unlabeled data. Evgeniou and Pontil learned the parameters of the source and target task simultaneously by assuming the parameter for each task can be separated into two terms, one of which is shared between the source and target task. In , the relational knowledge represented with Markov logic networks (MLNs) was transferred from the source domain to the target domain by first constructing a predicate mapping, and then refining the mapped structure in the target domain. There are lots of other works on homogeneous and heterogeneous transfer learning, and we refer to for a more comprehensive survey.

Despite the proposal of many transfer learning algorithms, to the best of our knowledge, only two consider homogeneous distance metric transfer. Zha et al. developed two algorithms for learning a distance metric from a small number of training samples by transferring the prior knowledge from auxiliary data and using a large number of unlabeled samples. Zhang and Yeung proposed a convex formulation for transferring the metric by encoding task relationships in a task covariance matrix. This matrix models positive, negative and zero task correlations. Both algorithms perform well on some applications, but the proposed DTDML will outperform them due the reasons discussed above in Section I. Before presenting the proposed DTDML, we first present certain notations that are used throughout this paper.

III Decomposition based transfer distance metric learning

Similar to , our method is also built on the regularized DML (RDML) and we introduce it here. In DML, we intend to learn a distance function dst(xi,xj∣A)dst(x_{i},x_{j}|A) parameterized by a distance metric AA so that the similarity/dissimilarity between a new instance pair xix_{i} and xjx_{j} is reflected by comparing dst(xi,xj∣A)dst(x_{i},x_{j}|A) with a constant threshold cc. In particular, the regularized distance metric learning (RDML) needs to learn a metric AA by the use of the following optimization problem:

An online method was presented in to solve problem (1). However, when training data are limited, RDML performs poorly. Our decomposition based transfer distance metric learning (DTDML) method improves RDML by using training data from certain relevant source domains. As we know that, any metric AA can be decomposed as A=UΛUT=∑i=1dλiuiuiTA=U\Lambda U^{T}=\sum_{i=1}^{d}\lambda_{i}u_{i}u_{i}^{T}. This indicates that the optimal target metric can be represented as a linear combination of at most dd target “base metrics” Bi=uiuiTB_{i}=u_{i}u_{i}^{T}. However, the target base metrics are not available. We thus propose to approximate the target base metric by combining some base metrics derived from the source metrics. This approximation is reasonable since the source tasks are related to the target task. Actually, we can also approximate the target base metric using some randomly generated bases and the effectiveness will be demonstrated empirically in our experiments. The proposed target metric learning strategy is advantageous compared to the traditional transfer metric learning algorithm, since we have fewer variables to be learned and thus can obtain more reliable solutions.

The general formulation of the proposed DTDML for learning the target metric matrix AA is given by

where A=∑r=1nθrururTA=\sum_{r=1}^{n}\theta_{r}u_{r}u_{r}^{T}, and the integrated metric AS=∑p=1mαpApA_{S}=\sum_{p=1}^{m}\alpha_{p}A_{p}. The term ∥A−AS∥F2\|A-A_{S}\|_{F}^{2} is a measure of the difference between AA and ASA_{S}, which are expected to be close. Both ∥α∥22\|\alpha\|_{2}^{2} and ∥θ∥1\|\theta\|_{1} are used to control the model complexity. As depicted above, at most dd optimal base metrics are needed to construct the optimal target metric. In practice, most base metric combination coefficients λi\lambda_{i} are small and approximate to zero. Therefore, many input base metrics of the proposed model are redundant or noisy. We thus constraint the base metric coefficients θ\theta to be sparse in order to suppress noisy ; γA\gamma_{A}, γB\gamma_{B} and γC\gamma_{C} are positive trade-off parameters.

For notation simplicity, we denote xix_{i}, xjx_{j} and yijy_{ij} as xk1x_{k}^{1}, xk2x_{k}^{2} and yky_{k} respectively, where k=1,…,N′=N(N−1)2k=1,\ldots,N^{\prime}=\frac{N(N-1)}{2}. We also set δk=xk1−xk2\delta_{k}=x_{k}^{1}-x_{k}^{2} so that ∥xk1−xk2∥A2=∑r=1nθrδkTururTδk=θThk\|x_{k}^{1}-x_{k}^{2}\|_{A}^{2}=\sum_{r=1}^{n}\theta_{r}\delta_{k}^{T}u_{r}u_{r}^{T}\delta_{k}=\theta^{T}h_{k} where hk=[hk1,…,hkn]Th_{k}=[h_{k}^{1},\ldots,h_{k}^{n}]^{T} with each hkr=δkTururTδkh_{k}^{r}=\delta_{k}^{T}u_{r}u_{r}^{T}\delta_{k}. Then, the problem (3) becomes

The solution can be obtained by alternating between two sub-problems (which correspond to the minimization w.r.t. α=[α1,…,αm]T\alpha=[\alpha_{1},\ldots,\alpha_{m}]^{T} and θ=[θ1,…,θn]T\theta=[\theta_{1},\ldots,\theta_{n}]^{T} respectively) until convergence.

III-B Optimization procedure

For fixed α\alpha, the optimization problem with respect to θ\theta is formulated as

By substituting the solution (7) back into (6), we have the piece-wise approximation of gg, i.e.,

We adopt the Nesterov’s method to solve the smoothed version of problem (5) since it can achieve the optimal convergence rate at O(1/k2)O(1/k^{2}), which indicates a low time complexity . To utilize Nesterov’s method for optimization, we have to compute the gradient of the smoothed hinge loss to determine the descent direction, as well as the Lipschitz constant to determine the step size of each iteration. We summarize the results in the following theorem.

The gradient of the smoothed hinge loss gσ(θ)g_{\sigma}(\theta) is

The sum of the gradient over all the samples is

Similarly, let l(θ)=∥θ∥1l(\theta)=\|\theta\|_{1}, so we have the following piece-wise approximation of ll with the smooth parameter σ′\sigma^{\prime}:

In addition, the gradient of Ω(θ)\Omega(\theta) is given by

Therefore, the gradient of the smoothed F(θ)F(\theta), is

Finally, based on the obtained gradient and Lipschitz constant, we apply Nesterov’s method to minimize the smoothed primal Fσ(θ)F_{\sigma}(\theta). In the tt’th iteration round, two auxiliary optimizations are constructed and their solutions are used to build the solution of problem (5). We use θt\theta^{t}, yty^{t} and ztz^{t} to represent the solutions of DTDML w.r.t. θ\theta and its two auxiliary optimizations at the tt’th iteration round, respectively. The Lipschitz constant of Fσ(θ)F_{\sigma}(\theta) is LσL_{\sigma} and the two auxiliary optimizations are,

where θ^\hat{\theta} is a guessed solution of θ\theta. By directly setting the gradients of the two objective functions in the auxiliary optimizations as zeros, we can obtain yty^{t} and ztz^{t}, respectively,

The solution after the tt’th iteration round is the weighted sum of yty^{t} and ztz^{t}, i.e.,

The stop criterion is ∣Fσ(θt+1)−Fσ(θt)∣<ϵ|F_{\sigma}(\theta^{t+1})-F_{\sigma}(\theta^{t})|<\epsilon. The initialization θ0\theta^{0} and guessed solution θ^\hat{\theta} are set as the zero vectors.

For fixed θ\theta, the optimization problem with respect to α\alpha can be formulated as

This is a standard quadratic programming problem and can be rewritten in compact form as

where εij=(Hii−Hji−Hij+Hjj)αi−∑k(Hik−Hjk)αk\varepsilon_{ij}=(H_{ii}-H_{ji}-H_{ij}+H_{jj})\alpha_{i}-\sum_{k}(H_{ik}-H_{jk})\alpha_{k}. The obtained αi∗\alpha_{i}^{*} or αj∗\alpha_{j}^{*} may violate the constraint αp≥0\alpha_{p}\geq 0, so we set

In the proposed model (4), we have three parameters γA\gamma_{A}, γB\gamma_{B} and γC\gamma_{C} to determine. Determination of all these parameters is nontrivial due to the limited number of labeled data available in the target task. Therefore, we present an automatic determination algorithm for the regularization parameters γB\gamma_{B} and γC\gamma_{C}. This algorithm is inappropriate for the determination of γA\gamma_{A} because the corresponding regularization term ∥A−AS∥F2\|A-A_{S}\|_{F}^{2} is a coupling of α\alpha and θ\theta.

The algorithm is based on the L-curve, which graphically displays the trade-off between approximation error and solution size as the regularization parameter varies . The proper regularization parameter value is associated with the corner of the curve, where both solution and approximation error have small norms. Following , we choose a tangency-based method to find the L-corner since it has a convergence guarantee and the computation is fast. The procedure is shown in Algorithm 1, where ρC\rho_{C} and ρB\rho_{B} are slopes of the straight line that are tangent to the L-curves, and are set to be one, empirically, in this paper.

The stopping criterion for terminating the algorithm can be the difference of the objective value 1N′∑k=1N′g(yk(1−θThk))+γA2∥A−AS∥F2+γB2∥α∥22+γC∥θ∥1\frac{1}{N^{\prime}}\sum_{k=1}^{N^{\prime}}g(y_{k}(1-\theta^{T}h_{k}))+\frac{\gamma_{A}}{2}\|A-A_{S}\|_{F}^{2}+\frac{\gamma_{B}}{2}\|\alpha\|_{2}^{2}+\gamma_{C}\|\theta\|_{1} between two consecutive steps. Alternatively, we can stop the iterations when the variation of α\alpha and θ\theta are both smaller than a predefined threshold. Our implementation is based on the difference of the objective value, i.e., if the value ∣Ok−Ok−1∣/∣Ok−O0∣|O_{k}-O_{k-1}|/|O_{k}-O_{0}| is smaller than a predefined threshold, then the iteration stops, where OkO_{k} is the objective value of the kk’th iteration step.

III-D Theoretical analysis

The generalization error bound of the proposed DTDML algorithm is now provided. We derive the generalization bound using the uniform stability .

(Uniform stability ). An algorithm has uniform stability β\beta with respect to the loss function ll if the following holds

where Z\mathcal{Z} is the sample space, hsh_{s} is the hypothesis function returned by the algorithm learning with the set of samples ss, and si={z1,…,zi−1,zi′,zi+1,…,zm}s^{i}=\{z_{1},\ldots,z_{i-1},z_{i^{\prime}},z_{i+1},\ldots,z_{m}\} denotes a set of samples with the ii’th element ziz_{i} replaced by zi′z_{i^{\prime}}.

For non-differential loss function, we use the generalized Bregman divergence. The sub-gradient of FF at hh (see e.g., ) is defined as

Let δF(h)\delta F(h) be an arbitrary element of ∂F(h)\partial F(h). The generalized Bregman divergence to FF is then defined as

According to the definition of sub-gradient, we have BF(h′∥h)≥0B_{F}(h^{\prime}\parallel h)\geq 0 and BP+Q=BP+BQB_{P+Q}=B_{P}+B_{Q} for any convex functions PP and QQ. That is, the generalized Bregman divergence is non-negative and additive.

In addition, to derive the uniform stability, we need the following lemma cited from (Proposition 2 therein):

For any two distance metrics AA and A′A^{\prime}, the following inequality holds for any sample ziz_{i} and zjz_{j}

Then we present the uniform stability for our model.

Let β\beta be the uniform stability of the developed algorithm for problem (2) and assume ∥x∥2≤R\|x\|_{2}\leq R for any sample xx. Then,

where LL is the Lipschitz constant of the function gg.

The detailed proof of Theorem 2 can be found in the Appendix. We then derive the generalization bound via the uniform stability.

III-D2 Generalization error bound

Let N\mathcal{N} denote the sample set and V(A,zi,zj)=g(yij[1−∥xi−xj∥A2])V(A,z_{i},z_{j})=g(y_{ij}[1-\|x_{i}-x_{j}\|_{A}^{2}]). The empirical risk and expected risk can be defined as RN(A)=2N(N−1)∑i<jV(A,zi,zj)R_{\mathcal{N}}(A)=\frac{2}{N(N-1)}\sum_{i<j}V(A,z_{i},z_{j}) and R(A)=E(zi,zj)[V(A,zi,zj)]R(A)=E_{(z_{i},z_{j})}[V(A,z_{i},z_{j})], respectively. A probabilistic bound on the defect R(A)−RN(A)R(A)-R_{\mathcal{N}}(A) is called the generalization bound.

The bound can be derived by utilizing the obtained uniform stability and the following McDiarmid inequality .

for all i∈[1,N]i\in[1,N] and any point zi′∈Zz_{i^{\prime}}\in\mathcal{Z}. Let f(N)=f(z1,…,zN)f(\mathcal{N})=f(z_{1},\ldots,z_{N}). Then, for all ϵ>0\epsilon>0, the following holds:

Then we present the generalization bound for our model.

Let N\mathcal{N} be a set of NN randomly selected samples and ANA_{\mathcal{N}} be the distance metric learned by solving (2). With probability at least 1−δ1-\delta, we have

To prove Theorem 4, we need an additional lemma:

The following two inequalities hold: 1) ∥AN−AS∥F≤(2(gAS+γC(∥θS∥1−∥θN∥1)))/γA\|A_{\mathcal{N}}-A_{S}\|_{F}\leq\sqrt{\left(2(g_{A_{S}}+\gamma_{C}(\|\theta_{S}\|_{1}-\|\theta_{\mathcal{N}}\|_{1}))\right)/\gamma_{A}} and 2) ∥AN′−AS∥F≤(2(gAS+γC(∥θS∥1−∥θN′∥1)))/γA≤(2(gAS+γC∥θS∥1))/γA\|A_{\mathcal{N^{\prime}}}-A_{S}\|_{F}\leq\sqrt{\left(2(g_{A_{S}}+\gamma_{C}(\|\theta_{S}\|_{1}-\|\theta_{\mathcal{N^{\prime}}}\|_{1}))\right)/\gamma_{A}}\leq\sqrt{\left(2(g_{A_{S}}+\gamma_{C}\|\theta_{S}\|_{1})\right)/\gamma_{A}}.

The detailed proof of Theorem 4 for the bound can be found in the Appendix.

In the upper bound of generalization error, ASA_{S} and θS\theta_{S} are learned from the source data. They are the information that was transferred from the source data to the target data.

IV Experimental evaluation

This section outlines the validation of the effectiveness of the proposed DTDML empirically on two popular handwritten image datasets, and a challenging natural image dataset. The first two datasets are obtained from . Specifically, we compare the following methods: ∙\bullet RDML : an online algorithm that has been demonstrated empirically to be effective and quite efficient in learning a distance metric, and can handle high dimensional data. This algorithm serves as a baseline here since it learns only from the target task and leverages nothing from the source tasks. ∙\bullet RDML_AGG: a simple aggregation strategy, which is to learn the target metric by directly applying RDML on the training set that consists of data from both the source and target tasks. ∙\bullet LDML : a transfer distance metric learning algorithm that is based on , and is formulated as:

where SS and DD are matrices of the similar and dissimilar constraints. The above formulation contains a semi-definite programming (SDP) problem, and in our re-implementation it is solved using the SDPT3 solver. According to , the parameters can be set empirically as γD=14γS\gamma_{D}=\frac{1}{4}\gamma_{S} and γB=18γS\gamma_{B}=\frac{1}{8}\gamma_{S}. Therefore, only γS\gamma_{S} needs to be tuned. ∙\bullet TML : a recently proposed transfer metric learning algorithm. Similar to , an online algorithm is developed to learn the target metric. The task relationship is learned for transfer by solving a second-order cone programming (SOCP) problem using the CVX solver. In addition, the parameters are automatically determined by adopting a Bayesian regularization scheme for the model. ∙\bullet DTDML: the proposed decomposition based transfer distance metric learning. The parameters γB\gamma_{B} and γC\gamma_{C} are determined automatically and we only need to optimize γA\gamma_{A}.

We train the source metrics using the RDML method and all the available data in the source tasks. We split the data into equal training and test sets for the target task. The number of labeled samples that are chosen from the training set is gradually increased to see the performance variation w.r.t. the size of the labeled set. We evaluate the learned target metric by applying the 1-nearest-neighbor classifier on the test set. Ten random choices of the labeled samples are used in our experiments. Both the mean and standard deviation of the accuracies are reported.

One of the handwritten image datasets we use is the well-known USPS digit datasethttp://www.csie.ntu.edu.tw/~cjlin/libsvmtools/datasets/multiclass.html#usps, which contains 7,2917,291 samples. Each sample is an image of size 16×1616\times 16 in raw pixels, and the feature dimension d=256d=256. We consider nine classification tasks, i.e., 0/6, 0/8, 1/4, 2/7, 3/5, 4/7, 4/9, 5/8, and 6/8, each corresponding to a classification of two digits. One of the nine tasks is treated as the target task and the others are the source tasks (each task is treated as the target task in turn).

The other is a handwritten letter datasethttp://ai.stanford.edu/~btaskar/ocr/, which is a little different from the dataset presented in since it cannot be downloaded immediately, according to the web link provided. The letter dataset used in this paper consists of 52,15252,152 samples and the feature dimension is 128128. Six binary classification problems, i.e., c/e, m/n, a/g, a/o, f/t, and h/n, are considered. For each task, we randomly select at most 1,0001,000 positive and 1,0001,000 negative samples from the dataset. The experimental settings are the same as for those of the digit classification.

As depicted in this paper, the “base metrics” Br=ururTB_{r}=u_{r}u_{r}^{T} that are utilized to construct the target metric A=∑r=1nθrBrA=\sum_{r=1}^{n}\theta_{r}B_{r} can be derived from either the source eigenvectors, or other randomly generated bases. Therefore, we first investigate the performance of these two strategies, which are denoted as DTDML_SE and DTDML_RB, respectively. For DTDML_SE, the ur,r=1,…,nu_{r},r=1,\ldots,n in problem (2) are eigenvectors of the source metrics, so the number of base metrics is fixed as n=m×dn=m\times d. For DTDML_RB, each uru_{r} is an eigenvector of some random matrix, and thus we can generate arbitrary number of base metrics. We randomly select one task from each of the two handwritten datasets, and report the results in Fig. 2.

The results demonstrate that: 1) Even when the number of random bases nbn_{b} is very small, e.g., 100100, we can still obtain satisfactory accuracy; 2) The accuracy of DTDML_RB tends to be higher when nbn_{b} is increased, but usually cannot outperform DTDML_SE. To this end, we adopt DTDML_SE in the following experiments. Another reason for choosing DTDML_SE is to avoid tuning the additional parameter nbn_{b}.

IV-A2 A comparison with the other algorithms

The classification accuracies of different methods, under different settings on the digit dataset are shown in Fig. 3. We observe from the results that: 1) when the number of labeled training samples increases, the performance of all the compared methods tends to be better (higher mean accuracy and smaller variance); 2) the transfer metric learning algorithms (LDML, TML, DTDML) that utilize the source task information for target task learning are usually superior to RDML, which only learns on the target task. RDML is comparable to LDML on some tasks (e.g., the 5’th, 7’th, and 9’th task), which may be due to the finding of a bad local minima in LDML; 3) Overall, the performance of RDML_AGG, which directly utilizes both the source and target training data without transfer, is better than RDML but worse than the transfer methods. This indicates that the distributions of the source and target datasets are different but related; 4) TML is better than LDML and RDML in most cases, while the proposed DTDML consistently outperforms all of them. In addition, we present the average performance over all settings in Table I. The results indicate a significant 3.2%3.2\% improvement compared with TML when using two labeled training samples. The level of improvement drops when more labeled samples are available. This is because DTDML has far fewer variables to learn than TML. The significance of this advantage gradually decreases since variable estimation can be steadily improved with an increase of labeled training samples. This indicates that the proposed algorithm is more suitable for the transfer scenario, since the labeled sample size of the target task is usually very small.

We report the performance on the letter dataset in Fig. 4. Similar to the digit classification, LDML is comparable to RDML and RDML_AGG sometimes, and DTDML is superior to other methods significantly on almost all tasks. The average performance is presented in Table II and we observe a significant 3.8%3.8\% improvement compared against TML when using four labeled training samples.

IV-B Web image annotation

This section provides details of the experiments conducted on a natural image dataset NUS-WIDE to further verify the effectiveness of the proposed algorithm. This dataset contains 269,648269,648 images and the features used in our experiments are 500500-D bag of visual words based on SIFT descriptors. To perform a meaningful transfer, we select 1212 animal concepts: bear, bird, cat, cow, dog, elk, fish, fox, horse, tiger, whale, and zebra. For each concept, 100100 samples were randomly selected from the dataset.

In this set of experiments, the source task requires annotation of six randomly selected concepts, and the target task requires annotation of all others. Both are multi-class problems, but there is no difference in training compared to the binary case since the sample pairs are used and only the pair labels are needed. A pair of samples is labeled as positive if they are from the same class, and negative otherwise.

We perform six random splits of the concept set, and show the result of each split in Fig. 5. Similar conclusions can be obtained as in the handwritten image classification. DTDML always performs the best for all splits and in particular, we obtain an 8.1%8.1\% improvement on the average performance over all splits compared with TML when using four labeled samples.

V Conclusion and Discussion

Existing transfer metric learning approaches usually learn entries of the target metric directly, so the amount of variables is large, especially for the high dimensional image features. To resolve this problem, we have presented a decomposition based method called DTDML that assumes the target metric can be represented as a combination of “base metrics”. DTDML has far less variables because we only have to learn the combination coefficients of the “base metrics”, so better solutions can be obtained. In addition, we adopt Nesterov’s optimal method to learn the coefficients and the optimization is quite efficient.

From the experimental validation on the popular handwritten image datasets and a challenging natural image dataset, we conclude that: 1) both source eigenvectors and random bases can be used to construct the target metric and the former performs a little better; 2) In the transfer scenario, using “base metrics” to induce the target metric is more effective than learning the target metric variables directly, even when the “base metrics” are randomly generated.

Appendix A Proof of Theorem 1

According to (7) and (8), we can calculate the gradient of gσg_{\sigma} for the kk’th sample as

This leads to (9). Given function g(x)g(x), for any x1x^{1} and x2x^{2}, the Lipschitz constant LL satisfies

Hence the Lipschitz constant of gσg_{\sigma} can be calculated from

To this end, the Lipschitz constant of Lg(θ)L^{g}(\theta) is calculated as

Appendix B Proof of Theorem 2

Let’s denote FN(θ)=PN(θ)+Q(θ)F_{\mathcal{N}}(\theta)=P_{\mathcal{N}}(\theta)+Q(\theta), where PN(θ)=2N(N−1)∑i<jV(A,zi,zj)P_{\mathcal{N}}(\theta)=\frac{2}{N(N-1)}\sum_{i<j}V(A,z_{i},z_{j}) and Q(θ)=γA2∥A−AS∥F2+γC∥θ∥1Q(\theta)=\frac{\gamma_{A}}{2}\|A-A_{S}\|_{F}^{2}+\gamma_{C}\|\theta\|_{1}. It is obvious that both PN(θ)P_{\mathcal{N}}(\theta) and Q(θ)Q(\theta) are convex. We assume θN\theta_{\mathcal{N}} and θN′\theta_{\mathcal{N}^{\prime}} to be the minimizers of FN(θ)F_{\mathcal{N}}(\theta) and FN′(θ)F_{\mathcal{N}^{\prime}}(\theta), respectively, where N′\mathcal{N}^{\prime} is the collection of examples that replaces zi∈Nz_{i}\in\mathcal{N} with another example zi′z_{i^{\prime}}.

Because the generalized Bregman divergence is non-negative and additive, we have

Besides, ∂Q(θN)/∂θ=γA2∂(∥A−AS∥F2)/∂θ+γCδf(θ)\partial Q(\theta_{\mathcal{N}})/\partial\theta=\frac{\gamma_{A}}{2}\partial(\|A-A_{S}\|_{F}^{2})/\partial\theta+\gamma_{C}\delta f(\theta), where δf(θ)\delta f(\theta) is the subgradient of ∥θ∥1\|\theta\|_{1}, so we can obtain

The second equality holds because θN\theta_{\mathcal{N}} and θN′\theta_{\mathcal{N}^{\prime}} are minimizers of FN(θ)F_{\mathcal{N}}(\theta) and FN′(θ)F_{\mathcal{N}^{\prime}}(\theta) respectively, which implies that ∂FN(θN)=∂FN′(θN′)=0\partial F_{\mathcal{N}}(\theta_{\mathcal{N}})=\partial F_{\mathcal{N}^{\prime}}(\theta_{\mathcal{N}^{\prime}})=0. The last inequality holds because of Lemma 1. By comparing the left and right side of (40), we obtain

By further utilizing Lemma 1, i.e., ∣V(AN,zi,zj)−V(AN′,zi,zj)∣≤4LR2∥AN−AN′∥F|V(A_{\mathcal{N}},z_{i},z_{j})-V(A_{\mathcal{N}^{\prime}},z_{i},z_{j})|\leq 4LR^{2}\|A_{\mathcal{N}}-A_{\mathcal{N}^{\prime}}\|_{F}, we have

Appendix C Proof of Lemma 2

Because θS\theta_{S} is a solution of A=ASA=A_{S}, so we have

since 2N(N−1)∑i<jV(AN,zi,zj)≥0\frac{2}{N(N-1)}\sum_{i<j}V(A_{\mathcal{N}},z_{i},z_{j})\geq 0. Therefore, we have ∥AN−AS∥F≤(2(gAS+γC(∥θS∥1−∥θN∥1)))/γA\|A_{\mathcal{N}}-A_{S}\|_{F}\leq\sqrt{\left(2(g_{A_{S}}+\gamma_{C}(\|\theta_{S}\|_{1}-\|\theta_{\mathcal{N}}\|_{1}))\right)/\gamma_{A}}. The same procedure can be applied to bounding ∥AN′−AS∥F\|A_{\mathcal{N}^{\prime}}-A_{S}\|_{F}. ∎

Appendix D Proof of Theorem 4

Let Φ(AN)=R(AN)−RN(AN)\Phi(A_{\mathcal{N}})=R(A_{\mathcal{N}})-R_{\mathcal{N}}(A_{\mathcal{N}}). It follows from that Φ(AN)≤2β\Phi(A_{\mathcal{N}})\leq 2\beta. Besides,

where gAS=sup⁡zi,zjV(AS,zi,zj)g_{A_{S}}=\sup_{z_{i},z_{j}}V(A_{S},z_{i},z_{j}) is the largest loss when the distance metric is ASA_{S}. The last inequality holds because of Lemma 2.

Given δ>0\delta>0, using the McDiarmid inequality, with probability at least 1−δ1-\delta, we have

In addition, we can conclude that E[Φ(AN)]≤2βE[\Phi(A_{\mathcal{N}})]\leq 2\beta:

References