Automatic Visual Instrumental Variable Learning for Confounding-Resistant Domain Generalization

Fuyuan Cao, Shichang Qiao, Kui Yu, Jiye LiangNeurIPS 2025

In the quest for models that generalize to unseen environments, machine learning researchers often hit a wall: confounders. These are hidden variables that influence both the input features and the labels, creating "spurious correlations" that look like patterns but vanish when the environment changes.

A new approach, "Automatic Visual Instrumental Variable Learning for Confounding-Resistant Domain Generalization" (VIV-DG), introduces a clever way to bypass these hidden traps by teaching models to find their own "natural experiments" within image data.

TL;DR

VIV-DG is a novel framework that automatically learns Visual Instrumental Variables (IVs)—stable non-causal attributes like color and texture—to mitigate the effects of unobserved confounders. By enforcing causal constraints on learned representations, it achieves state-of-the-art domain generalization without requiring manually defined instruments or assuming all confounders are visible.

The Challenge of Domain Generalization

Domain Generalization (DG) aims to train a model on "source" domains (e.g., photos of dogs) so it works on "target" domains (e.g., sketches of dogs). The primary enemy is the confounder. For example, if most training photos of cows are on green grass, a model might learn that "green background = cow." In a target domain where cows are on sand, the model fails.

Existing causal methods try to "adjust" for these confounders, but they usually require:

  1. Observing everything: Assuming you can see and label every possible confounder, which is nearly impossible in the real world.
  2. Manual Instrumental Variables: Using a predefined variable (like the domain ID) as an instrument. However, if that instrument isn't "pure"—meaning it affects the label directly or is linked to the confounder—it introduces massive bias.

The authors argue that we shouldn't just suppress non-causal features (like color); we should use them as instruments to help isolate the true causal relationship between an object's shape and its label.

Methods: The Visual Instrumental Variable (VIV)

The core of the paper is the Visual Instrumental Variable (VIV). In classical statistics, an IV is a variable that affects the "treatment" (the causal features) but has no direct link to the "outcome" (the label) or the "confounders."

The authors propose a refined Structural Causal Model (SCM) that splits non-causal factors into observed confounders, unobserved confounders, and Visual IVs.

Comparison of the proposed Structural Causal Model (SCM) against prior models, highlighting the split of non-causal factors into IVs and Confounders.

The VIV-DG Framework

The framework operates in four alternating phases to automatically learn and apply these variables:

  1. Causal Factor Extraction: Uses Fourier-based data augmentation. Since the phase of a Fourier transform captures shape/structure and the amplitude captures style/color, they perturb the amplitude to force the model to learn shape-consistent representations.
  2. Visual IV Learner: This module learns a representation from masked images (focusing on texture/color) and enforces three mathematical constraints via mutual information:
  3. Relevance: The IV must be strongly associated with the causal features.
  4. Independence: The IV must be independent of the observed confounders.
  5. Exclusion: The IV must not provide any information about the label that isn't already captured by the causal features.
  6. Regression Predictor: A lightweight network uses the learned IV to predict a debiased version of the causal features, effectively filtering out the noise from unobserved confounders.
  7. Refinement: The main classifier is fine-tuned using these debiased features.
Overview of the multi-stage VIV-DG training pipeline, detailing the extraction, IV learning, and refinement phases.

Key Insights and Results

VIV-DG was evaluated on standard DG benchmarks including Digits-DG, PACS, Office-Home, and VLCS.

  • Non-causal features are useful: Instead of treating color and texture as "noise" to be deleted, VIV-DG treats them as "witnesses." Because an object's color is often physically linked to its shape (Relevance) but doesn't define the category (Exclusion), it makes a perfect Instrumental Variable.
  • Automated vs. Manual: By learning the IV rather than picking one (like Domain ID), the model avoids the "violation of exclusion restriction" that plagues previous causal DG methods.
  • Superior Accuracy: On the PACS dataset, VIV-DG achieved an average accuracy of 87.2%, outperforming previous causal methods. It also showed significant gains on Digits-DG in domains with extreme distribution gaps (like SVHN and SYN).
  • The "Exclusion" Constraint is King: Ablation studies showed that the exclusion loss—ensuring the IV doesn't "leak" label information directly—is the most critical component for success.
  • Better Visual Explanations: Grad-CAM visualizations show that VIV-DG focuses on more holistic, object-centric regions (like the whole body of an animal) rather than the localized, potentially spurious cues picked up by baselines.

Limitations and Future Work

While highly effective, the multi-stage alternating optimization introduces computational overhead compared to standard training. Training with larger backbones like ResNet-50 requires significant VRAM. To address this, the authors proposed a "Lite" version (VIV-DG-Lite) that uses feature fusion to save time, though it trades off some interpretability.

Future directions could explore applying this "automatic IV" concept beyond image classification, such as in object detection or medical imaging where unobserved confounders are rampant. For those interested in the intersection of causal inference and computer vision, VIV-DG provides a powerful new blueprint for building models that understand the "why" behind the pixels.

Summary updated

BibTeX
@inproceedings{cao2025automatic,
  author = {Fuyuan CAO and Shichang Qiao and Kui Yu and Jiye Liang},
  title = {{Automatic Visual Instrumental Variable Learning for Confounding-Resistant Domain Generalization}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2025},
  url = {https://openreview.net/forum?id=SVGkn64X4m},
}
Figure