Mutual Mean-Teaching: Pseudo Label Refinery for Unsupervised Domain Adaptation on Person Re-identification

1 INTRODUCTION . Person re-identification ( re-ID ) aims at retrieving the same persons ’ images from images captured by different cameras . In recent years , person re-ID datasets with increasing numbers of images were proposed to facilitate the research along this direction . All the datasets require time-consuming annotations and are keys for re-ID performance improvements . However , even with such large-scale datasets , for person images from a new camera system , the person re-ID models trained on existing datasets generally show evident performance drops because of the domain gaps . Unsupervised Domain Adaptation ( UDA ) is therefore proposed to adapt the model trained on the source image domain ( dataset ) with identity labels to the target image domain ( dataset ) with no identity annotations . State-of-the-art UDA methods ( Song et al. , 2018 ; Zhang et al. , 2019b ; Yang et al. , 2019 ) for person re-ID group unannotated images with clustering algorithms and train the network with clusteringgenerated pseudo labels . Although the pseudo label generation and feature learning with pseudo labels are conducted alternatively to refine the pseudo labels to some extent , the training of the neural network is still substantially hindered by the inevitable label noise . The noise derives from the limited transferability of source-domain features , the unknown number of target-domain identities , and the imperfect results of the clustering algorithm . The refinery of noisy pseudo labels has crucial influences to the final performance , but is mostly ignored by the clustering-based UDA methods . 1Code is available at https : //github.com/yxgeee/MMT . To effectively address the problem of noisy pseudo labels in clustering-based UDA methods ( Song et al. , 2018 ; Zhang et al. , 2019b ; Yang et al. , 2019 ) ( Figure 1 ) , we propose an unsupervised Mutual Mean-Teaching ( MMT ) framework to effectively perform pseudo label refinery by optimizing the neural networks under the joint supervisions of off-line refined hard pseudo labels and on-line refined soft pseudo labels . Specifically , our proposed MMT framework provides robust soft pseudo labels in an on-line peer-teaching manner , which is inspired by the teacher-student approaches ( Tarvainen & Valpola , 2017 ; Zhang et al. , 2018b ) to simultaneously train two same networks . The networks gradually capture target-domain data distributions and thus refine pseudo labels for better feature learning . To avoid training error amplification , the temporally average model of each network is proposed to produce reliable soft labels for supervising the other network in a collaborative training strategy . By training peer-networks with such on-line soft pseudo labels on the target domain , the learned feature representations can be iteratively improved to provide more accurate soft pseudo labels , which , in turn , further improves the discriminativeness of learned feature representations . The classification and triplet losses are commonly adopted together to achieve state-of-the-art performances in both fully-supervised ( Luo et al. , 2019 ) and unsupervised ( Zhang et al. , 2019b ; Yang et al. , 2019 ) person re-ID models . However , the conventional triplet loss ( Hermans et al. , 2017 ) can not work with such refined soft labels . To enable using the triplet loss with soft pseudo labels in our MMT framework , we propose a novel soft softmax-triplet loss so that the network can benefit from softly refined triplet labels . The introduction of such soft softmax-triplet loss is also the key to the superior performance of our proposed framework . Note that the collaborative training strategy on the two networks is only adopted in the training process . Only one network is kept in the inference stage without requiring any additional computational or memory cost . The contributions of this paper could be summarized as three-fold . ( 1 ) We propose to tackle the label noise problem in state-of-the-art clustering-based UDA methods for person re-ID , which is mostly ignored by existing methods but is shown to be crucial for achieving superior final performance . The proposed Mutual Mean-Teaching ( MMT ) framework is designed to provide more reliable soft labels . ( 2 ) Conventional triplet loss can only work with hard labels . To enable training with soft triplet labels for mitigating the pseudo label noise , we propose the soft softmax-triplet loss to learn more discriminative person features . ( 3 ) The MMT framework shows exceptionally strong performances on all UDA tasks of person re-ID . Compared with state-of-the-art methods , it leads to significant improvements of 14.4 % , 18.2 % , 13.4 % , 16.4 % mAP on Market-to-Duke , Duke-to-Market , Market-to-MSMT , Duke-to-MSMT re-ID tasks . 2 RELATED WORK . Unsupervised domain adaptation ( UDA ) for person re-ID . UDA methods have attracted much attention because their capability of saving the cost of manual annotations . There are three main categories of methods . The first category of clustering-based methods maintains state-of-the-art performance to date . ( Fan et al. , 2018 ) proposed to alternatively assign labels for unlabeled training samples and optimize the network with the generated targets . ( Lin et al. , 2019 ) proposed a bottom- up clustering framework with a repelled loss . ( Yang et al. , 2019 ) introduced to assign hard pseudo labels for both global and local features . However , the training of the neural network was substantially hindered by the noise of the hard pseudo labels generated by clustering algorithms , which was mostly ignored by existing methods . The second category of methods learns domain-invariant features from style-transferred source-domain images . SPGAN ( Deng et al. , 2018 ) and PTGAN ( Wei et al. , 2018 ) transformed source-domain images to match the image styles of the target domain while maintaining the original person identities . The style-transferred images and their identity labels were then used to fine-tune the model . HHL ( Zhong et al. , 2018 ) learned camera-invariant features with camera style transferred images . However , the retrieval performances of these methods deeply relied on the image generation quality , and they did not explore the complex relations between different samples in the target domain . The third category of methods attempts on optimizing the neural networks with soft labels for target-domain samples by computing the similarities with reference images or features . ENC ( Zhong et al. , 2019 ) assigned soft labels by saving averaged features with an exemplar memory module . MAR ( Yu et al. , 2019 ) conducted multiple soft-label learning by comparing with a set of reference persons . However , the reference images and features might not be representative enough to generate accurate labels for achieving advanced performances . Generic domain adaptation methods for close-set recognition . Generic domain adaptation methods learn features that can minimize the differences between data distributions of source and target domains . Adversarial learning based methods ( Zhang et al. , 2018a ; Tzeng et al. , 2017 ; Ghifary et al. , 2016 ; Bousmalis et al. , 2016 ; Tzeng et al. , 2015 ) adopted a domain classifier to dispel the discriminative domain information from the learned features in order to reduce the domain gap . There also exist methods ( Tzeng et al. , 2014 ; Long et al. , 2015 ; Yan et al. , 2017 ; Saito et al. , 2018 ; Ghifary et al. , 2016 ) that minimize the Maximum Mean Discrepancy ( MMD ) loss between source- and target-domain distributions . However , these methods assume that the classes on different domains are shared , which is not suitable for unsupervised domain adaptation on person re-ID . Teacher-student models have been widely studied in semi-supervised learning methods and knowledge/model distillation methods . The key idea of teacher-student models is to create consistent training supervisions for labeled/unlabeled data via different models ’ predictions . Temporal ensembling ( Laine & Aila , 2016 ) maintained an exponential moving average prediction for each sample as the supervisions of the unlabeled samples , while the mean-teacher model ( Tarvainen & Valpola , 2017 ) averaged model weights at different training iterations to create the supervisions for unlabeled samples . Deep mutual learning ( Zhang et al. , 2018b ) adopted a pool of student models instead of the teacher models by training them with supervisions from each other . However , existing methods with teacher-student mechanisms are mostly designed for close-set recognition problems , where both labeled and unlabeled data share the same set of class labels and could not be directly utilized on unsupervised domain adaptation tasks of person re-ID . Generic methods for handling noisy labels can be classified into four categories . Loss correction methods ( Patrini et al. , 2017 ; Vahdat , 2017 ; Xiao et al. , 2015 ) tried to model the noise transition matrix , however , such matrix is hard to estimate in real-world tasks , e.g . unsupervised person re-ID with noisy pseudo labels obtained via clustering algorithm . ( Veit et al. , 2017 ; Lee et al. , 2018 ; Li et al. , 2017 ; Han et al. , 2019 ) attempted to correct the noisy labels directly , while the clean set required by such methods limits their generalization on real-world applications . Noise-robust methods designed robust loss functions against label noises , for instance , Mean Absolute Error ( MAE ) loss ( Ghosh et al. , 2017 ) , Generalized Cross Entropy ( GCE ) loss ( Zhang & Sabuncu , 2018 ) and Label Smoothing Regularization ( LSR ) ( Szegedy et al. , 2016 ) . However , these methods did not study how to handle the triplet loss with noisy labels , which is crucial for learning discriminative feature representations on person re-ID . The last kind of methods which focused on refining the training strategies is mostly related to our method . Co-teaching ( Han et al. , 2018 ) trained two collaborative networks and conducted noisy label detection by selecting on-line clean data for each other , Co-mining ( Wang et al. , 2019 ) further extended this method on the face recognition task with a re-weighting function for Arc-Softmax loss ( Deng et al. , 2019 ) . However , the above methods are not designed for the open-set person re-ID task and could not achieve state-of-the-art performances under the more challenge unsupervised settings . 3 PROPOSED APPROACH . We propose a novel Mutual Mean-Teaching ( MMT ) framework for tackling the problem of noisy pseudo labels in clustering-based Unsupervised Domain Adaptation ( UDA ) methods . The label noise has important impacts to the domain adaptation performance but was mostly ignored by those methods . Our key idea is to conduct pseudo label refinery in the target domain by optimizing the neural networks with off-line refined hard pseudo labels and on-line refined soft pseudo labels in a collaborative training manner . In addition , the conventional triplet loss can not properly work with soft labels . A novel soft softmax-triplet loss is therefore introduced to better utilize the softly refined pseudo labels . Both the soft classification loss and the soft softmax-triplet loss work jointly to achieve optimal domain adaptation performances . Formally , we denote the source domain data as Ds = { ( xsi , ysi ) | Ns i=1 } , where xsi and ysi denote the i-th training sample and its associated person identity label , Ns is the number of images , and Ms denotes the number of person identities ( classes ) in the source domain . The Nt target-domain images are denoted as Dt = { xti| Nt i=1 } , which are not associated with any ground-truth identity label . 3.1 CLUSTERING-BASED UDA METHODS REVISIT . State-of-the-art UDA methods ( Fan et al. , 2018 ; Lin et al. , 2019 ; Zhang et al. , 2019b ; Yang et al. , 2019 ) follow a similar general pipeline . They generally pre-train a deep neural networkF ( ·|θ ) on the source domain , where θ denotes current network parameters , and the network is then transferred to learn from the images in the target domain . The source-domain images ’ and target-domain images ’ features encoded by the network are denoted as { F ( xsi |θ ) } | Ns i=1 and { F ( xti|θ ) } | Nt i=1 respectively . As illustrated in Figure 2 ( a ) , two operations are alternated to gradually fine-tune the pre-trained network on the target domain . ( 1 ) The target-domain samples are grouped into pre-defined Mt classes by clustering the features { F ( xti|θ ) } | Nt i=1 output by the current network . Let ỹ t i denotes the pseudo label generated for image xti . ( 2 ) The network parameters θ and a learnable target-domain classifier Ct : f t → { 1 , · · · , Mt } are then optimized with respect to an identity classification ( crossentropy ) loss Ltid ( θ ) and a triplet loss ( Hermans et al. , 2017 ) Lttri ( θ ) in the form of , Ltid ( θ ) = 1 Nt Nt∑ i=1 Lce ( Ct ( F ( xti|θ ) ) , ỹti ) , ( 1 ) Lttri ( θ ) = 1 Nt Nt∑ i=1 max ( 0 , ||F ( xti|θ ) − F ( xti , p|θ ) ||+m− ||F ( xti|θ ) − F ( xti , n|θ ) || ) , ( 2 ) where || · || denotes the L2-norm distance , subscripts i , p and i , n indicate the hardest positive and hardest negative feature index in each mini-batch for the sample xti , and m = 0.5 denotes the triplet distance margin . Such two operations , pseudo label generation by clustering and feature learning with pseudo labels , are alternated until the training converges . However , the pseudo labels generated in step ( 1 ) inevitably contain errors due to the imperfection of features as well as the errors of the clustering algorithms , which hinder the feature learning in step ( 2 ) . To mitigate the pseudo label noise , we propose the Mutual Mean-Teaching ( MMT ) framework together with a novel soft softmax-triplet loss to conduct the pseudo label refinery .

Summary: This paper proposes an unsupervised domain adaptation method for person re-identification. The proposed method handles noises on pseudo labels created by unsupervised clustering. Two networks are used for training, and the estimated confidences of other models are used for the next training iterations. The temporally average model is used for each network to avoid error amplification. Also, soft softmax-triplet loss is proposed to handle soft labels for triplet loss.