Iterated Support Vector Machines for Distance Metric Learning
Distance metric learning aims to learn from the given training data a valid distance metric, with which the similarity between data samples can be more effectively evaluated for classification. Metric learning is often formulated as a convex or nonconvex optimization problem, while many existing metric learning algorithms become inefficient for large scale problems. In this paper, we formulate metric learning as a kernel classification problem, and solve it by iterated training of support vector machines (SVM). The new formulation is easy to implement, efficient in training, and tractable for large-scale problems. Two novel metric learning models, namely Positive-semidefinite Constrained Metric Learning (PCML) and Nonnegative-coefficient Constrained Metric Learning (NCML), are developed. Both PCML and NCML can guarantee the global optimality of their solutions. Experimental results on UCI dataset classification, handwritten digit recognition, face verification and person re-identification demonstrate that the proposed metric learning methods achieve higher classification accuracy than state-of-the-art methods and they are significantly more efficient in training.
Distance metric learning aims to train a valid distance metric which can enlarge the distances between samples of different classes and reduce the distances between samples of the same class . Metric learning is closely related to -Nearest Neighbor (-NN) classification , clustering , ranking [4, 5], feature extraction  and support vector machine (SVM) , and has been widely applied to face recognition , person re-identification [9, 10], image retrieval [11, 12], activity recognition , document classification , and link prediction , etc. One popular metric learning approach is the Mahalanobis distance metric learning, which is to learn a linear transformation matrix or a matrix from the training data. Given two samples and , the Mahalanobis distance between them is defined as:
To satisfy the nonnegative property of a distance metric, should be positive semidefinite (PSD). According to which one of and is learned, Mahalanobis distance metric learning methods can be grouped into two categories. Methods that learn , including neighborhood components analysis (NCA) , large margin components analysis (LMCA)  and neighborhood repulsed metric learning (NRML) , are mostly formulated as nonconvex optimization problems, which are solved by gradient descent based optimizers. Taking the PSD constraint into account, methods that learn , including large margin nearest neighbor (LMNN)  and maximally collapsing metric learning (MCML) , are mostly formulated as convex semidefinite programming (SDP) problems, which can be optimized by standard SDP solvers , projected gradient , Boosting-like , or Frank-Wolfe  algorithms. Davis et al.  proposed an information-theoretic metric learning (ITML) model with an iterative Bregman projection algorithm, which does not need projections onto the PSD cone. Besides, the use of online solvers for metric learning has been discussed in [24, 9, 25].
On the other hand, kernel methods [26, 27, 28, 29, 30, 31] have been widely studied in many learning tasks, e.g., semi-supervised learning, multiple instance learning, multitask learning, etc. Kernel learning methods, such as support vector machine (SVM), exhibit good generalization performance. There are many open resources on kernel classification methods, and a variety of toolboxes and libraries have been released [32, 33, 34, 35, 36, 37, 38]. It is thus important to investigate the connections between metric learning and kernel classification and explore how to utilize the kernel classification resources in the research and development of metric learning methods.
|PSD||Positive semidefinite (matrix)|
|-NN||-nearest neighbor (classification)|
|SVM||Support vector machine|
|LMCA||Large margin components analysis|
|LMNN||Large margin nearest neighbor|
|NCA||Neighborhood components analysis|
|MCML||Maximally collapsing metric learning|
|ITML||Information-theoretic metric learning|
|LDML||Logistic discriminant metric learning|
|DML-eig||Distance metric learning with eigenvalue optimization|
|PLML||Parametric local metric learning|
|KISSME||Keep it simple and straightforward metric learning|
|PCML||Positive-semidefinite constrained metric learning|
|NCML||Nonnegative-coefficient constrained metric learning|
In this paper, we propose a novel formulation of metric learning by casting it as a kernel classification problem, which allows us to effectively and efficiently learn distance metrics by iterated training of SVM. The off-the-shelf SVM solvers such as LibSVM  can be employed to solve the metric learning problem. Specifically, we propose two novel methods to bridge metric learning with the well-developed SVM techniques, and they are easy to implement. First, we propose a Positive-semidefinite Constrained Metric Learning (PCML) model, which can be solved via iterating between PSD projection and dual SVM learning. Second, by re-parameterizing the matrix , we transform the PSD constraint into a nonnegative coefficient constraint and consequently propose a Nonnegative-coefficient Constrained Metric Learning (NCML) model, which can be solved by iterated learning of two SVMs. Both PCML and NCML have globally optimal solutions, and our extensive experiments on UCI dataset classification, handwritten digit recognition, face verification and person re-identification clearly demonstrate the effectiveness of them.
The remainder of this paper is organized as follows. Section 2 reviews the related works. Section 3 presents the PCML model and the optimization algorithm. Section 4 presents the model and algorithm of NCML. Section 5 presents the experimental results, and Section 6 concludes the paper.
The main abbreviations used in this paper are summarized in Table 1.
2 Related Work
Compared with nonconvex metric learning models [16, 17, 40], convex formulation of metric learning [2, 3, 20, 21, 22] has drawn increasing attentions due to its desired properties such as global optimality. Most convex metric learning models can be formulated as SDP or quadratic SDP problems. Standard SDP solvers, however, are inefficient for metric learning, especially when the size of training samples is big or the feature dimension is high. Therefore, customized optimization algorithm needs to be developed for each specific metric learning model. For LMNN, Weinberger et al. developed an efficient solver based on the sub-gradient descent and the active set techniques . In ITML, Davis et al.  suggested an iterative Bregman projection algorithm. Iterative projected gradient descent method [3, 42] has been widely employed for metric learning but it requires an eigenvalue decomposition in each iteration. Other algorithms such as block-coordinate descent , smooth optimization , and Frank-Wolfe  have also been studied for metric learning. Unlike the customized algorithms, in this work we formulate metric learning as a kernel classification problem and solve it using the off-the-shelf SVM solvers, which can guarantee the global optimality and the PSD property of the learned , and is easy to implement and efficient in training.
Another line of work aims to develop metric learning algorithms by solving the Lagrange dual problems. Shen et al. derived the Lagrange dual of the exponential loss based metric learning model, and proposed a boosting-like approach, namely BoostMetric, where the matrix is learned as a linear positive combination of rank-one matrices [21, 45]. MetricBoost  and FrobMetric [47, 48] were further proposed to improve the performance of BoostMetric. Liu and Vemuri incorporated two regularization terms in the duality for robust metric learning . Note that BoostMetric [21, 45], MetricBoost , and FrobMetric  are proposed for metric learning with triplet constraints, whereas in many applications such as verification, only pairwise constraints are available in the training stage.
Several SVM-based metric learning approaches [50, 51, 52, 53] have also been proposed. Using SVM, Nguyen and Guo  formulated metric learning as a quadratic semidefinite programming problem, and suggested a projected gradient descent algorithm. The formulations of the proposed PCML and NCML in this work are different from the model in , and they are solved by the dual problems with the off-the-shelf SVM solvers. Brunner et al.  proposed a pairwise SVM method to learn a dissimilarity function rather than a distance metric. Different from , the proposed PCML and NCML learn a distance metric and the matrix is constrained to be a PSD matrix. Do et al.  studied SVM from a metric learning perspective and presented an improved variant of SVM classification. Wang et al.  developed a kernel classification framework for metric learning and proposed two learning models which can be efficiently implemented by the standard SVM solvers. However, they adopted a two-step greedy strategy to solve the models and neglected the PSD constraint in the first step. In this work, the proposed PCML and NCML models have different formulations from , and their solutions are globally optimal.
3 Positive-semidefinite Constrained Metric Learning (PCML)
Denote by a training set, where is the th training sample, and is the class label of . The Mahalanobis distance between and can be equivalently written as:
where is a PSD matrix, is defined as the Frobenius inner product of two matrices and , and stands for the matrix trace operator. For each pair of and , we define a matrix . With , the Mahalanobis distance can be rewritten as .
3.1 PCML and Its Dual Problem
Let be the set of similar pairs, and let be the set of dissimilar pairs. By introducing an indicator variable
the PCML model can be formulated as:
where denotes the slack variables, denotes the bias, and denotes the Frobenius norm.
The PCML model defined above is convex and can be solved using the standard SDP solvers. However, the high complexity of general-purpose interior-point SDP solver makes it only suitable for small-scale problems. In order to improve the efficiency, in the following we first analyze the Lagrange duality of the PCML model, and then propose an algorithm to iterate between SVM training and PSD projection to learn the Mahalanobis distance metric.
By introducing the Lagrange multipliers and a PSD matrix , the Lagrange dual of the problem in (4) can be formulated as:
Please refer to Appendix A for the detailed derivation of the dual problem. Based on the Karush-Kuhn-Tucker (KKT) conditions, the matrix can be obtained by
The strong duality allows us to first solve the equivalent dual problem in (5) and then obtain the matrix by (6). However, due to the PSD constraint , the problem in (5) is still difficult to optimize.
3.2 Alternative Optimization Algorithm
To solve the dual problem efficiently, we propose an optimization approach by updating and alternatively. Given , we introduce a new variable with , and the subproblem on can be formulated as:
The subproblem (7) is a QP problem. We can define a kernel function of sample pairs as follows:
Substituting (8) into (7), the subproblem on becomes a kernel-based classification problem, and can be efficiently solved by using the existing SVM solvers such as LibSVM . Given , the subproblem on can be formulated as the projection of a matrix onto the convex cone of PSD matrices:
where . Through the eigen-decomposition of , i.e., and is the diagonal matrix of eigenvalues, the solution to the subproblem on can be explicitly expressed as , where . Finally, the PCML algorithm is summarized in Algorithm 1.
3.3 Optimality Condition
The optimality condition of the proposed algorithm can be checked by the duality gap in each iteration, which is defined as the difference between the primal and dual objective values:
where , , , and are feasible primal and dual variables, and is the duality gap in the th iteration. According to (6), we can derive that
As shown in Subsection 3.2, , , and hence , where . Thus, can be computed by
Substituting (11) and (12) into (10), the duality gap of PCML can be obtained as follows
Based on the KKT conditions of the PCML dual problem in (5), can be obtained by
Please refer to Appendix A for the detailed derivation of and . The duality gap is always nonnegative and approaches to zero when the primal problem is convex. Thus, it can be used as the termination condition of the algorithm. Fig. 1 plots the curve of duality gap versus the number of iterations on the PenDigits dataset by PCML. One can see that the duality gap converges to zero in less than 20 iterations and our algorithm will reach the global optimum. In Algorithm 1, we adopt the following termination condition:
where is a small constant and we set in the experiment.
Warm-start: In the updating of , we adopt a simple warm-start strategy. We use the solution of the previous iteration as the initialization of the next iteration. Since the previous solution can serve as a good guess, warm-start results in significant improvement in efficiency.
Construction of pairwise constraints: Based on the training set, we can introduce pairwise constraints in total. However, in practice we only need to choose a subset of pairwise constraints to reduce the computational cost. For each sample, we find its nearest neighbors to construct similar pairs and its farthest neighbors to construct dissimilar pairs. Thus, we only need pairwise constraints. By this strategy, we can reduce the scale of pairwise constraints from to . Since is usually small constant (=13) in practice, the computational cost of metric learning is much reduced. Similar strategy for constructing pairwise or triplet constraints can be found in [2, 11].
Computational Complexity: We use the LibSVM library for SVM training. The computational complexity of SMO-type algorithms  is . For PSD projection, the complexity of conventional SVD algorithms is .
4 Nonnegative-coefficient Constrained Metric Learning (NCML)
Given a set of rank-1 PSD matrices , a linear combination of is defined as , where is the scalar combination coefficient. One can easily prove the following Theorem 1.
If the scalar coefficient , the matrix is a PSD matrix, where is a rank-1 PSD matrix.
Denote by a random vector. Based on the expression of , we have:
Since and , we have . Therefore, is a PSD matrix. \qed
4.1 NCML and Its Dual Problem
Motivated by Theorem 1, we propose to transform the PSD constraint in (4) by re-parameterizing the distance metric , and develop a nonnegative-coefficient constrained metric learning (NCML) method to learn the PSD matrix . Given the training data and , a rank-1 PSD matrix can be constructed for each pair . By assuming that the learned matrix should be the linear combination of with the nonnegative coefficient constraint, the NCML model can be formulated as:
By substituting with , we reformulate the NCML model as follows:
By introducing the Lagrange multipliers and , the Lagrange dual of the primal problem in (18) can be formulated as:
Please refer to Appendix B for the detailed derivation of the dual problem. Based on the KKT conditions, the coefficient can be obtained by:
Thus, we can first solve the above dual problem, and then obtain the matrix by
4.2 Optimization Algorithm
There are two groups of variables, and , in problem (19). We adopt an alternative optimization approach to solve them. First, given , the variables can be solved as follows:
where is the variable with . Clearly, the subproblem on is exactly the dual problem of SVM, and it can be efficiently solved by any standard SVM solvers, e.g., LibSVM .
Given , the subproblem on can be formulated as follows:
where . To simplify the subproblem on , we derive the Lagrange dual of (23) based on the KKT condition:
where is the Lagrange dual multiplier. The Lagrange dual problem of (23) is formulated as follows:
Please refer to Appendix C for the detailed derivation. Clearly, problem (25) is a simpler QP problem than (23), which can be efficiently solved by the standard SVM solvers.
By alternatively updating and , we can solve the NCML dual problem (19). After obtaining the optimal solutions of and , the optimal solution of in problem (18) can be obtained by
We then have . The NCML algorithm is summarized in Algorithm 2.
Analogous to PCML, the updating of and in NCML can be speeded up by using the warm-start strategy. As shown in Fig. 2, the proposed NCML algorithm will converge in 1015 iterations.
4.3 Optimality Condition
We check the duality gap of NCML to investigate the optimality condition of it. From the primal and dual objectives in (18) and (19), the NCML duality gap in the th iteration is
where and are the feasible solutions to the primal problem, and are the feasible solutions to the dual problem, and is the duality gap in the th iteration. As and are the optimal solutions to the primal subproblem on in (23) and its dual problem in (25), respectively, the duality gap of subproblem on is zero, i.e.,
As shown in (26), and should be equal. We substitute (28) into (27) as follows:
Based on the KKT conditions of the NCML dual problem in (19), can be obtained by (30) (see page 7), where and can be obtained by
Please refer to Appendix B for the detailed derivation of and .
Fig. 2 plots the curve of duality gap versus the number of iterations on the PenDigits dataset by NCML. One can see that the duality gap converges to zero in 15 iterations, and NCML reaches the global optimum. In the implementation of Algorithm 2, we adopt the following termination condition:
where is a small constant and we set in the experiment.
Computational complexity: We use the same strategy as that in PCML to construct the pairwise constraints for NCML. In each iteration, NCML calls for the SVM solver twice while PCML calls for it only once. When the SMO-type algorithm  is adopted for SVM training, the computational complexity of NCML is . One extra advantage of NCML lies in its lower computational cost with respect to , which involves the computation of and the construction of matrix . Since , the cost of computing is . The cost of constructing the matrix is less than , and this operation is required only once after the convergence of and .
Nonlinear extensions: Note that can be treated as an inner product of two pairs of samples: and . Analogous to PCML, if we can define a kernel on and , we can substitute with to develop new linear or even nonlinear metric learning algorithms, and the Mahalanobis distance between any two samples and can be formulated as:
Another nonlinear extension strategy is to define a kernel on and . Since , we can substitute with and formulate the Mahalanobis distance between and as:
That is to say, NCML allows us to learn nonlinear metrics for histograms and structural data by designing proper kernel functions and incorporating appropriate regularizations on . Metric learning for structural data beyond vector data has been recently receiving considerable research interests [56, 5], and NCML can provide a new perspective on this topic.
SVM solvers: Although our implementation is based on LibSVM, there are a number of well-studied SVM training algorithms, e.g., core vector machines , LaRank , BMRM , and Pegasos , which can be utilized for large scale metric learning. Moreover, we can refer to the progresses in kernel methods [26, 27, 28] for developing semi-supervised, multiple instance, and multitask metric learning approaches.
5 Experimental Results
We evaluate the proposed PCML and NCML models for -NN classification () using 9 UCI datasets, 4 handwritten digit datasets, 2 face verification datasets and 2 person re-identification datasets. We compare PCML and NCML with the baseline Euclidean distance metric and 7 state-of-the-art metric learning models, including NCA , ITML , MCML , LDML , LMNN , PLML , and DML-eig . On each dataset, if the partition of training set and test set is not defined, we evaluate the performance of each method by 10-fold cross-validation, and the classification error rate and training time are obtained by averaging over 10 runs of 10-fold cross-validation. PCML and NCML are implemented using the LibSVM111http://www.csie.ntu.edu.tw/~cjlin/libsvm/ toolbox. The source codes of NCA222http://www.cs.berkeley.edu/~fowlkes/software/nca/, ITML333http://www.cs.utexas.edu/~pjain/itml/, MCML444http://homepage.tudelft.nl/19j49/Matlab_Toolbox_for_Dimensionality_Reduction.html, LDML555http://lear.inrialpes.fr/people/guillaumin/code.php, LMNN666http://www.cse.wustl.edu/~kilian/code/code.html, PLML777http://cui.unige.ch/~wangjun/, and DML-eig888http://empslocal.ex.ac.uk/people/staff/yy267/software.html are online available, and we tune their parameters to get the best results.
5.1 Results on the UCI Datasets
We first use 9 datasets from the UCI Machine Learning Repository  to evaluate the proposed models. The information of the 9 UCI datasets is summarized in Table II. On the Satellite, SPECTF Heart, and Letter datasets, the training set and test set are defined. On the other datasets, we use 10-fold cross-validation to evaluate the metric learning models.
# of training samples
# of test samples
# of classes
The proposed PCML and NCML methods involve only one hyper-parameter, i.e., the regularization parameter . We simply adopt the cross-validation strategy to select by investigating the influence of on the classification error rate. Fig. 3 shows the curves of classification error rate versus for PCML and NCML on the SPECTF Heart dataset. The curves on other datasets are similar. We can observe that when , the classification error rates of PCML and NCML will be low and stable. When is higher than , the classification error rates jump dramatically. Thus, we set in our experiments.
We compare the classification error rates of the competing methods in Table III. On the Cardiotocography and Segmentation datasets, PCML achieves the lowest error rates. On the Segmentation and SPECTF Heart datasets, NCML achieves the lowest error rates. The average ranks of competing methods are listed in the last row of Table III. On each dataset, we rank the methods based on their error rates, i.e., we assign rank 1 to the method with the lowest error rate and rank 2 to the method with the second lowest error rate, and so on. The average rank is defined as the mean rank of one method over the nine datasets, which can provide a fair comparison of the learning methods . From Table III, we can see that both PCML and NCML achieve the first and second best average ranks, respectively, demonstrating strong classification capability for general classification tasks.
We then compare the training time of competing metric learning methods in Fig. 4. All the experiments are run in a PC with 4 Intel Core i5-2410 CPUs (2.30 GHz) and 16GB RAM. Clearly, the proposed PCML and NCML are the fastest in most cases. Although DML-eig is faster than PCML on the Letter dataset, its classification error rate on this dataset is much higher than PCML and NCML. On average, PCML and NCML are 23 and 18 times faster than PLML, the third fastest algorithm, respectively.
5.2 Handwritten Digit Recognition
We further evaluate the proposed methods on four handwritten digit datasets: MNIST, Pen-based recognition of handwritten Digits data set (PenDigits), Semeion and USPS. Table IV summarizes the basic information of these four handwritten digit datasets. On the MNIST, PenDigits, and USPS datasets, we use the defined training sets to train the metrics, and use the defined test sets to compute the classification error rates. On the Semeion dataset, we use 10-fold cross-validation to evaluate the metric learning methods, and the classification error rate and training time are obtained by averaging over 10 runs of 10-fold cross-validation.
# of training samples
# of test samples
# of classes
As the dimensions of images in the MNIST, Semeion and USPS datasets are relatively high, we use principal component analysis (PCA) to reduce the feature dimension to 100, and train the metrics in the PCA subspace. Table V lists the classification error rates of the ten competing methods on the four handwritten digit datasets. The last row of Table V lists the average ranks of the competing methods. We do not report the error rate and training time of MCML on the MNIST dataset because MCML requires too large memory space (more than 30 GB) on this dataset and cannot run in our PC. From Table V, we can see that both PCML and NCML achieve the best average rank. Again, the results indicate that the proposed methods have better classification performance.
All the experiments were executed in the same PC as used in Subsection 5.1. Fig. 5 compares the training time of NCA, ITML, MCML, LDML, LMNN, DML-eig, PLML, PCML, and NCML. Clearly, the proposed PCML and NCML methods are much faster than the other methods. On average, PCML and NCML are 61 and 27 times faster than PLML, the third fastest algorithm, respectively. One can conclude that PCML and NCML offer promising solutions to effective and efficient metric learning.
Finally, we compare the running time of PCML and NCML under different feature dimensions . As analyzed in Subsections 3.4 and 4.4, the time complexities of PCML and NCML are and , respectively. Fig. 6 shows the training time on the Semeion dataset with different PCA dimensions. We can see that when the dimension is lower than 110, the training time of NCML is longer than PCML. When the dimension is higher than 110, the training time of PCML increases and becomes longer than NCML.
5.3 Face Verification
5.3.1 The LFW Database
The face images in the LFW database were collected from the Internet and demonstrate large variations of pose, illumination, expression, etc. The database consists of 13,233 face images from 5,749 persons. Under the image restricted setting, the performance of a face verification method is evaluated by 10-fold cross validation. For each of the 10 runs, the database provides 300 positive pairs and 300 negative pairs for testing, and 5,400 image pairs for training. The verification rate and Receiver Operator Characteristic (ROC) curve of each method are obtained by averaging over the 10 runs.
In our experiments, we use the SIFT  features and the attribute features provided by  and  to evaluate the metric learning methods. Since the dimension of SIFT features is high (i.e., 128 3 9), PCA is used to reduce the feature dimension to 150. Under the restricted setting of the LFW database, we only know whether two images are matched or not for the given pairs. In the training stage, we use the training pairs to train a Mahalanobis distance metric. In the test stage, we compare the Mahalanobis distance of the test pair with a threshold to decide whether the two images are matched or not.
We report the ROC curves of PCML, NCML, DML-eig , ITML , KISSME , LDML  and Euclidean distance in Fig. 7. We also compare the verification accuracies of PCML and NCML and other metric learning methods by using the SIFT and the attribute features in Table VI. It can be seen that the proposed PCML and NCML methods perform much better than all the other competing methods. Using the combination of SIFT and Attribute features, the verification accuracies of PCML (89.00%) and NCML (89.50%) are higher than the third best method, i.e. DML-eig (85.65%), by 3.35% and 3.85%, respectively. We also compare the training time of the competing methods in Table VI. The training time of PCML and NCML is shorter than the other methods except for KISSME. The reason is that KISSME is a one-pass training approach. Although KISSME is faster, its verification accuracy is much lower than PCML and NCML.
|Method||Verification Accuracy (%)||Training Time (s)|
|SIFT||Attribute||SIFT + Attribute||SIFT||Attribute|
5.3.2 The PubFig Database
The PubFig database  contains 58,797 face images of 200 persons with large variations in pose, lighting, expression, scene, camera, imaging conditions and parameters, etc. In this database, the face verification methods are also evaluated using 10-fold cross validation. Among the given 20,000 image pairs, we randomly select 18,000 pairs for training and use the remaining 2,000 pairs for testing in each run. The ROC curves and verification rates are obtained by averaging over the 10 runs.
We use the attribute features provided by  to evaluate the competing methods. Fig. 8 shows the ROC curves of PCML, NCML, KISSME , ITML , DML-eig , Attribute Classifiers  and the baseline Euclidean distance. It can be seen that the performance of PCML and NCML is similar, and is superior to that of the other methods.
We further report the verification rates of PCML, NCML and the other methods in Table VII. One can see that PCML and NCML perform better than the other methods. The accuracies of PCML (79.71%) and NCML (79.75%) are higher than the third best method, i.e., Attribute Classifiers (78.65%), by 1.06% and 1.10%, respectively. The training time of PCML, NCML and other metric learning methods is also listed in Table VII. It can be seen that PCML and NCML are much faster than ITML and DML-eig.
Verification Accuracy (%)
Training Time (s)
5.4 Person Re-identification
In this subsection, we evaluate the performance of the proposed methods for person re-identification, i.e., recognizing a person at different locations and at different times . Two challenging person re-identification databases, the Viewpoint Invariant Pedestrian Recognition (VIPeR) database  and the Context Aware Vision using Image-based Active Recognition for Re-Identification (CAVIAR4REID) database  are used to assess the performance of the proposed methods.
5.4.1 The VIPeR Database
The VIPeR database contains 1,264 pedestrian images of 632 persons from two camera viewspoints (camera A and camera B). For each person, there are two images taken from different viewpoints with a change of 90 degrees. In our experiments, we randomly select 316 persons and use their images for training, and use the images of the other 316 persons for testing. For the testing images, we use the images taken by camera B as the probe set and the images from camera A as the gallery set. Finally, 10 partitions of training and test sets are constructed, and the average accuracy over the 10 test sets is computed as the final accuracy.
|Rank 1||Rank 25||Rank 50||Rank 80||Rank 100|
We report the Cumulative Matching Characteristic (CMC) curves of the competing methods in Fig. 9. We also compare their accuracies under different ranks in Table VIII. From Fig. 9 and Table VIII, one can see that both PCML and NCML outperform LMNN, ITML and Euclidean distance significantly under all ranks. When the rank is no more than 25, PCML performs similarly to KISSME, while NCML outperforms KISSME. When the rank is between 25 and 200, both PCML and NCML perform better than KISSME. The training time of the metric learning methods is also reported in Table VIII. We can see that both PCML and NCML are much more efficient than LMNN and ITML in training.
5.4.2 The CAVIAR4REID Database
CAVIAR4REID consists of 1,220 pedestrian images from 72 persons, where the images are extracted from the shopping center scenario of the CAVIAR database . The database covers a large range of image resolution and pose variation. The minimum and maximum image sizes in the CAVIAR4REID database are and , respectively. Following  and , we use the hierarchical Gaussian (HG) features to evaluate the metric learning methods.
According to the evaluation protocol in , we randomly select 36 persons and use their images for training, and use the rest images for testing. For the testing images, we randomly select one image for each person to construct a probe set consisting of 36 images, and use the other test images as the gallery set. Finally, 10 partitions of training and test sets are constructed, and the final results are obtained by averaging over the 10 runs.
We report the CMC curves of PCML, NCML, DML-eig , KISSME , ITML , LMNN  and Euclidean distance in Fig. 10. One can see that PCML and NCML perform the best and the second best among all the competing methods, respectively. Table IX lists the re-identification accuracies and training time by different methods. PCML and NCML perform better than the other metric learning methods under all the ranks. We also report the training times of the competing metric learning methods in Table IX. PCML and NCML are much faster than the other metric learning methods except for KISSME.
|Methods||Accuracy (%)||Training Time (s)|
|Rank 1||Rank 5||Rank 10||Rank 15|
We proposed two distance metric learning models, namely Positive-semidefinite Constrained Metric Learning (PCML) and Nonnegative-coefficient Constrained Metric Learning (NCML). The proposed models can guarantee the positive semidefinite property of the learned matrix , and can be solved efficiently by the existing SVM solvers. Experimental results on nine UCI machine learning repository datasets and four handwritten digit datasets showed that, compared with the state-of-the-art metric learning methods, including NCA , ITML , MCML , LDML , LMNN , PLML , and DML-eig , the proposed PCML and NCML methods can not only achieve higher classification accuracy, but also are much faster in training. On average, they are 35 and 21 times faster than PLML, the 3rd fastest metric learning method, respectively. The experimental results on LFW, PubFig, VIPeR and CAVIAR4REID databases indicate that the proposed methods also perform very well in vision tasks such as face verification and person re-identification, leading to higher verification rates and very competitive training efficiency.
Appendix A The Dual of PCML
The original problem of PCML is formulated as
Its Lagrangian is:
where , and are the Lagrange multipliers which satisfy , , and . Converting the original problem to its dual problem needs the following KKT conditions:
Equation (37) implies the following relationship between , and :
Substituting (37)(39) back into the Lagrangian, we get the following Lagrange dual problem of PCML:
As we can see from (43) and (44), is explicitly determined by the training procedure, but is not. Nevertheless, can be easily found by using the KKT complementarity condition in (39) and (42), which show that if , and if . Thus we can simply take any training point, for which , to compute by
Note that it is numerically wiser to take the average over all such training data points to compute . After is computed, we can compute by