Graph Sampling Based Deep Metric Learning for Generalizable Person Re-Identification

Recent studies show that, both explicit deep feature matching as well aslarge-scale and diverse training data can significantly improve thegeneralization of person re-identification. However, the efficiency of learningdeep matchers on large-scale data has not yet been adequately studied. Thoughlearning with classification parameters or class memory is a popular way, itincurs large memory and computational costs. In contrast, pairwise deep metriclearning within mini batches would be a better choice. However, the mostpopular random sampling method, the well-known PK sampler, is not informativeand efficient for deep metric learning. Though online hard example mining hasimproved the learning efficiency to some extent, the mining in mini batchesafter random sampling is still limited. This inspires us to explore the use ofhard example mining earlier, in the data sampling stage. To do so, in thispaper, we propose an efficient mini-batch sampling method, called graphsampling (GS), for large-scale deep metric learning. The basic idea is to builda nearest neighbor relationship graph for all classes at the beginning of eachepoch. Then, each mini batch is composed of a randomly selected class and itsnearest neighboring classes so as to provide informative and challengingexamples for learning. Together with an adapted competitive baseline, weimprove the state of the art in generalizable person re-identificationsignificantly, by 25.1% in Rank-1 on MSMT17 when trained on RandPerson.Besides, the proposed method also outperforms the competitive baseline, by 6.8%in Rank-1 on CUHK03-NP when trained on MSMT17. Meanwhile, the training time issignificantly reduced, from 25.4 hours to 2 hours when trained on RandPersonwith 8,000 identities. Code is available athttps://github.com/ShengcaiLiao/QAConv.