/RISE

Detect model's attention

Primary LanguageJupyter NotebookMIT LicenseMIT

RISE

This repository contains source code necessary to reproduce some of the main results in the paper:

Vitali Petsiuk, Abir Das, Kate Saenko (BMVC, 2018)
RISE: Randomized Input Sampling for Explanation of Black-box Models

If you use this software in an academic article, please consider citing:

@inproceedings{Petsiuk2018rise,
  title = {RISE: Randomized Input Sampling for Explanation of Black-box Models},
  author = {Vitali Petsiuk and Abir Das and Kate Saenko},
  booktitle = {Proceedings of the British Machine Vision Conference (BMVC)},
  year = {2018}
}

For more information regarding the paper, please visit http://cs-people.bu.edu/vpetsiuk/rise/.

Method overview

To generate a saliency map for model's prediction, RISE queries black-box model on multiple randomly masked versions of input. After all the queries are done we average all the masks with respect to their scores to produce the final saliency map. The idea behind this is that whenever a mask preserves important parts of the image it gets higher score, and consequently has a higher weight in the sum.

Repository contents

  • The whole idea is implemented in Easy_start notebook, it's done in Keras but is really easy to modify for any framework, since the method itself is model-agnostic.
  • Saliency notebook demonstrates the usage of RISE class optimized for PyTorch.
  • Evaluation notebook displays another contribution of the paper: Causal metrics.

Examples