GithubHelp home page GithubHelp logo

interpretablecnn's Introduction

Interpretable Convolutional Neural Networks

The python code has been released at https://github.com/ada-shen/ICNN, although this code was not implemented by my research group.

The following Matlab code is the original code corresponding to the paper.

Introduction

This paper proposes a method to modify traditional convolutional neural networks (CNNs) into interpretable CNNs, in order to clarify knowledge representations in high conv-layers of CNNs. In an interpretable CNN, each filter in a high conv-layer represents a certain object part. We do not need any annotations of object parts or textures to supervise the learning process. Instead, the interpretable CNN automatically assigns each filter in a high conv-layer with an object part during the learning process. Our method can be applied to different types of CNNs with different structures. The clear knowledge representation in an interpretable CNN can help people understand the logics inside a CNN, i.e., based on which patterns the CNN makes the decision. Experiments showed that filters in an interpretable CNN were more semantically meaningful than those in traditional CNNs.

Citation

Please cite the following two papers, if you use this code.

  1. Quanshi Zhang, Ying Nian Wu, and Song-Chun Zhu, "Interpretable Convolutional Neural Networks" in CVPR 2018
  2. Quanshi Zhang, Xin Wang, Ying Nian Wu, Huilin Zhou, and Song-Chun Zhu, "Interpretable CNNs for Object Classification" in IEEE Transactions on Pattern Analysis and Machine Intelligence, 2020. DOI:10.1109/TPAMI.2020.2982882

Code

We released the code with slight technical extensions to the above paper for more robustness. For example, the code learned the parameter \beta instead of simply setting \beta=4.

We will release the code based on PyTorch and TensorFlow, later.

How to use

run demo.m

Note that please set in the window of the MATLAB following "HOME --> Preferences --> MATLAB --> General --> MAT-Files --> MATLAB Version 7.3 or later." Thus, the Matlab can save large MAT files.

Please see demo.m for detailed introduction of the code

interpretablecnn's People

Contributors

zqs1022 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

interpretablecnn's Issues

Missing files

I am trying to reproduce demo with cub-200-2011 dataset.

readAnnotation tries to open two files that are not part of dataset: image_class_labels.txt and train_test_split.txt

Could you please share the files or the code to create them?

Looking forward to your comments

More information on how to reproduce the results

Hi, Could you please give more information on how to run demo.m. I have never used matlab, so it would be great if you could give an example of the commands used to train and test.

And , is it possible to execute this project on Octave.

Thanks

Setup

Error using vl_compilenn>check_clpath (line 599)
Unable to find cl.exe

Already tried mingw and visual studio 2019, both with matlab 2021b and CUDA 11

Would you please share the system specs in the following terms?

Matlab version
Visual studio version
MatConvNet 1.0 beta24 (known from code)
Cuda version

Any useful hint for setup is welcome!

Best regards!

Technique mistake in the paper

Hi,

About computing p(x|T), the technique currently listed in the paper is wrong:

It's clear that you are trying to normalize all scores in a batch using softmax where score function is the sum over masked activations, i.e.,

image

however the trace operation is not correct, since it would end in

image

Please consider the modification - it might be a minor mistake however resulting in unnecessary confusion.

When will you release the code based on PyTorch and TensorFlow?

Hi, I've been reading your article recently and been very interested in your research. Your research is very prospective. I'd like to know more about it. The Python version of the code is better for me. Thank you. Please expose the code as soon as possible.

Flipping of masks in the batch and filter dimension

Hi,

I am currently trying to recreate the results in the paper. However, I am unclear on why the mask array is flipped along the batch and filter dimension using END : -1 : 1 in backpropagation. I would appreciate if you could elaborate a bit on why this is done :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.