Skip to content
/ CLRP Public

Contrastive Layer-wise Relevance Propagation or CLRP is a modification of standard Layer-wise Relevance Propagation (LRP) with the goal of making the output (more) class discriminative. This notebook will use the LRP library Innvestigate to attempt to implement CLRP

License

Notifications You must be signed in to change notification settings

jurgyy/CLRP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Implementing Contrastive Layer-wise Relevance Propagation with Innvestigate

Contrastive Layer-wise Relevance Propagation[1] or CLRP is a modification of standard Layer-wise Relevance Propagation[2] (LRP) with the goal of making the output (more) class discriminative. This notebook will use the LRP library Innvestigate[3] to attempt to implement CLRP.

A general overview of CLRP is as follows:

  1. Given an output neuron  $y_j$ which represent concept $O$ we try to construct a dual virtual concept $\overline O$ which represents the opposite concept of $O$.
  2. This concept $\overline O$ can be represented in two different ways:
    A. CLRP1: The concept is represented by the selected classes with weights $\overline W = \{W^1, W^2, ..., W^{L-1}, W^L_{-j}\}$. Here $W_{-j}$ means the weights connected to the output layer excluding the $j$-th neuron.
    B. CLRP2: The concept is represented by the selected classes with weights$\overline W = \{W^1, W^2, ..., W^{L-1}, W^L_{-j}\}$. Which means all the weights are the same, except for the last layer where the weights to neuron $j$ are negated.
  3. (?) The score $S_{y_j}$ of target class is uniformly redistributted to other classes.
  4. $R_{\text{LRP}} = f_{\text{LRP}}(X, W, S_{y_j})$
  5. Given the same input example $X$ LRP generates an explanation $R_{\text{dual}} = f_{\text{LRP}}(X, \overline W, S_{y_j})$ for the dual concept.
  6. Then CLRP is defined as follows: $R_{\text{CLRP}} = \max(0, R - R_{\text{dual}})$

Here are some results from the CLRP paper which shows a very clear class discrimitative property. These results are from using VGG16 pre-trained on imagenet and applying the $z^\beta$-rule in the first convolution layer and for all the other convulutional layers the $z^+$-rule. For more details read the paper.

results


[1] Gu, Jindong, Yinchong Yang, and Volker Tresp. "Understanding Individual Decisions of CNNs via Contrastive Backpropagation." Asian Conference on Computer Vision. Springer, Cham, 2018

[2] Bach, Sebastian, et al. "On pixel-wise explanations for non-linear classifier decisions by layer-wise relevance propagation." PloS one 10.7 (2015): e0130140.

[3] iNNvestigate neural networks! - github repository

About

Contrastive Layer-wise Relevance Propagation or CLRP is a modification of standard Layer-wise Relevance Propagation (LRP) with the goal of making the output (more) class discriminative. This notebook will use the LRP library Innvestigate to attempt to implement CLRP

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published