oeberle / BiLRP_explain_similarity

Code for the paper "Building and Interpreting Deep Similarity Models"
https://arxiv.org/abs/2003.05431
6 stars 3 forks source link

I have some confusion about the implementation of the algorithm #2

Open MDK-L opened 1 year ago

MDK-L commented 1 year ago

First of all, thank you very much for your wonderful insight about similarity. Then, I have some doubts about the implementation of the algorithm, actually, I am trying to explain my contrastive learning model with BiLRP, but I have some difficulties. 1) I don't quite understand the role of the project head, especially the random projection, wouldn't this introduce some noise so that the explanation may not faithfully represent the behavior of the model? 2) There are very many parameters in the algorithm, such as gamma, clip_func, what is their meaning? I am getting very small alpha values when visualizing my VGG model with BiLRP, I suspect a normalization problem, which I have not encountered when using tools like gradCAM. 3) I have a hard time finding open source GitHub repositories about applying LRP to Resnet and fully connected networks, any suggestions, please? Finally, thanks, and looking forward to your reply.

oeberle commented 1 year ago

Thanks for your questions!

Re 1.) The projection head is mainly there to reduce the dimensionality of the embeddings, so if the dimensionality of your embedding allows computing all LRP maps individually, the random projection head can be skipped. We use random projections because they do not introduce additional parameters to be trained and have favorable theoretical properties (guarantees on the quality of the approximation, preservation of pairwise distances, and their robustness to noise).

Re 2.) The BiLRP explanations maps only require setting the gamma parameter, I would advise using the default values. The other parameters (the clip function, poolsie, p-parameter, etc.) are only there for visualization of the pair-wise interactions. We describe their function in the supplement to our paper ( [Appendix D](https://csdl-downloads.ieeecomputer.org/trans/tp/2022/03/extras/ttp202203-09183996s1-supp1-3020738.pdf?Expires=1679449211&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jc2RsLWRvd25sb2Fkcy5pZWVlY29tcHV0ZXIub3JnL3RyYW5zL3RwLzIwMjIvMDMvZXh0cmFzL3R0cDIwMjIwMy0wOTE4Mzk5NnMxLXN1cHAxLTMwMjA3MzgucGRmIiwiQ29uZGl0aW9uIjp7IkRhdGVMZXNzVGhhbiI6eyJBV1M6RXBvY2hUaW1lIjoxNjc5NDQ5MjExfX19XX0&Signature=TT9DcD95tO4TCpDd1nkP8VU6uWhInXHriVmraPGpu4WOCkoKNpGS07ZuGF8g6OZaOuWL8fR5Et9H~sZZbTrHwfuPRygNwTjsB8y5QYzgJ2GY2Eg37ngw6BwlIFmufRPpDdc4lmucT8-6XSbpBl7DhTyJ-6O2YQ5wmgcVF7liKYnufJYxMsLrjsoVzbe1dy2ZS3SzRLtt5IehGaSQVPD76t5rIAbtox1GREX0TblHCR1lPyq6KtunkgsXtTxTAApldCZZed4-9nKqtbZ~QUzsRqfek3TDeJ9wpsldbmFZ3qF7EEuE9St6a0onzoUgxXcBx6fF6UqAyF~KJbzPUItN6g__&Key-Pair-Id=K12PMWTCQBDMDT) ).

Re 3.) You can check the XAI-toolbox Zennit, there you can find a tutorial on LRP for ResNet-18 .

MDK-L commented 1 year ago

Thank you very much for the Q&A. I believe all my questions have been solved!