Factorial Counterfactuals for Clothes-Changing Re-Identification

Person re-identification means matching photos of the same person across different cameras. Current models mostly learn to recognize outfits rather than people: under clothing changes, standard models lose 30 to 50% of their accuracy (Wan et al.). The best recent fix generates new clothes with a diffusion model. A diffusion model is an image generator that learns to turn random noise into realistic pictures step by step, and it can fill in a masked region of a photo, which is called inpainting. DLCR uses this to repaint the clothing region of real photos from language-model prompts. It produces 2.1 million same-identity images and reports a Top-1 gain of 11.3 points over the CAL baseline on PRCC. The edited images have a side effect, though. Each one keeps the source photo's exact background, lighting, pose, crop and camera. A model can therefore match an edited image to its source through those unchanged pixels. In doing so it trades one shortcut, the outfit, for others, the scene and the camera.

We propose generating edits in a small factorial design and training on the pairs directly. From each real image we create three variants: one with the clothing changed, one with the background and lighting changed, and one with both changed. A text record states exactly what changed in each. Training asks the identity part of the embedding to stay fixed across every edited factor. A separate appearance part must predict the recorded change from the difference between paired embeddings. The claim has two halves. Controlled, factor-labelled pairs remove dependence on each named transient cue more effectively than the same images added to the training pool. The appearance part keeps the outfit information that same-clothes retrieval needs, so no hand-tuned trade-off weights are required.

Core Claim and What Is New

Existing work sits on one side or the other of this proposal. DLCR supplies the generation method, which we reuse. It edits only clothing and adds the synthetic images to the pool with progressive training, so it never uses the pairing between a source image and its edit. Rethinking CC-ReID supplies the key constraint: forcing a model to ignore clothing hurts same-clothes retrieval. That paper handles the conflict with multi-objective optimization steered by human preference vectors, and its garment-warping generator uses no text. DIFFER and CCAF use vision-language models, which link images and text, to describe or suppress clothing. Neither generates new images. DIFFER relies on a gradient-reversal adversary, an objective where the encoder is trained to defeat a clothing classifier, and that adversary becomes unstable when several factors change at once. AIM treats clothing as a confounder, a hidden cause of spurious correlation, and subtracts it causally. Its clothing branch estimates what the clothing contributes; it never actually changes the clothing in an image.

Our design differs from all of these in two ways. First, the intervention is performed in pixel space and is labelled by factor. Second, invariance comes from direct paired comparisons, not from adversaries or from pooling. The factorial structure is the part we consider genuinely new, because a clothing-only edit design cannot tell whether a model learned to identify people or learned to match scenes.

Research Program

Generation. We start from each training image of PRCC, LTCC and CCVID. A vision-language model (LLaVA, as in DLCR) describes the outfit and scene. A language model then writes a new outfit, a new background and lighting, or both. Stable Diffusion inpainting renders each variant, using the clothing mask for outfit edits and the complement of the person mask for scene edits. Every variant keeps a structured record of the change: garment type, color and texture, background category, and lighting.

Filtering for identity drift. Clothing edits often shift perceived build or age. If such edits were kept, the invariance objective would teach the model to ignore body shape. We therefore run the biometric attribute description step from DIFFER (build, age, gender) on both the source and the edit. We also compare pose keypoints between them. An edit is rejected if its biometric description disagrees with the source or its keypoints drift beyond a threshold. We report the rejection rate as a measurement of the drift problem itself.

Objective. The embedding is split as $f(x)=[f_{id}(x), f_{app}(x)]$. Here $f_{id}$ is the identity part and $f_{app}$ is the appearance part. For a real image $x$ and its edit $x^{k}$ along factor $k \in \{\text{clothes}, \text{scene}, \text{both}\}$, with change record $c^{k}$, we add

$$ \mathcal{L}_{pair} = \lVert f_{id}(x) - f_{id}(x^{k}) \rVert^2 + \lambda\, \mathrm{CE}\big(g(f_{app}(x^{k}) - f_{app}(x)),\, c^{k}\big), $$

where $g$ is a small classifier over the recorded attribute changes, $\mathrm{CE}$ is cross-entropy, and $\lambda$ is a single weight. This loss is added to the standard identity and triplet losses on real images. Clothes-changing queries use $f_{id}$ alone, and same-clothes queries use the full $f$. The trade-off is resolved by choosing which part of the embedding to use at query time, not by preference vectors.

Diagnostics. We define a factor sensitivity score: the mean cosine shift of $f_{id}$ under each edit type, computed on held-out identities. We also report real-data breakdowns. LTCC's 12 cameras allow clothes-changing retrieval to be split into query–gallery pairs from the same camera and pairs from different cameras.

Baselines

The naive reference point is the CAL-style ResNet-50 baseline trained on real data only. We report its clothes-changing and same-clothes Rank-1 and mean Average Precision (mAP) on PRCC and LTCC, reproduced under our training schedule.

The most important competitor is DLCR's pooled-expansion recipe, because it uses the same generator family and asks the same question. We run it on exactly our filtered generated images, with its progressive schedule, the same backbone, the same number of epochs, and the same hyperparameter search budget. Test-time query expansion is disabled for both methods and reported separately. DLCR reports an 11.3 Top-1 gain over CAL on PRCC and a 28.7 gain for MGN. The file gives no absolute value, and for LTCC there is no reported result found on Lacuna. We will therefore rely on our own reproduction.

The strongest published PRCC numbers in the file are:

  • CCAF: 70.4% Rank-1 and 63.7% mAP in the clothes-changing setting.
  • DIFFER: 68.5% Rank-1 on PRCC and 58.2% Rank-1 on LTCC.
  • Rethinking CC-ReID: 63.8% clothes-changing mAP and 97.1% same-clothes accuracy on PRCC.

We compare against these as reported, noting any backbone mismatch. Where code allows, we also retrain DIFFER on our backbone.

Beating the baselines means two things. The first is a gain over pooled DLCR on LTCC's cross-camera clothes-changing split that exceeds the spread across three seeds. The second is PRCC clothes-changing mAP above 63.8 with same-clothes accuracy within one point of 97.1.

Three ablations isolate the key ingredient:

  • Clothing-only edits with the paired loss, which removes the factorial design.
  • Factorial edits pooled without the paired loss, which removes the pairing.
  • The paired loss without the appearance part, which tests same-clothes retention.

Why not just…?

Why not just use DLCR's pooled images, which already work? This is the real threat. In triplet training, pooled edits already serve as same-identity positives, so the pairing may add nothing. The factorial ablation settles it. If pooled factorial edits match paired factorial edits on the cross-camera LTCC split, pairing is unnecessary and the contribution reduces to the factorial design. If clothing-only paired edits match factorial ones, the scene-shortcut hypothesis is wrong. We predict that pooled clothing-only training helps mostly on same-camera clothes-changing pairs, because the scene still matches there. The camera breakdown tests this prediction directly.

Why not just use strong color jitter and random erasing? These perturbations remove color but do not create plausible new garments, and they leave silhouette and texture layout in place. RGB models trained with standard processing still collapse under clothing change, from about 75% to about 19% (Yang et al.). Rethinking CC-ReID reports that weaker generative edits fail to preserve identity. We include an aggressive-augmentation baseline with matched compute so this comparison is measured, not assumed.

Why not just debias causally without generation, as AIM does? AIM reaches 57.9% Rank-1 on PRCC and 40.6% on LTCC. Methods that add richer supervision exceed it: DIFFER reaches 58.2% on LTCC. This suggests that subtraction cannot recover wardrobe variation the data never shows. Our objective is a pixel-level version of AIM's intervention, so AIM on our backbone is also a baseline.

Why not just fine-tune CLIP with prompts? CCAF reports that CLIP's image encoder over-weights color and pattern. CLIP3DReID needed distillation and 3D regularization to move Celeb-reID-light mAP from 21.8 to 26.3. Our objective is independent of the backbone, and we test it on a CLIP backbone as well.

Decisive Checks

The main test is LTCC clothes-changing retrieval split by same camera versus different camera, comparing pooled DLCR with our paired factorial training. The claim holds only if our gain concentrates on cross-camera pairs. We also check the scene-edit sensitivity of $f_{id}$ on held-out identities: it should fall for our model and stay high for pooled clothing-only training. On PRCC we require clothes-changing mAP gains without losing same-clothes accuracy. Finally, we evaluate cross-dataset transfer to Celeb-reID-light and Real28, with training on PRCC or LTCC and no target fine-tuning. This asks whether removing scene shortcuts generalizes beyond the source cameras. We report the filtering rejection rate and total GPU hours for generation alongside every result.