Skip to content

ChiyanFire/CAM

Repository files navigation

Sample code for the Class Activation Mapping

We propose a simple technique to espose the implicit attention of Convolutional Neural Networks on the image. It highlights the most informative image regions relevant to the predicted class. You could get attention-based model instantly by tweaking your own CNN a little bit more. The paper is published at CVPR'16.

The framework of the Class Activation Mapping is as below: Framework

Some predicted class activation maps: Results

Usage Instructions:

  1. Install caffe, compile the matcaffe (matlab wrapper for caffe), and make sure you could run the prediction example code classification.m.
  2. In matlab, run demo.m.

The demo video of what the CNN is looking is here. The reimplementation in tensorflow is here.

Reference:

B. Zhou, A. Khosla, A. Lapedriza, A. Oliva, and A. Torralba
Learning Deep Features for Discriminative Localization.
Computer Vision and Pattern Recognition (CVPR), 2016

Contact Bolei Zhou if you have questions.

Releases

No releases published

Packages

No packages published

Languages

  • MATLAB 71.4%
  • C++ 17.2%
  • C 6.4%
  • Python 4.5%
  • Other 0.5%