Abstract
Deep learning models often fail on out-of-distribution (OOD) data because they rely on spurious correlations between semantic features and variation factors. This paper introduces a Causal Semantic Generative (CSG) model that explicitly separates these factors using causal reasoning, enabling robust OOD prediction from a single training domain. We provide theoretical guarantees for identifying the true semantic cause and demonstrate state-of-the-art performance on various image classification benchmarks including PACS and VLCS.
Introduction
Standard supervised learning assumes that training and test data are independent and identically distributed (IID). However, in real-world scenarios, test data is frequently out-of-distribution. Deep neural networks are brittle in these cases because they often conflate "semantic factors" (the cause of a label) with "variation factors" (domain-specific noise). For instance, a model might learn a spurious correlation between a bed and a bedroom background. When this correlation breaks (e.g., a bed outdoors), the model fails. This work proposes a method to separate causal semantics from spurious variations using only a single training domain.
Methods
The Causal Semantic Generative (CSG) model formalizes the data-generating process by splitting latent variables into semantic factors ($s$), which cause the label $y$, and variation factors ($v$), which do not. Both $s$ and $v$ combine to generate the observed image $x$.
Causal Invariance Principle
We assume that the mechanisms generating the data—$p(x|s,v)$ and $p(y|s)$—represent fundamental invariant laws. Only the prior distribution $p(s,v)$ changes across domains. Based on this, we propose two variants:
- CSG-ind (for OOD Generalization): Uses an independent prior $p^{\perp}(s,v) = p(s)p(v)$ at test time to neutralize spurious correlations.
- CSG-DA (for Domain Adaptation): Learns a new target-specific prior $\tilde{p}(s,v)$ from unlabeled target data while keeping generative mechanisms frozen.
Training is conducted using Variational Bayes to optimize the Evidence Lower Bound (ELBO), employing a reformulation that avoids the need for separate inference models for each domain.
Key Insights
Single-Domain Identifiability
A significant theoretical contribution is the proof that the true semantic factor can be identified from a single training domain under conditions such as additive noise and a strong generative mechanism. This challenges the common belief that multiple domains are strictly necessary for disentanglement.
Causal vs. Inference Invariance
Many existing methods attempt to learn domain-invariant representations. We argue that if the generative process is noisy, inference should actually rely on domain-specific priors to resolve ambiguity. Causal invariance is thus a more fundamental assumption than inference invariance.
Experimental Results
We evaluated the CSG framework on several challenging benchmarks:
- Shifted-MNIST: CSG-ind achieved 82.6% accuracy, far exceeding standard Cross-Entropy (42.9%). CSG-DA reached 97.6%.
- PACS & VLCS: CSG models consistently outperformed baselines like DANN and CDAN. For example, on PACS Art, CSG-DA achieved 88.8%.
- ImageCLEF-DA: While performance gains were more modest, the model remained competitive, highlighting the need for diverse variation factors in the training set for optimal disentanglement.
Qualitative visualizations using LIME confirmed that CSG models focus on the semantic shapes of objects, such as the outline of a dog, rather than irrelevant background pixels.
Conclusion
The CSG model provides a robust framework for OOD prediction by explicitly modeling causal generative processes. By identifying semantic factors from a single domain, it offers a practical solution for real-world domain shifts. Future research will focus on relaxing mathematical assumptions and integrating causal discovery techniques.
Summary updated