Learning Causal Semantic Representation for Out-of-Distribution Prediction

Abstract: Conventional supervised learning methods, especially deep ones, are found to be sensitive to out-of-distribution (OOD) examples, largely because the learned representation mixes the semantic factor with the variation factor due to their domain-specific correlation, while only the semantic factor causes the output. To address the problem, we propose a Causal Semantic Generative model (CSG) based on a causal reasoning so that the two factors are modeled separately, and develop methods for OOD prediction from a single training domain, which is common and challenging. The methods are based on the causal invariance principle, with a novel design in variational Bayes for both efficient learning and easy prediction. Theoretically, we prove that under certain conditions, CSG can identify the semantic factor by fitting training data, and this semantic-identification guarantees the boundedness of OOD generalization error and the success of adaptation. Empirical study shows improved OOD performance over prevailing baselines.


Reviews and author responses:

 Thanks for acknowledging our novelty, and technical and theoretical contributions. We’ll further improve the paper according to your valuable feedback.

* Clarity.

  We paid dedicated effort to make the paper easy to follow (noted by Reviewer SkAw), nevertheless it is still possible that it does not please a general reader. We apologize for possible difficulties in your reading and really appreciate your effort to understand our work. The content of Sec. 3 is to build a graphical model that embodies causal relations, by processing motivating examples through a causal reasoning process. Sec. 3.1 introduces the causal-invariance principle for leveraging the causal relations for OOD prediction, and Sec. 3.2 compares it with the inference-invariance principle. We’ll make the presentation more friendly. It would be especially helpful if you could further detail your complaint.

  Apart from the ideological explanations in Sec. 3 and theoretically-guaranteed advantages in Sec. 5, we also showed solid empirical support on the design of CSG. Table 1 and Tables 2-5 in Appendix G show the better performance over inference-invariance-based OOD generalization (CNBB [39]) and domain adaptation methods (classical methods DANN [31], DAN [70], CDAN [71], as well as very recent methods MDD [118] and BNM [25] in Tables 2-5). Also, the ablation study results in Tables 2-5 in Appendix G (i.e., the comparison with CSGz and CSGz-DA) show the benefit of modeling the semantic factor $s$ and the variation factor $v$ separately (Lines 375-379).

* Datasets.

  We’d like to mention that we also experimented on the VLCS dataset (results shown in Tables 2-5 in Appendix G, supporting the same conclusions), which is even _larger_ than the PACS dataset. The ColoredMNIST dataset is for the domain generalization task, which is not a goal in this work (Lines 91-94). Moreover, colors are represented as channels which amounts to positions after vectorization, so it is similar to the shifted MNIST dataset we considered. We’ll conduct experiments on the Office dataset (though VLCS has a comparable scale).

* About the question on inference invariance (Sec. 3.2).

  A nearly deterministic and invertible $p(x|z)$ means that an image $x$ can be deterministically generated once we know _all latent factors_ $z$ (including both semantic factors $s$ and variation factors $v$, but _not only the object position_ which is only part of $v$). It is due to this assumption that inference invariance holds, since this assumption indicates $z$ (including object position) can be almost determined from $x$. This is what is discussed in the first paragraph of Sec. 3.2.

  Line 173 in the second paragraph, in contrast, is talking about the _general case_ (Line 172) where this “deterministic and invertible $p(x|z)$” assumption does _not_ hold. In this case, “multiple $z$ can lead to the same $x$” (Fig. 2), consequently inference invariance does not hold (since an inference rule then depends on a _domain-specific_ preference over these multiple $z$; Lines 174-176), so causal invariance is more reliable in a general case. We’ll make this clearer.

  As for the difficulty to identify latent factors, we do have a condition for identifying $s$, as covered by Remark (1) of Thm. 5. The condition is still more general than inference invariance.


 Dear Reviewer bSHd,

Thanks again for your comment. We hope that our response has addressed your questions and could help understand our novelty and significance. As the discussion period is coming to an end, we'd be more than happy to hear your further thoughts, and provide any additional clarification that you may need.

Thanks for your effort on our paper!

Authors of Paper6147

 Dear Reviewer 9SYR,

Thank you very much for your informative comments. We hope our response could be helpful for resolving your misunderstandings and for re-evaluating our work, especially based on our clarification on the relation between our claims and empirical supports, and the comparison with your mentioned works. We'd be more than glad to hear your further thoughts!

Thanks for your effort on our paper!

Authors of Paper6147

 Dear reviewers,

Thanks for your valuable feedback! We've responded to each comment during the author response period. As the deadline for discussion is approaching, we wonder if there are additional questions or concerns that may require further explanations. We'd be more than happy to hear your post-rebuttal feedback and provide more information on any additional questions.

Thank you again for taking your valuable time and the kind effort for the discussion!

Authors of Paper6147

 Thanks for acknowledging the significance, novelty, and quality of our work. We’ll further improve the paper according to your valuable feedback.

* Empirical evaluation and comparison with other methods.

  Thanks for sharing your feelings. We’ll pay more attention to the discussions on other methods and make well-supported claims. Regarding specific claims you mentioned, we’ll improve some of them accordingly. Meanwhile, we’d also like to clarify possible misunderstandings for others.
  - Line 68: We compared with CNBB [39] as a representative of the mentioned works, and the experiment results support the claim.
  - Lines 79-80, 83: We’ll suppress the conceptual/ideological comparisons with these works, as they are for the _domain generalization_ task but we did not propose a method for this related but different task (Lines 91-94) so an empirical comparison is _not possible_ (if have to, these domain generalization methods simply reduce to the standard supervise learning (i.e., the CE baseline) in our tasks; see Line 338).
  - Lines 100-101: This means the mentioned methods cannot be implemented for our tasks, so an empirical comparison is not possible. We’ll suppress the empirically-unverifiable ideological claim therein.
  - Sec. 3.2: We compared with [31,70,71] (i.e., DANN, DAN, CDAN) as representative inference-invariance-based methods, and the results validate the empirical benefits of leveraging causal invariance. We’ll suppress other mentioned works [97,2,63,76] which are either for domain generalization or cannot form a fair comparison.
  - Lines 66-67: [76] uses direct supervision on what is a variation factor. This information is beyond the dataset so a fair comparison is not possible.
  - Lines 74-75: We compared with [31,70,71] (i.e., DANN, DAN, CDAN) as representatives of the mentioned domain adaptation methods, while others [77,97] are for domain generation so an empirical comparison is not possible as explained above.
  - Lines 81-85: The mentioned works are for domain generalization so an empirical comparison is not possible as explained above.

  We’ll improve the claims accordingly, and provide analysis on the learned representation.

  Regarding experimental validation, we’d also like to highlight that Tables 2-5 in appendix also show the results on the VLCS dataset, which has an even _larger scale_ than the PACS dataset. The tables also show the comparison with more recent domain adaptation baselines MDD [118] and BNM [25], and our methods consistently perform the best.

* Comparison with recommended works.

  Thanks for recommending the very recent progress on OOD generalization [Huang’20] and domain adaptation [Qian’20]. For performance comparison, [Huang’20] does not show better results on PACS or VLCS using the same model structure, while [Qian’20] does on ImageCLEF-DA. But both works seem to select hyperparameters according to the accuracy on the _test_ set, while we do this on a validation set from the _training_ domain (Lines 341-344; Appendix G). This difference is recently shown influential [37], and our choice is arguably more reasonable and realistic (Appendix G). Methodologically, both works use a shared feature extractor for all domains, which suggests inference invariance (particularly, [Huang’20] explicitly assumes covariate shift). We develop methods based on causal invariance (Sec. 3.2), and CSG-ind and CSG-DA use different feature extractors (i.e., inference models) on different domains (see the equations in Lines 223 and 235). Moreover, we also show theoretical guarantees on identifying the latent cause of prediction (i.e. the semantic factor) and generalization guarantees. We'll include this comparison in our paper.

* Clarity.

  Thanks for your feedback. We’ll make the language more concise (e.g. Sec. 3) and better highlight the proposed idea and approach.

* Limitations and societal impact.

  As mentioned in the checklist (item 1(b)), Remark (1) of Thm. 5 discussed the limitation that the identifiability requires certain conditions, and Line 372 also discussed how it affects the empirical performance. We’ll make the discussion on the limitation clearer and more explicit.


 Thanks for acknowledging the novelty and solidity of our work, as well as your valuable constructive feedback.

* Writing.

  We tried hard to make the paper friendly to general audience (noted by Reviewer SkAw) and we’ve revised the presentation round by round. Nevertheless, it is absolutely possible that we did not cover all considerations and there is no end to improve writing. We apologize for possible difficulties during your reading and really appreciate your great effort. We’ll keep making the motivations clearer and more intuitive. It would be especially great if you could point out specific problems or suggestions in your reading.

* Benefit of the $z = (s,v)$ split.

  On the non MNIST datasets, the variation factors are not as misleading as on shifted-MNIST, so the benefit from being a generative method (including CSGz and CSGz-DA) to capture causal mechanisms may be more significant than from splitting into the semantic and variation factors. Also, we’ve shown the theoretical benefits that the underlying cause for prediction (i.e., the semantic factor) is then identifiable (Thm. 5), and that the split especially benefits OOD generalization (Remark of Thm. 6) (also supported by Table 4 in appendix).

* Semantic features on ImageCLEF-DA and PACS.

  The semantic features for these real-world image datasets can be the object shape or special characteristics (like a crossing shape pattern for airplanes) that are invariant to variations like background and style. We’ll mention this insights in future versions.

* On the experiments.

  We’d like to first mention that we also experimented on the VLCS dataset (results shown in Tables 2-5 in appendix; supporting the same conclusions) which has a larger scale than the PACS dataset. Using a pooled training domain follows the setup of a recent large-scale evaluation benchmark on PACS and VLCS [37]. Our methods achieve the best results under the same setup. We’ll also show the results using a single training domain on PACS, where the advantage is not as significant. This is similar to the comparison with the results on ImageCLEF-DA, which is explained in Lines 372-373 that a pooled training domain helps identifying the latent factors.

 Thanks for acknowledging the significance, novelty, quality, and presentation of our work.
* Thanks for pointing out the typos! We’ll correct them.
* Limitations and societal impact:

  As mentioned in the checklist (item 1(b)), Remark (1) of Thm. 5 discussed the limitation that the identifiability requires certain conditions, and Line 372 also discussed how it affects the empirical performance. We’ll make the discussion on the limitation clearer and more explicit.
  We also thank you for the suggestion and we’ll include a visualization evaluation.

The paper addresses the problem of out-of-distribution prediction by proposing a causal model which captures the underlying data generation process. The causal model consists of a latent variable which generates both the input images and the associated output labels. The novelty of the paper stems from the fact that the authors split the latent variable into two parts. The first part (s) captures the semantics of the generation process and the second part (v) captures the spurious domain specific variations. Since maximizing the likelihood of the data under this model is intractable, the authors propose an approximate and efficient training and inference mechanism. The authors show theoretically that their model will learn semantic features which are responsible for the final prediction. The claims are backed by a collection of experiments on simple datasets.  
  The paper seems to be technically sound and the claims are backed up by the experiments. The generative model proposed in the paper is fairly intuitive and well motivated. The ideas are reasonably novel, though incremental. I do have a couple of objections with the way the paper currently stands: 

1. The paper is very poorly written and it is extremely difficult to follow the arguments and the motivations behind the arguments. The authors really need to revise the presentation of the paper to make it easier to understand before it is accepted. 

2. It is not clear what is the full benefit of splitting the latent variable z, which is generating the x and y. While the authors claim to show some results of the ablation study in the appendix by combining the two variables, the error bars of the two methods have a significant overlap (especially on the non MNIST datasets). 

3. There are no insights provided around what semantic features is the model learning on the ImageCLEF-DA and PACS datasets. 

4. The experimental section backing up the claims of out-of-domain generalization is somewhat weak. The images in the ImageCLEF-DA datasets are not very different visually. In the PACS datasets the images are fairly different however pooling across three domains to create the training set is bound to make the task easier. It would be interesting to see the performance of the model on one domain when trained on images only from a single domain. 

Originality
The ideas in the paper, although somewhat incremental, are fairly original. 

Quality
The research presented in this paper is of good quality however the presentation of the research is extremely poor. 

Clarity
The paper is rather poorly written and extremely hard to follow. Furthermore it is certainly not a self contained paper with a lot of important details left to the appendix.  

Significance
I believe more thorough empirical evidence is required to infer the true significance of this approach. 

 The paper does not have any concerns around societal impact and they seem to have called out most of the limitations of their model.


This paper proposes a Causal Semantic Generative model (CSG) for out-of-distribution (OOD) generalization. It assumes a semantic latent variable $s$ and a variation latent variable $v$, following the causal graph that $s,v$ are the causes of the input $x$ and $s$ is the only cause of the label $y$. The prior $p(s,v)$ is domain-specific, but the causal mechanisms $p(x|s,v)$ and $p(y|s)$ are invariant across domains. To learn the model, the authors adopt variational inference by introducing $q(s,v|x)$ and training with ELBO. The authors consider single-domain OOD prediction and domain adaptation. For single-domain, they advocate to use an independent prior p(s)p(v) to eliminate spurious correlation. For domain adaptation, a new prior is learned on the target domain.

The authors provide theoretical analysis, showing that under additive noise assumption, the ground-truth CSG is identifiable, and subsequently the OOD generalization error and domain adaptation error are bounded. Experiments are conducted on Shifted MNIST, ImageCLEF-DA and PACS datasets. The proposed model achieves superior performance compared to CNBB in single domain and DANN, DAN, CDAN in domain adaptation.  Causal learning and OOD generalization are very important problems. This paper proposes a novel model that's well motivated, theoretically justified, and empirically achieves good results. I'd like to recommend acceptance.

The paper is well-written and I enjoyed reading it. I just found two typos. Line 203 "use $q(s, v|x)p(y|x)$ as $q(s, v, y|x)$", should be $p(y|s)$ instead of $p(y|x)$. Line 321 "it is scales larger", remove "is". Limitations and potential negative societal impact are not discussed in the paper.

As the proposed CSG is a generative model, if you can visualize the effects of $s$ and $v$ on $x$ and $y$, it will help understand what the model has learned.

The authors propose a specific graphical model, Causal Semantic Generative model, which is based on the principles of casual reasoning. The graphical model attempts to explicitly distinguish between meaningful semantic factors of variation and spurious correlations. The design of the model is targeted at out-of-domain generalization and domain adaptation performance. The authors describe an approach for training such a model using variational inference, and demonstrate theoretically and experimentally that their approach gives superior OOD generalization and domain adaptation performance compared to relevant baselines.  Originality: While latent variable models aiming to separate out some form of content and style have been proposed before, the specific model proposed by the authors along with in-depth intuitive and formal justification represents a novel contribution.

Quality: The authors make theoretical claims about the properties of their model, and experimental claims about the value of their formulation. As far as I can tell their theoretical claims are well supported.

However, I feel their specific experiment claims become lost in jargon. Specifically, the authors make a number of strong claims based on intuition (e.g. lines 68, 72-73, 79-80, 83, 100-101, all of section 3.2). These are central claims to the justification of the authors’ model, and are made repeatedly and strongly, but I don’t feel that the experimental evidence is commensurate with the strength of the authors’ claims. For example, there are a number of works the authors do no cite that outperform their method on ImageCLEF-DA or PACS (e.g. Wang, Qian, and Toby Breckon. "Unsupervised domain adaptation via structured prediction based selective pseudo-labeling." Proceedings of the AAAI Conference on Artificial Intelligence. Vol. 34. No. 04. 2020, Huang, Zeyi, et al. "Self-challenging improves cross-domain generalization." Computer Vision–ECCV 2020: 16th European Conference, Glasgow, UK, August 23–28, 2020, Proceedings, Part II 16. Springer International Publishing, 2020.). Similarly, despite making claims about the shortcomings of many other works (lines 66-67, 74-75, 81-85), the authors do not compare to these models. 

If the authors' claims are solely supported by empirical evaluation, then they should be evaluated against actual state of the art methods. Moreover, if the authors are going to make such strong claims about the shortcomings of many other models they need to demonstrate that their approach is superior. Instead of pure accuracy results, these claims could alternatively be supported by analysis showing that the representations learned by their method do indeed separate out true signal from spurious signal better than competing methods. But they do not provide any such evidence as it stands.

Clarity: The organization of the paper is strong, although as a reader I felt there was a large amount of unnecessary language and appeal to intuition which hides what the authors actually did and how they evaluated their hypotheses. Section 3.1 has a lot of this in my opinion, with the e.g. very formal Principle 2 and section 3.2.

Significance: Learning models that are robust to domain shift is one of the major open challenges in machine learning right now in my opinion, and methods that attempt to improve this robustness are very much worthwhile.


Overall this paper presents an interesting model along with theoretical analysis and a small amount of experimental validation. The model itself and theoretical analysis may merit publication on its own, but I am concerned with the amount and strength of claims made by the authors in proportion to the evidence for their claims. As a reader I felt like formality and jargon were used as a tool to convince me of the correctness of claims, instead of evidence. It would not take a huge amount of experimental evidence or experimentation at a large scale to push me to accept, and in fact it may be as simple as toning down the unfounded rhetoric, but as written I do not feel the authors have supported their claims with good-faith experimentation. The authors do not discuss the limitations of their work.

This paper focuses on addressing the domain generalization problem through the lens of causality. Instead of learning environment-invariant representation/inference p(z|x) like [31,97], the paper proposes to learn the other direction p(x|z). The paper proposes a novel graph, where it assumes the latent semantic-object representation (s) and domain-specific representation (v) cause the image. The generative mechanism works (s,v) -> x, while the prior p(s, v) can be prone to environment change at test time.   Therefore, the model proposes a CSG-ELBO to maximize the likelihood of E_{p(x, y)}[log p(x,y)], and further derive a CSG-ind to disentangle v from s. The paper conducts three experiments on different datasets for both OOD generalization and domain adaptation to show the advantage of their proposed model.  Pros:
1. I think the causal graph proposed to estimate (x -> y) is novel. Instead of directly maximizing p(y|x), the paper proposes to model the causal direction (s,v->x) and uses the variational method to approximate the original objective function. 
2. The paper establishes a theory for the identification of the semantic factor (cause of prediction) and subsequent merits for OOD generalization and domain adaptation.

Cons:
1. The paper is somewhat elusive. Maybe because I'm not an expert in Causality/Domain-Adaptation area, it took me very long to understand section 3. It would be good to make this paragraph more understandable. Due to the clarity issue, I'm not convinced of the design of the proposed CSG. 
2. The used datasets are somewhat toy and not quite representative in the field. Is there any chance to apply your method on ColoredMNIST or Office to see its performance?

Questions:
1. In line 166, why do you suggest p(x|z) is nearly deterministic and invertible? Are you suggesting that once we know the object position z, we can deterministically generate an image x? While in line 173, you suggest that multiple z can lead to the same x, therefore, identifying z from a single x is difficult, which seems to contradict the original assumption.  Yes

Meta-review: This paper attempts to robustify models learned on a particular dataset to OOD examples which could plausibly be addressed if the model learns based on the semantics of training observations, rather than spurious factors. The proposed solution is—inspired by recent work in causality—to introduce a pair of latent variables modelling the semantic relationship between inputs and labels, and the natural spurious variations/noise in the input, respectively. Neural variational inference is used to jointly learn this generative model. Experiments show it works on some relatively toy data, which is arguably complex enough to prove the concept.

I personally like the idea, and would like to have seen a richer discussion here. I have read all the reviews and rebuttals carefully, it is seems like the main issues had to do with clarity, the strength of some of the claims in the paper, and the appropriateness of comparisons and datasets used. I feel in the rebuttals the authors have responded to the latter two points to my satisfaction, and if the concerned reviewers are not satisfied with those rebuttals, they have not made this known to me. The authors have committed to reviewing the strength of some the assertions about the approach in their rebuttal, and I count on them to make good on this in the preparation of their camera ready. Regarding clarity, I did find section 4 a bit hard to read due to the density of mathematical expressions. My suggestion would be to summarise the findings of section 5 in the main paper, move the rest of section 5 to the appendix, and expand section 4 to give a little bit of visual breathing room and more detail where needed. I don't think this sort of change warrants asking for further reviews, and believe this paper will be of interest to NeurIPS attendees. I recommend acceptance.

Decision: accept