Controlling for Omitted Variable Bias in Deep Neural Networks
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 known covariates with model predictions, we show that this usually fails to obtain unbiased estimates and may remove important predictive information. 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 confounder-controlled direct effects can be decomposed into mediated and residual components and how to obtain confounder-adjusted predictions. We verify our approach using simulated images, and demonstrate consistent estimation of effects. In contrast, existing methods cannot handle continuous and multivariate confounders, require more data, and/or are unable to consistently estimate true effects. We further 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/ovb-dnn.