[Paper Review] Causality-aware counterfactual confounding adjustment for feature representations learned by deep models
This paper proposes a causality-aware counterfactual confounding adjustment method for deep neural network (DNN) feature representations by leveraging the linear modeling step inherent in DNNs with softmax output. By using the penultimate layer features—which are linearly associated with labels—it applies linear confounding adjustment via counterfactuals, significantly improving model stability under dataset shift while maintaining performance in the absence of shift.
Causal modeling has been recognized as a potential solution to many challenging problems in machine learning (ML). Here, we describe how a recently proposed counterfactual approach developed to deconfound linear structural causal models can still be used to deconfound the feature representations learned by deep neural network (DNN) models. The key insight is that by training an accurate DNN using softmax activation at the classification layer, and then adopting the representation learned by the last layer prior to the output layer as our features, we have that, by construction, the learned features will fit well a (multi-class) logistic regression model, and will be linearly associated with the labels. As a consequence, deconfounding approaches based on simple linear models can be used to deconfound the feature representations learned by DNNs. We validate the proposed methodology using colored versions of the MNIST dataset. Our results illustrate how the approach can effectively combat confounding and improve model stability in the context of dataset shifts generated by selection biases.
Motivation & Objective
- To address the problem of spurious correlations in DNNs caused by confounding factors and selection biases in training data.
- To adapt a counterfactual confounding adjustment method, originally designed for linear structural causal models, to deep feature representations.
- To improve model generalization and stability under dataset shift by deconfounding learned representations.
- To validate that counterfactual adjustment of DNN features outperforms data-balancing approaches like SMOTE in maintaining predictive stability.
- To provide a practical, non-invasive method for deconfounding DNN features without retraining the model.
Proposed method
- Train a deep neural network with softmax activation at the output layer to ensure the penultimate layer features are linearly associated with class labels.
- Extract the feature representation from the last hidden layer prior to the softmax output as the input for confounding adjustment.
- Apply a counterfactual confounding adjustment method based on linear modeling of the features, using observed confounders (e.g., image color in MNIST) to deconfound predictions.
- Use linear regression to model the relationship between features, confounders, and labels, then generate counterfactual features that remove the confounder's influence.
- Evaluate adjustment effectiveness via conditional independence tests: check if adjusted features are independent of confounders given the true label.
- Perform empirical sanity checks using partial correlation analysis to verify that adjusted features are conditionally independent of confounders given the label.
Experimental results
Research questions
- RQ1Can a counterfactual confounding adjustment method designed for linear models be effectively applied to feature representations learned by deep neural networks?
- RQ2Does counterfactual adjustment of DNN features improve model stability under dataset shift caused by selection biases?
- RQ3How does the proposed method compare to data-balancing approaches like SMOTE in terms of predictive stability?
- RQ4Is the effectiveness of the counterfactual adjustment empirically verifiable through conditional independence testing?
- RQ5Does the method preserve performance when no confounding exists, i.e., when the confounder is predictive?
Key findings
- The causality-aware counterfactual adjustment effectively removed confounding effects, as shown by partial correlations between adjusted features and confounders being tightly centered around zero when conditioned on the true label.
- Classifiers trained on counterfactually adjusted features maintained strong generalization performance across all levels of dataset shift, while unadjusted models degraded significantly.
- In the absence of dataset shift, where color was predictive, the counterfactual adjustment reduced performance—confirming it successfully suppressed spurious correlations.
- The proposed method outperformed a SMOTE-based balancing approach in terms of prediction stability under shift, demonstrating the advantage of deconfounding both training and test features.
- The method is computationally lightweight, requiring only linear regression fits on pre-trained DNN features, and does not require retraining the DNN.
- Empirical sanity checks using conditional independence patterns confirmed that the adjustment achieved the desired statistical properties, validating its effectiveness.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.