hila-chefer / Transformer-Explainability

[CVPR 2021] Official PyTorch implementation for Transformer Interpretability Beyond Attention Visualization, a novel method to visualize classifications by Transformer based networks.
MIT License
1.75k stars 232 forks source link

Question about perturbation results #31

Closed scott870430 closed 2 years ago

scott870430 commented 2 years ago

Hi @hila-chefer! I have a question about perturbation results, following your README.md, I try to reproduce the perturbation results. Is the average of np.mean(num_correct_pertub, axis=1) AUC? There is no false negative in this experiment, so the y-axis is the classification accuracy, and the x-axis is the different cover rate (0.1~0.9)? I got a little different result on the rollout method for 55.2 (53.1 in paper), and GradCAM for 41.8 (41.52 in paper) with --vis-class = top. Are my reproduced results and understanding correct?

Thank you in advance for your help.

hila-chefer commented 2 years ago

Hi @scott870430, thanks for your interest in our work!

We calculated the AUC using np.trapz(y, x) * 100 Which is not equivalent to the average. Also, we accounted for the original accuracy as well, i.e. for x=0 we used the accuracy of the network. This is my full table of results for rollout for example (negative perturbation, top class): D474F101-5AC8-4AB6-8426-1086D3A1D03D

I hope this helps. Best, Hila.

scott870430 commented 2 years ago

Thank you for the response!