P OST HOC E XPLANATIONS MAY BE I NEFFECTIVE FOR D ETECTING U NKNOWN S PURIOUS C ORRELATION
Anonymous authors
Paper under double-blind review
A BSTRACT
Ascertaining that a deep network does not rely on an unknown spurious signal as basis for its output, prior to deployment, is crucial in high stakes settings like healthcare.
While many post hoc explanation methods have been shown to be useful for some end tasks, theoretical and empirical evidence has also accumulated that show that these methods may not be faithful or useful.
This leaves little guidance for a practitioner or a researcher using these methods in their decision process.
To address this gap, we investigate whether three classes of post hoc explanations–feature attribution, concept activation, and training point ranking–can alert a practitioner to a model’s reliance on unknown spurious signals.
We test them in two medical domains with plausible spurious signals.
In a broad experimental sweep across datasets, models, and spurious signals, we ﬁnd that the post hoc explanations tested can be used to identify a model’s reliance on a visible spurious signal provided the spurious signal is known ahead of time by the practitioner using the explanation method.
Otherwise, a search over possible spurious signals and available data is required.
This ﬁnding casts doubt on the utility of these approaches, in the hands of a practitioner, for detecting a model’s reliance on spurious signals.
It is hard to ﬁnd a needle in a haystack, it is much harder if you haven’t seen a needle before (Pearl).
—Judea Pearl
I NTRODUCTION
A challenge that precludes the deployment of modern deep neural networks (DNN) in high stakes domains is their tendency to latch onto ‘spurious signals’—shortcuts—in the training data (Geirhos et al., 2020).
For example, Badgeley et al.
(2019) showed that an Inception-V3 model trained to detect hip fracture relied on the scanner type for its classiﬁcation decision.
Deep learning models easily base output predictions on object backgrounds (Xiao et al., 2020), image texture (Geirhos et al., 2018), and skin tone (Stock and Cisse, 2018).
Post hoc model explanation methods—approaches that give insight into the associations that a model has learned—are increasingly used to determine whether a model relies on spurious signals.
Ribeiro et al.
(2016) used LIME to show an Inception-V3 model’s reliance on the snow background for identifying Wolves.
Such demonstration and others (Lapuschkin et al., 2019; Rieger et al., 2020) point to post hoc explanation methods as effective tools for the spurious signal detection task.
However, these results conﬂict with evidence that indicates that practitioners (and researchers) struggle to use explanations to identify spurious signals (Chen et al., 2021;
Chu et al., 2020;
Alqaraawi et al., 2020; Adebayo et al., 2020; Poursabzi-Sangdeh et al., 2018).
We seek to resolve this conﬂict by answering the simple but important question:
Can post hoc explanations help detect a model’s reliance on unknown spurious training signal?
Motivating Example.
Consider a machine learning (ML) engineer whose job is to train DNN models to detect knee arthritis from radiographs.
She—the engineer—is handed a trained ResNet-50 model, to be deployed in a hospital, that relies on a hospital tag in the radiographs to detect knee arthritis.
She has no prior knowledge of the model’s reliance on the spurious tags.
In this work, our key concern is whether the ML engineer can use post hoc explanations to identify that the model is defective.
1. O UR C ONTRIBUTIONS
We address the motivating question above in a two-pronged manner.
First, we develop an actionable methodology based on the ability to carefully craft datasets to induce spurious correlation in trained models.
Second, we backup this experimental design with a human subject study.
Taken together, the takeaway of the work is that: post hoc explanations can be used to identify a model’s reliance on a visible spurious signal, provided the signal is known ahead of time by the practitioner.
While this conclusion may seem unsurprising, it has important implications for how post hoc explanation methods should be used effectively.
Experimental Design & Performance Measures.
We provide an end-to-end experimental design for assessing the effectiveness of an explanation method for detecting a model’s reliance on spurious training signals.
We deﬁne a spurious score that helps quantify the strength of a model’s dependence on a training signal.
Using carefully crafted semi-synthetic datasets, we are able to train models where the ground-truth expected explanation is known.
Additionally, we develop 3 performance measures: i) Known Spurious Signal Detection Measure (K-SSD), ii) Cause-for-Concern Measure (CCM), and iii) a False Alarm Measure (FAM).
These measures help characterize different notions of reliability for the spurious signal detection task.
We instantiate the proposed design on 3 classes of post hoc explanation types—feature attribution, concept activation, and training point ranking—where we comprehensively assess the performance of these approaches across 3 datasets (2 medical tasks, and dog species classiﬁcation task), and different model architectures.
When the spurious signal is known, we ﬁnd that the feature attribution methods tested, and the concept activation importance approach are able to detect visible spurious signals like a text tag and distinctive stripped patterns.
However, we ﬁnd these approaches less effective for non-pronounced signals like background blur.
The false alarm measure further indicates that feature attribution methods are susceptible to erroneously indicating dependence on spurious signals.
The cause-for-concern measure quantiﬁes the similarity between explanations of ‘normal’ inputs derived from spurious and normal models when the spurious signal is unknown.
Across the settings considered, we ﬁnd that the methods tested are unable to conclusively detect model reliance on unknown spurious signals.
Blinded Study.
The ﬁndings from our empirical assessment question the reliability of the methods tested; however, it might not correlate with utility in the hands of practitioners.
To address this issue, we conduct a user study where practitioners are randomly assigned to one of two groups: the ﬁrst group is told explicitly of potential spurious signals, and the second is not.
We consider three different kinds of explanation methods along with a control where only model predictions are shown.
We ﬁnd that when participants are not provided with prior knowledge of the spurious signal, none of the methods tested are effective, in the hands of the participants, for detecting model reliance on spurious signals.
More surprisingly, even when the participants had prior knowledge of the spurious signal, we ﬁnd evidence that only the concept activation approach, for visible spurious signals, is effective.
These ﬁndings cast doubt on the reliability of current post hoc tools for spurious signal detection.
Guidance.
On the basis our analysis, we can provide the following guidance for using the approaches tested, in this work, for detecting model reliance on spurious signals when the signal of interest is visible :
• Feature Attributions : to conﬁrm that a model is relying on a ‘visible’ spurious signal, the practitioner needs to obtain attributions for inputs that contain the hypothesized spurious signal, and the attribution should be computed for the output class to which the spurious signal is aligned.
• Concept Activation : the spurious concept should be known ahead of time, and tested against the output class to which the concept is aligned.
• Training Point
Ranking : an input that contains the hypothesized spurious signal of interest should be used at test-time in computing training point ranking.
1. R ELATED W ORK
This paper belongs to a line of work on assessing the effectiveness of post hoc explanations methods (Alqaraawi et al., 2020; Adebayo et al., 2020;
Chu et al., 2020; Hooker et al., 2019; Meng et al., 2018; Poursabzi-Sangdeh et al., 2018; Tomsett et al., 2020).
Here we focus on directly relevant literature, and defer an extensive discussion of the literature to Section A in the Appendix.
This work departs from previous work in two ways: 1) we focus exclusively on whether these explanations can be used by a practitioner (or researcher) to detect spurious signals that are unknown to her at test-time, and 2) we move beyond sole focus on the feature attribution setting to test concept activation and training point ranking methods.
Han et al.
(2020) and Adebayo et al.
ﬁnd that certain kinds of feature attributions and training point ranking via inﬂuence functions are able to detect a model’s reliance on spurious signals.
However, in their setting, the spurious signal is known ahead of time.
More recently, Zhou et al.
(2021) conduct an extensive assessment of several feature attribution methods also under the spurious correlation setting, for visible and non-visible artifacts, and ﬁnd that these class of methods are not effective for non-visible artifacts.
Further, they also propose an experimental methodology for controlling model dependence on training set features, which allows them to quantify attribution effectiveness carefully and precisely.
Overall, our ﬁndings align with theirs; however, we focus, speciﬁcally, on the setting where the spurious signal is not known ahead of time.
Further, we consider other kinds of post hoc explanation approaches in this work.
Kim et al.
(2021) conduct an assessment of several feature attribution methods using a synthetic evaluation framework where the ground-truth explanation is known for simple and complex reasoning tasks.
They ﬁnd that feature attribution methods often attribute irrelevant features even in simple settings, and these methods show high variability across data modalities and tasks.
Plumb et al.
(2021) introduce a method that searches over a dataset to identify important associations that a model might have learned, detect which of these associations are spurious, and propose a data augmentation procedure to overcome the reliance.
Nguyen et al.
(2021) conduct a large-scale user study on lay and expert users to assess the effectiveness of feature attribution methods on image tasks.
They ﬁnd that feature attributions are not more effective than showing end users nearest neighbor training points.
E XPERIMENTAL M ETHODOLOGY
In this section, we setup our experimental methodology.
We discuss quantitative analysis of post hoc explanations derived from models trained to rely on pre-deﬁned spurious signals, and a blinded user study that measures the ability of users to use the post hoc explanation methods tested to detect model reliance on spurious signals.
We discuss the types of spurious signals considered, deﬁne a spurious score that allows us to ascertain that a model indeed relies on a signal as basis of its classiﬁcation decision, and layout performance measures that capture the reliability of the explanation methods.
We conclude with an overview of the methods tested, datasets, and models.
2. E XPERIMENTAL D ESIGN
Spurious Signals & Score.
We consider a spurious signal to be input features that encode for the output but have ‘no meaningful connection’ to the ‘data generating process’ (DGP) of the task.
A hospital tag present in a hand radiograph is not clinically relevant to the age of the patient.
If the tag encodes for the output then it is a spurious signal.
Domain expertise is ultimately required for adjudicating that a signal is spurious.
We consider 3 (2 visible and 1 non-visible) kinds of spurious signals (See Figure 1): i) a localized tag; ii) a distinctive stripped pattern; and iii) Gaussian blur applied to the image background.
The signals are all spatially localized, so we can easily obtain ground-truth expected explanations.
To induce reliance on spurious signals, we train models on "contaminated” versions of the training set.
Given input-label pairs, { ( x i , y i ) } ni , where x i ∈ X
and
y i ∈ Y , we can learn a classiﬁer, f θ , via empirical risk minimization (ERM) that corresponds to minimizing a loss function, (cid:96) : arg min θ (cid:80) ni =1 (cid:96) ( x i , y i ; θ ) .
To contaminate the training set, we apply a spurious contamination function (SCF) to the training set; SCF : X × Y × C → S , where C is the spurious signal set and S is the transformed set.
An example of an SCF is a function that pastes an hospital tag onto the bone age radiographs of all pre-puberty individuals in the dataset.
To derive models reliant on a spurious signal, c i ∈ C , we simply learn a new classiﬁer via ERM on the modiﬁed dataset as follows: arg min θ (cid:80) ni =1 (cid:96) (cid:0) SCF( x i , y i , c i ) (cid:1) to obtain θ spu .
Contemporary evidence suggests that this approach produces models that easily latch onto the spurious signal (Nagarajan et al., 2020).
We focus on the classiﬁcation setting, and restrict spurious signals to encode, only, for a single class—the spurious aligned class .
We measure a model’s reliance on the spurious signal via a score.
Deﬁnition 2.1.
(Spurious Score).
Given a spurious signal, c i , the index of its spurious aligned class, j ∈ [ k ] , a model, θ spu : R d → R k , where arg max( θ spu ) indicates the classiﬁer’s predicted class, we deﬁne the spurious score as:
[Equation]
y i , c i ))) = j ] . Given an input that does not contain the spurious signal, and for which the model’s prediction is not the spurious aligned class, the model’s spurious score is the probability that the model assigns the input to the spurious aligned class if the spurious signal is added to the input.
Model Conditions.
We focus our analysis on two model conditions: i) a ‘normal model’, f norm , for which we can rule out dependence on any of the spurious signals tested across all classes on the basis of the spurious score, and ii) a ‘spurious model’, f spu , for which one of the spurious signals encodes for a particular output class.
We empirically estimate the spurious score and term models that have a score above 0 .
for any of the pre-deﬁned signals ‘spurious models’.
We term a model ‘normal’ if the spurious score is below 0 .
1 across all classes and the 3 pre-deﬁned spurious signals.
Spurious Signal Detection Reliability Measures.
Equipped with spurious ( f spu ) and normal ( f norm ) models, we are now able to quantitatively assess the motivating question of this work.
We do this by comparing explanations derived from spurious models, f spu , to those derived from normal models ( f norm ).
We can partition the kinds of inputs used for deriving explanations into two: 1) spurious inputs ( x spu )—inputs that include the spurious signal and 2) normal inputs ( x norm )—inputs do not not contain the spurious signal.
Comparing the explanations produced by these two classes of inputs for normal and spurious models, we derive reliability performance measures.
• Known Spurious Signal Detection Measure (K-SSD) - measures the similarity of explanations derived from spurious models on spurious inputs to the ground truth explanation.
The ground truth explanation is one that only assigns relevance to the spurious signal as explanation of the output of a spurious model on a spurious input.
K-SSD measures method reliability when the spurious signal is known.
Given a similarity metric, S d , then K-SSD corresponds to: S d (cid:0) E f spu ( x spu ) , x gt ) (cid:1) ; where E f spu ( x spu ) are explanations derived from the spurious model for spurious inputs, and x gt is the ground truth explanation.
The similarity function, S d , depends on the type of explanation considered—we will make our choice of this function concrete shortly.
• Cause-for-Concern Measure (CCM) - measures the similarity of explanations derived from spurious models for normal inputs to explanations derived from normal models for normal inputs : S d (cid:0) E f spu ( x norm ) , E f norm ( x norm ) (cid:1) .
This measure simulates the setting where a practitioner does not know the spurious signal, and can only inspect explanations for inputs without the signal.
If this measure is high, then it is unlikely that such a method alert a practitioner that a spurious model exhibits defects.
• False Alarm Measure (FAM) - measures the similarity of explanations derived from normal models for spurious inputs to explanations derived from spurious models for spurious inputs : S d (cid:0) E f norm ( x spur ) , E f spu ( x spu ) (cid:1) .
We also introduce a variant of this measure, FAM-GT, which measures the similarity of a explanations derived from normal models for spurious inputs to the ground truth explanation of a spurious model for that spurious input.
If this measure is high, then that approach is more likely to signal to a practitioner that a model is relying on spurious signal when the model does not.
Having deﬁned the metrics above, it remains which similarity function to use.
Computing Metrics for Feature Attribution.
For feature attribution methods, we follow prior literature (Adebayo et al., 2020) and use the Structural Similarity Index (SSIM).
SSIM measures the visual similarity between two images, so we use this metric as the measure of similarity between two attribution maps.
Concretely, given a set of normal inputs, we can obtain a corresponding spurious set of these inputs by applying the spurious contamination function, SCF to these inputs.
Consequently, we can then compute the K-SSD, CCM, and FAM metrics given these two sets of inputs using the SSIM metric. Computing Metrics for Concept Activation. A concept activation method provides a relevance score for a user deﬁned concept.
Given a set of user deﬁned concepts, one can estimate and rank each concept by the relevance score.
We measure comparison between two concept rankings using a
Kolmogorov-Smirnoff (KS) test comparing two distributions where the null hypothesis is that the two distributions are identical; we set signiﬁcance level to be 0 . 05 .
Computing Metrics for Training Point Ranking.
The training point ranking approach assigns a ‘relevance’ score to each training point based on inﬂuence of each training point on the test loss of a particular sample.
Recently, Hanawa et al.
(2020) introduced the Identical class metric’ (ICM), which is the fraction of the top training inputs, for a given test example, that belong to the same class as the true class of the test example in question.
Here we also use the KS test to compare the ICM distributions for two different models and set the signiﬁcance level to be 0 . 05 .
Taken together, these measures provide a comprehensive overview of an explanation method’s performance for detecting spurious signals.
2. B LINDED S TUDY
To complement the quantitative setup, we further designed a user study (IRB approved) to assess the ability of end-users (200 in total) to use post hoc explanations to detect a model’s reliance on spurious signals.
About 50 percent of the participants had trained a ML model before, and 74 percent at interacted with an ML model.
We refer to the appendix for additional details.
Task & Setup: The study participants were tasked with assessing model reliability with the aid of model explanations.
The participants were randomly assigned to one of two groups: the ﬁrst group is told explicitly of potential spurious signals, and the second is not.
They were asked to rate how likely they are to recommend the model for deployment using a 5-point Likert scale, and a rationale for their decision.
Our study design follows that of Adebayo et al.
(2020); however, we use a mixed within-subjects and between subjects design for the factors of interest.
The Likert scale is as follows, 1: Definitely Not to 5: Deﬁnitely.
Participants select ‘Deﬁnitely’ if they deemed the dog breed classiﬁcation model reliable.
We refer to Appendix H for discussion on user recruitment, statistical analyses, and study design.
Methods: We test SmoothGrad, TCAV (a concept activation method), a training point ranking method, and a Control setting with no explanations.
2. E XPLANATION M ETHODS , D ATA , & M ODELS
Here we give an overview of the explanation methods, datasets, and models.
We present a discussion of how these methods are used in practice in Appendix Section C.
Feature Attributions assign a relevance score for each dimension of an input towards an output.
We consider: Input-Gradient, SmoothGrad, Integrated Gradients (IG), and Guided Backprop (GBP) .
Concept-Based ((Bau et al., 2017;
Kim et al., 2018)) approaches measure the dependence of a DNN’s prediction on user-deﬁned features—termed concepts.
We select TCAV as the approach to assess in this class (Kim et al., 2018).
Training Point Ranking via Inﬂuence Functions
(Koh and Liang, 2017).
This approach ranks the training samples in order of importance/inﬂuence on the loss (or prediction) of a test example.
[Figure]
Models, Datasets, & Tasks.
We consider two medical datasets: Hand (Halabi et al., 2019) and Knee radiographs (Chen et al., 2019) and a dog breed classiﬁcation task.
We consider a small DNN (layers, 5 of which are the traditional conv-relu-batchnorm-maxpool combination) inspired by the CBR-Tiny architecture of Raghu et al.
(2019) and a ResNet-50 model.
We report results for the small DNN model in the paper since we ﬁnd correspondence for the two models (See Appendix for additional details).
F EATURE A TTRIBUTIONS
In this section, we present results on whether feature attributions are effective for detecting unknown spurious correlation.
Setup.
We consider 3 kinds of spurious signals which we term: Tag for the ‘MGH’ hospital tag added to the pre-puberty class, Stripe for the paired vertical stripped signal, and Blur for the background blur.
Given these signals, we then compute the three performance measures of interest: K-SSD, CCM,
FAM, and FAM-GT.
K-SSD indicates a method’s reliability when the spurious signal is known, CCM when the signal is not known and the practitioner only has access to inputs that don’t encode the spurious signal.
Lastly, FAM and FAM-GT indicates the susceptibility of a method to false positives.
An oft-used heuristic based on prior work (Adebayo et al., 2020) for interpreting SSIM scores is that SSIM scores 0 . 2 − 0 . 4 indicate weak visual similarity, 0 .
5 − 0 .
7 indicate moderate similarity, and > 0 .
75 high similarity. This is because two random images typically have SSIM much less than 0.1. For example, we empirically estimate the similarity of two random ( 229 × 229 ) Gaussian images to be less than 0 . 00023 .
Even for natural images, we still ﬁnd the SSIM values to be below 0 . 005 , which substantiates the previous heuristic.
Results.
We show performance measures for all the feature attribution methods tested for the Tag and
Blur settings in Tables 1 & 15 (See Appendix).
For the tag setting, the attribution methods are indeed able to attribute to the visible spurious signal and the K-SSD measure indicates this ﬁnding with mean scores typically above 0.65 for the bone age setting.
Contrary to previous ﬁndings, we ﬁnd that GBP outperforms other approaches for known spurious signals.
Alternatively, GBP is more suceptible to false positives based on the FAM and FAM-GT score.
Across all methods, we ﬁnd that these methods also seem to attribute to the spurious signal (FAM-GT > 0.4) even when the signal is not being relied on by the model.
We observe similar ﬁndings for the strip setting as well across all tasks.
The CCM measure further indicates that these methods do not indicate presence of spurious signals [Table] when the signal is unknown for both the Tag and Stripe signals.
This ﬁnding, however, reverses for the non-visible blur spurious signal.
Across all measures, we ﬁnd that all methods struggle to reliably indicate that spurious models are reliant on the blur signal.
Additionally, we also ﬁnd that the FAM scores are typically higher than the CCM scores across the tasks.
This ﬁnding indicates that the feature attribution methods tested are more susceptible to false positives than they are to indicate to a practitioner that a model is defective in the absence of the spurious signal, a ﬁnding that casts doubt on the utility of such approaches in practice.
C ONCEPT A CTIVATION I MPORTANCE
We ﬁnd that concept methods can indicate a model’s reliance on Tag and Stripe signals when known.
However, the approach struggles to detect Blur signal even when known.
As is the case with feature attributions, when a spurious signal is not explicitly tested for, our signiﬁcance tests indicate that reliance cannot be detected in the non-spurious concepts available.
Overview & Setup.
In this setting, we compute the 3 performance metrics of interest: K-SSD, CCM, and FAM.
To measure comparison between two concept rankings, we use a Kolmogorov-Smirnoff (KS) test comparing two distributions where the null hypothesis is that the two distributions are identical; we set signiﬁcance level to be 0 . 05 . [Table] FAM [Table]
Result.
In Figure 5, we show TCAV scores for each bone age class for both the spurious tag and the blur models.
In Table 2, we show results of the KS-Test across metrics for the Tag Setting.
Here, a X means we reject the null, while an (cid:88) means we are unable to do so at the pre-speciﬁed signiﬁcance level.
For the K-SSD metric, the KS-test rejects the null for the Tag and Stripe signals.
However, we ﬁnd that the opposite is the case for the blur signal.
This suggests that concept rankings can help detect reliance on the visible signals but not nonvisible signals when the spurious signals are unknown.
However, for the CCM metric, we are unable to reject the hypothesis that the distribution of concept rankings are not similar for all spurious signals.
This ﬁnding suggests that when the spurious signal is unknown, and we only compare the distributions of known (non-spurious) concepts for a normal model and a spurious model, there is high similarity.
Lastly, a difference in means test as well as a KS-Test for the FAM measure indicates that the normal models do not rely on the spurious signals as well.
Overall, this ﬁnding suggests that TCAV is less susceptible to false positives.
T RAINING P OINT R ANKING & B LINDED S TUDY
Overview & Setup.
We now describe our empirical ﬁndings for the training point ranking via inﬂuence functions approach.
Here we present results for the case where the spurious signal is aligned with the Pre-Puberty class.
Results.
The main take away is that given a known spurious signal, the fraction of top ranked training spurious signal inputs increases with a spurious model across all of the spurious signals.
While this might seem encouraging, we note that such increase actually indicates that the ICM metric might provide illusory conﬁdence in a spurious model.
Ultimately, a critical requirement here is knowing what the spurious signal ahead of time and to be able to select the right inputs to inspect.
Blinded Study.
We now turn to a summary of the results of the blinded user study.
The median recommendations selected by participants (200 in total) is reported for each explanation-model condition in Table 10.
We plot a box plot of all 16 categories in the appendix. Our setting mimics traditional randomized experimental settings, so we adopt a randomization inference analysis to determine the effect of each treatment, which is the explanation method in this case, on the ability of the users to recommend a model. A higher Likert score means the user is more likely to recommend a model.
Consequently, if an explanation method is effective, then it should be the case that users should be less likely to recommend a model that relies on a spurious signal.
[Table]
We conduct two kinds of statistical analyses of the data. First, under each condition, we perform a difference of means test for each treatment compared to the control setting. Secondly, for each model manipulation, we performed a one-way Anova test, and a TukeyKramer test to assess the effect of the explanation type on the ability of the participants to reject a defective model. We observe that when blinded, in none of the methods do participants conclusively reject spurious models.
Perhaps more surprising, when the participants were not blinded, we see that only participants using the TCAV approach rejected a spurious model. This ﬁnding has signiﬁcant implications on whether these current tools are effective in the hands of a practitioner. [Table] conditions.
D ISCUSSION & C ONCLUSION
Conclusion.
DNNs trained on image datasets can naturally rely on spurious training signals (Geirhos et al., 2020).
Discovering this reliance is crucial in consequential settings like medical imaging.
Post hoc explanations methods are a promising direction towards detecting such reliance; however, their effectiveness is currently under question.
We investigated whether 3 classes of post hoc explanations are effective for detecting a model’s reliance on spurious training signals.
We present an experimental setup that can also be easily adapted to other settings to assess a larger class of approaches.
The setup comes equipped with a spurious score and performance measures for spurious signal detection.
We ﬁnd that the 3 classes of post hoc explanations tested are only sometimes able to diagnose the spurious training signal even if they are used to explicitly test for model dependence on these signals.
Consequently, our ﬁndings calls for, potentially, a completely different paradigm of methods that are designed to address the important and challenging question of detecting spurious training signals.
Limitations.
We have focused exclusively on DNNs trained on image tasks; hence, it is unclear if our ﬁndings will generalize to other modalities like text or time-series data.
While we considered a diverse set of methods, the literature on post hoc explanations is quite vast, so undoubtedly there exist methods that do not ﬁt neatly into the 3 explanation classes that we explored.
For the normal models that we tested, we note it is indeed possible for the dataset to encode for other kinds of spurious signals; however, our analysis can rule out the model dependence on the 3 pre-deﬁned spurious signals that we study in this work.
Appendix A E XTENDED R ELATED W ORK .
Overview of Recent work The recent work of Adebayo et al.
(2020) presents debugging tests for assessing feature attribution methods.
The spurious correlation setting that we consider here ﬁts under their framework.
However, they only consider feature attribution methods.
Here we extend this analysis to concept and training point ranking methods.
Critically, Adebayo et al.
(2020) show that feature attributions are able to identify spurious training signals.
We make a similar ﬁnding in this work; however, we further demonstrate this ﬁnding for concept and training point ranking methods.
Our work takes important departures from theirs: 1) we explain the source of this phenomenon, and 2) we demonstrate that naive application of these methods might be unable to detect spurious correlation in practice.
Adebayo et al.
(2020) assume the spurious correlation training bug is known, a priori; however, here we demonstrate that the more challenging task is identifying the spurious signal in the ﬁrst place.
More recently, Han et al.
(2020) demonstrate that training point ranking via inﬂuence functions is able to identify the dependence of an NLP model on dataset artifacts.
In addition, they show correspondence between the insights observed with the input-gradient feature attribution and the training point ranking.
Along similar lines, Guo et al.
(2020) present fast approximations for computing the training point ranking for a test point.
In addition, they show how to identify and correct model errors in a natural language task.
Similar to the distinctions that we note with the work by Adebayo et al.
(2020) above, here, they also assume that the spurious signal being identiﬁed is known a priori.
Post hoc explanations, more generally, have been shown to be able to identify a model’s reliance on spurious training signals (Ribeiro et al., 2016;
Meng et al., 2018; Lapuschkin et al., 2019; DeGrave et al., 2020; Ross et al., 2017).
Recent work by Rieger et al.
(2020) showed that regularizing model attributions during training can help lead to models that avoid spurious correlation and enable improved debugging by experts.
Similarly, Erion et al.
(2019) show that regularizing the expected gradient attribution during training confers similar beneﬁts.
Koh and Liang (2017) used inﬂuence functions to identify domain shift.
Kim et al.
(2018) also perform a user study to understand if attribution methods can be used for catch spurious correlation.
However, similar methods have also been shown to struggle in the hands of end-users for diagnosing model errors (Alqaraawi et al., 2020; Adebayo et al., 2020).
This contradiction reﬂects the challenge that we explore in this work.
Often, post hoc explanations have been shown to be effective for identifying spurious signals that were suspected or known a priori; however, these methods seem to struggle when confronted with the task of identifying an unexpected spurious signal.
Increasingly, insights into why overparametrized DNNs rely on spurious training set signals is starting to be theoretically and empirically analyzed (Sagawa et al., 2019; 2020; Khani and Liang, 2020;
Nagarajan et al., 2020), yet it is still unclear how to reliably detect that a model is relying on such signals prior to model deployment.
Assessing whether a post hoc explanation approach is faithful to the underlying model being explained has been addressed in recent works, yet this challenge remains elusive (Hooker et al., 2019; Tomsett et al., 2020).
Generally, the class of approaches that modify backpropagation with positive aggregation have been shown to be invariant to the higher layer parameters of a DNN (Mahendran and Vedaldi, 2016; Nie et al., 2018; Adebayo et al., 2018; Sixt et al., 2019).
In an intriguing demonstration, Srinivas and Fleuret (2021) show that the input-gradient, a key feature attribution primitive, might not capture discriminative signals about input sensitivity.
Instead they show that input-gradient likely captures the ability of the model to be able to generate class-conditional inputs.
User studies are typically the classic approach for evaluating the effective of an explanation (DoshiVelez and Kim, 2017).
Poursabzi-Sangdeh et al.
(2018) manipulate the features of a predictive model trained to predict housing prices to assess how well end-users can identify model mistakes.
Their results indicate that users found it challenging to debug these linear models with the model coefﬁcients.
Recent work by Chu et al.
and Shen and Huang (2020) has shown similar results in the DNN setting as well.
Alqaraawi et al.
ﬁnd that the LRP explanation method improves participant understanding of model behavior for an image classiﬁcation task, but provides limited utility to end-users when predicting the model’s output on new inputs.
Post hoc explanations have been shown to be fragile and very easily manipulated Ghorbani et al.
(2019a); Heo et al.
; Dombrowski et al.
; Anders et al.
Slack et al.
Lakkaraju and Bastani (2020).
Our work tackles a difference concern: whether they are suitable for detecting unexpected spurious training set signals.
Yeh et al.
(2020) and Ghorbani et al.
(2019b)
both present approaches to automatically discover concepts and quantify a model’s dependence on these concepts.
These approaches are promising directions for addressing the challenge we identify in this work.
Ghorbani et al.
(2019b)’s approach,
ACE, segments input images and clusters to discover inherent clusters.
We present some analysis on this approach in the appendix.
Critically, this approach would identify spurious signals that the underlying segmentation algorithm can discover such the image tag, but not the blur or other visually imperceptible features.
Koh et al.
and
Chen et al.
(2020) present approaches that learn
DNN models whose features inherently map onto concepts of interest.
In this work, we assume the model is given, focusing on post hoc explanations for models that are not inherently interpretable.
Recent work at the intersection of causal inference and explanations might also open up avenues to help reveal unexpected confounding, some of which could be unknown spurious signals.
Along this line, (Bahadori and Heckerman, 2021) present an instrumental variable approach for debiasing concept based explanations that might be confounded.
Kazhdan et al.
(2020) present CME, an approach identify the important concepts that can help improve a model’s performance.
We rely on Guo et al.
(2020) for fast approximations for computing the training point ranking for a test point.
In addition, they show how to identify and correct model errors in a natural language task.
However, Basu et al.
(2020) show inﬂuence functions for DNNs are fragile and perhaps inaccurate for deeper networks.
Other recent work has cast doubt on the utility of trying to explain ‘traditionally’ trained deep network models.
For example, Srinivas and Fleuret (2021) show that the input-gradient might not reﬂect the discriminative capabilities of a DNN, but instead encode for an implicit density model.
More recently, Shah et al.
(2021) show that the input and loss gradients of traditionally trained models do not indicate the importance features that a DNN model relies on for its output—a phenomenon they term feature inversion.
Further they show that adversarially trained models do not exhibit feature inversion.
Taken together these results might explain some of the counter intuitive ﬁndings that we observe even when the spurious signal is known since we only consider non-adversarially trained models in this work.
Along a different direction, post hoc explanations have been shown to be fragile and very easily manipulated Ghorbani et al. (2019a); Heo et al.
; Dombrowski et al.
Anders et al.
Slack et al.
; Lakkaraju and Bastani (2020).
B D ETAILED O VERVIEW OF E XPLANATION M ETHODS
In this section, we provide additional implementation details for the explanation methods that we consider in this work.
To start with the model setup: let’s say we are given input-output pairs, { x i , y i } ni , where x ∈ X and y ∈ Y ; and a classiﬁer’s goal is to learn a function, f θ : X → Y that generalizes to new inputs via empirical risk minimization (ERM).
In this work, we assume that f θ is an over-parametrized deep neural network (DNN) trained on image data for classiﬁcation ( C classes).
We plan to release our larger codebase with the paper; however, in lieu of this we include a zip folder that includes representative implementations.
For each of the explanation methods described here, we implement them from scratch and then compare to open-source libraries that also implement these methods.
We found that our results for both settings is comparable.
Feature Attributions.
An attribution functional, E : F × R d × R → R d , maps the input, x i ∈ R d , the model, f θ , output, f k ( x ) , to an attribution map, M x i ∈ R d .
The class of feature attribution methods is large, so in this work we pick: Input Gradient, SmoothGrad, Integrated Gradients, and
Guided Backprop.
We choose these approaches since they were the top-ranked methods tested under the spurious correlation setting of Adebayo et al.
The Input-Gradient (Gradient) Simonyan et al.
; Baehrens et al.
(2010) map, |∇ x i F i ( x i ) | , is a key primitive upon which several other methods are based.
SmoothGrad Smilkov et al.
(2017) corresponds to the average of noisy input gradients:
M sg ( x ) = 1 N (cid:80) Ni
=
∇ x i F i ( x i + n i ) where n i is sampled according to a random Gaussian noise.
We considered 50 noisy inputs, selected the standard deviation of the noise to be 0 .
15 ∗ input range.
Here input range refers to the difference between the maximum and minimum value in the input.
Integrated Gradients ( Sundararajan et al.
(2017)) sums input gradients along an interpolation path from the “baseline input”, ¯ x , to x i : M IntGrad ( x i ) =
( x i − ¯ x ) × (cid:82)0 ∂S (¯ x + α ( x i − ¯ x ))
∂x i dα .
For integrated gradients we set the baseline input to be a vector containing the minimum possible values across all input dimensions.
This often corresponds an all-black image.
The choice of a baseline for IntGrad is not without controversy; however, we follow this setup since it is one of the more widely used baselines for image data.
Guided Backpropagation (GBP) Springenberg et al.
(2014) modiﬁes the backpropagation process at ReLU units in DNNs.
Let, a = max(0 , b ) , then for a backward pass, ∂l∂s = 1 s>
∂l ∂b , where l is a function of s .
For GBP, ∂l ∂s = 1 s> 0 1 ∂l∂s > 0 ∂l ∂b .
Feature Attributions: Implementation.
We implement all of these methods from scratch in the
PyTorch framework and also compare our implementations to the output of the Captum (PyTorch) and the Innvestigate framework (in Keras).
We were able to conﬁrm a correspondence between these outputs.
We include the innvestigate script here.
Concept-Based Approaches.
We now discuss additional implementation details of our concept based approach.
We select the TCAV approach to quantify the sensitivity of a DNN model’s class score to user provided inputs represent a particular class.
Given hidden representations, h l , from a particular layer of a DNN for for images belonging to concept class C .
We can derive the sensitivity score as: ∇ h l,k ( f l ( x )) .θ
lc .
The previous expression indicates the sensitivity of the class score (logit) for class k to inputs indicating concept, C , given hidden representations from layer l from the DNN f .
The concept vector, θ lc , typically corresponds to a the weights of a linear classiﬁer trained to separate the images for a particular concept class from or images.
For completeness, we show in Figure 20 an overview of the clinical concepts that we consider in this work.
These are the representative clinical attributes that a radiologist would inspect to ascertain the bone age of a particular input.
These concepts are: DIP, PIP, MCP, Radius, Ulna, and Wrist.
Concept Implementation.
To compute the TCAV score for each concept, we collect representations from all hidden ‘layers’ of the model and train linear models to obtains the concept vector for the corresponding attribute.
We then compute the class sensitivity score for each concept attribute.
We train the linear model 100 times and perform statistical signiﬁcance testing in order to mitigate the case where a spurious concept is selected.
For each concept class, we use 325 images that part of the training, validation, or test sets.
These new set of images were annotated by a board certiﬁed radiology with the clinical bone age regions (MCP, PIP, DIP etc) that we chose.
Inﬂuence Functions for Training Point Ranking.
The ﬁnal kind of interpretation that we consider is training point ranking via inﬂuence functions.
In the case of training point ranking via inﬂuence functions, we rank the training samples, in terms of ‘inﬂuence’, on the loss of a test example.
Speciﬁcally, if we up-weighted a training point and retrained the model, then by how much would the loss on a given test example change?
Koh and Liang (2017) analytically derive the analytically formulas for computing this quantity.
Given a test point, x t , the inﬂuence of a training point, x i , on the test loss is: I ( x t , x i ) =
−∇ θ (cid:96) ( x t , ˆ θ ) (cid:62)
H − 1 ˆ θ ∇ θ (cid:96) ( x i , ˆ θ ) , where H is the empirical Hessian of the loss.
Estimating the inﬂuence requires computing hessian-vector products, so it can be difﬁcult to scale to model with large number of parameters, and recent work has shown that inﬂuence estimate for test points for deep networks can be inaccurate due to non-convexity (Basu et al., 2020).
Consequently, we estimate inﬂuence on a linear model student network trained to mimic the original DNN.
We empirically verify that the predictions of the student network seem to mimic the original DNN.
Implementation Details.
There are two other training point ranking methods that we also consider in this work (Yeh et al., 2018; Pruthi et al., 2020).
For 150 inputs in the test set, we compare the Spearman rank correlation of the training point due to Inﬂuence Functions to these other two approaches.
We obtain mean values of 0 . 88 , and 0 .
76 respectively, which suggests high similarity amongst these approaches.
Ultimately, we chose to present the main results in the draft for the training point ranking due to inﬂuence functions approach.
We rely on the fast inﬂuence heuristic of (Guo et al., 2020) to speed up the inﬂuence ranking computations.
We were able to obtain a 5-10X speed in doing so.
In addition, we trained a student multi-class logistic regression model to mimic the original model for each model we want to compute inﬂuence for.
Here for all training points, we collect embeddings across all layers and pass these embedding through a random projection to obtain a 1000 -dimensional approximation.
We then train linear models to mimic the original deep network using these features.
The correlation between the output of the student models and the original teacher models was found to be 0 .
Ultimately, we went with the fast inﬂuence implementation of (Guo et al., 2020).
B. A DDITIONAL D ETAILS ON M ETRICS C H OW ARE THE APPROACHES TESTED USED IN PRACTICE ?
Feature Attributions To understand or debug a model, a practitioner would have to inspect, one sample at a time, the attribution of a collection of inputs.
In inspecting these attributions, the practitioner can then form an hypothesis about the behavior of the model on certain inputs.
Along these lines, to detect a model’s reliance on spurious signals with feature attributions, one of the following must occur: i)
The practitioner should inspect attributions for inputs that contain the spurious signal and notice that the spurious signal constitute the key feature for a model’s output decision or ii)
The practitioner should inspect attributions for inputs that do not contain the spurious signal and notice ‘an issue’ with these attributions.
In addition, the output decision to be explained has to also be the class for which the spurious signal encodes for.
For example, in our experiments the hospital tag encodes for the pre-puberty class.
These two settings are exactly what we measure with the SSIM metric in our analysis for feature attributions.
Concept Activation these classes of approaches measure the dependence of a particular class to a user provided concept.
For example, one could measure the pre-puberty class’ dependence on the hospital tag concept.
As part of this approach, the hospital tag is user deﬁned, and it is up to the practitioner to decide whether to test this concept.
Other concepts include low frequency signals, patches of the image, color dimensions, or even any conceivable high-level concept the practitioner is interested in.
For example, in the bone-age model, the concepts DIP, PIP, MCP, Wrist etc, are user deﬁned clinical concepts that we chose and which are well speciﬁed for this setting.
For each concept of interest, the practitioner collects input examples that have this concept.
For example, to test a model’s dependence on a hospital tag, we collect images that all have hospital tags in them.
Given this collection of examples, the TCAV approach can then be used to calculate a score,
TCAV score, that corresponds to the sensitivity of a particular output class to the input concept.
The key insight that makes the TCAV approach susceptible to the limitations we point out are 1) it is up to the practitioner to decide which concept to test, and 2) our ﬁndings suggests that unless the spurious signal is explicitly tested, the TCAV scores for other concepts do not indicate that a model is reliant on a spurious signal.
We note that even though we show all the concept scores in a single bar chart, these concepts are actually tested independently.
Training Point
Ranking These class of approaches ranks all training points by inﬂuence on the test loss of an input.
Qualitatively, if a training point has a high inﬂuence on the test loss of an input, it means that if the model were re-trained without that training point, the test loss of that test point would change signiﬁcantly.
Intuitively, the most highly ranked training points for a given test input should also be points for which the model relies on semantically similar features.
For example, one would expect the most highly ranked training points for a pre-puberty test-input to be other pre-puberty inputs as well (assuming a model has learned the right semantic features)
To use this approach to identify spurious signals, one would have to inspect an input that contains the spurious signal and further notice that the top ranked training inputs also include the training signal.
Speciﬁcally, to test that a model is relying on the hospital tag to identify pre-puberty inputs one would have to use a test-input that has a hospital tag and then notice that all the top ranked inputs also have hospital tags.
The crux of our argument is that the choice and decision to use a test-input with an hospital tag is the critical choice underlying whether the training point ranking methods can be used to effectively detect a model’s reliance on spurious signals.
One measure of reliability for an inﬂuence function approach is the ICM metric that we compute in the paper.
Taken together, in the scenario where a practitioner is handed a model and asked to assess whether it relies on any spurious signal, detecting a model’s reliance spurious signals requires that the practitioner know which speciﬁc signals to test ahead of time.
D M ODEL T RAINING & D ATASET P ROCESSING
Bone Age Dataset We consider the high stakes task of predicting the bone age category from a radiograph to one of ﬁve classes based on age: Infancy/Toddler, Pre-Puberty, Early/MiD Puberty,
Late Puberty, and Post Puberty.
This task is one that is routinely performed by radiologists and as been previously studied with a variety of DNN.
The dataset we use is derived from the Pediatric
Bone Age Machine learning challenge conducted by the radiological society of North America in 2017 Halabi et al.
The dataset consists of 12282 training, 1425 validation, and 200 test samples.
We resize all images to (299 by 299) grayscale images for model training.
We note here that the training, validation, and test set splits correspond to similar splits used for the competition, so we retain this split.
[Figure] Knee Dataset We also consider the high stakes task of predicting the Kellgren and Lawrence (KL) grade of osteoarthritis based on Knee Xrays.
The KL grade ranges from the integers 0 to 4 ; 5 classes, so we treat it as a classiﬁcation task.
The Knee Radiographs are obtained from the open source release by Chen et al.
and consists of 5778 training samples, 826 validation samples, andtest samples.
Again here, we follow Chen et al.
(2019) data splits.
The images were resized to be 299 bypixels.
Dog Dataset
The third dataset that we use in this work is the dog breed classiﬁcation dataset that is a combination of Stanford dogs dataset Khosla et al.
(2011) and the Oxford Cats and Dogs datasets Parkhi et al.
(2012b) following Adebayo et al.
Similarly, we restrict our attention to 10 dog classes: Beagle, Boxer, Chihuahua, Newfoundland, Saint Bernard, Pugs, Pomeranian, Great Pyrenees, Yorkshire
Terrier, Wheaten Terrier.
Instead of the background spurious signal ofAdebayo et al.
(2020), we focus instead on the three spurious signals tested in this work.
Models We consider two different kinds of models: i) a small vanilla DNN based on Raghu et al.
(2019), and a Resnet-50 model.
The small DNN consists of: conv-relu-batchnorm-maxpooling operation successively, and two fully connected layers at the end.
All convolutional kernels have stride 1 , and kernel size 5 .
We train this model with SGD with momentum (set to 0 . 9 ) and an initial learning rate of 0 .
We use a learning rate scheduler that decays the learning rate every 10 epochs by γ = 0 . 1 .
Hyper-Parameter Tuning for Model Training We used the Ray Tune library for hyper-parameter tuning of all the models used in this work.
For the ResNet-50, we tuned with Ray, but the best performing models retained the default parameter settings.
In the case of the Small DNN model, we tune the batch size, and learning rate with the validation set.
Compute We perform all of our experiments on a VM with 60GB of RAM and a k80 GPU on
Google Cloud.
A Note about random seeds and Model Runs.
We train 5 models each (different random seeds) for each category and in the following tables the average performance metrics for these models.
We found that the standard error of the mean for typically between 0 .
01 − 0 .
05 , so we omit these in the tables to improve readability. [Figure] [Figure] [Table]
[Figure] [Table] [Figure] [Figure]
[Table]
0.46 TagModel0.
- - - - StripeModel0.
- - BlurModel0.
E A DDITIONAL R ESULTS : F EATURE A TTRIBUTIONS
In a series of subsequent ﬁgures with this appendix.
We show additional saliency visualizations for settings considered in the main text.
Here show a single visualization for the bone age setting since we found that the saliency attributions for such setting were quite faint.
Overall we obtain similar results between the knee and bone age datasets, so we opt to show the bone age visualizations here instead.
F A DDITIONAL R ESULTS : C ONCEPTS A PPROACHES
Normal Model compared to radiologist Concept Ranking For each of the 100 re-runs, we computed the rank correlation between the concept ranking for the normal model and rankings provided by a board certiﬁed radiologist.
Concepts for Dogs and Bone Age.
We consider TCAV for the bone age and dog breeds task.
For bone age, we choose as concepts the partitions of a hand, which correspond to the parts of the hand a radiologist would inspect to ascertain the age from a radiograph.
We show, in Figure 20, a representation of these concepts.
In the dog breeds classiﬁcation task, consider concepts related ﬂoppiness of the ear, erectness of the ear, the dog head type, and color.
We manually collect data on the dog breed concept.
Here we showed Amazon mechanical Turkers an image from each class (10 classes) and then asked them to indicate whether each speciﬁc dog class had ﬂoppy ears or not, erect ears or not, single colored or not etc.
We normalize each attribute to be binary and apply each concept broadly across each class.
Discussion on ACE .
The ACE concept approach segments an image and uses the image segments as concepts as part of a TCAV pipeline.
In an experimental analysis, we segment the spurious images using the various segmentation algorithms in algorithm to identify how often the spurious signal is selected as a distinct segment.
We found segmentation to be ineffective in the stripe and blur settings.
For the spurious tag, we found segmentation to be effective in only 25 percent of the examples tested, which suggests that the underlying segmentation algorithm as part of ACE might be ineffective for detecting hidden spurious signals. [Figure] [Figure]
G A DDITIONAL R ESULTS : I NFLUENCE F UNCTIONS
In Figure we show the inﬂuence metric that we computed in the main text for the small DNN model for the Knee Arthritis prediction.
In this task, the spurious signal is always aligned with the
Grade 2 class.
Here again, we see that in the spurious settings each metric actually improves.
H U SER S TUDY D ISCUSSION
In this section we present additional results of the user study along with break down of some demographic information about the participants.
[Figure]
[Figure]
We now provide additional tables for the the feature attribution metrics from the main text. Setting
Spearman Correlation w/Rad
Infancy/Toddler 0. Pre-Puberty 0. Pre-Puberty 0. Late Puberty 0.
Post Puberty 0.
[Table] [Table] [Table]
[Table] [Table] Model. Input
Grad SmoothGrad IG GBP
Input
Grad
SmoothGrad
IG
GBP
Input
Grad
SmoothGrad
IG
GBP
Input
Grad
SmoothGrad
IG
GBP
Input
Grad
SmoothGrad
IG
GBP
Input
Grad
SmoothGrad
IG
GBP
Input
Grad
SmoothGrad
IG
GBP
Input
Grad
SmoothGrad
IG
GBP
ICM measures what fractions of the top training inputs for a given test example belong to the same class as the true class of the test example in question.
[Table]
[Table]