Dynamic Label Graph Matching for Unsupervised Video Re-Identification
Mang Ye, Andy J Ma, Liang Zheng, Jiawei Li, P C Yuen
Introduction
Person re-identification (re-ID), a retrieval problem in its essence , aims to search for the queried person from a gallery of disjoint cameras. In recent years, impressive progress has been reported in video based re-ID , because video sequences provide rich visual and temporal information and can be trivially obtained by tracking algorithms in practical video surveillance applications. Nevertheless, the annotation difficulty limits the scalability of supervised methods in large-scale camera networks, which motivates us to investigate an unsupervised solution for video re-ID.
The difference between unsupervised learning and supervised learning consists in the availability of labels. Considering the good performance of supervised methods, an intuitive idea for unsupervised learning is to estimate re-ID labels as accurately as possible. In previous works, part from directly using hand-crafted descriptors , some other unsupervised re-ID methods focus on finding shared invariant information (saliency or dictionary ) among cameras. Deviating from the idea of estimating labels, these methods might be less competitive compared with the supervised counterparts. Meanwhile, these methods also suffer from large cross-camera variations. For example, salient features are not stable due to occlusions or viewpoint variations. Different from the existing unsupervised person re-ID methods, this paper is based on a more customized solution, i.e., cross-camera label estimation. In other words, we aim to mine the labels (matched or unmatched video pairs) across cameras. With the estimated labels, the remaining steps are exactly the same with supervised learning.
To mine labels across cameras, we leverage the graph matching technique (e.g., ) by constructing a graph for samples in each camera for label estimation. Instead of estimating labels independently, the graph matching approach has shown good property in finding correspondences by minimize the globally matching cost with intra-graph relationship. Meanwhile, label estimation problem for re-ID task is to link the same person across different cameras, which perfectly matches the graph matching problem by treating each person as a graph node. However, labels directly estimated by existing graph matching are very likely to be inaccurate and noisy due to the significant appearance changes across cameras. So a fixed graph constructed in the original feature space usually does not produce satisfying results. Moreover, the assumption that the assignment cost or affinity matrix is fixed in most graph matching methods may be unsuitable for re-ID due to large cross-camera variations .
In light of the above discussions, this paper proposes a dynamic graph matching (DGM) method to improve the label estimation performance for unsupervised video re-ID (the main idea is shown in Fig. 1). Specifically, our pipeline is an iterative process. In each iteration, a bipartite graph is established, labels are then estimated, and then a discriminative metric is learnt. Throughout this procedure, labels gradually become more accurate, and the learnt metric more discriminative. Additionally, our method includes a label re-weighting strategy which provides soft labels instead of hard labels, a beneficial step against the noisy intermediate label estimation output from graph matching.
The main contributions are summarized as follows:
We propose a dynamic graph matching (DGM) method to estimate cross-camera labels for unsupervised re-ID, which is robust to distractors and noisy initial training data. The estimated labels can be used for further discriminative re-ID models learning.
Our experiment confirms that DGM is only slightly inferior to its supervised baselines and yields competitive re-ID accuracy compared with existing unsupervised re-ID methods on three video benchmarks.
Related Work
Unsupervised Re-ID. Since unsupervised methods could alleviate the reliance on large-scale supervised data, a number of unsupervised methods have been developed. Some transfer learning based methods are proposed. Andy et al. present a multi-task learning method by aligning the positive mean on the target dataset to learn the re-ID models for the target dataset. Peng et al. try to adopt the pre-trained models on the source datasets to estimate the labels on the target datasets. Besides that, Zhao et al. present a patch based matching method with inconsistent salience for re-ID. An unsupervised cross dataset transfer learning method with graph Laplacian regularization terms is introduced in , and a similar constraint with graph Laplacian regularization term for dictionary learning is proposed in to address the unsupervised re-ID problem. Khan et al. select multiple frames in a video sequence as positive samples for unsupervised metric learning, which has limited extendability to the cross-camera settings.
Two main differences between the proposed method and previous unsupervised re-ID methods are summarized. Firstly, this paper estimates labels with graph matching to address the cross-camera variation problem instead of directly learning an invariant representation. Secondly, output estimated labels of dynamic graph matching can be easily expanded with other advanced supervised learning methods, which provides much flexibility for practical applications in large-scale camera network.
Two contemporary methods exists which also employ the idea of label estimation for unsupervised re-ID. Liu et al. use a retrieval method for labeling, while Fan et al. employ -means for label clustering.
Graph Matching for Re-ID. Graph matching has been widely studied in many computer vision tasks, such as object recognition and shape matching . It has shown superiority in finding consistent correspondences in two sets of features in an unsupervised manner. The relationships between nodes and edges are usually represented by assignment cost matrix or affinity matrix . Currently graph matching mainly focuses on optimizing the matching procedure with two fixed graphs. That is to say, the affinity matrix is fixed first, and then graph matching is formulated as linear integer programs or quadratic integer programs . Different from the literature, the graph constructed based on the original feature space is sub-optimal for re-ID task, since we need to model the camera variations besides the intra-graph deformations. Therefore, we design a dynamic graph strategy to optimize matching. Specifically, partial reliable matched results are utilized to learn discriminative metrics for accurate graph matching in each iteration.
Graph matching has been introduced in previous re-ID works which fall into two main categories. (1) Constructing a graph for each person by representing each node with body parts or local regions , and then a graph matching procedure is conducted to do re-identification. (2) Establishing a graph for each camera view, Hamid et al. introduces a joint graph matching to refine final matching results. They assume that all the query and gallery persons are available for testing, and then the matching results can be optimized by considering their joint distribution. However, it is hard to list a practical application for this method, since only the query person is available during testing stage in most scenarios. Motivated by , we construct a graph for each camera by considering each person as a node during the training procedure. Subsequently, we could mine the positive video pairs in two cameras with graph matching.
Graph Matching for Video Re-ID
Suppose that unlabelled graph contains persons, which is represented by for camera A, and another graph consists of persons denoted by for camera B. Note that contains another 0 element besides the persons. The main purpose is to model the situation that more than one person in cannot find its correspondences in , i.e. allowing person-to-dummy assignments. To mine the label information across cameras, we follow to formulate it as a binary linear programming with linear constraints:
For video re-ID, each node (person) is represented by a set of frames. Therefore, Sequence Cost () and Neighborhood Cost () are designed as the assignment cost in the graph matching model for video re-ID under a certain metric. The former cost penalizes matchings with mean set-to-set distance, while the latter one constrains the graph matching with within-graph data structure. The assignment cost between person and is then formulated as a combination of two costs with a weighting parameter in a log-logistic form:
Sequence Cost. The sequence cost penalizes the matched sequences with the sequence difference. Under a discriminative metric learnt from frame-level features, the average set distance between video sequences and is defined as the sequence cost, i.e.,
Neighborhood Cost. The neighborhood cost models the within camera data structure with neighborhood similarity constraints. Specifically, the correctly matched person pair’s neighborhood under two cameras should be similar . A primarily experiment on PRID2011 dataset with features in is conducted to justify this point. Results shown in Fig. 2 illustrates that the percentages of the same person having common neighbors are much larger than that of different persons. It means that the same person under two different cameras should share similar neighborhood . Moreover, compared with image-based re-ID, the neighborhood similarity constraints for video-based re-ID are much more effective. It verifies our idea to integrate the neighborhood constraints for graph matching in video re-ID, which could help to address the camera camera variations. The neighborhood cost penalizes the neighborhood difference between all matched sequences, which is formulated by,
where and denote the neighborhood of person in camera and person in camera , is the neighborhood parameter. For simplicity, a general kNN method is adopted in our paper, and is set as 5 for all experiments. Meanwhile, a theoretical analysis of the neighborhood constraints is presented. Let be a neighbor of person in camera A and be its neighbor in camera B. From the geometry perspective, we have
Since and are the neighbors of and , respectively, and are small positive numbers. On the other hand, is also a small positive under a discriminative metric . Thus, the distance between two neighbors and is small enough, i.e.,
Dynamic Graph Matching
A number of effective graph matching optimization methods could be adopted to solve the matching problem. After that, an intuitive idea to solve unsupervised video re-ID is learning a re-identification model based on the output of graph matching. However, there still remains two obvious shortcomings:
Since existing graphs are usually constructed in the original feature space with fixed assignment cost, it is not good enough for re-ID problem due to the large cross camera variations. Therefore, we need to learn a discriminative feature space to optimize the graph matching results.
The estimated labels output by graph matching may bring in many false positives and negatives to the training process. Moreover, the imbalanced positive and negative video pairs would worsen this situation further. Therefore, it is reasonable to re-encode the weights of labels for overall learning, especially for the uncertain estimated positive video pairs.
To address above two shortcomings, a dynamic graph matching method is proposed. It iteratively learns a discriminative metric with intermediate estimated labels to update the graph construction, and then the graph matching is improved. Specifically, a re-weighting scheme is introduced for the estimated positive and negative video pairs. Then, a discriminative metric learning method is introduced to update the graph matching. The block diagram of the proposed method is shown in Fig. 3.
This part introduces the designed label re-weighting scheme. Note that the following re-weighting scheme is based on the output () of optimization problem Eq. 1. is a binary indicator representing whether and are the same person () or not ().
Positive Re-weighting. All estimated by graph matching are positive video pairs. Since the labels are uncertain, it means that considering all equally is unreasonable. Therefore, we design a soft label encoded with a Gaussian kernel for ,
where is the pre-defined threshold. means the assignment cost computed in Eq. 2 in current iteration. In this manner, the positive labels () are converted into soft labels, with smaller distance assigned larger weights while larger distance with smaller weights. Meanwhile, the filtering strategy could reduce the impact of false positives.
Negative Re-weighting. Since abundant negative video pairs exist in video re-ID task compared with positive video pairs, some hard negative are selected for efficient training, for all is defined as
where is the pre-defined threshold. Considering both Eq. 7 and Eq. 8, we define based on the observation shown in Fig 4. denotes the mean of , which would be quite efficient. Thus, the label re-weighting scheme is refined by
The label re-weighting scheme has the following advantages: (1) for positive video pairs, it could filter some false positives and then assign different positive sample pairs different weights; (2) for negative video pairs, a number of easy negatives would be filtered. The re-weighing scheme is simple but effective as shown in the experiments.
2 Metric Learning with Re-weighted Labels
With the label re-weighting scheme, we could learn a discriminative metric similar to many previous supervised metric learning works. We define the loss function by log-logistic metric learning as done in , i.e.,
where is a positive constant bias to ensure has a lower bound. It is usually defined by the average distance between two cameras. The function denotes the distance of and under the distance metric , which is defined by . We choose the first-order statistics and to represent each person as done in .
By summing up all of sequence pairs, we obtain the probabilistic metric learning problem under an estimated formulated by,
where is a weighting parameter to deal with the imbalanced positive and negative pairs. The weights are caculated by if , and if , where denotes the number of candidates in the set. Note that some uncertain pairs are assigned with label without affecting the overall metric learning. The discriminative metric can be optimized by minimizing Eq. 11 using existing accelerated proximal gradient algorithms (e.g., ).
3 Iterative Updating
With the label information estimated by graph matching, we could learn an improved metric by selecting high-confident labeled video pairs. By utilizing the learnt metric, the assignment cost of Eq. 3 and Eq. 4 could be dynamically updated for better graph matching in a new iteration. After that, better graph matching could provide more reliable matching results, so as to improve the previous learnt metric. Iteratively, a stable graph matching result is finally achieved by a discriminative metric. The matched result could provide label data for further supervised learning methods. Meanwhile, a distance metric learnt in an unsupervised way could also be directly adopted for re-ID. The proposed approach is summarized in Algorithm 1.
Convergence Analysis. Note that we have two objective functions and optimizing and in each iteration. To ensure the overall convergence of the proposed dynamic graph matching, we design a similar strategy as discussed in . Specifically, can be easily optimized by choosing a suitable working step size , where is the Lipschitz constant of the gradient function . Thus, it could ensure , a detailed proof is shown in . For at iteration , we constrain the updating procedure by keep on updating the assignment cost matrix until getting a better which satisfies , similar proof can be derived from . By constrain the updating procedure, it could satisfy the criteria . This is validated in our experiments as discussed in Section 5.2. Particularly, the proposed method converges steadily.
Complexity Analysis. In the proposed method, most computational costs focus on the iterative procedure, since we need to conduct the graph matching with Hungarian algorithm at each iteration. We need to compute the sequence cost and neighborhood cost for each camera, and then graph matching time complexity is . Updating with accelerated proximal gradient is extremely fast as illustrated in . However, the proposed method is conducted offline to estimate labels, which is suitable for practical applications. During the online testing procedure, we only need to compute the distance between the query person and the gallery persons with the learnt re-identification model. The distance computation complexity is and ranking complexity is , which is the same as existing methods .
Experimental Results
Datasets. Three publicly available video re-ID datasets are used for evaluation: PRID-2011 , iLIDS-VID and MARS dataset. The PRID-2011 dataset is collected from two disjoint surveillance cameras with significant color inconsistency. It contains 385 person video tracks in camera A and 749 person tracks in camera B. Among all persons, 200 persons are recorded in both camera views. Following , 178 person video pairs with no less than 27 frames are employed for evaluation. iLIDS-VID dataset is captured by two non-overlapping cameras located in an airport arrival hall, 300 person videos tracks are sampled in each camera, each person track contains 23 to 192 frames. MARS dataset is a large scale dataset, it contains 1,261 different persons whom are captured by at least 2 cameras, totally 20,715 image sequences achieved by DPM detector and GMCCP tracker automatically.
Feature Extraction. The hand-craft feature LOMO is selected as the frame feature on all three datasets. LOMO extracts the feature representation with the Local Maximal Occurrence rule. All the image frames are normalized to . The original 26960-dim features for each frame are then reduced to a 600-dim feature vector by a PCA method for efficiency considerations on all three datasets. Meanwhile, we conduct a max-pooling for every 10 frames to get more robust video feature representations.
Settings. All the experiments are conducted following the evaluation protocol in existing works . PRID-2011 and iLIDS-VID datasets are randomly split by half, one for training and the other for testing. In testing procedure, the regularized minimum set distance of two persons is adopted. Standard cumulated matching characteristics (CMC) curve is adopted as our evaluation metric. The procedure are repeated for 10 trials to achieve statistically reliable results, the training/testing splits are originated from . Since MARS dataset contains 6 cameras with imbalanced tracklets in different cameras, we initialize the tracklets in camera 1 as the base graph, the same number of tracklets from other five cameras are randomly selected to construct a graph for matching. The evaluation protocol on MARS dataset is the same as , CMC curve and mAP (mean average precision) value are both reported.
Implementation. Both the graph matching and metric learning optimization problems can be solved separately using existing methods. We adopt Hungarian algorithm to solve the graph matching problem for efficiency considerations, and metric learning method (MLAPG) in as the baseline methods. Some advanced graph matching and metric learning methods may be adopted as alternatives to produce even better results as shown in Section 5.3. We report the results at iteration, with for all three datasets if without specification.
2 Self Evaluation
Evaluation of iterative updating. To demonstrate the effectiveness of the iterative updating strategy, the rank-1 matching rates of training and testing at each iteration on three datasets are reported in Fig. 5. Specifically, the rank-1 accuracy for testing is achieved with the learnt metric at each iteration, which could directly reflect the improvements for re-ID task. Meanwhile, the overall objective values on three datasets are reported.
Fig. 5(a) shows that the performance is improved with iterative updating procedure. We could achieve 81.57% accuracy for PRID-2011, 49.33% for iLIDS-VID and 59.64% for MARS dataset. Compare with iteration 1, the improvement at each iteration is significant. After about 5 iterations, the testing performance fluctuates mildly. This fluctuation may be caused by the data difference of the training data and testing data. It should be pointed out that there is a huge gap on the MARS dataset, this is caused by the abundant distractors during the testing procedure, while there is no distractors for training . Experimental results on the three datasets show that the proposed iterative updating algorithm improves the performance remarkably. Although without theoretical proof, it is shown in Fig. 5(b) that DGM converges to steady and satisfactory performance.
Evaluation of label re-weighting. We also compare the performance without label re-weighting strategy. The intermediate labels output by graph matching are simply transformed to for matched and for unmatched pairs. The rank-1 matching rates on three datasets are shown Table 1. Consistent improvements on three datasets illustrate that the proposed label-re-weighting scheme could improve the re-ID model learning.
Evaluation of label estimation. To illustrate the label estimation performance, we adopt the general precision, recall and F-score as the evaluation criteria. The results on three datasets are shown in Table 2. Since graph matching usually constrains full matching, the precision score is quite close to the recall on the PRID-2011 and iLIDS-VID datasets. Note that the precision score is slightly higher than recall is due to the proposed positive re-weighting strategy.
Running time. The running times on three datasets with the settings described in Section 5.1 are evaluated. It is implemented with Matlab and executed on a desktop PC with i7-4790K @4.0 GHz CPU and 16GB RAM. The training and testing time are reported by the average running time in 10 trials. For training, since we adopt an efficient graph matching algorithm and accelerated metric learning , the training time is acceptable. The training time for the PRID2011 dataset is about 13s, about 15s for iLIDS-VID dataset, about 2.5 hours for the MARS dataset due to the large amount of tracklets. For testing, the running time is fast for our method, since standard 1-vs-N matching scheme is employed. The testing times are less than 0.001s on PRID2011 and iLIDS-VID datasets for each query process, and around 0.01s on MARS with 636 gallery persons.
3 Estimated Labels for Supervised Learning
This subsection evaluates the effectiveness of the output estimated labels for other supervised learning methods. Compared with the re-identification performances with groundtruth labels (GT), they provide upper bounds as references to illustrate the effectiveness of DGM. Specifically, two metric learning methods MLAPG and XQDA , and an ID-discriminative Embedding (IDE) deep model are selected for evaluation as shown in Fig. 6.
Configured with MLAPG and XQDA, the performances outperform the baseline -norm on all three datasets, usually by a large margin. The results show that the estimated labels also match well with other supervised methods. Compared with the upper bounds provided by supervised metric learning methods with groundtruth labels, the results on PRID-2011 and MARS datasets are quite close to the upper bounds. Although the results on iLIDS-VID dataset are not that competitive, the main reason can be attributed to its complex environment with many background clutters, such as luggage, passengers and so on, which cannot be effectively solved by a global descriptor (LOMO) .
Another experiment with IDE deep model on the three datasets shows the expendability of the proposed method to deep learning methods. Specifically, about 441k out of 518k image frames are labelled for 625 identities on the large scale MARS dataset, while others are left with Eq. 9. The labelled images are then resized to pixels as done in , square regions are randomly cropped from the resized images. Three fully convolutional layers with 1,024, 1,024 and blobs are defined by using AlexNet , where denotes the labelled identities on three datasets. The FC-7 layer features (1,024-dim) are extracted from testing frames, maxpooling strategy is adopted for each sequence . Our IDE model is implemented with MxNet. Fig. 6 shows that the performance is improved with a huge gap to hand-craft features with deep learning technique on the large scale MARS dataset. Comparably, it does not perform well on two small scale datasets (PRID-2011 and iLIDS-VID dataset) compared to hand-craft features due to the limited training data. Meanwhile, the gap between the estimated labels to fully supervised deep learning methods is consistent to that of metric learning methods. Note that since one person may appear in more than one cameras on the MARS dataset, the rank-1 matching rates may be even higher than label estimation accuracy.
4 Comparison with Unsupervised re-ID
This section compares the performances to existing unsupervised re-ID methods. Specifically, two image-based re-ID methods, Salience results originated from , and GRDL is implemented by averaging multiple frame features in a video sequence to a single feature vector. Four state-of-the-art unsupervised video re-ID methods are included, including DVDL , FV3D , STFV3D and UnKISS . Meanwhile, our unsupervised estimated labels are configured with three supervised baselines MLAPG , XQDA and IDE to learn the re-identification models as shown in Table 3.
It is shown in Table 3 that the proposed method outperforms other unsupervised re-ID methods on PRID-2011 and MARS dataset often by a large margin. Meanwhile, a comparable performance with other state-of-the-art performances is obtained on iLIDS-VID dataset even with a poor baseline input. In most cases, our re-ID performance could achieve the best performances on all three datasets with the learnt metric directly. We assume that the proposed method may yield better results by adopting better baseline descriptors, other advanced supervised learning methods would also boost the performance further. The advantages can be attributed to two folds: (1) unsupervised estimating cross cameras labels provides a good solution for unsupervised re-ID, since it is quite hard to learn invariant feature representations without cross-camera label information; (2) dynamic graph matching is a good solution to select matched video pairs with the intra-graph relationship to address the cross camera variations.
5 Robustness in the Wild
This subsection mainly discusses whether the proposed method still works under practical conditions.
Distractors. In real applications, some persons may not appear in both cameras. To simulate this situation for training, we use the additional 158 person sequences in camera A and 549 persons in camera B of PRID-2011 dataset to conduct the experiments. distractor persons are randomly selected from these additional person sequences for each camera. They are added to the training set as distractors. is the size of training set. We use these distractors to model the practical application, in which many persons cannot find their correspondences in another camera.
Trajectory segments. One person may have multiple sequences in each camera due to tracking errors or reappear in the camera views. Therefore, multiple sequences of the same person may be unavoidable to be false treated as different persons. To test the performance, person sequences are randomly selected to be divided into two halves in each camera on PRID-2011 dataset. In this manner, about persons would be false matched since the are both randomly selected for two cameras.
Table 4 shows that the performance without one-to-one matching assumption is still stable, with only a little degradation in both situations, this is because: (1) Without one-to-one assumption, it will increase the number of negative matching pairs, but due to the abundant negatives pairs in re-ID task, the influence is not that much. (2) The label re-weighting strategy would reduce the effects of low-confidence matched positive pairs.
Conclusion
This paper proposes a dynamic graph matching method to estimate labels for unsupervised video re-ID. The graph is dynamically updated by learning a discriminative metric. Benefit from the two layer cost designed for graph matching, a discriminative metric and an accurate label graph are updated iteratively. The estimated labels match well with other advanced supervised learning methods, and superior performances are obtained in extensive experiments. The dynamic graph matching framework provides a good solution for unsupervised re-ID.
Acknowledgement This work is partially supported by Hong Kong RGC General Research Fund HKBU (12202514), NSFC (61562048). Thanks Guangcan Mai for the IDE implementation.