Controlling for Omitted Variable Bias in Deep Neural Networks
Authors: Manuel Pfeuffer, Roshan Prakash Rane, Kerstin Ritter, Sonja Greven
Organizations: Humboldt-Universität zu Berlin, Berlin, Germany · Hertie Institute for AI in Brain Health, Universität Tübingen, Tübingen, Germany · Universität Tübingen, Tübingen, Germany
Control variables are widely used in statistical modelling to account for omitted variable bias of known confounders. However, they have largely been underexplored in deep learning. This is surprising, given that deep learning models encode image-inferable covariates, such as demographic variables, into their predictions when these covariates are correlated with the outcome---a form of omitted variable bias referred to as 'shortcut learning'. While many existing confound-control or fairness methods try to restrict the correlation of such covariates with model predictions, we show that this fails to correct for omitted variable bias. We therefore propose a control variable approach for deep learning models, based on generalised additive modelling of the effects of model inputs and covariates. As flexible additive models can suffer from concurvity, we introduce an estimation procedure that refits the final layer of a pre-trained network to include covariate effects, using cross-fitting with ridge penalisation. We show how these effects can be orthogonalised with respect to covariates to exclude their mediated effects and that model predictions can be marginalised over the covariate distribution to control for their effect. This yields unbiased, interpretable predictions and offers flexibility to model the desired effects depending on the scientific or fairness objective. We verify our approach using simulated images, and demonstrate consistent estimation of true effects. Existing methods either require more data or fail to recover the true effects. We apply our method to real neuroimaging data with experimentally induced confounding, where it recovers prediction performance to near the level of a model trained on unconfounded data. Code is available at https://github.com/mpff/cocodeel.
Figures & tables
Figure 1: (a) Simulation setting and (b) convergence results under increasing strength βZ of fZ with scalar valued outcomes Y∈R , when including (top) or omitting (bottom) control variables in the estimation of fX (left) and fXre (right). MSPE is calculated on a holdout test dataset and over 50 model fits, each trained on independently drawn training and validation data sets of size Ntrain . See Section 5 for details on the simulation study.
Figure 2: Convergence of f^X and f^Xre across fitting strategies. See Fig. 1 a and Section 5 for details on the simulation study. The used backbone has ∼21,000 parameters. Section C.4 contains an additional comparison to NAM over increasing backbone size. Train and hyperparameter search are documented in Section D.1 .
Figure 3: Sample X for p=16 . Strips have intensities v1,k (left), v2,k (center), and v3 (right).
Figure 4: Convergence behaviour of f^X (top) and f^Xre (bottom) in different adversarial settings for y∈R and βZ=1 , with varying q (left), p (middle) and c1 (right).
Figure 5: (left) Visualization of the resampling procedure. (right) Comparison of AUC over a heldout test set that was resampled so that y is balanced with respect to age . x -axis indicates whether a model was trained on data that is balanced or age -confounded.
Appendix figures & tables9 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 6: Convergence behaviour with binary outcome Y∈{0,1} and Sigmoid response function g−1(⋅) under increasing strength βZ of fZ . Also in this generalized case, controlling for covariates using our method leads to consistent estimation (left), here measured by MSPE(f^X) , while fitting a DNN without covariates (right) leads to inconsistent estimates with MSPE increasing with βZ . See Section 5 for details on the simulation study.
Figure 7: Convergence of f^X as the backbone size grows, comparing DNN with Controls (top, 2 -fold cross-fit) and a NAM with linear covariate effect (bottom, trained end-to-end with SGD). Columns show MSPE , Bias2 , and Var of f^X . Curves are coloured by the trainable parameter count of the DNN backbone, ranging from ∼ 9k to ∼ 531k.
Figure 8: Bias–variance decomposition of f^X in Fig. 1 . It is clear that bias (left) dominates the MSPE of models fit without covariates, while variance converges for all models as the sample size grows (right).
Figure 9: MSPEs of y^ and f^Z in Fig. 1 . Only DNNs with controls predict y well (MSPE near the noise floor) and only the DNN with covariates can disentangle fX and fZ effects. We can see that also fZ (here including the intercept β0 !) is consistently estimated when using a model with control variables, while models without controls have no estimate for fZ (greyed out line indicates β0 only).
Figure 10: Nonlinear fZ for different values of βZ .
Figure 11: Convergence behaviour under non-linear fZ for the DNN w. Controls estimator with k=2 cross-fitting and a cubic B-spline basis on Z . Top : MSPE and bias-variance decomposition of f^X . Bottom : MSPE and bias-variance decomposition of f^Z . Curves are nearly independent of βZ .
Figure 12: Convergence behaviour for non-linear fZ under model misspecification. Here we control for only linear effects of Z , even though the true fZ is non-linear. Top : MSPE and bias-variance decomposition of f^X . Bottom : MSPE and bias-variance decomposition of f^Z .
Figure 13: Squared bias (a) and variance (b) of f^X (left blocks) and of the orthogonalised f^Xre (right blocks) when estimators observe only the corrupted covariate Z~=(1−a)Z+aε , for noise levels a∈{0,0.1,…,1} (colour), over the sample size Ntrain=n/2 available to the backbone and refit stages of each fold under 2 -fold cross-fitting. Top rows: DNN with Controls; bottom rows: DNN fit without covariates, with post-hoc orthogonalisation [ 20 ] for f^Xre . The bias interpolates between the noise-free decay at a=0 and the flat level of the uncontrolled DNN at a=1 , while the variance of the DNN with Controls is essentially unaffected by a .
Figure 14: Additional diagnostic results for the UK Biobank application. Top row – test-set AUC across model and control variants: (left) base DNN, full versus half training fold; (middle) age control, sample-split versus cross-fit (marginalised); (right) age and sex control, sample-split versus cross-fit (marginalised). Bottom row – cross-fit coefficient recovery: (left) estimated −β^age vs. ground truth (dashed); (right) estimated β^sex vs. ground truth (dashed). All boxplots span five cross-validation folds.
The deep neural network is a widely used framework in machine learning that has been widely applied in various fields. However, deep neural networks often involve a large number of parameters and inputs, many of which may be irrelevant to the goal or true output. These parameters and input variables not only increase computational complexity, but also contribute to additional computational cost. One solution to this problem is knockoff methods, which have proven successful in controlling false discovery rates in high-dimensional regression. Building on the knockoff methods and using the regularised neural network, this paper proposes three variable screening methods under the condition of controlling false discovery rates: one layer filter, multiple layers filter, and variable weight aggregation filter. In comparison with existing algorithms, we find that our algorithms show satisfactory performance.
Wenyu Liao, Yiqing Shi, Fang Xie
Guangdong Provincial Key Laboratory of IRADS, Beijing Normal-Hong Kong Baptist University, Zhuhai 519087, China
Deep learning systems are known to exhibit implicit regularization (alt. implicit bias), favoring simple solutions instead of merely minimizing the loss function. In some cases, we can analytically derive the implicit regularization -- connecting it to an equivalent penalty that augments the learning objective. However, modern deep learning systems are complex, carrying modifications to the training procedure and architecture (e.g. early stopping, minibatching, dropout) whose effects are not always directly interpretable. Although estimating the resulting implicit regularization could aid theorists in algorithm design and practitioners in interpreting their hyperparameter choices, this problem has received little direct attention. It is also tractable: regularization makes weight updates deviate from loss gradients, promising a signal for identifying implicit bias. Here we provide gradient matching methods that can be used to empirically estimate the implicit regularization. Our method works on networks with known regularization, recovering popular explicit penalties like ℓ1 and ℓ2. It also replicates known implicit effects, like the quadratic weight penalty induced by early stopping in gradient descent, demonstrating that it can be used to test theories of implicit regularization. Crucially, because our method is empirical, it can handle implicit regularization in arbitrary networks. We demonstrate this use by characterizing the effects of dropout in deep networks, showing implicit ℓ2 effects in this popular method. Our work shows that practitioners can use gradient matching to understand regularization in networks with implicit biases that are too complicated to derive analytically.
Deep neural networks (DNNs) achieve remarkable predictive performance but remain difficult to interpret, largely due to overparameterization that obscures the minimal structure required for interpretation. Here we introduce DeepIn, a self-interpretable neural network framework that adaptively identifies and learns the minimal representation necessary for preserving the full expressive capacity of standard DNNs. We show that DeepIn can correctly identify the minimal representation dimension, select relevant variables, and recover the minimal sufficient network architecture for prediction. The resulting estimator achieves optimal non-asymptotic error rates that adapt to the learned minimal dimension, demonstrating that recovering minimal sufficient structure fundamentally improves generalization error. Building on these guarantees, we further develop hypothesis testing procedures for both selected variables and learned representations, bridging deep representation learning with formal statistical inference. Across biomedical and vision benchmarks, DeepIn improves both predictive accuracy and interpretability, reducing error by up to 30% on real-world datasets while automatically uncovering human-interpretable discriminative patterns. Our results suggest that interpretability and statistical rigor can be embedded directly into deep architectures without sacrificing performance.
Zhiyao Tan, Liu Li, Huazhen Lin
Center of Statistical Research, School of Statistics, Southwestern University of Finance and Economics, Chengdu, China · School of Mathematics and Statistics, Wuhan University, Wuhan, China · New Cornerstone Science Laboratory, Southwestern University of Finance and Economics, Chengdu, China