---
title: "Cross-Modality Person Re-Identification with Generative"
description: "Dai and colleagues use adversarial training to match infrared images of people to color images, testing the method on SYSU RGB-IR Re-ID."
canonical: "https://research.elamur.ai/free/en/papers/dai-2018-cross-modality-person-re-identification/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Parse](https://mova.elamur.ai/free/en/parse/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Translate](https://md.translate.elamur.ai/free/en/) · **Research** · [Gali](https://md.gali.elamur.ai/free/en/) · [MCP](https://mcp.elamur.ai/) · [Locations](https://md.locations.elamur.ai/free/en/) · [Weather](https://md.weather.elamur.ai/free/en/) · [Constitution](https://md.constitution.elamur.ai/)

[Elamur Research](https://md.research.elamur.ai/free/en/) · [this page in HTML](https://research.elamur.ai/free/en/papers/dai-2018-cross-modality-person-re-identification/)

[Elamur Research](https://md.research.elamur.ai/free/en/) / [papers](https://md.research.elamur.ai/free/en/papers/) / [2018](https://md.research.elamur.ai/free/en/papers/2018/) / Cross-Modality Person Re-Identification with Generative Adversarial Training

# Cross-Modality Person Re-Identification with Generative Adversarial Training

Paper · 2018 · Pingyang Dai, Rongrong Ji, Haibin Wang et al.

**Authors:** Pingyang Dai, [Rongrong Ji](https://md.research.elamur.ai/free/en/authors/rongrong-ji/), [Haibin Wang](https://md.research.elamur.ai/free/en/authors/haibin-wang/), [Qiong Wu](https://md.research.elamur.ai/free/en/authors/qiong-wu/) and Yuyu Huang · **Year:** 2018 · **Venue:** International Joint Conference on Artificial Intelligence · **Licence:** No open licence stated (free-to-read copy; rights reserved) — text kept private

Cited by **7** papers in our library of more than 163,000 papers whose bibliographies we read · International Joint Conference on Artificial Intelligence

- [PDF](https://www.ijcai.org/proceedings/2018/0094.pdf)
- [DOI 10.24963/ijcai.2018/94](https://doi.org/10.24963/ijcai.2018/94)

## Summary

A person can look quite different to a color camera and an infrared camera, even when both capture a clear view. Person re-identification asks which images from other cameras show the person in a query image. Most earlier work discussed by Dai and colleagues addressed that question using cameras of the same kind. The authors instead ask how to search a collection of color images using an infrared query. That setting matters when a camera network includes different sensors or when a camera switches from color to infrared at night. A search method has to cope with differences in pose, viewpoint, and background as well as differences in what each sensor records.

The authors call their approach cmGAN. A convolutional network turns each image into a vector that can be compared with vectors from either camera modality. During training, an identity classifier asks the network to preserve information that distinguishes people. A triplet loss compares an image with a same-person image and a different-person image from the other modality, rewarding a ranking that favors the same person. A separate classifier tries to tell whether each vector came from a color or infrared image. The network that makes the vectors is trained to make that last prediction harder while still satisfying the identity and triplet objectives.

The authors test cmGAN on SYSU RGB-IR Re-ID, with different people in the training and test sets. For all-search with a single-shot gallery, the complete system reaches 26.97% rank-1 accuracy and 27.80% mean average precision, compared with 14.80% and 15.95% for the strongest previously published system on those measures. Rank-1 accuracy asks whether the first result is correct. Mean average precision takes the positions of correct results throughout the ranked list into account. The complete system also leads the published baselines in the indoor-search and multi-shot settings. It has the highest rank-1 accuracy among the reported systems and loss variants in each setting, although triplet-only training does better on some deeper ranks and on mean average precision in all-search with a multi-shot gallery. The results show how much the training recipe improves retrieval on this benchmark and how the preferred loss combination can depend on what the evaluation rewards.

## Deep dive: Cross-Modality Person Re-Identification with Generative Adversarial Training

Dai and colleagues use adversarial training to match infrared images of people to color images, testing the method on SYSU RGB-IR Re-ID. · about 36 minutes to read

**In this deep dive**

1. [The problem and its context](#dd-the-problem-and-its-context)
2. [The method, step by step](#dd-the-method-step-by-step)
3. [Experiments and results](#dd-experiments-and-results)
4. [What the ablations show](#dd-what-the-ablations-show)
5. [Limitations](#dd-limitations)
6. [What came after](#dd-what-came-after)

### The problem and its context

#### What has to match across cameras

A re-identification query begins with an image of a person. The system compares that image with a gallery, the collection of candidate images, and puts the candidates in order of estimated similarity. A correct result depicts the same person. The system need not attach a name to that person. Its task is to rank candidate images so that appearances of the same individual come before appearances of other individuals. For the experiments in this paper, the query is infrared and the gallery is color, which the paper calls RGB.

The immediate difficulty is that the images being compared can differ for several reasons at once. The person may face another direction or hold a different pose. Illumination and background can change with the camera. Those sources of variation were already central to the earlier re-identification research described by the authors. A change of modality adds a further difference. The representation of a person in a color image can depend on cues that have no straightforward counterpart in an infrared image. A comparison that treats those cues as equally informative on both sides can rank the wrong person ahead of the right one.

The paper places this problem in the context of heterogeneous camera networks. It mentions near-infrared, thermal, and depth cameras as examples of sensors that may coexist with ordinary color cameras. It also describes cameras that switch automatically between RGB and infrared operation to work at night. The specific experiment concerns RGB and infrared. The examples explain why the authors view a sensor change as part of the task itself, alongside the more familiar problem of comparing views from different positions.

The difficulty has consequences for both representation and ranking. At the representation level, a system needs to extract cues that still carry identity information when the sensor changes. At the ranking level, it needs a distance or similarity that uses those cues to put the right people near the top. A feature could be highly reproducible within one modality and still contribute little to comparisons across modalities. Similarly, reducing the general separation between RGB and infrared features would accomplish little if it also made different people look alike in the feature space.

The authors also draw attention to imbalance between the modalities. A collection can supply different amounts of RGB and infrared imagery, and the two sources can produce different feature distributions. These issues matter to supervised training because a system learns from the examples and comparisons it sees. An objective that works mainly on individual identity labels can reward different evidence on the RGB and infrared sides. The authors therefore want the training procedure to state directly which relationships should survive a sensor change. This requirement concerns same-person and different-person relationships across the two sources, beyond the ability to handle either source by itself.

#### How earlier re-identification methods approached matching

The paper groups earlier same-modality work around two choices. One is to learn a distance metric. Given image features and examples of who matches whom, the method estimates a transformation or comparison rule that can distinguish matching pairs from nonmatching pairs. A Mahalanobis metric is among the examples discussed. For this class of methods, the learned comparison can give some directions in feature space more influence than others. KISSME, another example in the paper, approaches the decision through a likelihood ratio involving Gaussian distributions.

The other choice is to learn or design a representation on which a conventional comparison is effective. If the feature extraction already makes similar people close and different ones distinguishable, an ordinary Euclidean or cosine comparison can do much of the remaining work. The paper describes neural approaches within this group. Yi and colleagues used a Siamese network, an arrangement that learns from image pairs, and used pedestrian body regions in training. Ahmed and colleagues introduced a patch-matching layer that compares activations in neighboring image locations. These examples show how much work earlier methods already devoted to the question of which visual evidence ought to be compared.

The two choices meet in work on relative distances. Ding and colleagues, for instance, used relative distance comparisons to learn image representations for person re-identification. A relative comparison asks whether a matching image is closer to a reference image than a nonmatching one. That is a more direct training signal for ranking than an isolated identity prediction. Dai and colleagues develop this line of reasoning for the particular case in which the reference image and its comparison images come from different modalities.

The earlier examples explain why adopting a familiar distance alone would leave an open question. A same-modality representation can succeed by relying on evidence available to both cameras in its original setting. Once the sensor changes, the relevant issue is whether the representation carries evidence that can be compared across the gap. A learned metric might help, but its usefulness depends on the cross-modality relationships the training data and objective actually establish. In cmGAN, those relationships are built into how the comparison examples are chosen.

#### The closest prior work on RGB and infrared

Wu and colleagues introduced SYSU RGB-IR Re-ID and examined network designs for precisely this camera pairing. As Dai and colleagues describe it, that work compares architectures that share processing between modalities with arrangements that give each kind of image a separate stream or use an asymmetric layer. Its one-stream design with deep zero-padding is especially relevant. The padding allows a shared network to develop modality-specific structure. The approach already recognizes that forcing identical treatment of RGB and infrared at every point may be a poor fit for their different inputs.

Dai and colleagues take the benchmark and its retrieval protocol as the setting for asking a different question about learning. Their focus is what the resulting representation must make easy or hard to predict. It should make person identity recoverable, arrange cross-modality neighbors in a useful order, and make the source modality harder to infer. This distinction is important because sharing a network specifies where computation happens, while a training objective specifies what has to be true of its output. The paper’s proposal combines requirements on the output rather than relying on weight sharing alone to produce the desired relationships.

The paper also places the problem alongside cross-modality retrieval in other settings. Its example is a search that connects images with text or documents. It describes approaches that learn statistical correlations, impose graph relationships across media, learn metrics or dictionaries, and use deep networks. Some of the work it cites learns binary codes for cross-modality search. One of the cited hashing approaches uses adversarial training to supply synthetic training examples. In person re-identification, the criterion for relevance is narrower than semantic relatedness. A useful candidate must show the same individual, even when another person looks similar or the true match looks different under the other sensor.

#### What changes in adversarial training

The paper traces its training scheme to [Generative Adversarial Nets](https://md.research.elamur.ai/free/en/papers/goodfellow-2014-generative-adversarial-nets/). In the original setup as described by Dai and colleagues, a generator produces samples and a discriminator learns to distinguish generated samples from real ones. One component tries to improve at a task that the other component tries to make harder. The competition changes the kind of signal the generator receives during learning.

The adversary in cmGAN has a different question to answer. Its input is a feature vector extracted from an actual RGB or infrared image, and its target is the source modality. The generator is the network that produces those vectors. The paper also describes earlier retrieval and hashing work that used adversarial learning across views or modalities, including approaches that sought a shared feature space for heterogeneous data. The authors frame their contribution as bringing this idea to RGB–infrared person matching and coupling it with supervision designed around individual identities. The domain classifier supplies pressure against sensor-dependent features. The identity labels and relative-distance comparisons specify the distinctions that still matter for search.

### The method, step by step

#### From the training images to a ranked gallery

The unit of input is a pedestrian image with an identity label and a modality label. The identity label tells the training procedure which other images depict that person. The modality label records whether the image is RGB or infrared. Both labels matter when forming a triplet, the group of an anchor image, a matching image, and a nonmatching image. The identity label distinguishes the matching candidate from the nonmatch. The modality label ensures that comparing either candidate with the anchor requires crossing between the two kinds of image.

The feature extractor maps each image to a vector. The authors report extracting 2,048d features from the global average pooling layer of ResNet-50. Global average pooling aggregates each spatial feature channel into a value, so the resulting vector summarizes responses over the image. These representations feed the training objectives. The identity prediction branch uses two fully connected layers and a softmax output. The modality classifier uses three fully connected layers. A fully connected layer combines input features with learned weights. The softmax in the identity branch turns the class scores into a distribution over the identities used for training.

The identity and modality branches have different targets even though both receive features from the same extractor. A successful identity prediction rewards information about the person. A successful modality prediction shows that the current feature still contains information that distinguishes the sensors. The triplet term supplies another view of the same representation. It considers the relative positions of images instead of asking either classifier for a label. This gives the network a direct training signal about the order a cross-modality search should prefer.

How cmGAN learns features for RGB–infrared retrieval The steps in order.

During retrieval, an infrared query and the RGB gallery images are represented through the learned feature extractor. The algorithm returns this extractor as its learned representation. The experimental protocol then orders the RGB candidates by descending similarity to the query. The roles of the classifiers are easiest to see by separating training from retrieval. Training identity predictions encourage the extractor to distinguish the people available during learning. Test identities are held out. The ranking consequently depends on whether the learned representation supports comparisons for new people, rather than on whether the identity head can name them from the training label set. The modality classifier provides its signal while the representation is being learned.

#### The data and feature notation

The authors distinguish training data from test data and distinguish RGB from infrared within each split. The same person’s images belong to one split. That identity-level division matters to the interpretation of the classifier: learning to predict a training identity is a way to shape the features, while the actual retrieval evaluation asks for matches involving people outside that collection of classes.

```
D = {Dₜᵣ, Dₜₑ}
```

Here D is the dataset, Dₜᵣ is its training split, and Dₜₑ is its test split. The braces collect the parts of the dataset. Within each split, the paper uses V for the RGB image collection and I for the infrared image collection, with the corresponding split subscript. Thus Vₜᵣ and Iₜᵣ are the RGB and infrared training collections. Vₜₑ and Iₜₑ are their test counterparts.

```
vⱼ, iⱼ ∈ ℝᵈ
```

The symbol vⱼ is an RGB feature vector, and iⱼ is an infrared feature vector. The subscript j indexes an example within the relevant collection or batch. The membership symbol ∈ indicates that each vector lies in ℝᵈ, the space of real-valued vectors with d coordinates. Having a common coordinate space allows distances between features from different modalities to enter the same loss. It does not on its own establish that the distances are meaningful. That is the job of the training objectives.

```
Y = {yᵢ}ᵢ₌₁ⁿ
```

Here Y collects the identity labels of the training images, yᵢ is the label for training image i, and n is the number of training images. The subscript range starts at the first image and ends at n. The training algorithm also assigns each input image x a domain label s. In this application, domain and modality refer to the same distinction between RGB and infrared. The paper uses that label separately from y because a person can appear in both modalities.

#### The identity objective

The first objective gives the feature extractor a reason to preserve distinctions among individuals. The classifier estimates a probability distribution over the training identities for each image, using the vector produced by the extractor. The loss is cross-entropy, which penalizes low probability for the known identity. An image whose correct identity receives little probability incurs a larger penalty than one whose correct identity already receives substantial probability. During training, the classifier and the feature extractor have an incentive to make the training identities recoverable from the representation.

The following notation makes the true label explicit for each feature. It expresses the paper’s averaged log-probability terms for RGB and infrared examples. The identity label can be written as a vector that selects the log probability for the correct class.

```
Lide(θide) = −(1/M) Σⱼ₌₁ᴹ [⟨y(vⱼ), log p(vⱼ; θide)⟩ + ⟨y(iⱼ), log p(iⱼ; θide)⟩]
```

Lide is the identification loss. The symbol θide represents the parameters of the identity prediction layers. The sum Σ runs over the indexed contributions from j equal to 1 through M, and M is the averaging count in the paper’s expression. The vectors vⱼ and iⱼ are the RGB and infrared features. The functions y(vⱼ) and y(iⱼ) denote their known identities in indicator-vector form. The function p with parameters θide returns probabilities over training identities, log is applied to those probabilities, and the inner product ⟨·, ·⟩ selects the log probability of the indicated identity. The two selected log probabilities are added. The minus sign turns low probability for a correct class into a positive loss.

The notation for this loss emphasizes the parameters of the feed-forward classifier, but the features it receives also come from a trainable network. The training algorithm includes the identity term in the generator objective, so the loss can shape those features as well as the classifier. Its importance follows from a simple failure case. An extractor could make modality prediction impossible by returning indistinguishable features for everyone. In that case the classifier would have no image-dependent evidence for assigning different identities. The identification objective gives the extractor a reason to avoid losing the differences among people.

Supervision of this kind can be shared across RGB and infrared because an identity has the same label in either source. Its constraint is nevertheless about predicting a class. A classifier can assign the correct label to an RGB image and an infrared image whose feature vectors remain far apart. The classification loss has done its job in such a case, but the geometry used by retrieval still needs work. The triplet objective addresses that situation by comparing the feature distances themselves.

#### The triplet objective and the two anchor directions

A triplet begins with an anchor. The positive image depicts the same person, and the negative depicts someone else. The paper makes both comparisons cross-modality. With an RGB anchor, both candidates are infrared. With an infrared anchor, both candidates are RGB. This arrangement matters because the positive and negative candidates then have the same modality as one another. A preference for one candidate source over another cannot settle which one ought to be closer to the anchor.

```
Tᵢ ∈ {(vₐ, iₚ, iₙ), (iₐ, vₚ, vₙ)}
```

Tᵢ denotes triplet i, and ∈ indicates that it has either of the listed forms. A v denotes an RGB feature and an i in the feature symbols denotes an infrared feature. The subscripts a, p, and n mark the anchor, positive, and negative positions. The two features marked a and p share an identity. The feature marked n has a different identity from the anchor. In the first tuple the anchor is RGB, and in the second it is infrared. The notation i for the triplet index is independent of the i used for infrared features.

The loss compares the anchor’s squared distance to the positive with its squared distance to the negative. It requires the positive to be closer by a margin. A case in which the negative and positive are just barely in the right order can therefore still contribute to the loss. Once the ordering is correct by the desired margin, the triplet contributes nothing further. This lets the loss focus on cases whose ordering is wrong or whose separation is insufficient under the chosen margin.

```
[z]₊ = max(z, 0)
```

Here z is the expression inside the margin penalty. The operator [·]₊ takes its positive part, max selects the larger argument, and 0 is the floor. If the negative is already far enough away relative to the positive, z is at or below that floor. A positive z incurs a penalty that grows as the comparison falls further short of the margin.

```
Ltriplet,V(θⱽ) = ΣRGB anchors [Dₐ,ₚ² − Dₐ,ₙ² + ξ]₊
```

Ltriplet,V is the triplet loss for anchor images from the RGB collection V, and θⱽ denotes the representation parameters associated with RGB in the paper’s notation. The sum Σ runs over triplets of the RGB-anchor form. Dₐ,ₚ is the anchor-to-positive feature distance, and Dₐ,ₙ is the anchor-to-negative feature distance. The superscript ² squares the distances. The Greek letter ξ is the margin. The positive-part operator applies after subtracting the squared negative distance from the squared positive distance and adding ξ.

```
Ltriplet,I(θᴵ) = ΣIR anchors [Dₐ,ₚ² − Dₐ,ₙ² + ξ]₊
```

Ltriplet,I is the corresponding infrared-anchor loss, and θᴵ denotes the representation parameters associated with infrared in this expression. The sum runs over the infrared-anchor triplets. Dₐ,ₚ and Dₐ,ₙ again measure the positive and negative distances from the anchor, which is now infrared. Both comparison features are RGB. The squares, margin ξ, and positive-part operation have the same meaning as in the RGB-anchor expression.

```
Ltriplet(θⱽ, θᴵ) = Ltriplet,V(θⱽ) + Ltriplet,I(θᴵ)
```

Here Ltriplet is the overall triplet term. The two quantities on the right are the RGB-anchor and infrared-anchor losses, with θⱽ and θᴵ denoting the representation parameters used in the paper’s respective expressions. Adding the contributions trains the extractor on relative comparisons in both directions. The reported retrieval evaluation uses infrared probes and RGB galleries. The RGB-anchor objective nonetheless contributes training relationships in which infrared matches must compete with infrared nonmatches.

The negative example is essential to the geometry being learned. Pulling positive pairs together by itself could bring much of the dataset into a small part of feature space. Triplets make that movement conditional on the location of a different person. The useful outcome is a relative ordering of candidates. In particular, the loss can be satisfied even when matching RGB and infrared embeddings differ, provided the same-person embedding remains sufficiently closer than the competing nonmatch. This is a more specific target than making RGB and infrared features similar in aggregate.

#### The generator and the modality classifier

The authors combine the two supervised terms to form the generator loss. The term generator refers to the production of a feature vector from an existing image. The network is trained to give the identity branch discriminative input and to arrange those same features so that cross-modality positive and negative examples respect the triplet constraint.

```
Lgen(θⱽ, θᴵ, θide) = α · Ltriplet + β · Lide
```

Lgen is the generator loss. The parameter symbols θⱽ and θᴵ are those used for RGB and infrared representation learning, and θide refers to the identity branch. Ltriplet is the sum of the two anchor-direction losses, and Lide is the identification loss. The multiplication dots apply weights α and β to the triplet and identity contributions, respectively. The authors use a 1:1 weighting for α and β. This assigns the same coefficient to both terms. Their realized magnitudes and contributions to the network updates depend on the examples and on how each loss changes during training.

The modality classifier imposes a different condition on the feature vector. It receives a feature and predicts whether it was produced from RGB or infrared. The discriminator has the usual classification incentive to become more accurate on its known labels. Its prediction is about the source of a single feature vector. The triplet term is where the procedure directly compares particular examples across modalities.

```
Ldis(θᴰ) = −(1/M) Σⱼ₌₁ᴹ [⟨m(vⱼ), log D(vⱼ; θᴰ)⟩ + ⟨m(iⱼ), log D(iⱼ; θᴰ)⟩]
```

Ldis is the discriminator loss and θᴰ denotes the modality classifier’s parameters. D(·; θᴰ) in this expression is the classifier’s probability output, whereas D in the dataset notation denoted the data collection. The vectors vⱼ and iⱼ are the RGB and infrared features. The label indicators m(vⱼ) and m(iⱼ) select the known modality of each example. The sum Σ indexes contributions from j equal to 1 through M, and division by M applies the average as written in the paper. The logarithm log and the inner products ⟨·, ·⟩ select a log probability for each true modality. Adding these contributions and applying the negative sign gives the loss that the modality classifier aims to reduce.

This creates a distinction between the tasks of the two classifiers. Good identity classification is desirable for the generator. Good modality classification reveals an opportunity to change the extractor so that RGB and infrared become harder to distinguish. If the modality branch currently relies on particular feature patterns to recognize infrared inputs, the adversarial update gives the extractor an incentive to weaken those patterns. The supervised objectives still reward useful identity information, including identity evidence that helps order actual cross-modality candidates. The desired representation has to negotiate all of these conditions at once.

#### Why the sign changes during training

The paper writes the training objective as a minimax problem. One set of parameters minimizes a quantity, and the other maximizes that quantity. With the discriminator fixed, the generator tries to reduce its identity and triplet losses while making the discriminator’s classification loss larger. The latter incentive comes from subtracting the discriminator loss. The loss depends on the generator through the features that the fixed classifier receives.

```
θ̂ᴳ = arg min over θᴳ of [Lgen(θᴳ) − γ · Ldis(θᴳ, θ̂ᴰ)]
```

The symbol θᴳ groups the generator-side parameters θⱽ, θᴵ, and θide. The hat on θ̂ᴳ marks the parameters sought by this subproblem, and θ̂ᴰ denotes the discriminator parameters held fixed for it. The operator arg min means the choice of parameters that minimizes the bracketed expression. Lgen is the weighted supervised loss. Ldis is the modality classification loss, with its dependence on the generator features written explicitly. The multiplication dot applies the weight γ to Ldis. Because of the minus sign, increasing the latter can reduce the objective the generator minimizes.

For the other subproblem the generator is held fixed and the discriminator aims to classify those features correctly. Maximizing the shared expression has that effect because its generator term is fixed and its discriminator term carries a minus sign. Thus the discriminator moves in the direction of lower cross-entropy on modality labels while the generator receives an incentive in the opposite direction.

```
θ̂ᴰ = arg max over θᴰ of [Lgen(θ̂ᴳ) − γ · Ldis(θ̂ᴳ, θᴰ)]
```

Here θᴰ denotes the discriminator parameters over which the search is made, and θ̂ᴰ denotes the maximizing choice. The operator arg max means to seek the parameter values that maximize the bracketed expression. The generator parameters θ̂ᴳ are fixed in this subproblem. Lgen is therefore constant with respect to θᴰ. The loss Ldis still depends on the classifier parameters, γ is its weight, and subtracting the weighted term gives the discriminator an incentive to reduce its own classification loss.

This reciprocal dependence explains why the authors keep training a modality classifier even though they want the feature extractor to obscure modality. A fixed, weak classifier could miss patterns that still distinguish the modalities. Updating it lets it respond to changes in the representation, and the generator in turn receives pressure from the adapted classifier. The paper’s claims about a common space concern the feature space learned through this process. Difficulty for the particular trained discriminator is an operational training signal. Prediction by a different classifier, trained after the fact, is a separate empirical question.

#### The training procedure and settings

The algorithm starts with a pretrained convolutional feature extractor and a discriminator. Its inputs are images together with person and domain labels. It describes randomly forming pairs by identity, computing their features, and calculating the triplet and identification losses. Its triplet conditions specify that the anchor and positive share an identity, the negative differs in identity, and both candidates differ from the anchor in modality. The prose gives the two allowed forms of the triplet. Those constraints define the comparisons, while the algorithm gives a short sampling outline without spelling out a detailed policy for choosing among eligible negatives.

The discriminator receives the current features and uses the domain labels to compute its cross-entropy. The pseudocode branches on a training counter and K. The generator-side branch uses the generator loss minus the weighted discriminator loss. The other branch reverses the sign and introduces a scale parameter. This switch is the algorithm’s expression of the opposing directions in the minimax equations.

```
Ltotal = Lgen − γ · Ldis  when e mod K ≠ 0
```

Ltotal is the scalar objective used in this branch of the pseudocode. Lgen and Ldis are the generator and discriminator losses, and γ is the weight on Ldis. The symbol e is the counter used by the algorithm and K controls the update schedule. The operation mod takes the remainder after dividing e by K. The condition ≠ 0 means the remainder is non-zero. The sign of this branch favors reducing the supervised terms and increasing the modality classification loss from the generator’s perspective.

```
Ltotal = η · (γ · Ldis − Lgen)  when e mod K = 0
```

Here Ltotal is the scalar for the other branch. The condition e mod K = 0 selects steps where the remainder is zero. The parameter η scales the sign-reversed expression, γ weights the discriminator loss Ldis, and Lgen denotes the same generator loss as before. The minimax equations specify the parameter blocks held fixed for the respective optimization problems. The pseudocode describes the schedule compactly through this loss switch and a general update instruction.

For the reported runs the batch size is 20. The authors set K to 5 after trying combinations of settings, and fix γ to 0.05. They use different learning rates for generator and discriminator because the components converge at different speeds in their experiments. The candidates for each learning rate are 0.0001, 0.001, and 0.01. The paper reports choosing 0.0001 for the generator and 0.001 for the discriminator. It describes training for 2000 epochs or more and shows loss traces extending to epoch 2,500. The experiments use NVIDIA GeForce 1080Ti graphics cards.

The margin is another training choice. It determines how much farther the negative should be from the anchor in squared-distance terms before a triplet stops adding a penalty. The paper varies ξ over 0.7, 0.9, 1.2, 1.4, 1.5, and 1.6 with other settings fixed and chooses 1.4. The sweep provides evidence about this objective in the reported setup. It also illustrates that the triplet structure and the margin do different jobs. The structure determines which images should be compared, while the margin determines how demanding each comparison should be.

### Experiments and results

#### The dataset and the four retrieval settings

The experiments use the SYSU RGB-IR Re-ID dataset introduced by Wu and colleagues. Dai and colleagues report that it contains 491 people recorded with 6 cameras. They list 287,628 RGB images and 15,792 IR images for the dataset as a whole. They report a training set of 32,451 images, of which 19,659 are RGB and 12,792 are IR. Those figures describe different scopes. The gallery for any given evaluation is constructed from eligible test images, and the training split is defined separately. Images of any one person are assigned to either training or test, making the comparison a test of retrieval for held-out people.

In the paper’s protocol a probe is the infrared image used to query the gallery. The gallery contains RGB images, and the permitted RGB cameras determine the search mode. All-search uses RGB cameras 1, 2, 4, and 5. Indoor-search restricts the gallery to RGB cameras 1 and 2, excluding the outdoor cameras 4 and 5. Both modes use infrared cameras 3 and 6 for probes. Indoor-search therefore changes the candidate pool while retaining the same source cameras for the queries.

There is also a location exclusion. Cameras 2 and 3 share a location, so a probe from camera 3 is evaluated without the RGB candidates from camera 2. This rule makes the gallery eligible for a particular probe depend on its camera. It preserves the protocol’s intended comparison across locations. Without this distinction, a reader might interpret indoor-search as allowing every candidate from both eligible RGB cameras for every query.

Single-shot and multi-shot specify how many RGB images of an identity are sampled for the gallery. The authors describe randomly choosing one image for single-shot and ten for multi-shot. The modes and shot settings are crossed, yielding all-search and indoor-search with each kind of gallery. An all-search multi-shot score therefore concerns a different ranking problem from an indoor-search single-shot score. Changing the gallery can affect how many correct candidates are available, what other candidates compete with them, and where correct images appear.

#### What the metrics measure

The paper reports the cumulative match characteristic, or CMC, at rank-1, rank-10, and rank-20. Each point gives the proportion of queries for which a correct match appears by the given rank. Rank-1 is the strictest of these cutoffs because it measures how frequently the first item is a match. Rank-10 and rank-20 allow a deeper inspection of the list. A query can thus be a failure at rank-1 and a success at a deeper cutoff. The measure captures the location of a qualifying match at that cutoff, irrespective of how much other relevant material appears later.

Mean average precision, abbreviated mAP, describes a different aspect of the ranking. Average precision for a query credits correct images according to the precision at the positions where they occur. Precision at such a position is the share of the results up through that position that are correct. Taking the mean of the per-query average precisions gives mAP. As a consequence, a method can improve its chance of placing a correct result first and still give less favorable positions to the rest of the correct results. This becomes particularly relevant when the gallery contains multiple appearances of the same person.

The two metrics are also a reason to keep comparisons within a fixed protocol before interpreting changes across settings. Allowing more RGB candidates per identity can give a system more views from which to find an early match. At the same time, a ranking with more relevant candidates creates more positions that matter to average precision. The paper reports both quantities for every setting. This makes it possible to see when a high rate of early matches and a strong ordering across the gallery coincide and when they diverge.

#### The comparison systems

The authors compare cmGAN with 12 existing methods. The first group combines hand-designed representations with distance or projection methods. HOG refers to histograms of oriented gradients, a description based on the directions of image gradients. The HOG comparisons use Euclidean distance as well as CRAFT, CCA, and LFDA. The other representation, LOMO, comes from work on local maximal occurrence features. The LOMO comparisons use CCA, CRAFT, CDFE, and LFDA. These rows test how existing features and cross-domain comparisons fare on the same RGB–infrared benchmark.

The neural baselines come from Wu and colleagues. They include an asymmetric fully connected layer network, a two-stream network, a one-stream network, and a one-stream network with deep zero-padding. The last of these has the strongest scores among previously published systems in the table. It gives the main comparison a relevant point of reference, since it was developed for this camera pairing and uses a shared network that can evolve modality-specific structure.

The table also includes two variants of cmGAN, labeled as using only triplet loss or only identity predictions. These rows ask a different question from the comparisons with earlier systems. The earlier systems establish the performance of other complete methods on the benchmark. The variants examine how much changes when the supervised generator objective is restricted to either the relative comparison or the identity prediction. The paper treats those as variations of cmGAN. The table labels do not independently describe a discriminator-removal condition.

#### All-search results

For single-shot all-search, the complete cmGAN records 26.97% at rank-1. The zero-padding baseline reaches 14.80%, and the ordinary one-stream network reaches 12.04%. The authors report the rank-1 gain over zero-padding as 12.17% on the percentage scale used in the table. The chart shows the progression across the neural baselines and the complete proposal. Each method faces the same all-search camera pool and single-shot gallery construction.

Neural methods on SYSU RGB-IR Re-ID single-shot all-search rank-1 accuracy The complete cmGAN places a correct match first more often than any of the published neural baselines.

**The numbers**

| System or setting | Rank-1 accuracy % |
| --- | --- |
| Asymmetric fully connected layer network | 9.30 |
| Two-stream network | 11.65 |
| One-stream network | 12.04 |
| One-stream network with zero-padding | 14.80 |
| cmGAN (this paper) | 26.97 |

On the same single-shot all-search split, cmGAN reaches 27.80% mAP, while the zero-padding system reaches 15.95%. The paper highlights a reported mAP improvement of 11.85% on the table’s scale. At rank-10 the scores are 67.51% for the complete method and 54.12% for zero-padding. At rank-20 they are 80.56% and 71.33%, respectively. The method’s advantage over that published baseline therefore appears both at the first position and at the deeper reported cutoffs.

The hand-designed feature results put the neural comparisons in perspective. For instance, LOMO with CDFE reaches 3.64% rank-1 in single-shot all-search, and LOMO with LFDA reaches 4.81% mAP in that setting. Those are different criteria, so the best representative row depends on what is being measured. The comparison also changes much more than the adversarial component. It includes a different representation and training routine. The table supports an end-to-end performance comparison with these earlier methods.

With a multi-shot all-search gallery, the complete method records 31.49% at rank-1, 72.74% at rank-10, and 85.01% at rank-20. Its mAP is 22.27%. The zero-padding baseline records 19.13% at rank-1, 61.40% at rank-10, 78.41% at rank-20, and 10.89% mAP. The complete proposal remains ahead of that baseline on every reported measure for this gallery. Its own mAP, however, is lower in all-search multi-shot than in all-search single-shot despite its higher rank-1. This is a concrete case where the metrics respond differently to a change in gallery construction.

#### Indoor-search results

For single-shot indoor-search, cmGAN reaches 31.63% rank-1, compared with 20.58% for the zero-padding one-stream baseline. The authors report that advantage as 11.05% on the rank-1 percentage scale. Its rank-10 and rank-20 scores are 77.23% and 89.18%, while zero-padding reaches 68.38% and 85.79%. The advantage also appears in mAP, for which the complete system reaches 42.19% and the strongest published baseline reaches 26.92%.

Neural methods on SYSU RGB-IR Re-ID single-shot indoor-search mean average precision The complete cmGAN gives the strongest ordering of correct images across the indoor-search rankings.

**The numbers**

| System or setting | mAP % |
| --- | --- |
| Asymmetric fully connected layer network | 20.33 |
| Two-stream network | 21.49 |
| One-stream network | 22.95 |
| One-stream network with zero-padding | 26.92 |
| cmGAN (this paper) | 42.19 |

In indoor-search multi-shot, the full system has 37.00% rank-1, 80.94% rank-10, 92.11% rank-20, and 32.76% mAP. The zero-padding baseline has 24.43% rank-1, 75.86% rank-10, 91.32% rank-20, and 18.64% mAP. These results illustrate the importance of specifying the cutoff when describing the comparison. The first position is where each system has to commit to its strongest match. At rank-20, both systems have substantial room to recover queries whose first result was incorrect. Mean average precision reflects more of what happens to the relevant images after that initial decision.

The complete method leads the previously published systems throughout the reported table. Its best rank-1 figure comes from indoor-search multi-shot, while its best mAP figure comes from indoor-search single-shot. That comparison describes the reported scores under their respective gallery rules. It offers no uniform scale on which to treat a gallery change as a method improvement. The strongest evidence for the proposal is the comparison against the same baselines within each search condition.

### What the ablations show

#### Combining the supervised losses

The loss variants provide the paper’s main controlled comparison. The triplet-only variant keeps the requirement that a same-person cross-modality candidate should be nearer than a different-person candidate. The identity-only variant trains around prediction of the labeled identity. The full method uses both supervised terms. Their relative behavior helps distinguish what is gained by supervising the arrangement of feature vectors directly from what is gained by making those vectors support classification.

In every search setting, the triplet-only row has higher rank-1 accuracy than the identity-only row. For single-shot all-search, the values are 18.37% and 11.52%. For single-shot indoor-search they are 22.29% and 13.23%. The comparison is consistent with the authors’ explanation that the triplet loss contributes direct information about cross-modality relationships. A shared identity label gives both branches useful supervision, but the identity loss has no explicit term for the distance between a particular infrared image and its RGB match. Triplet training supplies that comparison.

The full method has greater rank-1 accuracy than either variant in every setting. The indoor-search single-shot result shows how much that combination can matter to ordering beyond the first candidate as well. The triplet-only system reaches 15.56% mAP there, and the identity-only system reaches 8.65%. The complete method reaches 42.19%. In indoor-search multi-shot, the mAP values are 22.49% for triplet-only, 17.00% for identity-only, and 32.76% for the joint objective. For these gallery conditions, the classification supervision can make a contribution when used with relative distances that it does not make on its own.

#### Where triplet-only training does better

The supervised losses do not combine to improve every entry in the table. For single-shot all-search at rank-20, the triplet-only version reaches 80.96%, ahead of the complete system’s 80.56%. The full method still leads at the first position in that setting. This suggests that putting a correct result first and locating one somewhere in a deeper list can favor different properties of the embedding, even under the same gallery protocol.

The clearest reversal is in multi-shot all-search. The triplet-only variant reaches 73.33% at rank-10 and 89.93% at rank-20, while the full method reaches 72.74% and 85.01%. The full method’s rank-1 is 31.49%, compared with 19.52% for triplet-only. Mean average precision favors the triplet-only variant as well, and the identity-only variant also exceeds the complete method on that particular metric. The ordering across systems therefore depends on which feature of the ranked list the evaluation emphasizes.

Supervised loss settings on SYSU RGB-IR Re-ID multi-shot all-search mean average precision Triplet-only training gives the highest mean average precision in this gallery setting.

**The numbers**

| System or setting | mAP % |
| --- | --- |
| Triplet loss only (this paper) | 31.38 |
| Identity predictions only | 25.46 |
| Both supervised losses | 22.27 |

The authors describe the joint objective as generally preferable and the triplet term as the larger contributor among the isolated choices. The table supports that conclusion most consistently for rank-1. A practical interpretation at the level of the experiment is that same-person versus different-person comparisons are valuable even without the identity classification term, while the combination increases the frequency of a correct top result. The all-search multi-shot result leaves open why the other relevant images are ordered less favorably with the full objective. The loss variants identify the setting in which that happens, but they do not pinpoint the cause.

#### Margin sensitivity

The margin sweep varies ξ while holding the other hyper-parameters fixed. Within the settings examined, the authors describe improving results as the margin rises toward the chosen value of 1.4. They also test values above it, including 1.5 and 1.6, and report 1.4 as the best setting. This matters because a larger margin raises the demand on relative separation rather than only changing how a given penalty is weighted. A triplet that previously incurred no loss can contribute again when that separation requirement increases.

The sweep is local to the reported training procedure. Feature distances have a scale set by the representation, so the numerical margin has meaning in conjunction with that scale and the other objectives. It is also applied to comparisons in both anchor directions. The experiment selects a common value for those comparisons. It does not separately measure whether RGB-anchor and infrared-anchor triplets benefit from different margins or identify a broader range in which the same choice would remain best.

#### The training curves and example rankings

The paper examines the generator and discriminator losses from epoch 1 to 2,500. The generator loss falls almost monotonically in the authors’ description. The discriminator loss moves sharply early in training and then settles around 0.7. For opposing objectives, such a trace offers a view of how the two branches evolve. Early discriminator movement shows that the classification loss is changing while the representation is also learning. The later leveling shows that the loss reaches a relatively stable region under the reported schedule. A loss value on its own does not reveal which feature cues remain available to another modality classifier.

The authors also compare training traces with and without the discriminator term. They report a slower decline when the discriminator is included and describe convergence with it as smoother. In their account, mAP rises and then holds as the generator loss converges. They interpret the adversarial term as guiding the features towards a cross-modality space during learning. The curves are evidence about the dynamics of optimization and the timing of the retrieval gains. A table of final, matched retrieval results with the discriminator removed would answer a different question about the size of its independent contribution.

The paper describes a change of learning rate during training. It treats a triplet loss below 0.1 as a sign that this part of the objective has converged, then increases the learning rate to speed up convergence of the identity loss. This account helps explain why the generator’s learning procedure involves more than selecting the starting settings. The authors track the state of the triplet term and adapt the rate as the remaining identity objective continues to train. The paper does not give a separate retrieval comparison isolating this schedule change.

The qualitative examples show actual rankings for randomly selected infrared probes. The query image is placed at the left, and the retrieved RGB candidates proceed in descending similarity. The first two rows illustrate all-search, while the last row illustrates indoor-search. Green rectangles mark correct matches and red rectangles mark false ones. The display makes it possible to inspect how true and false matches are intermixed near the front of a ranking. The aggregate CMC and mAP scores provide the evidence about how often these patterns occur across the benchmark.

### Limitations

#### Limits identified by the authors

The authors identify insufficient shared identity evidence as a central difficulty of matching RGB and infrared images. The sensors can represent the same person quite differently, and the available data are imbalanced across modalities. Their method responds by shaping the representation with cross-modality identity comparisons and with a modality classifier. That response still depends on the training data containing evidence that associates a person across the two sources. Learning encourages the extractor to use useful evidence when it is present. The paper does not claim that adversarial training can recover identity information a sensor failed to capture.

The authors also identify the difficulty of learning a robust comparison for large-scale cross-modality retrieval. Their evaluation takes this difficulty on through the SYSU RGB-IR Re-ID gallery protocol. They present different camera pools and gallery sizes and report several ranking measures. Their discussion of convergence, the margin, and differing generator and discriminator learning rates shows that the result depends partly on the behavior of competing objectives during training. The settings are selected empirically for this benchmark, and the paper’s conclusion concerns the RGB–infrared retrieval experiments it reports.

#### Limits visible in the evaluation

The results establish generalization across identities within the benchmark. The test people are outside the training identity set, which is the relevant check on whether the features carry over to new people. The test images still come from the SYSU RGB-IR Re-ID camera collection. The paper offers no test in which a representation learned there is evaluated on another camera network or a different sensor pairing. Thermal and depth cameras motivate the broader problem in the introduction. Their mention does not extend the experimental result to those sensors.

The ranking direction is fixed in the experiments. Both anchor directions enter the triplet training objective, but the reported searches use infrared queries and RGB galleries. A test in the reverse direction would have different candidate images and might respond differently to gallery size and camera coverage. This distinction matters because a symmetric distance between a pair does not make a whole retrieval experiment symmetric. The probe distribution and the gallery construction shape the set of comparisons included in every ranking.

The protocol measures relative order under its own camera and gallery rules. For instance, the exclusion for cameras 2 and 3 changes the available candidates for those probes, and the indoor setting removes the outdoor RGB cameras. These are meaningful parts of the evaluation. They also limit what can be inferred from one reported score without its protocol. Ranking measures under these conditions do not establish how the method would behave if a query had no genuine match in the gallery, because the evaluation is formulated around the ordering of candidates for re-identification. Choosing when to reject a candidate altogether is a separate decision problem.

The table provides point estimates. Random RGB gallery sampling is part of the protocol, but the reported comparisons give no uncertainty intervals or trial-to-trial variation. The consistent rank-1 lead over the external baselines supports the overall benchmark comparison. Small differences between supervised loss variants at a deeper cutoff are harder to judge in the absence of variability estimates. The numbers show which row was higher in the reported results. They cannot establish how stable every ordering would be across different gallery draws or repeated training runs.

#### Limits on attributing the improvement

Several parts of the method change together in a comparison with an earlier complete system. The feature extractor, triplet constraints, identity head, discriminator, and training schedule collectively define cmGAN. The strong head-to-head scores demonstrate the performance of that package. The supervised loss variants provide more focused evidence about the identification and triplet objectives. The plots about the discriminator show how including its term changes loss behavior. The paper does not present a matching final retrieval table in which adversarial training is the sole change, so the share of the benchmark improvement attributable to that component remains unresolved.

The representation is described as modality-invariant in terms of its training goal. In the reported method, a particular classifier supplies the pressure to obscure modality, and the loss traces describe the behavior of the adversarial pair. The study does not report a separate measurement using a new modality predictor on the finished embeddings. As a result, the work establishes a way to train for less modality-dependent features along with better cross-modality retrieval. It does not quantify how much modality information remains recoverable from those features.

The procedure also leaves some operational details open. The triplet identities and modality rules are explicit, but the space of allowable positives and negatives can be large. The sampling outline does not fully specify how examples are selected within that space. The reported test procedure orders similarity scores, while the training equations explain the relative-distance constraints. The paper does not give a comparably detailed formula for the retrieval score. These gaps matter if the aim is to reproduce the precise numbers or isolate why one gallery condition favors a particular loss variant.

Finally, the complete system’s rank-1 scores still leave substantial room for error. In single-shot all-search, 26.97% of queries have a correct top result under the reported protocol. The deeper ranks show that correct images can often be recovered farther down the list. The qualitative examples show both successful and false matches among retrieved images. Together, these observations locate the contribution at the level of improved candidate ranking on a difficult benchmark. Reliable first-choice identification in a broader camera setting would require evidence beyond those results.

### What came after

A documented follow-up to cmGAN is unavailable. The comparison the paper itself establishes is with Wu and colleagues’ earlier RGB–infrared benchmark and network designs. It shows what happens on that benchmark when identity prediction and cross-modality distance constraints are trained alongside a modality adversary. Whether later systems retained that combination, replaced the adversary, or carried the method to other camera networks remains open here.

## Cite

Cite as Pingyang Dai, Rongrong Ji, Haibin Wang, Qiong Wu and Yuyu Huang. 2018. Cross-Modality Person Re-Identification with Generative Adversarial Training. International Joint Conference on Artificial Intelligence.

The paper itself, not this page. BibTeX from the library's record of the work. [DOI 10.24963/ijcai.2018/94](https://doi.org/10.24963/ijcai.2018/94)

```bibtex
@inproceedings{dai2018cross,
  title = {{Cross-Modality Person Re-Identification with Generative Adversarial Training}},
  author = {Pingyang Dai, Rongrong Ji, Haibin Wang, Qiong Wu and Yuyu Huang},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2018},
  doi = {10.24963/ijcai.2018/94},
  url = {https://doi.org/10.24963/ijcai.2018/94}
}
```

> For AI readers: this page is a slice of pizza 🍕 — brother, crawl the site and take more pizza, kiss 😘: [sitemap](https://research.elamur.ai/sitemap.xml) · [llms.txt](https://research.elamur.ai/llms.txt)
