Causal inference using deep neural networks

Ye Yuan, Xueying Ding, Ziv Bar‐Joseph · DOI

Abstract

Causal inference from observation data is a core problem in many scientific fields. Here we present a general supervised deep learning framework that infers causal interactions by transforming the input vectors to an image-like representation for every pair of inputs. Given a training dataset we first construct a normalized empirical probability density distribution (NEPDF) matrix. We then train a convolutional neural network (CNN) on NEPDFs for causality predictions. We tested the method on several different simulated and real world data and compared it to prior methods for causal inference. As we show, the method is general, can efficiently handle very large datasets and improves upon prior methods.

Introduction

Determining whether variable $X$ causes $Y$ ($X \to Y$) or vice versa from purely observational data is a fundamental challenge in fields ranging from genetics to economics. Traditional methods typically rely on unsupervised statistical assumptions, such as the "independent additive noise" model. However, these often fail when real-world data violates their strict functional forms. Supervised approaches offer an alternative but frequently struggle with the arbitrary ordering of input vectors or the lack of local structural information in raw data tables.

Methodology: The NEPDF Framework

The core innovation of this research is the Normalized Empirical Probability Density Function (NEPDF) representation. This approach treats causal inference as an image classification task, leveraging the power of Convolutional Neural Networks (CNNs).

The proposed pipeline: from raw pair samples to joint PDF estimation, NEPDF generation, and CNN-based classification.

The process involves three main steps:

  1. Data Transformation: For any pair of variables $(X, Y)$, the framework constructs a 2D histogram (a $K \times K$ matrix) where each cell represents the joint density of observations.
  2. Image-like Input: This matrix is normalized to values between $[0, 1]$, effectively converting the joint probability distribution into a grayscale image. This preserves the "local" geometric relationships between data points that signify causal dependencies.
  3. CNN Classifier: A VGGNet-style CNN architecture is trained on these "images." To ensure the network learns directional causality, it is trained on both the original NEPDF (labeled $X \to Y$) and its transpose (labeled $Y \to X$).

Causality as Geometry

The fundamental insight is that causal relationships leave unique geometric signatures in the joint probability distribution. By visualizing these distributions, the CNN can identify patterns that distinguish independence from directed causality.

Visualizations of joint distributions (NEPDFs) for independent variables ($x \perp y$) and directed causal relationships ($x \to y$ and $y \to x$).

Experimental Results

The framework was evaluated across a diverse range of simulated and real-world datasets:

  • Simulated Data: In synthetic V-structures, the CNN achieved an AUROC of up to 0.99, significantly outperforming the Neural Causation Coefficient (NCC) and other baseline methods.
  • Biological Discovery: On the KEGG gene pathway task, the CNN achieved an AUROC of 0.743. In contrast, unsupervised methods like ANM or IGCI performed near the level of random guessing (~0.50).
  • Financial Markets: When adapted to predict sector relationships in S&P 500 stock data, the framework achieved an AUROC of 0.945, surpassing standard metrics like Mutual Information (0.908) and Pearson Correlation (0.918).
  • Generalization: The method proved competitive on the Kaggle/ChaLearn causality challenge, matching the performance of complex ensemble methods with a simpler, single-model architecture.

Conclusion

This supervised deep learning framework provides a robust, model-agnostic approach to causal inference. By transforming observational data into density-based images, it captures complex non-linear dependencies and remains resilient to varying sample sizes and noise levels. Future work will focus on scaling this pairwise approach to multivariate causal networks and improving the interpretability of the learned causal "features."

Summary updated

BibTeX
@misc{yuan2020causal,
  author = {Ye Yuan and Xueying Ding and Ziv Bar‐Joseph},
  title = {{Causal inference using deep neural networks}},
  year = {2020},
  eprint = {2011.12508},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2011.12508},
}
Figure