arXiv:2608.25930stat.MEAug 2026

Manuscript Offprint

arXiv:2608.25930

Controlling for Omitted Variable Bias in Deep Neural Networks

Manuel Pfeuffer, Roshan Prakash Rane, Kerstin Ritter, Sonja Greven

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original. This text is shared under the same licence.

Abstract

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.

1 Introduction

Deep neural networks (DNNs) are known to learn spurious associations due to covariates that are confounding or sensitive variables encoded in the input data, a phenomenon referred to as shortcut learning [1]. Examples include medical image classifiers that use acquisition artefacts, such as rulers or markers, to predict disease labels [2], or models that leverage demographic attributes such as sex or age when predicting neurological or psychiatric outcomes [3], [4]. While such associations may improve predictive performance on the training distribution, they typically fail to generalize out-of-sample and hinder meaningful interpretation and clinical applicability.

We argue that shortcut learning should be identified with omitted variable bias (OVB) in classical regression analysis and addressed accordingly. This bias arises when covariates (Z) are correlated with both the DNN input (X) and the outcome (Y), causing variation in the outcome (Y) associated

*Corresponding author. E-mail: manuel.pfeuffer@hu-berlin.de.

Preprint.

with Z to be incorrectly attributed to the input variable X through this joint correlation. Throughout, we assume that these confounding covariates are observed and available for modelling. A standard strategy for addressing OVB in classical regression models is the explicit inclusion of control variables (see e.g. [5], [6]), accounting for the association between Z and Y in the model. Such variables could be demographic confounders, but also acquisition-related variables such as scanner type, imaging site, or visual artefacts. However, despite their central role in classical statistics and econometrics, control variable techniques have, to our knowledge, seen little application in deep learning.

We propose incorporating covariates explicitly and additively into the final layer of DNNs, extending classical control-variable methods to deep learning models. Our approach builds on work that connects the statistical theory of Generalized Additive Models (GAMs) [7], an interpretable and flexible regression framework, with modern deep learning through Neural Additive Models (NAMs) [8] and Semi-structured Networks (SSNs) [9]. Because the final layer of a DNN is linear in its coefficients, it can be interpreted as an additive model operating on a learned feature representation, which may be called a neural basis [10]. Informed by this connection, we formalize shortcut learning as OVB arising within this additive structure. This formulation provides a model-based framework for mitigating shortcut learning and further grounds DNNs in established statistical methodology.

In the biomedical applications that motivate our work, predictive accuracy is not the sole goal: DNNs are increasingly used to test medical hypotheses, where the question is what the input itself contributes to the outcome, and answering such questions requires modelling the data-generating process rather than maximising prediction alone [11]. Consider predicting alcohol misuse from structural MRI [12]. The covariate sex is correlated with alcohol misuse through social and behavioural factors, and when sex is inferable from the scan, a DNN attributes a higher misuse probability to any male-looking brain, even when no disorder-related changes are present in the image. Estimating an additive model instead separates the variation into an image component and a covariate component, so that the analysis can focus on the biomedically relevant image effect. Much of this paper is devoted to ensuring that these components are accurately identified.

In general, a covariate Z may have a direct effect on the outcome Y as well as a mediated effect on Y through the input X. If both pathways are present, we call Z a confounder for X [13]. We prove that OVB (and hence shortcut learning) arises whenever Z has a direct effect on Y and is correlated with X: it is this direct effect that gets attributed to X, while the mediated effect does not bias the estimate. When Z is a confounder, however, the mediated effect is additionally absorbed into the X-effect — which may or may not be desirable depending on the application. We further show that confound control and fairness methods that penalize correlation of model predictions and confounders (e.g. [14], [15], [16], [17], [18], [19], [20]) implicitly control for the mediated effects of Z, but fail to address the issue of OVB.

Our method is based on refitting the last layer of a DNN to include control variables, while in- or excluding an orthogonalisation (secondary regression) of the last layer features with respect to the covariates. Including this orthogonalisation allows for the unbiased estimation of the effect of X while excluding the mediated effect of Z. We restrict our approach to act on the last layer of a DNN due to problems with concurvity [21], that prevent simultaneous training of covariate and network input effects when sample sizes are low with respect to the number of parameters in the DNN. Concurvity is the non-linear analogue of multicollinearity and hinders identifiability of estimates when models become too flexible [22]. This issue is pronounced in DNNs which can interpolate covariate effects in finite samples, as documented for additive models with neural networks such as NAMs [23], [24] and SSNs [9], [25].

For our refitting procedure we use a back-fitting algorithm for additive models [7], while incorporating a ridge penalty to stabilise estimation in settings with a small number of observations. As fitting the DNN backbone on the same sample used for refitting the last layer leads to biased estimates, we follow an approach proposed in [26] and cross-fit DNN backbone and last layer parameters over separate folds. We provide a linear version of our approach suitable to regression tasks with real-valued output, as well as a generalized version based on the iteratively reweighted least squares (IRLS) algorithm [27] (suitable, e.g., for binary classification). The ridge penalty is chosen using a validation data set, following the literature on elastic-net regularization paths [28], [29].

References (73)