Coder Social home page Coder Social logo

icnn's Introduction

ICNN

This repository is a pytorch implementation of interpretable convolutional neural network (arXiv, IEEE T-PAMI).

It is created by Wen Shen, Ping Zhao, Qiming Li, Chao Li.

Notice

  • model

The project now supports three different vggs (vgg_vd_16, vgg_m, vgg_s), alexnet, resnet-18/50, and densenet-121.

You can add your own model in the /model folder and register the model in /tools/init_model.py.

  • dataset

The project now supports vocpart, ilsvrc animalpart, cub200, celeba, voc2010_crop, helen.

You can add your own dataset in the way similar to the datasets above.

Note that in our code, we will first make the data into imdb file, so if your dataset is large, the preprocessing time may be long, and the generated imdb file will be relatively large.

Requirement

The environment should have all packages in requirements.txt

$ pip install -r requirements.txt

You can see that we recommend pytorch=1.2.0, this is because we find some bugs when pytorch=1.4.0, but there is no such problem in pytorch 1.2.0. We will continue to study this problem.

Usage

Here, we take resnet-18 + voc2010_crop bird classification as an example.

To get the training results, we can run:

$ python demo.py --model resnet_18 --dataset voc2010_crop --label_name bird

After running the instructions above, you will get a new folder whose path is /resnet_18/voc2010_crop/bird in the /task/classification folder.

the new folder bird will contain a subfolder named 0 (correspond to your task_id) and three mat files (mean.mat, train.mat and val.mat). the 0 folder stores the model of every 10 epoches and log which contains train/val loss and train/val accuracy during network training.

You can use the trained model to calculate other metrics or to look at middle-level features.

Citation

If you use this project in your research, please cite it.

@inproceedings{zhang2018interpretable,
 title={Interpretable convolutional neural networks},
 author={Zhang, Quanshi and Wu, Nianying and Zhu, Song-Chun},
 booktitle={Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition},
 pages={8827--8836},
 year={2018}
}

icnn's People

Contributors

ada-shen avatar

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.