Module2 Lecture 6 Cat1 UptoSmoothGrad
Module2 Lecture 6 Cat1 UptoSmoothGrad
explanations
CSEP 590B: Explainable AI
Ian Covert & Su-In Lee
University of Washington
𝑥1 -
𝑥2 -
: 𝑓 ⋅ 𝑦"
𝑥𝑑 -
𝑥 ℎ! ℎ" 𝑦#
Network weights
𝑥 ℎ! ℎ" 𝑦#
Gradient descent
§ Gradient calculation:
5
1
∇6 ℒ 𝜃 = ) ∇6 ℓ 𝑓 𝑥 2 ; 𝜃 , 𝑦 2
𝑛
234
𝜕ℒ 𝜕ℒ
ℒ 𝜃 = ( ℓ 𝑦,
* 𝑦
𝜕ℎ% 𝜕ℎ!
𝜕ℒ 𝜕ℒ 𝜕ℒ
𝜕𝑤% 𝜕𝑤! 𝜕𝑤"#$
𝜕ℒ 𝜕ℒ 𝜕ℒ
𝜕𝑏% 𝜕𝑏! 𝜕𝑏"#$
©2022 Su-In Lee 10
Propagation-based
explanations
𝜕ℒ 𝜕ℒ
ℒ 𝜃 = ( ℓ 𝑦,
* 𝑦
𝜕ℎ% 𝜕ℎ!
𝜕ℒ 𝜕ℒ 𝜕ℒ 𝜕ℒ
𝜕𝑥 𝜕𝑤% 𝜕𝑤! 𝜕𝑤"#$
𝜕ℒ 𝜕ℒ 𝜕ℒ
𝜕𝑏% 𝜕𝑏! 𝜕𝑏"#$
©2022 Su-In Lee 12
Input gradients
𝑥 ℎ! ℎ" 𝑦#
Gradient of prediction
𝜕𝑓& 𝜕𝑓&
(instead of loss) 𝑓& 𝑥; 𝜃 = 𝑦*
𝜕ℎ% 𝜕ℎ!
𝜕𝑓7 𝑓7 𝑥 + 𝑒2 ⋅ 𝜖 − 𝑓7 𝑥
𝑥 = lim
𝜕𝑥2 8→: 𝜖
Limit as change becomes very small Measured relative to the size of change
<=0
𝑎2 = 𝔼 𝑥+𝜖 where 𝜖 ∼ 𝒩 0, 𝜎 ?
<>1
Shrikumar et al., “Not just a black box: Learning important features through propagating
activation differences” (2016)
@
𝜕𝑓7
𝑓7 𝑥 ≈ 𝑓7 𝑥: + 𝑥 − 𝑥: 𝑥:
𝜕𝑥
In this region, 𝑓 𝑥 is
insensitive to small 𝑥
changes
Gradient ≈ 0
,
1 𝜕𝑓* %
𝑎$ ≈ 𝑥$ − 𝑥$% / 𝑥 + 𝛼+ ⋅ 𝑥 − 𝑥 %
𝑚 𝜕𝑥$
+')
Selvaraju et al., “Grad-CAM: Visual explanations from deep networks via gradient-based
localization” (2017)
𝑦-
𝑓( 𝑥
Bach et al., “On pixel-wise explanations for non-linear classifier decisions by layer-wise
relevance propagation” (2015)
56) 5,56)
𝑅+ = / 𝑅$←+ Summation of outgoing
$ importance
(5) 5,56)
Summation of incoming 𝑅$ = / 𝑅$←+
importance +
56) 5 56)
where 𝑧$+ = 𝑤$+ ℎ$ , 𝑧+ = ∑$ 𝑧$+ + 𝑏+ , and 𝜖 > 0
)
§ Finally, attributions are given by 𝑎$ = 𝑅$ for 𝑖 = 1, … , 𝑑
§ Propagation-based explanations
§ SmoothGrad, IntGrad, GradCAM