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:
- Given an output neuron which represent concept we try to construct a dual virtual concept which represents the opposite concept of .
- This concept can be represented in two different ways:
A. CLRP1: The concept is represented by the selected classes with weights . Here means the weights connected to the output layer excluding the neuron.
B. CLRP2: The concept is represented by the selected classes with weights. Which means all the weights are the same, except for the last layer where the weights to neuron$j$ are negated. - (?) The score of target class is uniformly redistributted to other classes.
- Given the same input example LRP generates an explanation for the dual concept.
- Then CLRP is defined as follows:
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 -rule in the first convolution layer and for all the other convulutional layers the -rule. For more details read the paper.
[3] iNNvestigate neural networks! - github repository