论文——Axiomatic Attribution for Deep Networks
Axiomatic Attribution for Deep Networks, ICML 2017
1. 介绍
这是一篇关于模型可解释性的论文,研究了将深层网络的预测归因于其输入特征的问题, 简单的说就是通过研究输入与输出的关系,去理解模型的输入-输出行为。
We study the problem of attributing the pre-diction of a deep network to its input features.
在第一节中,作者给出了归因的定义
定义 1: 假设有一个函数
F
:
R
n
→
[
0
,
1
]
F: R^{n} \to [0, 1]
F:Rn→[0,1]表示为一个深层网络,然后有一个在
R
n
R^{n}
Rn空间上的输入
x
=
(
x
1
,
.
.
.
.
,
x
n
)
∈
R
n
x=(x_{1},...., x_{n}) \in R^{n}
x=(x1,....,xn)∈Rn.对于baseline输入(基准输入)
x
′
x'
x′, 在输入
x
x
x产生的预测结果的结果下,
x
x
x的归因用一个向量表示为
A
F
(
x
,
x
′
)
=
(
a
1
,
.
.
.
,
a
n
)
∈
R
n
A_{F}(x, x')=(a_{1},...,a_{n}) \in R^n
AF(x,x′)=(a1,...,an)∈Rn, 其中
a
i
a_{i}
ai对应为
x
i
x_{i}
xi的归因
并定义归因应该满足的2个基本公理,敏感性和实现不变性
We identify two fundamental axioms— Sensitivity and Implementation Invariance that attribution methods ought to satisfy.
作者证明目前大多数广泛接受的归因方法都不满足这两个公理:敏感性和实现不变性
We show that they are not satisfied by most known attri- bution methods, which we consider to be a fun- damental weakness of those methods.
Unfortunately most previous methods do not satisfy one of these two axioms.
基于这两条公理,作者提出了新的归因方法,积分梯度。
We use the axioms to guide the design of a new attri-bution method called Integrated Gradients.
对于一个物体识网络,归因方法可以告诉我们图像中哪几个像素点对预测的label有主要影响。(如图)
左边为原始图像,右边为归因方法实现的特征可视化。
右1 为作者提出的积分梯度方法
右2 为传统的归因方法,通常使用 image*梯度 所得
可以看到作者基于2条公理 所提出的积分梯度方法,明显得到的特征图比一般的梯度方法(不满足公理)要好,至少从直观上来讲特征表现更清晰。
2. 基本公理
作者发现其他关于特征归因方法的文献中,对于2条公理,至少有一条是不满足的。
这些文献包括
DeepLift (Shrikumar et al., 2016; 2017), Layer-wise relevance propagation (LRP) (Binder et al., 2016), Deconvolutional networks (Zeiler & Fergus, 2014), and Guided back-propagation (Springenberg et al., 2014).
We find that other feature attribution methods in literature break at least one of the two axioms.
These methods include DeepLift (Shrikumar et al., 2016; 2017), Layer-wise relevance propagation (LRP) (Binder et al., 2016), Deconvolutional networks (Zeiler & Fergus, 2014), and Guided back-propagation (Springenberg et al., 2014).
梯度: 对于线性模型,ML实验人员会检查模型系数和特征值的乘积,以便调试预测。
对于一个深度网络来讲,梯度是模型的一个固有参数,设计一个归因方法的出发点往往是通过梯度和特征的乘积
Gradients (of the output with respect to the input) is a natural analog of the
model coefficients for a deep network, and therefore the product of the gradient and feature values is a reasonable starting point for an attribution method
但问题是梯度打破了敏感性这条公理
The problem with gradients is that they break sensitivity, a property that all attribution methods should satisfy.
2.1 公理:敏感性(a)
一个归因方法对于所有的输入和基准输入都应该满足敏感性,即对不同的输入特征,产生不同的预测结果时,这个不同的特征所对应的归因(属性)非0。
归因函数
A
F
(
x
,
x
′
)
=
(
a
1
,
.
.
.
,
a
n
)
∈
R
n
A_{F}(x, x')=(a_{1},...,a_{n}) \in R^n
AF(x,x′)=(a1,...,an)∈Rn,若
∃
x
i
≠
x
i
′
\exists x_{i} \ne x'_{i}
∃xi=xi′,使
f
(
x
′
)
≠
f
(
x
)
f(x') \ne f(x)
f(x′)=f(x),则
a
i
≠
0
a_{i} \ne 0
ai=0。
梯度违反了敏感性(a)一个实际例子:对于一个单变量的Relu网络, f ( x ) = 1 − R e L U ( 1 − x ) f(x)=1-ReLU(1-x) f(x)=1−ReLU(1−x)。
假设基准输入baseline是
x
′
=
0
x'=0
x′=0,实际输入是
x
=
2
x=2
x=2,
则,
f
(
x
′
)
=
0
f(x')=0
f(x′)=0变为
f
(
x
)
=
1
f(x)=1
f(x)=1, 梯度方法给出的归因(属性)在
x
=
1
x=1
x=1处应该是平滑的。
对于
x
=
1
x=1
x=1 时,
f
(
x
)
=
1
f(x)=1
f(x)=1与基准输入的输出产生不同的结果,但是在
x
=
1
x=1
x=1处,
f
(
x
)
f(x)
f(x)梯度却为0,这违反了公理的敏感性。
在实际中,缺乏敏感性会导致梯度注意在无关紧要的特征上。
2.2 公理:实现不变性
如果两个完全不同的方式实现的网络对于所有输入,输出都相等,则两个网络在功能上是等效的。归因方法应该满足实现不变性,对于2个功能完全相同的网络,归因应该保持一致。
Two networks are functionally equivalent if their outputs are equal for all inputs, despite having very different imple-mentations. Attribution methods should satisfy Implemen-tation Invariance, i.e., the attributions are always identical for two functionally equivalent networks.
首先需要注意的是,梯度对于实现是不变的。事实上,链式求导法则 ∂ f ∂ g = ∂ f ∂ h ⋅ ∂ h ∂ g \frac{\partial f}{\partial g} = \frac{\partial f}{\partial h} \cdot \frac{\partial h}{\partial g} ∂g∂f=∂h∂f⋅∂g∂h对于实现不变性十分重要。考虑实现由输出 f f f和输入 g g g的一个系统,可以使用 ∂ f ∂ g \frac{\partial f}{\partial g} ∂g∂f计算输出 f f f关于的输入 g g g的梯度,从而可以将中间函数(实现细节) h h h忽略(抵消)。或者通过 h h h调用链式规则,这也是反向传播的工作原理。
但是对于像LRP和DeepLift使用离散梯度,并仍然使用一种改进的反向传播形式将离散梯度应用在归因中。然而,通常来说,链式求导法则并不适用于离散梯度。形式上如:
f
(
x
1
)
−
f
(
x
0
)
g
(
x
1
)
−
g
(
x
0
)
≠
f
(
x
1
)
−
f
(
x
0
)
h
(
x
1
)
−
h
(
x
0
)
⋅
h
(
x
1
)
−
h
(
x
0
)
g
(
x
1
)
−
g
(
x
0
)
\frac{f(x_{1})-f(x_{0})}{g(x_{1})-g(x_{0})} \ne \frac{f(x_{1})-f(x_{0})}{h(x_{1})-h(x_{0})} \cdot \frac{h(x_{1})-h(x_{0})}{g(x_{1})-g(x_{0})}
g(x1)−g(x0)f(x1)−f(x0)=h(x1)−h(x0)f(x1)−f(x0)⋅g(x1)−g(x0)h(x1)−h(x0)
因此这些方法不满足实现不变性。