This research presents a significant advancement in Contrastive Analysis (CA) by bridging the gap between statistical factor separation and high-fidelity image synthesis. The framework automatically identifies and separates shared features (common factors) from unique features (salient factors) between two image datasets using only dataset-level labels.
Introduction
In generative AI, manipulating specific image attributes typically requires precise, per-image labels (e.g., "glasses" or "age"). However, in many real-world scenarios, such as medical imaging, we may only have dataset-level labels (e.g., a set of healthy scans vs. a set of scans with a specific pathology).
Contrastive Analysis (CA) aims to disentangle "common" factors (features shared by both sets) from "salient" factors (features unique to one set). While previous CA methods relied on Variational Autoencoders (VAEs), they often produced blurry, low-quality results. This work adapts CA to state-of-the-art architectures like StyleGAN and Diffusion Models to maintain high image quality while achieving clean factor separation.
Methodology
The core innovation is a Separating Network ($S$ for StyleGAN, $D$ for Diffusion) that acts as a wedge in the latent space to perform latent decomposition.
Latent Decomposition and Weak Supervision
The network splits a latent representation into two distinct vectors: $c$ (common) and $s$ (salient). Training is conducted using weak supervision; for the "background" dataset, the salient factor $s$ is encouraged to be zero, while for the "target" dataset, both $c$ and $s$ are utilized.
To ensure $c$ truly represents shared information, an adversarial discriminator attempts to identify the source dataset of a $c$ vector. Simultaneously, a regressor network ensures statistical independence between $c$ and $s$, preventing "leakage" where common factors accidentally learn salient details. For StyleGAN, an additional F-space Refinement stage preserves fine-grained details like skin texture that are often lost in lower-dimensional latent spaces.
Experimental Results
The framework was evaluated across diverse domains, including human faces (FFHQ/CelebA-HQ), animal faces (AFHQv2), and brain MRI scans (BraTS2023).
Qualitative and Quantitative Performance
As shown in the comparison below, the proposed method significantly outperforms previous CA baselines in both reconstruction quality and the clarity of attribute swapping.
- High Fidelity: The StyleGAN-based refinement (pSp-cs-Ref) achieved a Frechet Inception Distance (FID) as low as 2.406 on FFHQ, compared to FIDs over 70 for older methods.
- Identity Preservation: During attribute swaps, the model maintained an identity similarity score of 0.804, ensuring the subject's identity remained intact.
- Superior Separation: Quantitative tests showed significantly lower "leakage" metrics compared to baselines like MM-cVAE and Double InfoGAN.
Conclusion
By enabling high-quality, weakly-supervised image editing and factor discovery, this framework offers powerful utility for unsupervised discovery of disease markers in medical imaging and general attribute manipulation. Future work will address computational costs associated with diffusion models and strategies to mitigate potential dataset biases.
Summary updated