Image-Image Domain Adaptation with Preserved Self-Similarity and
Domain-Dissimilarity for Person Re-identification
Weijian Deng† , Liang Zheng‡ , Guoliang Kang‡ , Yi Yang‡ , Qixiang Ye† , Jianbin Jiao†∗
†
University of Chinese Academy of Sciences ‡ University of Technology Sydney

arXiv:1711.07027v2 [] 10 Jan 2018

dengweijian16@mails.ucas.ac.cn, liangzheng06@gmail.com

self-similarity

Abstract
Person re-identification (re-ID) models trained on one
domain often fail to generalize well to another. In our attempt, we present a “learning via translation” framework.
In the baseline, we translate the labeled images from source
to target domain in an unsupervised manner. We then
train re-ID models with the translated images by supervised
methods. Yet, being an essential part of this framework, unsupervised image-image translation suffers from the information loss of source-domain labels during translation.
Our motivation is two-fold. First, for each image, the
discriminative cues contained in its ID label should be
maintained after translation. Second, given the fact that two
domains have entirely different persons, a translated image
should be dissimilar to any of the target IDs. To this end,
we propose to preserve two types of unsupervised similarities, 1) self-similarity of an image before and after translation, and 2) domain-dissimilarity of a translated source image and a target image. Both constraints are implemented
in the similarity preserving generative adversarial network
(SPGAN) which consists of a Siamese network and a CycleGAN. Through domain adaptation experiment, we show
that images generated by SPGAN are more suitable for domain adaptation and yield consistent and competitive re-ID
accuracy on two large-scale datasets.

(a)
(b) and domainFigure 1: Illustration
of self-similarity
dissimilarity. In each triplet, left: a source-domain image,
middle: a source-target translated version of the source image, right: an arbitrary target-domain image. We require
that 1) a source image and its translated image should contain the same ID, i.e., self-similarity, and 2) the translated
image should be of a different ID with any target image,
i.e., domain dissimilarity. Note: the source and target domains contain entirely different IDs.

single-domain re-ID methods may be limited in real world
scenarios, where domain-specific labels are not available.
A common strategy for this problem is unsupervised domain adaptation (UDA). But this line of methods assume
that the source and target domains contain the same set of
classes. Such assumption does not hold for person re-ID because different re-ID datasets usually contain entirely different persons (classes). In domain adaptation, a recent trend
consists in image-level domain translation [18, 4, 28]. In
the baseline approach, two steps are involved. First, labeled images from the source domain are transferred to the
target domain, so that the transferred image has a similar
style with the target domain. Second, the style-transferred
images and their associated labels are used in supervised
learning in the target domain. In literature, commonly used
style transfer methods include [27, 22, 46, 53]. In this paper,
we use CycleGAN [53] following the practice in [27, 18].
In person re-ID, there is a distinct yet unconsidered requirement for the baseline described above: the visual content associated with the ID label of an image should be preserved after image-image translation. In our scenario, such

1. Introduction
This paper considers domain adaptation in re-ID. The
re-ID task aims at searching for the relevant images to the
query. In our setting, the source domain is fully annotated,
while the target domain does not have ID labels. In the
community, domain adaptation re-ID are gaining increasing popularity, because 1) of the expensive labeling process
and 2) when models trained on one dataset are directly used
on another, the re-ID accuracy drops dramatically [6] due
to dataset bias [41]. As a result, current fully supervised,
∗ Corresponding

domain-dissimilarity

Author

1

domain-dissimila

Source domain

…

Target domain

similarity preserving
image-to-image translation

…

source domain

Feature
learning

re-ID
model

target domain

Figure 2: Pipeline of the “learning via translation” framework consisting of two steps. First, we translate the labeled images
from a source domain to a target domain in an unsupervised manner. Second, we train re-ID models with the translated
images using supervised feature learning methods. The major contribution consists in the first step, i.e., similarity preserving
…
image-image translation.
…
visual content usually refers to the underlying (latent) ID in2. Related Work
formation for a foreground pedestrian. To meet this requireImage-image translation. Image-image translation
ment tailored for re-ID, we need additional constraints on
aims
at constructing a mapping function between two dothe mapping function. In this paper, we propose a solution
mains.
A representative mapping function is the conditional
to this requirement, motivated from two aspects. First, a
GAN
[20],
which using paired training data produces imtranslated image, despite of its style changes, should contain
pressive
image-to-image
transition results. However, the
the same underlying identity with its corresponding source
paired
training
data
is
often
difficult to acquire. Unsuperimage. Second, in re-ID, the source and target domains convised
image-image
translation
is thus more applicable since
tain two entirely different sets of identities. Therefore, a
data
collection
is
easier.
To
tackle
unpaired settings, a cytranslated image should be different from any image in the
cle
consistency
loss
is
introduced
by
[22, 46, 53]. In [3],
target dataset in terms of the underlying ID.
an
unsupervised
distance
loss
is
proposed
for one side doThis paper introduces the Similarity Preserving cyclemain
mapping.
In
[27],
a
general
framework
is proposed by
consistent Generative Adversarial Network (SPGAN), an
making
a
shared
latent
space
assumption.
Our
work aims to
unsupervised domain adaptation approach which generates
find
a
mapping
function
between
source
domain
and target
images for effective target-domain learning. SPGAN is
domain,
and
we
more
concerned
with
similarity
preserving
composed of a Siamese network (SiaNet) and a CycleGAN.
translation.
Using a contrastive loss, the SiaNet pulls close a translated
Neural style transfer [12, 23, 43, 21, 5, 24, 19, 25] is
image and its counter part in the source, and push away the
another strategy of image-image translation, which aims at
translated image and any image in the target. In this manner,
replicating the style of one image, while our work focuses
the contrastive loss satisfies the specific requirement in peron learning the mapping function between two domains,
son re-ID. Note that, the added constraint is unsupervised,
rather than two images.
i.e., the source labels are not used during domain adaptation.
During training, in each mini-batch (batch size = 1), a trainUnsupervised domain adaptation. Our work relates
ing image is firstly used to update the Generator (of Cycleto unsupervised domain adaptation (UDA) where no laGAN), then the Discriminator (of CycleGAN), and finally
beled target images are available during training. In this
the convolutional layers in SiaNet. Through the coordinacommunity, some methods aim to learn a mapping betion between CycleGAN loss and the SiaNet loss, we are
tween source and target distributions [37, 13, 9, 38]. Corable to generate samples which not only possess the style of
relation Alignment (CORAL) [38] propose to match the
the target domain and but also preserve their underlying ID
mean and covariance of two distributions. Recent methinformation.
ods [18, 4, 28] use an adversarial approach to learn a transUsing SPGAN, we are able to create a dataset on the tarformation in the pixel space from one domain to another.
get domain in an unsupervised manner. The dataset inherits
Other methods seek to find a domain-invariant feature space
the labels from the source domain and thus can be used in
[34, 31, 10, 30, 42, 11, 2]. Long et al. [30] and Tzeng et al.
supervised learning in the target domain. The contributions
[42] use the Maximum Mean Discrepancy (MMD) [15] for
of this work are summarized below:
this purpose. Ganin et al. [11] and Ajakan et al. [2] introduce a domain confusion loss to learn domain-invariant
• Minor contribution: we present a “learning via translafeatures. Different from the settings in this paper, most of
tion” baseline for domain adaptation in person re-ID.
the UDA methods assume that class labels are the same
across domains, while different re-ID datasets contain en• Major contribution: we introduce SPGAN to improve
tirely different person identities (classes). Therefore, the
the baseline. SPGAN works by preserving the underapproaches mentioned above can not be utilized directly for
lying ID information during image-image translation.
domain adaptation in re-ID.
2

Method
Train. Set Test Set
Supervised
Ttrain
Ttest
Direct Transfer
Strain
Ttest
Ttest
CycleGAN (basel.) G(Strain )
SPGAN
Gsp (Strain )
Ttest

Unsupervised re-ID. Hand-craft features [32, 14, 7, 33,
26, 49] can be directly employed for unsupervised re-ID.
All these methods focus on feature design, but the rich information from the distribution of samples in the dataset
has not been fully exploited. Some methods are based
on saliency statistics [48, 44]. In [47], K-means clustering is used for learning a unsupervised asymmetric metric.
For unsupervised domain adaptation re-ID, the authors of
[35] propose an asymmetric multi-task dictionary learning
method to transfer the view invariant representation learned
on source data to target data.
Recently, several works focus on label estimation of the
unlabeled target dataset. Ye et al. [45] use graph matching
for cross-camera label estimation. Fan et al. [6] propose
a progressive method based on the iterations between Kmeans clustering and IDE [50] fine-tuning. Liu et al. [29]
employ a reciprocal search process to refine the estimated
labels. Our work aims to learn re-ID models that can be
utilized directly to target domain, and can potentially cooperate with label estimation methods in model initialization.

Accuracy
+++++
++
+++
++++

Table 1: A brief summary of different methods considered
in this paper. “G” and “Gsp ” denote the Generator in CycleGAN and SPGAN, respectively. Strain , Ttrain , Ttest denote the training set of the source dataset, the training set
and testing set of the target dataset, respectively.
not resolved (to be shown in Table 2). Using CycleGAN and
SPGAN to generate a new training set, which is more styleconsistent with the target, respectively yields improvement.

3.2. SPGAN: Approach Details
3.2.1

CycleGAN Revisit

CycleGAN introduces two generator-discriminator pairs,
{G, DT } and {F, DS }, which map a sample from source
(target) domain to target (source) domain and produce a
sample which is indistinguishable from those in the target
(source) domain, respectively. For generator G and its associated discriminator DT , the adversarial loss is,

3. Proposed Method
3.1. Baseline Overview
Given an annotated dataset S from source domain and
unlabeled dataset T from target domain, our goal is to use
the labeled source images to train a re-ID model that generalizes well to target domain. Figure 2 presents a pipeline of
the “learning via translation” framework, which consists of
two steps, i.e., source-target image translation for training
data creation, and supervised feature learning for re-ID.

LT adv (G, DT , px , py ) =Ey∼py [(DT (y) − 1)2 ]
+ Ex∼px [(DT (G(x))2 ],

(1)

where px and py denote the sample distributions in the
source and target domain, respectively. For generator F and
its associated discriminator DS , the adversarial loss is,

• Source-target image translation. Using a generative
function G(·) that translates the annotated dataset S
from the source domain to target domain in an unsupervised manner, we “create” a labeled training dataset
G(S) on the target domain. In this paper, we use CycleGAN [53], following the practice in [27, 18].

LSadv (F, DS , py , px ) =Ex∼px [(DS (x) − 1)2 ]
+ Ey∼py [(DS (F (y))2 ].

(2)

Considering there exist infinitely many alternative mapping functions due to the lack of paired training data, CycleGAN introduces a cycle-consistent loss, which attempts
to recover the original image after a cycle of translation and
reverse translation, to reduce the space of possible mapping
functions. The cycle-consistent loss is,

• Feature learning. With the translated dataset G(S)
that contains labels, feature learning methods are applied to train re-ID models. Specifically, we adopt the
same setting as [50], in which the rank-1 accuracy and
mAP on the fully-supervised Market-1501 dataset is
75.8% and 52.2%.

Lcyc (G, F ) =Ex∼px [kF (G(x)) − xk1 ]
+ Ey∼py [kG(F (y)) − yk1 ].

The focus of this paper is to improve Step 1, so that with
better training samples, the overall re-ID accuracy can be
improved. The experiment will validate the proposed Step
2 (Gsp (·)) on several feature learning methods. A brief
summary of different methods considered in this paper is
presented in Table 1. We denote the method “Direct Transfer” as directly using the training set S instead of G(S) for
model learning. This method yields the lowest accuracy because the style difference between the source and target is

(3)

Apart from the cycle-consistent loss, adversarial loss, we
use the target domain identity constraint as an auxiliary for
image-image translation. Target domain identity constraint
was introduced by [40] to regularize the generator to be the
identity matrix on samples from target domain, written as,
Lide (G, F, px , py ) =Ex∼px kF (x) − xk1
+ Ey∼py kG(y) − yk1 .
3

(4)

Training image pair selection. In Eq. 5, the contrastive loss uses binary labels of input image pairs. The
design of the pair similarities reflects the “self-similarity”
and “domain-dissimilarity” principles. Note that, we select
training pairs in an unsupervised manner, so that we use
the contrastive loss without additional annotations.
Formally, CycleGAN has two generators, i.e., generator G which maps source-domain images to the style of the
target domain, and generator F which maps target-domain
images to the style of the source domain. Suppose two samples denoted as xS and xT come from the source domain
and target domain, respectively. Given G and F , we define
two positive pairs: 1) xS and G(xS ), 2) xT and F (xT ). In
either image pair, the two images contain the same person;
the only difference is that they have different styles. In the
learning procedure, we encourage the whole network to pull
these two images close.
On the other hand, for generator G and F , we also define
two types of negative training pairs: 1) G(xS ) and xT , 2)
F (xT ) and xS . Such design of negative training pairs is
based on the prior knowledge that datasets in different reID domains have entirely different sets of IDs. As a result,
a translated image should be of different ID from any target
image. In this manner, the network pushes two dissimilar
images away. Training pairs are shown in Fig. 1. Some
positive pairs are also shown in (a) and (d) of each column
in Fig. 4.
Overall objective function. The final SPGAN objective
can be written as,

SiaNet
G
DT

DS
F
source domain

target domain

Figure 3: SPGAN consists of two components: a SiaNet
(top) and CycleGAN (bottom). CycleGAN learns mapping
functions G and F between two domains, and the SiaNet
learns a latent space that constrains the learning procedure
of mapping functions.

As mentioned [53], generators G and F may change the
color of output images without Lide . In experiment, we observe that the model may generate unreal results without
Lide (Fig. 4(b)). This is undesirable for re-ID feature learning. By turning on the identity loss, the color of the input
and output can be preserved (see Section 4.3).
3.2.2

SPGAN

Applied in person re-ID, similarity preserving is an essential
function to generate improved samples for domain adaptation. As analyzed in Section 1, we aim to preserve the IDrelated information for each translated image. We emphasize that such information should not be the background or
image style, but should be underlying and latent. To fulfill
this goal, we integrate a SiaNet with CycleGAN, as shown
in Fig 3. During training, CyleGAN is to learn a mapping
function between two domains, and SiaNet is to learn a latent space that constrains the learning procedure of mapping
function.
Similarity preserving loss function. We utilize the contrastive loss [16] to train SiaNet,
Lcon (i, x1 , x2 ) =(1 − i){max(0, m − d)}2 + id2 ,

Lsp = LT adv + LSadv + λ1 Lcyc + λ2 Lide + λ3 Lcon ,
(6)
where λt , t ∈ {1, 2, 3} controls the relative importance of
four objectives. The first three losses belong to the CycleGAN formulation [53], and the contrastive loss induced by
SiaNet imposes a new constraint on the system.
SPGAN training procedure. In the training phase, SPGAN are divided into three components which are learned
alternately, the generators, discriminators, and SiaNet.
When the parameters of two components are fixed, the parameters of the third component is updated. We train the
SPGAN until the convergence or the maximum iterations.

(5)

3.3. Feature Learning

where x1 and x2 are a pair of input vectors, and i represents
the binary label assigned to this pair. i = 1 if x1 and x2
are positive pair; i = 0 if x1 and x2 are negative pair. m
is the margin that defines the separability in the embedding
space. When m = 0, the loss of the negative training pair is
not back-propagated in the system. When m > 0, both positive and negative sample pairs are considered. A larger m
means that the loss of negative training samples has a higher
weight in back propagation. d denotes the Euclidean distance between two input vectors: d(x1 , x2 ) = kx1 − x2 k2 .

Feature learning is the second step of the “learning via
translation” framework. Once we have the style-transferred
dataset G(S) composed of the translated images and their
associated labels, the feature learning step is the same as
supervised methods. Since we mainly focus on Step 1
(source-target image translation), we adopt the baseline IDdiscriminative Embedding (IDE) specified in [50]. We employ ResNet-50 [17] as the base model and only modify
the output dimension of the last fully-connected layer to the
4

Market

Duke

Duke

Market

1×1×2048

7×4×2048

pooling

7×7×2048

(a)

partition

concat

(overlap=1)

pooling

conv5 feature maps

1×1×4096

(b)
7×4×2048

1×1×2048

Figure 5: Illustration of LMP. We partition the feature map
into P (P = 2) parts horizontally with one pixel overlap.
We conduct global max/avg pooling on each part and concatenate the feature vectors as the final representation.

(c)

Duke images

Duke images to Market style

Market images

Market images to Duke style

(d)

Figure 4: Visual examples of image-image translation. The
left four columns map Market images to the Duke style,
and the right four columns map Duke images to the Market
style. From top to bottom: (a) original image, (b) output of
CycleGAN, (c) output of CycleGAN + Lide , and (d) output
of SPGAN. Images produced by SPGAN have the target
style while preserving the ID information in the source.
number of training identities. During testing, given an input image, we can extract the 2,048-dim Pool5 vector for
retrieval under the Euclidean distance.
Local Max Pooling. To further improve re-ID performance on the target dataset T , we introduce a feature pooling method named as local max pooling (LMP). It works
on a well-trained IDE model and can reduce the impact of
noisy signals incurred by the fake examples. In the original ResNet-50, global average pooling (GAP) is conducted
on Conv5. In our proposal (Fig. 5), we first partition the
Conv5 feature maps to P parts horizontally with one pixel
overlap. Then, we conduct global max/avg pooling on each
part. Finally, we concatenate the output of global max pooling (GMP) or GAP of each part as the final feature representation. The procedure is nonparametric, and can be directly used in the testing phase. In the experiment, we will
compare local max pooling and local average pooling, and
demonstrate the superiority of the former (LMP).

Figure 6: Sample images of (upper left:) DukeMTMC-reID
dataset, (lower left:) Market-1501 dataset, (upper right:)
Duke images which are translated to Market style, and
(lower right:) Market images translated to Duke style. We
use SPGAN for image-image translation.

4. Experiment

tities for testing. Each identity is captured by at most 6
cameras. All the bounding boxes are produced by DPM [8].
DukeMTMC-reID is a re-ID version of the DukeMTMC
dataset [36]. It contains 34,183 image boxes of 1,404 identities: 702 identities are used for training and the remaining 702 for testing. There are 2,228 queries and 17,661
database images. For both dataset, we rank-1 accuracy and
mAP for re-ID evaluation [49]. Sample images of the two
datasets are shown in Fig. 6.

4.1. Datasets

4.2. Implementation Details

We select two large-scale re-ID datasets for experiment,
i.e., Market-1501 [49] and DukeMTMC-reID [36, 51].
Market-1501 is composed of 1,501 identities, 12,936 training images and 19,732 gallery images (with 2,793 distractors). It is split into 751 identities for training and 750 iden-

SPGAN training and testing. We use Tensorflow [1]
to train SPGAN using the training images of Market-1501
and DukeMTMC-reID. Note that, we do not use any ID annotation during the learning procedure. In all experiment,
we empirically set λ1 = 10, λ2 = 5, λ3 = 2 in Eq. 6
5

Methods
Supervised Learning
Direct Transfer
CycleGAN (basel.)
CycleGAN (basel.) + Lide
SPGAN (m = 0)
SPGAN (m = 1)
SPGAN (m = 2)
SPGAN (m = 2) + LMP

rank-1
66.7
33.1
38.1
38.5
37.7
39.5
41.1
46.4

DukeMTMC-reID
rank-5 rank-10 rank-20
79.1
83.8
88.7
49.3
55.6
61.9
54.4
60.5
65.9
54.6
60.8
66.6
53.1
59.5
65.6
55.0
61.4
67.3
56.6
63.0
69.6
62.3
68.0
73.8

mAP
46.3
16.7
19.6
19.9
20.0
21.0
22.3
26.2

rank-1
75.8
43.1
45.6
48.1
49.2
48.7
51.5
57.7

Market-1501
rank-5 rank-10 rank-20
89.6
92.8
95.4
60.8
68.1
74.7
63.8
71.3
77.8
66.2
72.7
80.1
66.9
74.0
80.0
65.7
73.0
79.3
70.1
76.8
82.4
75.8
82.4
87.6

mAP
52.2
17.0
19.1
20.7
20.5
21.0
22.8
26.7

Table 2: Comparison of various methods on the target domains. When tested on DukeMTMC-reID, Market-1501 is used as
source, and vice versa. “Supervised learning” denotes using the full ID labels on the corresponding target dataset. “Direct
Transfer” means directly applying the source-trained model on the target domain (see Section 3.1). By varying m specified
in Eq. 5, the sensitivity of SPGAN to the relative importance of the positive and negative pairs is shown. When local max
pooling (LMP) is applied, the number of parts is set to 6. We use IDE [50] for feature learning.
and m = 2 in Eq. 5. With an initial learning rate 0.0002,
and model stop training after 5 epochs. During the testing procedure, we employ the Generator G for Market-1501
→ DukeMTMC-reID translation and the Generative F for
DukeMTMC-reID → Market-1501 translation. The translated images are used for training re-ID models.
For CycleGAN, we adopt the architecture released by its
authors. For SiaNet, it contains 4 convolutional layers, 4
max pooling layers and 1 fully connected (FC) layer, configured as below. (1) Conv. 4 × 4, stride = 2, #feature maps
= 64; (2) Max pooling 2 × 2, stride = 2; (3) Conv. 4 × 4,
stride = 2, #feature maps = 128; (4) Max pooling 2 × 2,
stride = 2; (5) Conv. 4 × 4, stride = 2, feature maps = 256;
(6) Max pool 2 × 2, stride = 2; (7) Conv. 4 × 4, stride = 2,
#feature maps = 512; (8) Max pooling 2 × 2, stride = 2; (9)
FC, output dimension = 128.
Feature learning for re-ID. Following [50], we train a
classification network for re-ID embedding learning, named
ID-discriminative Embedding (IDE). Specifically, ResNet50 [17] pretrained on ImageNet is used for fine-tuning on
the translated training set. We modify the output of the
last fully-connected layer to 751 and 702 for Market-1501
and DukeMTMC-reID, respectively. We use mini-batch
stochastic gradient descent to train the CNN model on a
Tesla K80 GPU. Training parameters such as batch size,
maximum number epochs, momentum and gamma are set
to 16, 50, 0.9 and 0.1, respectively. The initial learning rate
is set as 0.001, and decay to 0.0001 after 40 epochs.

model on the target domain. For instance, the ResNet-50
model trained and tested on Market-1501 achieves 75.8%
in rank-1 accuracy, but drops to 43.1% when trained on
DukeMTMC-reID and tested on Market-1501. A similar
drop can be observed when DukeMTMC-reID is used as
the target domain, which is consistent with the experiments
reported in [6]. The reason behind the performance drop is
the bias of data distributions in different domains.
The effectiveness of the “learning via translation”
baseline using CycleGAN. In this baseline domain adaptation approach (Section 3.1), we first translate the label images from the source domain to the target domain and then
use the translated images to train re-ID models. As shown
in Table 2, this baseline framework effectively improves the
re-ID performance in the target dataset. Compared with
the direct transfer method, the CycleGAN transfer baseline
gains +2.5% and +2.1% improvements in rank-1 accuracy
and mAP on Market-1501. When tested on DukeMTMCreID, the performance gain is +5.0% and +2.9% in rank-1
accuracy and mAP, respectively. Through such an imagelevel domain adaptation method, effective domain adaptation baselines can be learned.
The impact of the target domain identity constraint.
We conduct experiment to verify the influence of the identity loss on performance in Table 2. We arrive at mixed
observations. On the one hand, on DukeMTMC-reID, compared with the CycleGAN baseline, CycleGAN + Lide
achieves similar rank-1 accuracy and mAP. On the other
hand, on Market-1501, CycleGAN + Lide gains +2.5% and
1.6% improvement in rank-1 accuracy and mAP, respectively. The reason is that Market-1501 has a larger intercamera variance. When translating Duke images to the Market style, the translated image may be more prone to translation errors induced by the camera variances. Therefore,
the identity loss is more effective when Market is the target

4.3. Evaluation
Comparison between supervised learning and direct
transfer. The supervised learning method and the direct
transfer method are specified in Table 1. When comparing
the two methods in Table 2, we can clearly observe a large
performance drop when directly using a source-trained
6

CycleGAN+Lide

48.5

48.1

48

46.2

44

48.0

49.1

45.5

46
43.1

42
40
IDE

IDE +

51.5

52

50.1

50

Impact of 𝜆3 on re-ID accuracy

SPGAN

Rank-1 accuracy (%)

Rank-1 accuracy (%)

52

Direct Transfer
51.5

51
49.7

50
49

49.0
48.1

48
47
46
0

SVDNet

49.2
48.5

1

2

4

6

10

value of 𝜆3

Figure 7: Domain adaptation performance with different feature learning methods, including IDE (Section 3.3),
IDE+ [52], and SVDNet [39]. Three domain adaptation
methods are compared, i.e., direct transfer, CycleGAN with
identity loss, and the proposed SPGAN. The results are on
Market-1501.

Figure 8: λ3 (Eq. 6) v.s re-ID accuracy. A larger λ3 means
larger weight of similarity preserving constraint.
negative pairs in Eq. 5, (m = 0), SPGAN only marginally
improve the accuracy on Market-1501, and even compromises the system on Duke. When increasing m to 2, we
have much superior accuracy. It indicates that the negative
pairs are critical to the system.
Moreover, we evaluate the impact of λ3 in Eq. 6 on
Market-1501. λ3 controls the relative importance of the
proposed similarity preserving constraint. As shown in Fig.
9, the proposed constraint is proven effective when compared to λ3 = 0, but a larger λ3 does not bring more gains
in accuracy. Specifically, λ3 = 2 yields the best accuracy.
Local max pooling further improves the transfer performance. We apply the LMP on the Conv5 layer to mitigate the influence of noise. Note that LMP is directly
adopted in the feature extraction step for testing without
fine-tuning. We empirically study how the number of parts
and the pooling mode affect the performance. Experiment
is conducted on SPGAN. The performance of various numbers of parts (P = 1, 2, 3, 6) and different pooling modes
(max or average) is provided in Table 3. When we use average pooling and P = 1, we have the original GAP used
in ResNet-50. From these results, we speculate that with
more parts, a finer partition leads to higher discriminative
descriptors and thus higher re-ID accuracy.
Moreover, we test LMP on supervised learning and domain adaptation scenarios with three feature learning methods, i.e., IDE [50], IDE+ [52], and SVDNet [39]. As shown
in Fig. 9, LMP does not guarantee stable improvement on
supervised learning as observed in “IDE+ ” and SVDNet.
However, when applied in the scenario of domain adaptation with SPGAN, LMP yields improvement over IDE,
IDE+ , and SVDNet. The superiority of LMP probably lies
in that max pooling filters out some noisy signals in the descriptor induced by SPGAN.

domain. Considering that the performance never drops, we
use the target domain identity constraint as an auxiliary tool
for image-image translation. As shown in Fig. 4, this loss
helps CycleGAN prevent from generating strangely colored
results.
The effectiveness of the proposed SPGAN. On top of
the CycleGAN baseline, we replace CycleGAN with SPGAN (m = 2). The effectiveness of the proposed similarity preserving constraint can be seen in Table 2. Compared with Cycle + Lide , on DukeMTMC-reID, the similarity preserving constraint leads to +2.6% and +2.4% improvement over CycleGAN + Lide in rank-1 accuracy and
mAP, respectively. On Market-1501, the gains are +3.4%
and +2.1% in rank-1 accuracy and mAP, respectively. The
working mechanism of SPGAN consists in preserving the
underlying visual cues associated with the ID labels. The
consistent improvement suggests that this working mechanism is critical for generating suitable samples for training
in the target domain. Examples of translated images by SPGAN are shown in Fig. 6.
Comparison of different feature learning methods. In
Step 2, we evaluate three feature learning methods, i.e., IDE
[50] (described in Section 3.3), IDE∗ [52], and SVDNet
[39], as shown in Fig. 7. An interesting observation is that,
while IDE+ and SVDNet are superior to IDE under the scenario of “Direct Transfer”, the three learning methods are
basically on par with each other when using training samples generated by SPGAN. A possible explanation is that
many of the generated samples are imperfect, which has a
larger effect on those better learning schemes.
Sensitivity of SPGAN to key parameters. The margin
m defined in Eq. 5 is a key parameter. If m = 0, the loss of
negative pairs is not back propagated. If m gets larger, the
weight of negative pairs in loss calculation increases. We
conduce experiment to verify the impact of m, and results
are shown in Table 2. When turning off the contribution of

4.4. Comparison with State-of-the-art Methods
We compare the proposed method with the state-ofthe-art unsupervised learning methods on Market-1501 and
DukeMTMC-reID in Table 4 and Table 5, respectively.
7

Supervised Learning
SPGAN

Rank-1 accuracy (%)

90
80

75.8

Methods

82.8 82.3

82.4 82.2

78.2

Market-1501
Setting Rank-1 Rank-5 Rank-10
Bow [49]
SQ
35.8
52.4
60.3
SQ
27.2
41.6
49.1
LOMO [26]
UMDL [35]
SQ
34.5
52.6
59.6
SQ
45.5
60.7
66.7
PUL [6]*
Direct transfer
SQ
43.1
60.8
68.1
Direct transfer MQ
47.9
65.5
73.0
MQ
54.5
CAMEL [47]
SPGAN
SQ
51.5
70.1
76.8
MQ
57.0
73.9
80.3
SPGAN
SPGAN+LMP SQ
57.7
75.8
82.4

Supervised Learning+LMP
SPGAN+LMP

70
57.7

60

51.5

50

56.7
50.1

53.8
49.1

40
30
IDE

IDE +

SVDNet

Figure 9: Experiment of LMP (P = 6) on scenarios of supervised learning and SPGAN. Three feature learning methods are compared, i.e., IDE [50], IDE+ [52], and SVDNet
[39]. The results are on Market-1501.
#parts mode
1
2
3
6

dim

Avg
2048
Max
Avg
4096
Max
Avg
6144
Max
Avg
12288
Max

mAP
14.8
8.0
12.4
20.5
17.0
20.6
26.3
22.8
27.1
26.7

Table 4: Comparison with state of the art on Market-1501. *
denotes unpublished papers. “SQ” and “MQ” are the singlequery and multiple-query settings, respectively.

DukeMTMC-reID Market-1501
rank-1
mAP
rank-1 mAP
41.1
22.3
51.5 22.8
44.3
25.0
55.7 21.8
42.3
23.3
54.4 25.0
45.6
25.5
57.3 26.2
43.1
23.6
54.9 25.5
45.5
25.6
57.4 26.4
44.1
24.4
55.9 26.0
46.4
26.2
57.7 26.7

Methods
Bow[49]
LOMO[26]
UMDL[35]
PUL[6]*
Direct transfer
SPGAN
SPGAN+LMP

Table 3: Performance of various pooling strategies with different numbers of parts (P ) and pooling modes (maximum
or average) over SPGAN. The best results are in bold.

Rank-1
17.1
12.3
18.5
30.0
33.1
41.1
46.4

DukeMTMC-reID
Rank-5 Rank-10
28.8
34.9
21.3
26.6
31.4
37.6
43.4
48.5
49.3
55.6
56.6
63.0
62.3
68.0

mAP
8.3
4.8
7.3
16.4
16.7
22.3
26.2

Table 5: Comparison with state of the art on DukeMTMCreID. * denotes unpublished papers.

mAP = 22.3%. Compared with the second best method, i.e.,
PUL [6], our result is +11.1% higher in rank-1 accuracy.
Therefore, the superiority of SPGAN can be concluded.

Market-1501. On Market-1501, we first compare our
results with two hand-crafted features, i.e., Bag-of-Words
(BoW) [49] and local maximal occurrence (LOMO) [26].
Those two hand-crafted features are directly applied on test
dataset without any training process, their inferiority can be
clearly observed. We also compare existing unsupervised
methods, including the Clustering-based Asymmetric MEtric Learning (CAMEL) [47], the Progressive Unsupervised
Learning (PUL) [6], and UMDL [35]. The results of UMDL
are reproduced by Fan et al. [6]. In the single-query setting,
we achieve rank-1 accuracy = 51.5% and mAP = 22.8%. It
outperforms the second best method [6] by +6.0% in rank-1
accuracy. In the multiple-query setting, we arrive at rank1 accuracy = 57.0% and mAP = 27.1%, which is +2.5%
higher than CAMEL [47]. The comparisons indicate the
competitiveness of the proposed method on Market-1501.
DukeMTMC-reID. On DukeMTMC-reID, we compare
the proposed method with BoW [49], LOMO [26], UMDL
[35], and PUL [6] under the single-query setting (there is no
multiple-query setting in DukeMTMC-reID). The result obtained by the proposed method is rank-1 accuracy = 41.1%,

5. Conclusion
This paper focuses on domain adaptation in person reID. When models trained on one dataset are directly transferred to another dataset, the re-ID accuracy drops dramatically due to dataset bias. To achieve improved performance
in the new dataset, we present a “learning via translation”
baseline for domain adaptation, characterized by 1) unsupervised image-image translation and 2) supervised feature
learning. We further propose that the underlying (latent)
ID information for the foreground pedestrian should be preserved after image-image translation. To meet this requirement tailored for re-ID, we introduce the unsupervised selfsimilarity and domain-dissimilarity for similarity preserving image generation (SPGAN). We show that SPGAN better qualifies the generated images for domain adaptation and
yields consistent improvement over the CycleGAN.
8

References

[20] P. Isola, J. Zhu, T. Zhou, and A. A. Efros. Image-to-image
translation with conditional adversarial networks. In CVPR,
2017. 2
[21] J. Johnson, A. Alahi, and L. Fei-Fei. Perceptual losses for
real-time style transfer and super-resolution. In ECCV, 2016.
2
[22] T. Kim, M. Cha, H. Kim, J. K. Lee, and J. Kim. Learning to
discover cross-domain relations with generative adversarial
networks. In ICML, 2017. 1, 2
[23] C. Li and M. Wand. Precomputed real-time texture synthesis
with markovian generative adversarial networks. In ECCV,
2016. 2
[24] Y. Li, C. Fang, J. Yang, Z. Wang, X. Lu, and M. Yang. Diversified texture synthesis with feed-forward networks. In
CVPR, 2017. 2
[25] Y. Li, N. Wang, J. Liu, and X. Hou. Demystifying neural
style transfer. In IJCAI, 2017. 2
[26] S. Liao, Y. Hu, X. Zhu, and S. Z. Li. Person re-identification
by local maximal occurrence representation and metric
learning. In CVPR, 2015. 2, 8
[27] M. Liu, T. Breuel, and J. Kautz. Unsupervised image-toimage translation networks. In NIPS, 2017. 1, 2, 3
[28] M. Liu and O. Tuzel. Coupled generative adversarial networks. In NIPS, 2016. 1, 2
[29] Z. Liu, D. Wang, and H. Lu. Stepwise metric promotion for
unsupervised video person re-identification. In ICCV, 2017.
3
[30] M. Long, Y. Cao, J. Wang, and M. I. Jordan. Learning transferable features with deep adaptation networks. In ICML,
2015. 2
[31] M. Long, G. Ding, J. Wang, J. Sun, Y. Guo, and P. S. Yu.
Transfer sparse coding for robust image representation. In
CVPR, 2013. 2
[32] B. Ma, Y. Su, and F. Jurie. Covariance descriptor based
on bio-inspired features for person re-identification and face
verification. Image Vision Comput., 2014. 2
[33] T. Matsukawa, T. Okabe, E. Suzuki, and Y. Sato. Hierarchical gaussian descriptor for person re-identification. In CVPR,
2016. 2
[34] S. Motiian, M. Piccirilli, D. A. Adjeroh, and G. Doretto. Unified deep supervised domain adaptation and generalization.
In ICCV, 2017. 2
[35] P. Peng, T. Xiang, Y. Wang, M. Pontil, S. Gong, T. Huang,
and Y. Tian. Unsupervised cross-dataset transfer learning for
person re-identification. In CVPR, 2016. 3, 8
[36] E. Ristani, F. Solera, R. Zou, R. Cucchiara, and C. Tomasi.
Performance measures and a data set for multi-target, multicamera tracking. In European Conference on Computer
Vision workshop on Benchmarking Multi-Target Tracking,
2016. 5
[37] K. Saenko, B. Kulis, M. Fritz, and T. Darrell. Adapting visual category models to new domains. In ECCV, 2010. 2
[38] B. Sun, J. Feng, and K. Saenko. Return of frustratingly easy
domain adaptation. In AAAI, 2016. 2
[39] Y. Sun, L. Zheng, W. Deng, and S. Wang. SVDNet for pedestrian retrieval. In ICCV, 2017. 7, 8

[1] M. Abadi, P. Barham, J. Chen, Z. Chen, A. Davis, J. Dean,
M. Devin, S. Ghemawat, G. Irving, M. Isard, M. Kudlur,
J. Levenberg, R. Monga, S. Moore, D. G. Murray, B. Steiner,
P. A. Tucker, V. Vasudevan, P. Warden, M. Wicke, Y. Yu, and
X. Zheng. Tensorflow: A system for large-scale machine
learning. In OSDI, 2016. 5
[2] H. Ajakan, P. Germain, H. Larochelle, F. Laviolette, and
M. Marchand. Domain-adversarial neural networks. arXiv
preprint arXiv:1412.4446, 2014. 2
[3] S. Benaim and L. Wolf. One-sided unsupervised domain
mapping. In NIPS, 2017. 2
[4] K. Bousmalis, N. Silberman, D. Dohan, D. Erhan, and D. Krishnan. Unsupervised pixel-level domain adaptation with
generative adversarial networks. In CVPR, 2017. 1, 2
[5] T. Q. Chen and M. Schmidt. Fast patch-based style transfer
of arbitrary style. arXiv preprint arXiv:1612.04337, 2016. 2
[6] H. Fan, L. Zheng, and Y. Yang. Unsupervised person reidentification: Clustering and fine-tuning. arXiv preprint
arXiv:1705.10444, 2017. 1, 3, 6, 8
[7] M. Farenzena, L. Bazzani, A. Perina, V. Murino, and
M. Cristani. Person re-identification by symmetry-driven accumulation of local features. In CVPR, 2010. 2
[8] P. Felzenszwalb, D. McAllester, and D. Ramanan. A discriminatively trained, multiscale, deformable part model. In
CVPR, 2008. 5
[9] B. Fernando, A. Habrard, M. Sebban, and T. Tuytelaars. Unsupervised visual domain adaptation using subspace alignment. In ICCV, 2013. 2
[10] Y. Ganin and V. S. Lempitsky. Unsupervised domain adaptation by backpropagation. In ICML, 2015. 2
[11] Y. Ganin, E. Ustinova, H. Ajakan, P. Germain, H. Larochelle,
F. Laviolette, M. Marchand, and V. S. Lempitsky. Domainadversarial training of neural networks. Journal of Machine
Learning Research, 2016. 2
[12] L. A. Gatys, A. S. Ecker, and M. Bethge. Image style transfer
using convolutional neural networks. In CVPR, 2016. 2
[13] B. Gong, Y. Shi, F. Sha, and K. Grauman. Geodesic flow
kernel for unsupervised domain adaptation. In CVPR, 2012.
2
[14] D. Gray and H. Tao. Viewpoint invariant pedestrian recognition with an ensemble of localized features. In ECCV, 2008.
2
[15] A. Gretton, K. M. Borgwardt, M. J. Rasch, B. Schölkopf, and
A. J. Smola. A kernel two-sample test. Journal of Machine
Learning Research, 2012. 2
[16] R. Hadsell, S. Chopra, and Y. LeCun. Dimensionality reduction by learning an invariant mapping. In CVPR, 2006.
4
[17] K. He, X. Zhang, S. Ren, and J. Sun. Deep residual learning
for image recognition. In CVPR, 2016. 4, 6
[18] J. Hoffman, E. Tzeng, T. Park, and J.-Y. Zhu. Cycada: Cycleconsistent adversarial domain adaptation. arXiv preprint
arXiv:1711.03213, 2017. 1, 2, 3
[19] X. Huang and S. J. Belongie. Arbitrary style transfer in realtime with adaptive instance normalization. In ICCV, 2017.
2

9

[40] Y. Taigman, A. Polyak, and L. Wolf. Unsupervised crossdomain image generation. ICLR, 2016. 3
[41] A. Torralba and A. A. Efros. Unbiased look at dataset bias.
In CVPR, 2011. 1
[42] E. Tzeng, J. Hoffman, N. Zhang, K. Saenko, and T. Darrell.
Deep domain confusion: Maximizing for domain invariance.
arXiv preprint arXiv:1412.3474, 2014. 2
[43] D. Ulyanov, V. Lebedev, A. Vedaldi, and V. S. Lempitsky.
Texture networks: Feed-forward synthesis of textures and
stylized images. In ICML, 2016. 2
[44] H. Wang, S. Gong, and T. Xiang. Unsupervised learning
of generative topic saliency for person re-identification. In
BMVC, 2014. 3
[45] M. Ye, A. J. Ma, L. Zheng, J. Li, and P. C. Yuen. Dynamic label graph matching for unsupervised video re-identification.
In ICCV, 2017. 3
[46] Z. Yi, H. Zhang, P. Tan, and M. Gong. Dualgan: Unsupervised dual learning for image-to-image translation. In ICCV,
2017. 1, 2
[47] H. Yu, A. Wu, and W. Zheng. Cross-view asymmetric metric
learning for unsupervised person re-identification. In ICCV,
2017. 3, 8
[48] R. Zhao, W. Ouyang, and X. Wang. Unsupervised salience
learning for person re-identification. In CVPR, 2013. 3
[49] L. Zheng, L. Shen, L. Tian, S. Wang, J. Wang, and Q. Tian.
Scalable person re-identification: A benchmark. In ICCV,
2015. 2, 5, 8
[50] L. Zheng, Y. Yang, and A. G. Hauptmann. Person reidentification: Past, present and future. arXiv preprint
arXiv:1610.02984, 2016. 3, 4, 6, 7, 8
[51] Z. Zheng, L. Zheng, and Y. Yang. Unlabeled samples generated by gan improve the person re-identification baseline in
vitro. In ICCV, 2017. 5
[52] Z. Zhong, L. Zheng, D. Cao, and S. Li. Re-ranking person
re-identification with k-reciprocal encoding. 2017. 7, 8
[53] J. Zhu, T. Park, P. Isola, and A. A. Efros. Unpaired imageto-image translation using cycle-consistent adversarial networks. ICCV, 2017. 1, 2, 3, 4

10

