Causally motivated multi-shortcut identification & removal
Abstract
We present an approach to discourage shortcut learning.
Our approach has two steps: (1) efficiently identify relevant shortcuts, and (2) leverage the identified shortcuts to build robust and efficient models.
We present theoretical and empirical arguments which show that our approach leads to robust and efficient estimators.
1. Introduction
Despite their immense success, predictors constructed from deep neural networks (DNNs) tend to have poor performance under distribution shift [7, 22, 5, 12].
One reason behind such brittleness is “shortcut learning”: when a predictor relies on spurious correlations between the inputs and the target label that are easy to learn (i.e., shortcuts) and are predictive of the label in the training data [13].
If these spurious correlations no longer exist when the test distribution shifts, the accuracy of the predictor deteriorates.
Here, we study the problem of learning a performant predictor whose risk is invariant to interventions that change the association between irrelevant factors (i.e., shortcuts) and the target label.
Our work tackles two limitations in previous literature on preventing shortcut learning.
First, previous work often assumes that the set of shortcuts are known in advance, or is easily identifiable using interpretability methods such as saliency maps.
Second, much of the existing work assumes that there are a few (often one) shortcuts.
To tackle these limitations, we propose an approach to identify shortcuts, and build models that are invariant to possibly many shortcuts.
Throughout, we will use the example of detecting the presence and severity of diabetic retionpathy (DR) using images taken using a funduscope.
We focus on a setting where we are also given multiple auxiliary labels (e.g., the type of funduscope, patient age, sex and previous medical history) at training but not test time.
A subset of these auxiliary data label factors of variation (i.e., shortcuts) that we want to be invariant to but the rest might be redundant for the purpose of shortcut removal.
Our contributions can be summarized as follows.
(1) We leverage ideas from causality to show that robustness to a large set of distribution shifts is possible through ensuring invariance to a small set of shortcuts.
(2) We develop a method for identifying these shortcuts, provide theoretical arguments about validity of our approach and show that it leads to more efficient predictors.
(3) We extend previous work on single shortcut removal to a more general formulation that allows for high dimensional shortcuts of arbitrary types (4) We empirically validate our theoretical findings using a semi-simulated benchmark and a medical task, showing our approach has favorable in- and out-of-distribution generalization properties.
Related Work.
Unlike previous work [35, 26, 33, 23, 30, 4], we do not assume that the relevant shortcuts are known a priori and we do not make any assumptions about the type or dimension of the auxiliary and target labels.
A more extensive review of related work is in the appendix.
2. Preliminaries
Setup.
We consider a supervised learning setup where the task is to construct a predictor f ( X ) that predicts a label Y (e.g., presence and severity of DR) from an input X (e.g., image).
We assume that at training time only, we have a set of auxiliary labels V d , with d = { 0 , . . .
, D } .
We use
V i to denote the i th column of V d , and V d \ i to denote all columns except the i th column.
We use X , Y , V d to denote the domains of X , Y , and V d respectively.
We make no assumptions about these domains: they can contain binary, categorical or continuous variables.
We use the notation
Z ⊥⊥ P Z ′ to denote that the two variables Z, Z ′ are independent under the distribution P .
We use capital letters to denote variables, and small letters to denote their value.
Our training data consist of tuples D
= { ( x i , y i , v di ) } ni
= drawn from a source training distribution P s .
We will consider predictors f of the form f = h ( ϕ ( x )) , where ϕ is a representation mapping and h is the final predictor.
We assume that P s follows an anti-causal structure, meaning that X is generated by the labels Y and V p , where V p is a subset of V d .
Importantly, we do not assume that such a subset is known a priori .
We use V c to denote the complement of V p , i.e., all the variables in V d that do not di- X ∗ X Y
V p
V c (a)
X ∗ X Y V p
V c (b)
X ∗
X
Y
V p
V c (c)
X ∗
X
Y
V p
V c (d) rectly affect X .
We assume that the labels Y and V p are are correlated, but not causally related; that is, an intervention on V p does not imply a change in the distribution of
Y , and vice versa.
Such correlation often arises through the influence of an unobserved third variable such as the environment from which the data is collected.
We make no assumptions about the relationship between Y and V c or V c and V p : they can be causal or correlations.
Figure 1 shows examples of the causal directed acyclic graphs (DAGs) that conform with our assumptions.
Solid edges in the figure depict causal relationships, and dashed bidirectional arrows depict correlations.
We assume that there is a sufficient statistic X ∗ such that
Y only affects X through X ∗ , and X ∗ can be fully recovered from X via the function X ∗ :
= e ( X ) , where e ( X ) is unknown.
We make an overlap assumption with respect to V p on the source distribution, P s : we assume that
P s ( V p ) P s ( Y ) ≪
P s ( V p , Y ) .
We also assume that V p has a bounded variance.
In the appendix, we give examples for the DAGs in figure 1.
Risk invariance and shortcuts.
We define the generalization risk of a function f on a distribution P as R P =
E
X,Y ∼ P [ ℓ ( f ( X ) , Y )] , where ℓ is an appropriate loss function.
We focus on obtaining an optimal risk invariant predictor, whose risk is invariant across a family of target distributions P that can be obtained from P s by interventions on the DAGs in Figure 1.
Specifically, we consider interventions on any non-causal relationship that keep the marginal distribution of Y constant 1 .
For example, each distribution in the target family of distributions described by the DAG in 1(a) can be obtained by replacing the source conditional distribution P s ( V p | Y ) with a target conditional distribution P t ( V p | Y ) .
In this case, the target set of distributions is: P = { P s ( X | X ∗ ,
V p ) P s ( X ∗ |
Y ) P s ( Y | V c ) P ( V c )
P t ( V p | Y ) }
This family allows the marginal dependence between Y and V p to change arbitrarily.
We define the set of risk invariant predictors to be all predictors that have the same risk for all P t ∈ P ,
F rinv =
{ f : R P t ( f ) =
R P ′ t ( f ) ∀ P t , P ′ t ∈ P} and an optimal risk-invariant predictor f rinv to have the property f
rinv ∈ arg min f ∈F rinv R P t ( f ) ∀ P t ∈ P .
The definition of
P also allows us to define a set of shortcuts that we care to remove: these are the set of shortcuts that would lead to varying risk across different distributions in P .
We will refer to this set as P -specific shortcuts, but drop such notation when it is implied from the text.
The sufficiency of V p for P -shortcut removal.
One of the insights of our work is that by taking into account the causal DAG that generates the data, we are able to identify a small subset of the auxiliary labels that are sufficient to induce robustness across P .
Specifically, for any DAG that satisfies the properties outlined above, we show that it is sufficient to remove shortcuts that are labeled by V p to achieve robustness.
We formally state this in the following proposition.
Proposition 1.
Let T ( P s ) be any transformation that renders Y ⊥⊥ T ( P s )
V p .
Under such transformation, the Bayes optimal predictor is a function of X ∗ only and is asymptotically risk invariant.
The proof follows from the fact that X ∗ d-separates Y, X when Y ⊥⊥ T ( P s ) V p .
Since the full statement of the proof is identical that of proposition 1 in [26], it is omitted.
The proposition states that any transformation that renders X independent of V p is sufficient to give us risk invariance for DAGs that satisfy the assumptions outlined above.
Meaning the only shortcuts that we care about are ones induced by V p .
Transformations T include conditioning on V p or reweighting the distribution.
As shown in [26], conditioning might lead to poor estimators especially when training involves small batches.
So we focus on reweighting schemes.
We use P ◦ to denote the outcome of such a reweighting transformation, i.e., P ◦ =
T ( P s ) , with Y ⊥⊥ P ◦ V p .
We refer to this P ◦ as the ideal distribution.
In the DR example, this distribution is one where we are equally likely to observe a man or a woman with DR.
3. Identifying a sufficient subset of shortcuts
Our training strategy follows two steps.
First, we develop a novel approach to identify V p .
Second, by extending previous work on single shortcut removal, we suggest an approach which leverages the results from the first step to train predictors that are robust to arbitrary types and dimensionality of auxiliary labels and target labels.
Examining the DAGs described in figure 1 reveals that the variables V p have two properties which can be exploited to differentiate them from V c .
We state those two properties in the following proposition.
Proposition 2.
For all V i ∈ V d , the following two properties hold:
[Equation]
[Equation]
p ,
[Equation]
Proposition 2 states that if any V i is independent of Y conditional on the rest of the auxiliary variables, it is not in V p , and that for any V i in V p , it must hold that X is not independent of such a variable conditional on all other auxiliary labels.
These two properties provide us with two tests that enables us to identify which auxiliary labels mark shortcuts that are necessary to account for to induce robustness versus ones which are not.
In principal, we can apply non-parametric conditional independence tests to each of the auxiliary labels to identify whether it satisfies the two properties.
However, the power of non-parametric independence tests has been shown to decline as a function of of the dimension of the data [28, 29].
This dependence on the dimension of the data makes testing if X ̸⊥⊥ P s V i
| Y, V d \ i particularly difficult in situations where X is high dimensional, which is the case for high resolution images.
Instead, we seek out to find a low dimensional representation s ( X ) , with s ∈ S such that if and only if X ̸⊥⊥ P s V i |
Y, V d \ i then it also true that s ( X ) ̸⊥⊥ P s V i | Y, V d \ i .
Intuitively, if X contains any information about a given
V i ∈
V d in some source distribution P s , s ( X ) must retain such information.
This intuition implies that taking s ( X ) to be the empirical risk minimizing function that predicts
V d from X , is a good reduction.
To prove the validity of this simple reduction, we assume that V p is s -representable.
Meaning there exists some s ∈
S that can perfectly predict V p .
We do not require that such an s is identifiable using finite samples.
We note that under the causal DAGs in figure 1, for an appropriately chosen S , there should exist performant (albeit not perfect) predictors of V p from X since V p causes X .
In the appendix, we discuss cases where this assumption can be relaxed.
Proposition 3.
For a loss function ℓ , and function space S , let s ∗ ( X )
=
argmin s ∈S E P s [ ℓ ( s ( X ) , V d )] .
Then s ∗ ( X ) ̸⊥⊥
P s V i
| Y, V d \ i ⇔ X ̸⊥⊥ P s V
i |
Y, V d \ i , for all
V i ∈ V d
Propositions 2 and 3 give us a practical and efficient procedure to identify a subset of V d that is sufficient for Pshortcut removal.
For each V i , we propose first testing if Y ⊥⊥ P s V i | V d \ i .
We remove labels for which this relationship holds (consistent with condition 1 of proposition 2).
We use d to denote the remaining set of auxiliary label indices.
For the remaining labels in d , we test if the second condition of proposition 2 holds as follows.
We split the training data into two sub samples D 1 and D 2 .
We use D 1 to train a model s : X → V d .
We then proceed by predicting the value of S =
s ( x i ) for i ∈ D 2 , and testing if
S ⊥⊥ V i | Y, V d/ i for all i ∈ d .
To conduct the conditional independence tests, we use kernel-based conditional independence (KCIT) tests [37].
Such methods ascertain conditional independencies by analyzing the cross covariance operator.
Intuitively, the crosscovariance operator can be thought of as an extension of the covariance matrix when the variables are infinite dimensional.
We formally define it in the appendix.
In KCIT, the cross covariance operator is used to conduct a hypothesis test with the null hypothesis defined as
X ⊥⊥ P s V
i |
Y, V d \ i , for example in our case.
We use the Gamma approximation method suggested in [37] to approximate the null distribution and reject the null if the pvalue corresponding to the independence test is less than a pre-specified significance level.
To account for the multiple hypothesis tests, we set the significance level to be low (0.001), following the authors of KCIT.
We use the radial basis function (RBF) to estimate the kernel matrices, and use the median heuristic described in [17] to set the kernel bandwidth.
Finally, KCIT requires setting a parameter ϵ , which is a small regularization parameter.
We set ϵ = 10 − 3 as suggested by the authors but we find that the tests are generally robust to this hyperparameter.
This procedure gives us a subset of (cid:98) V p , which is an estimate of V p that is sufficient for shortcut removal.
When characteristic kernels such as the RBF are used as the basis for the RKHS over which we measure the cross covariance operator, Zhang et al.
[37] show that KCIT is asymptotically consistent, which in turns mean that (cid:98) V p is an asymptotically consistent estimate of V p .
4. Building risk invariant predictors
Given the set (cid:98) V p , the challenge of building an invariant predictor reduces to an extension of Makar et al.
In that work, the authors assume that (1) V c = ∅ , (2) the auxiliary and target labels are binary, and (3) there is a single, binary auxiliary label.
We relax these assumptions.
Reweighting to recover P ◦ .
Makar et al.
[26] show that by reweighting data sampled from an arbitrary P s to generate a pseudo-sample from P ◦ , the empirical risk minimizer f ∗ is asymptotically risk invariant across P .
However, their proposed reweighting scheme assumes that V p and Y are binary.
Instead we leverage permutation weighting [3] which allows for arbitrarily valued V p and Y .
Per- mutation weighting proceeds by permuting Y in the training data to create D ′ =
{ ( x i , y π ( i ) , v di ) } ni =1 , where π is a random permutation of the indices.
The original D and
D ′ are stacked and a label C ∈ { 0 , 1 } is given to examples in the observed and permuted data respectively.
A classifier η : Y ×V p → { 0 , 1 } is trained to learn P s ( C = 1 | Y, V p ) .
The weights are then computed as:
[Equation]
We use ˜ u i to denote a normalized version of u i such that (cid:80) i ˜ u
i = 1 .
Under this reweighting scheme, the empirical risk minimizer f ∗ = argmin f (cid:80) i ˜ u i ℓ ( f ( x i ) , y i ) is asymptotically risk invariant.
The proof for this statement is identical to results by Makar et al.
[26] and is hence omitted.
Causally-motivated regularization for lower variance.
Reweighting leads to estimators that are inefficient in finite samples [10].
Similar to [26], we penalize models which encode a correlation between ϕ ( X ) and V p to improve the efficiency of our approach.
However, instead of using the maximum mean discrepancy, which assumes that the auxiliary label is a single binary label, to enforce independence between ϕ ( X ) and V p , we use the Hilbert Schmidt Independence Criterion ( HSIC ).
The HSIC measures the dependence between two vectors [17].
When P s = P ◦ , we can penalize HSIC( ϕ ( X ) , V p ) to enforce the desired independencies.
When P s ̸ =
P ◦ , we need to penalize a weighted version of the HSIC .
This weighting in necessary since the independence property only holds under P ◦ .
We use the weighted HSIC estimator suggested by [21].
Putting all components of our approach together the final objective to minimize the following loss function
[Equation]
where α > 0 is a hyperparameter that controls the cost of violating the HSIC penalty, (cid:92) HSIC u
γ is the estimate of the
HSIC , computed over samples weighted by u which is defined in equation (1) using a kernel with bandwidth γ .
In the appendix, we show that our estimator inherits the finite sample efficiency guarantees of the methods described in [26].
Our cross-validation procedure (described in the appendix) is a modification of the one presented in [26].
5. Experiments
We study the performance of our approach in two tasks: predicting diabetic retinopathy (presented in the appendix), and predicting bird type.
The latter is based on semisimulated task where the data generation process follows the DAG described in figure 1(a).
Specifically, we generate a high dimensional set of auxiliary labels with a small subset that affects both Y and X while the rest only affect
Y .
We follow Sagawa et al.
[30] by constructing a semisynthetic waterbirds dataset where the task is to predict Y , the type of bird (land or water).
In this setting V p isdimensional, with V p 0 representing the image background (land or water) and V p 1 camera artifacts (present or absent).
To generate the background shortcut, we combine images of water and land birds extracted from the CUB dataset [36] with water and land background extracted from the Places dataset [38].
To generate the camera artifact shortcut, we add small black patches to the image if camera artifacts are present.
In addition, we generate 10 auxiliary labels ( V c ) that affect the outcome Y but not the image X .
Additional details are included in the appendix.
We generate the source distribution P s such that P s ( V p 0 = 1 | Y = 1)
=
P s ( V p 0 =
| Y = 0)
≈ 0 .
75 , and
P s ( V p 1 = 1 | Y = 1) = P s ( V p 1 = 0 | Y = 0)
≈ 0 .
We also generate three test distributions: P s , P Flip , and P ◦ .
P s is the same as the training distribution.
P ◦ is the ideal distribution, where P ◦ ( V p 0 = 1 | Y = 1) =
P ◦ ( V p 0 =
| Y = 0)
=
P ◦
( V p 1 = 1 | Y = 1) =
P ◦ ( V p 1 =
| Y = 0)
= 0 .
Finally, P Flip is the most dissimilar to the training distribution, where the relationship between
V p 0 , V p 1 and Y is flipped in that P Flip ( V p 0 = 1 | Y = 1) =
P Flip ( V p 0 =
| Y = 0)
≈ 0 .
25 , and P Flip ( V p 1 = 1 |
Y = 1) =
P s ( V p 1 = 0 | Y = 0)
≈ 0 .
We introduce noise by randomly flipping 1% of the labels.
We present the results from 10 simulations.
Additional training details are included in the appendix.
Baselines.
We compare our approach to the following baselines: L2 is the standard neural network trained to minimize the empirical risk, with an L 2 penalty on the model weights.
W-L2-FullV minimizes the weighted empirical risk, with the weights computed as defined in equationbut using the full set of 12 auxiliary variables, V d .
W-L2S is similar to W-L2-FullV but it follows the first step in our approach to identify a sufficient set of auxiliary labels to compute the sample weights.
W-L2-HDX is similar to
W-L2-S
but instead of first reducing X to the low dimensional s ( X ) , it conducts the conditional independence tests on the raw input X .
W-HSIC-FullV and W-HSIC-HDX are similar to W-L2-FullV and W-L2-HDX respectively
but instead of an L2 penalty, they penalizes the HSIC penalty.
Note that as Sagawa et al.
[30] show, the baselines W-L2FullV, W-L2-S and W-L2-HDX are equivalent to distributionally robust optimization in some special cases.
Results.
By reducing X to its low dimensional sufficient statistic, our approach is able to correctly identify the two true auxiliary labels in all 10 simulations.
By contrast, utilizing the full X rather than s ( X ) to conduct the conditional independence tests identifies the correct auxiliary labels in only 1 simulation.
Figure 2 shows the AUROC [Figure] ( y -axis), on the three different test distributions P Flip , P ◦ , and P s ( x -axis).
Our approach outperforms all others under distribution shift and performs comparably to the best models in-distribution.
W-HSIC-HDX and W-HSIC-FullV are unable to achieve the same level of robustness as our approach highlighting the limitation of conducting the conditional independence tests on the full X , and the importance of selecting a sufficient subset of shortcuts respectively.
6. Conclusion
We presented an approach to identify a sufficient set of shortcuts and leverage the identified shortcuts to build predictors that are invariant to distribution shifts.
We analyzed the theoretical properties of our approach, showing that it is both consistent and efficient.
Empirically, we showed that our approach outperforms others using a semi-simulated dataset and a medical dataset.
Acknowledgements
We thank the anonymous reviewers for their feedback.
We also thank Alex D’Amour for his insightful comments.
This work was partially supported by the National Science
Foundation under Grant No. 2153083.
A. Related work
Existing work tackling out-of-distribution generalization tends to fall into two categories: those which assume access to some (usually unlabeled) examples from the target domain (e.g., [15, 18, 25, 8]) and those which do not (e.g., [33, 32, 26, 35, 30]).
Our work falls into the latter category.
Robustness to known shortcuts.
Similar to our work, a number of authors adapt causal ideas for the purpose of out-ofdistribution generalization when samples from the target domain are unavailable.
By contrast to our work, this line of work tends to assume that the sources of bias (or shortcuts) are known a priori .
For example, Subbaswamy et al.
[33] assume the availability of a “selection diagram” that specifies which variables have a unstable relationship with the target label, and hence could be shortcuts.
Absent prior knowledge, the authors suggest constructing this selection diagrams using conditional independence tests.
We show here that such tests are unreliable when the variables are high dimensional, and present an solution to this limitation.
The assumption of known shortcuts is implicit in other work (e.g., [23, 30, 4]) where the authors aim to find the best predictor over a set of possible distributions.
Here, defining such a set requires knowledge of the meaningful shortcuts.
In the experiments section, we show that our approach, by identifying a subset of relevant shortcuts, is able to outperform approaches equivalent to [30].
Most similar to our work is [26], where the authors study an anti-causal prediction problem similar to ours.
Unlike us, they assume that there is a single shortcut labeled by a binary auxiliary label.
Our work can be viewed as a direct extension of this work to relax assumptions about the type and dimension of the auxiliary label as well as the prior knowledge about the shortcut.
Shortcut identification.
One approach that has been suggested to identify possible shortcuts is by leveraging interpretability methods such as saliency maps [31] which visually highlight which parts of an image is most important for a prediction.
However, user-based studies have found that saliency maps often have limited utility in explaining model features [2].
In addition, in domains such as healthcare, leveraging saliency maps to identify shortcuts might require expert knowledge.
In [6], the authors suggest manipulating the observed examples by intervening on possible shortcuts and measuring the behviour of the model under such interventions.
However, such work relies on being able to faithfully manipulate the observed data, which is not possible in most cases.
B. Additional preliminary information
Examples of DAGs.
To establish the intuition underlying the DAGs in figure 1, we highlight some possible scenarios that these DAGs depict.
In all DAGs, V p can denote the quality of the funduscope, which is used to capture the image
X , or the sex of the patient which has been shown to affect the shape of the retina [9].
In figure 1(a), V c can denote high sugar intake: it can cause diabetes and its complications such as DR but it likely does not directly affect the appearance of the retina ( X ) independently of Y .
In figure 1(b), V c can denote conditions that tend to co-occur with DR such as kidney diseases [27] in figure 1(c), V c could be socio-economic characteristics correlated with access to high quality funduscopes (or healthcare in general) while in figure 1(d) V c could be sex-specific diseases such as cervical cancer.
Relaxing s-representability
In cases where V p is binary, the assumption of s -representability can be relaxed.
In that case it is sufficient to assume that S contains some s with bounded δ error such that δ is less than the proportion of the smallest subgroup defined by Y, V p .
Under such assumption, the following proposition establishes the validity of this simple reduction.
Cross covariance operator definition
The formal definition of the cross covariance operator is stated below
Definition 1.
Let Z, Z ′ be a pair of random variables defined on Z × Z ′ and let Ω Z and Ω Z ′ be two Reproducing Kernel
Hilbert Spaces (RKHSs) defined on Z and Z ′ .
Define the cross-covariance operator of Z, Z , C zz ′ :
Ω Z → Ω Z ′ such that
[Equation]
∈ [Equation]
[Table]
[Equation]
C. Proofs for sectionC.1. Proof for proposition
The proof relies on examining the d-separation properties implied by the DAGs.
We will assume that V p and V c are single dimensional for simplicity.
First property.
Note that for all DAGs, the two paths Y ← U
→ V i is unblocked by any other V d \ i , which means that for all V i ∈ V p , Y ̸⊥⊥ V i | V d \ i .
Unfortunately, the same property holds for V i ∈ V c in all DAGs except the DAG in 1(d).
To see that note that in DAG 1(a)
the path Y ← V p is unblocked by any other variables in V d , in DAG 1(b),
Y ← U 2 → V c is unblocked by any other variables in V d , in DAG 1(c)
the path Y ← U 1 → V p → U 2 ← V c is unblocked by conditioning on V p , which is a collider.
So in all these DAGs, V i ∈ V p , Y ̸⊥⊥ V i | V d \
i .
However, in
DAG 1(d) the path Y ← U → V p
→ V c is blocked by V p so Y ⊥⊥ V i | V d \ i for V
i =
V c only.
Second property.
We start by proving the direction: X ̸⊥⊥ P s V i | Y, V d/ i ⇒ V
i ∈
V p .
Suppose that there exists some i such that X ⊥⊥ P s V i | Y, V d/ i but V
i ∈
V p .
This means that all paths between V i and X are blocked by V d/ i .
However in all DAGs for all V i ∈ V p , the the path X ← V p cannot be blocked via conditioning on any other variables, which represents a contradiction.
We next prove the direction V i ∈
V p ⇒
X ̸⊥⊥ P s V i | Y, V d/ i .
Suppose there exists some i such that V i
̸∈ V p
but
X ̸⊥⊥ P s V i | Y, V d/ i .
Then there exists an unblocked path between V i and X .
This is a contradiction because:
In DAG 1(a)
the only path between V c and X is X
← V
p ← U
→ Y ← V c .
This path is blocked by conditioning on V p .
In DAG 1(b) the only path between V c and X is X ← V
p ← U
→ Y ← U 2 → V c .
This path is blocked by conditioning on V p .
In DAG 1(c) the only path between V c and X is X ← V
p
← U 2 → V c , which is blocked by V p .
In DAG 1(d) the path between V c and X is X ← V p
→ V c which is blocked by V p .
C.2. Proof for proposition
The direction X ̸⊥⊥ P s V i | Y, V d/ i ⇒ s ∗ ( X ) ̸⊥⊥ P s V
i |
Y, V d/ i is easy to prove as follows.
Suppose that X ⊥⊥
P s V i
| Y, V d/ i but s ∗ ( X ) ⊥⊥ P s V
i |
Y, V d/ i .
This statement presents an immediate contradiction since any functions of independent random variables must be independent so such an s ∗ cannot exist.
Next, the direction s ∗ ( X ) ̸⊥⊥ P s V i | Y, V d/ i ⇒
X ̸⊥⊥ P s V
i |
Y, V d/ i .
Suppose that s ∗ ( X ) ⊥⊥ P s V i | Y, V d/ i but
X ̸⊥⊥ P s V i | Y, V d/ i .
By proposition 2, X ̸⊥⊥ P s V i | Y, V d/ i implies that V i ∈
V p .
And by the assumption that V p is srepresentable, we have that there exists some s such that V i =
s ( X ) .
Such an s is an empirical risk minimizer achieving the minimum possible risk of 0.
By definition for such an s , s ( X ) ̸⊥⊥ P s V i
| Y, V d/ i and E P
s [ s ( X ) | V i
= v i , Y
=
y, V d/ i = v d/
i ] ̸ = E P s [ s ( X ) | V i =
˜
v
i , Y =
y, V d/ i = v d/
i ] for all v i ̸ =
˜ v i and all z, y .
However, for s ∗ ( X ) ⊥⊥ P s V i | Y, V d/ i to hold, it must be true that E P s [ s ( X ) | V i
= v i , Y
=
y, V d/ i = v d/ i ] =
E P s [ s ( X ) | V i
=
˜
v
i , Y =
y, V d/ i = v d/
i ] for all v i ̸ =
˜ v i and all z, y .
This means that s ∗ must have an empirical risk greater than 0, i.e., it is not an empirical risk minimizer which is a contradiction.
D. Proofs for sectionD.1. Reducing sample complexity
To explain how the HSIC penalty leads to a reduction in the sample complexity and hence the variance of the estimator, we follow the same strategy as Makar et al.
[26] in studying a simple setting where we focus on a linear function class and analyze how the suggested HSIC penalty compares to a standard L 2 -regularized function class.
Our analysis is extendable to more complex neural networks e.g., through approaches studied in [14].
For some A > 0 , τ ≥ 0 , define the two function classes:
[Equation]
In this simple function class, the HSIC constraint restricts the projection of the weights w onto ∆ :=
Cov P ◦ ( X , V p ) .
To simplify notation, we assume that the variance of V p is the vector of ones.
However, if that is not true, V p can be rescaled such that the variance is the vector of ones, which is possible because of the assumption of bounded variance.
The matrix ∆ is the average change in X caused by intervening to change each dimension in V p under P ◦ .
Define the projection matrix Π := ∆(∆ ⊤ ∆) − 1 ∆ ⊤ = ∥ ∆ ∥ − 2 2 ∆∆ ⊤ , which projects any vector onto ∆ , and w ⊥ :=
Π w as the projection of w onto ∆ , which can be thought of as the “irrelevant” dimension of X .
To directly compare our results with Makar et al.
[26], we consider the case where V p is one dimensional, i.e., ∆ is a vector.
Proposition A1.
Let f ( x ) =
σ ( ϕ ( x ))
=
σ ( w ⊤ x ) be a function contained in F L 2 , HSIC .
Then, ∥ w ⊥ ∥ ≤ τ ∥ ∆ ∥ .
and
[Equation]
Proof.
By Gretton and Gy¨orfi [16] we have that:
[Equation]
where Ω and Ψ are two RKHS spaces defined over ϕ ( X ) and V p respectively.
Taking ω , and ψ to be the identity functions, and substituting ϕ for w ⊤ x , we have that:
[Equation]
where ∥
∥ F is the Frobenius norm, and the equalities follow from the fact that w Cov ( X , V p ) is a scalar.
Note that ∥ w ⊥ ∥ =
| w ∆ | ∥ ∆ ∥ , which completes our proof for the first part of the statemenet (bound on ∥ w ⊥ ∥ ).
The rest of the proof follows identically to Makar et al.
The generalization bound can also be obtained identically to Makar et al.
[26], and is hence omitted.
We note that if V d is used instead of V p , the term C P in proposition A8 of [26] is larger, leading to a larger (less favorable) generalization error bound.
E. Cross-validation
Cross-validation.
The objective function in (2) depends on two hyperparameters: the cost of the HSIC penalty α , and the penalty’s kernel bandwidth γ .
Unlike many regularizers, the HSIC penalty depends on the distribution of the data, and is vulnerable to overfitting, such that the estimated (cid:92) HSIC on the training data underestimates the population HSIC .
For this reason, we follow a two-step cross-validation procedure.
Letting D valid denote a held out validation set, ϕ valid denote { ϕ ( x i ) } i ∈D valid , and similarly define V p valid , our cross validation procedure proceeds as follows.
In the first step, for a given α = α 0 , γ = γ 0 , we first check if the corresponding ϕ valid is independent of V p valid .
We do so using the permutation test suggested by Gretton et al.
This test entails creating 100 permutations of the validation set, with the k th permutation defined as D ′
= { x i , y i , v pπ k ( i ) } , and π k ( i ) is a permutation of the indices.
We compute a vector of HSIC values for each of the permuted datasets, and the corresponding 1 − β th quantile of that vector.
β is a pre-specified significance level that we use to accept or reject the null hypothesis that the estimated ϕ ( X ) , V p are independent.
Similar to before, we set that to be 0.001 as a heuristic to account for the multiple tests.
We reject α 0 , γ 0 as valid hyperparameters if (cid:92) HSIC as calculated on the unpermutated validation set is larger than the value corresponding to the 1 − β th quantile.
Repeating this process for all α, γ candidates gives us a subset of the that set that encode the desired invariances.
In the second step, we pick the best performing model out of this subset of candidate functions.
F. Waterbirds experiments details F.1. Data generation
We use the subset of the places images provided by Makar et al.
[26] in https://github.com/mymakar/ causally_motivated_shortcut_removal .
We generate the data as follows.
V p 0 ∼ Binomial (0 . 5) , V p 1 is generated such that it has a 70% correlation with V p 0 .
V c is drawn from Binomial(0.01).
We generate the outcome
Y =
σ ( θ
+ θ p 0 V p
+ θ p 1 V p 1 + θ ⊤ c V c + ε ) , where σ ( . ) is the sigmoid function, and ε ∼ N (0 , 0 . 5) .
For P s : θ 0 = − 0 .
84 , θ p 0 = 0 .
θ p 1 = 0 .
4 and θ c ∼ N (0 , 1) .
For P Flip : θ 0 = 0 .
45 , θ p 0 = − 0 .
θ p 1 = − 0 .
4 and θ c ∼ N (0 , 1) .
For P ◦ : θ 0 = − 0 .
15 , θ p 0 = 0 , θ p 1 = 0 and θ c ∼ N (0 , 1) .
Examples of the generated images are in figure 3.
F.2. Training details
We split the data into 70% training and validation and 30% is a held out test set.
The training and validation data is further split into 75% training and 25% validation.
We resize the images to a resolution of 128 × 128, and train for 500 epochs.
We use ResNet-50 [20], pretrained on ImageNet.
All models in this paper are implemented in TensorFlow [1].
In each of the 10 simulations, we generate different train/test splits, different draws of auxiliary labels and different bird-backgroundcamera artifact combinations.
For all HSIC based models, we cross validate over bandwidth values =
[1 . 0 , 10 . 0 , 100 . 0 , 1000 . 0] , and α values =
[1 e 3 , 1 e 5 , 1 e 7 , 1 e 9] .
We picked this set of bandwidths to cross validate over using the following heuristic: for each HSIC model, we train its corresponding unpenalized (i.e., α = 0 ) model.
We evaluate the HSIC of the unpenalized model at various bandwidth levels, and pick the set that has non-zero HSIC as the reasonable set to cross validate over.
For all L 2 models we cross validate over L 2 penalty =
We use Adam optimizer, with the default learning rate 0 .
001 and default ϵ = 1 e − 07 .
Each model takes roughly 50 minutes to train, with of 56 models per simulation and a total of 560 models, the total compute time is roughly 470 hours on a Tesla T4 GPU.
G. Additional experiments: Diabetic Retinopathy
Setup.
In this setting, we examine the validity of our approach when the outcome is non-binary.
We use a publicly available dataset made available by EyePACS, LLC [11].
Approval for the use of this data set for the purpose of research was obtained via correspondence with the data curators.
Here, we predict the presence and severity of diabetic retinopathy (DR) using fundus images, with Y ∈ { 0 , . . .
To focus the analysis on the challenges pertaining to categorical outcomes, we generate a single binary auxiliary label, V p , reflecting the presence or absence of funduscope artifacts.
Similar to before, we add small black patches to the image if funduscope artifacts are present.
We simulate the training distribution P s with
P s ( V p = 1 | Y = 0)
=
P s ( V p =
| Y > 0) = 0 .
We introduce noise by randomly permuting 1% of the labels.
Here, we compare two baselines to our approach: L2 is defined similar to before, W-L2 is a weighted version of L2, using
[Table]
We present results In We split the data into 70% training and validation and 30% is a held out test set.
The training and validation data is further split into 75% training and 25% validation.
We follow [19] in preprocessing the images such that they are macula-centered, and resize them to be 299 × 299.
We train each model for 2 epochs (which is sufficient since the DR data is larger than the waterbirds data).
We use Adam as our optimizer, and follow tensorflow guidance in setting ϵ = 0 .
We also find that a slower learning rate leads to better results for all models, so set it to 0 . 0001 .
For the HSIC based model, we consider bandwidths =
[0 . 1 , 1 . 0] , which were picked using the same heuristic described in the waterbirds experiment, and α =
[1 e 3 , 1 e 5 , 1 e 7] .
Each model takes roughly 30 minutes.
With 10 models per simulation, we have 100 models which take a total of 5 hours to train on a Tesla T4 GPU.
Results.
Similar to the waterbirds setting, we measure the performance of the three models on three distributions P s , P Flip , and P ◦ , where P Flip has P Flip ( V p = 1 | Y = 0) =
P Flip ( V p =
| Y > 0) = 0 .
1 and P ◦ is the ideal distribution.
Table 1 shows the AUROCs averaged over 10 simulations and their corresponding standard errors.
The results show that our approach vastly outperforms others in the most severe distribution shifts, and performs relatively on par with the other models in-distribution.
The slight drop in accuracy in-distribution is attributable to the fact that the baselines exploit the shortcut whereas our approach does not.
The results confirm that our approach extends to setting where the target label is non-binary.