Diff-CA: Separating Common and Salient Factors with Diffusion Models

Michaël Soumm1, Alexandre Fournier-Montgieux2, Yunlong He1, Pietro Gori1, Alasdair Newson1
1Télécom Paris, Institut Polytechnique de Paris  2CEA List
NeurIPS 2026 · Spotlight
Unpaired face images without glasses (background) and with glasses (target) are separated, using only weak binary supervision, into common factors (identity, gender, pose, hair color) and salient factors (glasses style, shape, color). Bottom: swapping salient factors for glasses, head pose, cat/dog and brain tumors.
Contrastive Analysis separates common from salient factors between two unpaired data distributions using only weak binary supervision (i.e., dataset-level labels). The learned common and salient latent spaces can be manipulated, for instance for editing or knowledge discovery.

Abstract

Contrastive Analysis aims to separate factors that are common between two data distributions from those that are salient to only one of them. Existing contrastive methods are based on generative models (e.g., VAEs or GANs) that often suffer from limited reconstruction and image quality, which hampers effective latent factor separation and limits their applicability to high-fidelity image generation and editing. We propose a novel conditioning framework for diffusion models that enables contrastive decomposition without compromising generation quality. We first train a prompt-free, image-conditioned diffusion model, and then learn to decompose the conditioning into a common and a salient factor, using weak supervision. We prove that the additive contrastive factorization, commonly assumed in prior work, is identifiable under mild conditions. This factorization enables targeted editing operations by swapping or interpolating only the salient factor while preserving the common factor.

Method

Diff-CA applies Contrastive Analysis to the conditioning tokens Z of a latent diffusion model, in two stages. In Stage 1, we train a prompt-free, image-conditioned diffusion model from scratch: a cross-query module compresses DINOv3 features into a short sequence of tokens, completed by a color token, so that the generated attributes depend on Z rather than on the starting noise. In Stage 2, a small Transformer encoder splits Z into a salient code ẐS and a common code ẐC whose sum reconstructs Z. A pinning loss pushes ẐS to zero on background samples, adversarial training discourages ẐC from predicting the dataset label, and a cycle-consistency loss on swapped codes encourages the two factors to be independent. We prove that this additive factorization is identifiable under mild conditions.

Diagram: factors S and C generate an image X; a feature extractor f maps X to tokens Z; an encoder E splits Z into salient and common codes, whose sum conditions the diffusion model G, which generates an approximation of X.
Factors (S, C) generate an observed image X. A feature extractor fθ projects the image into conditioning tokens Z, and an encoder EθE splits Z into (ẐS, ẐC), aimed at representing (S, C). Their sum Ẑ conditions a diffusion model Gψ that generates an approximation X̂ of X.

Salient swapping

Exchanging the salient codes ẐS of two images while keeping their common codes ẐC transfers the salient attribute without altering the rest of the image. We evaluate on three domains, with only binary labels: faces (FFHQ: glasses, smile), animals (AFHQ: cat vs. dog) and brain MRI (BraTS 2023: tumor).

Four panels of two image pairs each. Glasses styles are exchanged between two faces, smiles between two faces, cat and dog features between a dog and a cat, and a tumor between two brain MRI slices.
In each panel, the top row shows two real images and the bottom row shows the result of swapping their salient codes. Salient factor: glasses (top left), smile (top right), cat vs. dog (bottom left), tumor (bottom right).

Comparison with CA baselines

Existing CA methods (MM-cVAE, SepVAE, DoubleInfoGAN) rely on low-capacity VAE or GAN generators: they swap the salient factor, but produce blurry images and lose identity. On FFHQ glasses, trained with binary labels only, Diff-CA reaches 94.5% fine-grained glasses accuracy after swapping, against 47.0% for the best baseline, while preserving gender, smile and head pose.

Reconstruction and swapping of two FFHQ faces by MM-cVAE, SepVAE, DoubleInfoGAN and Diff-CA. Baseline outputs are blurry; Diff-CA outputs are sharp and keep identity.
Reconstruction and swapping with Diff-CA and CA baselines. The baselines succeed in swapping the salient factor, but only generate blurry pictures, undermining the fidelity to the original image.
Reconstruction Swapping (fine-grained glasses classes)
Method SSIM ↑ LPIPS ↓ ID-Sim ↑ Acc (%) ↑ ID-Sim ↑ Gender (%) ↑ Smile (%) ↑ Pose MAE (°) ↓
MM-cVAE.370.643.30711.8.30262.357.74.62
SepVAE.358.642.30719.6.30157.756.48.29
DoubleInfoGAN.326.430.32747.0.31468.579.27.35
Diff-CA (ours).610.115.52294.5.47492.592.91.87

FFHQ, glasses attribute; all models are trained with binary labels only (glasses vs. no glasses). Acc: accuracy of a fine-grained glasses classifier on the swapped images. ID-Sim: cosine similarity between face-recognition (ArcFace) embeddings of the original and generated images. Gender, smile and pose measure the preservation of common factors. Swapping results are macro-averaged over no glasses, reading glasses and sunglasses.

Salient interpolation

Fixing the common code of one image and interpolating its salient code toward that of another image produces semantically meaningful intermediate images: the glasses style changes gradually while identity is preserved, and cat features appear on a dog while pose and background are kept.

Top row: a woman's reading glasses gradually turn into the aviator sunglasses of another person. Bottom row: a black puppy gradually gains the ears and whiskers of a tabby cat.
We fix the common code ẐC of the left image and interpolate its salient code toward the salient code of the right image. Top: the style of the glasses is progressively transferred. Bottom: cat features (ears, whiskers) progressively appear.

The salient space is also organized beyond the labels it was trained with. Although training only used glasses / no-glasses labels, the salient codes of faces without glasses, with reading glasses and with sunglasses form distinct groups, most clearly in the UMAP projection: a form of concept discovery.

PCA scatter plot of salient codes: sunglasses (red) separate from reading glasses (green), with no-glasses faces (blue) collapsed to one corner. UMAP scatter plot of salient codes with three separate clusters: no glasses (blue), reading glasses (green) and sunglasses (red).
PCA (left) and UMAP (right) projections of the salient codes ẐS on FFHQ, colored by fine-grained sub-label: no glasses (blue), reading glasses (green) and sunglasses (red).

Brain MRI

On BraTS 2023, the salient factor is the presence of a brain tumor, and the only supervision is a slice-level label (tumor / no tumor) on 2D slices. Such binary labels are routinely assigned in hospitals, while the corresponding imaging patterns can be hard to describe with a text prompt. Swapping ẐS adds a tumor to a healthy slice or removes it from a pathological one, and interpolating ẐS between two slices changes the tumor progressively.

Brain MRI slices. Rows show originals, reconstructions, salient-swapped images and absolute differences: tumors are added to healthy slices and removed from pathological ones. Bottom: interpolation of the salient code between two tumors.
Top: original slices, reconstructions, results after swapping the salient code, and absolute difference between reconstruction and swap. Bottom: interpolating the salient code from tumor 1 toward tumor 2.

BibTeX

@inproceedings{soumm2026diffca,
  title={Diff-CA: Separating Common and Salient Factors with Diffusion Models},
  author={Soumm, Micha{\"e}l and Fournier-Montgieux, Alexandre and He, Yunlong and Gori, Pietro and Newson, Alasdair},
  booktitle={Advances in Neural Information Processing Systems (NeurIPS)},
  year={2026}
}