Visual Representation Learning through Causal Intervention for Controllable Image Editing

Shanshan Huang, Haoxuan Li, Chunyuan Zheng, Lei Wang, Guorui Liao, Zhili Gong, Huayi Yang, Li LiuCVPR 2025 · DOI

TL;DR

This paper introduces CIDiffuser, a novel framework for controllable image editing that tackles the problem of spurious correlations between visual attributes. By leveraging causal inference and a diffusion model, CIDiffuser learns disentangled representations that allow for precise attribute manipulation without affecting unrelated image features, significantly outperforming existing methods.

What Problem Does This Paper Address?

Controllable image editing, the ability to modify specific attributes of an image (like changing a smile or adjusting age) while leaving others untouched, is a highly sought-after capability for applications ranging from creative design to personalized content generation. However, a major hurdle in this field is the inherent "spurious correlation" present in real-world datasets. For instance, in datasets of faces, older individuals might be more likely to wear glasses, leading models to incorrectly associate "age" and "glasses" as directly linked. Existing image editing methods often fail to disentangle these spurious correlations, resulting in unintended side effects – changing someone's age might inadvertently add or remove glasses, even if there's no causal relationship. This paper aims to address this by learning "causal representations" that truly reflect the underlying causal structure of image attributes.

Methods

The core of CIDiffuser lies in its multi-stage approach:

  1. Decomposition of Representations: The framework first decomposes an image's representation into two parts:
  2. High-level Semantic Representation: This captures core attributes and their causal relationships, extracted by a semantic encoder.
  3. Low-level Stochastic Representation: This accounts for random or less structured image details, captured by a stochastic encoder.
  4. Causal Effect Learning Module (DCEL): This is the key innovation. It uses a Structural Causal Model (SCM) to explicitly model the relationships between attributes. To disentangle direct causal effects from confounding biases, it employs a causal intervention strategy. This involves comparing the outcome of an attribute when it's directly manipulated (intervened) versus when it's observed naturally. The difference quantifies the Direct Causal Effect (DCE), effectively isolating the true influence of one attribute on another. A specialized loss function, Limb, is used to refine this causal effect matrix, mitigating dataset biases.
  5. Diffusion-Based Representation and Reconstruction: The learned causal representations are then fused with the stochastic representations. This fused representation is fed into a diffusion model (specifically, a denoising U-Net) which acts as a decoder. This diffusion process allows for the gradual generation of high-fidelity images, ensuring that the editing process is guided by the learned causal structure.

Datasets

The authors evaluated CIDiffuser on two datasets:

  • CelebA: A real-world dataset of facial images with 40 attributes. They created three subsets for specific evaluations: CelebA-smile, CelebA-age, and CelebA-gender, each with carefully defined causal relationships between attributes.
  • Pendulum: A synthetic dataset with four attributes, used to test the model's ability to handle confounding biases stemming from physical concepts.

Key Insights and Ideas

  • Causality is Crucial for Controllable Editing: The paper strongly argues that simply learning correlations is insufficient for robust image editing. Understanding and modeling the causal relationships between attributes is essential to avoid unintended side effects.
  • Decomposition Enhances Control: Separating semantic (causal) and stochastic (random) components of an image representation allows for targeted manipulation of the former while preserving the latter.
  • Intervention as a Tool for Disentanglement: The core idea of using "do-calculus" (intervening on an attribute) to isolate its true causal effect from confounding factors is a powerful technique for learning cleaner representations.
  • Diffusion Models Complement Causal Learning: The diffusion model's strength in generating high-quality, diverse images complements the causal representation learning by providing a robust decoding mechanism.

Key Results

  • State-of-the-Art Performance: CIDiffuser significantly outperforms existing methods on both representation quality metrics (like Attr, MIC, TIC) and image generation quality metrics (FID, IS, KID) across the evaluated datasets.
  • Effective Bias Mitigation: Ablation studies show that CIDiffuser's causal modeling and DCEL module are crucial for removing confounding biases, leading to more accurate attribute manipulation. For example, editing "age" in CelebA-smile did not inadvertently affect "smile" as seen in other methods.
  • High-Quality Image Generation: The framework produces visually appealing and realistic images, demonstrating a good balance between disentanglement and fidelity.

Limitations and Future Work

  • Computational Cost: Diffusion models are known for their computational expense, and CIDiffuser, by incorporating causal inference and diffusion, likely inherits this.
  • Defining Causal Graphs: The paper relies on pre-defined causal graphs for the datasets. For more complex or novel scenarios, automatically discovering these causal structures could be a challenging but valuable future direction.
  • Generalizability to Unseen Attributes: While the framework aims for interpretable representations, extending it to edit attributes not explicitly modeled in the causal graph might require further research.

The authors suggest that their work provides a strong foundation for future research in causal representation learning for controllable generation tasks.

Summary updated

BibTeX
@inproceedings{huang2025visual,
  author = {Shanshan Huang and Haoxuan Li and Chunyuan Zheng and Lei Wang and Guorui Liao and Zhili Gong and Huayi Yang and Li Liu},
  title = {{Visual Representation Learning through Causal Intervention for Controllable Image Editing}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2025},
  doi = {10.1109/cvpr52734.2025.02187},
}
Figure