Skip to content

MaxHolmberg96/GradCAM

Repository files navigation

GradCAM

Reimplementation of https://arxiv.org/pdf/1610.02391.pdf in Tensorflow 2.1.

Authors

  • Max Holmberg
  • Joel Lidin

Data for sentiment classification

The datasets and word2vec files for the sentiment classification can be found here:

Put the files in a folder called dataset-text with the following structure:

  • dataset-text/train.tsv
  • dataset-text/test.tsv
  • dataset-text/glove.6B.200d.txt

Run Grad-CAM for Images

python run.py --path image_path --output output_path

Run Grad-CAM for binary sentiment classification

python run.py --text --output output_path --weights sentiment_cnn_weights/cp.ckpt --sentence "I love this movie"

Results

Grad-CAM for Image classification

Original Heatmap overlay (predicted: Mountains)
Original Heatmap overlay (predicted: Egyptian cat)
Original Heatmap overlay (predicted: Curly coated retriever)

Grad-CAM for sentiment classification (predicted: positive)

Releases

No releases published

Packages

No packages published

Languages