CSAILVision / NetDissect-Lite

Light version of Network Dissection for Quantifying Interpretability of Networks
216 stars 50 forks source link

Network Dissection Lite in PyTorch

Introduction

This repository is a light version of NetDissect, which contains the demo code for the work Network Dissection: Quantifying Interpretability of Deep Visual Representations. This code is written in pytorch and python3.6, tested on Ubuntu 16.04. The processing speed is greatly improved compared to the original version: It only takes about 20 mins for netdissecting the Resnet18, and about 2 hours for DenseNet161, and no complex shell commands. Note that the dissection result will be slightly different to the original version due to the faster upsampling function used. Please install Pytorch in python36 and Torchvision first.

Download

Note that AlexNet models work with 227x227 image input, while VGG, ResNet, GoogLeNet works with 224x224 image input.

Run NetDissect in PyTorch

    python main.py

NetDissect Result

Reference

If you find the codes useful, please cite this paper

@inproceedings{netdissect2017,
  title={Network Dissection: Quantifying Interpretability of Deep Visual Representations},
  author={Bau, David and Zhou, Bolei and Khosla, Aditya and Oliva, Aude and Torralba, Antonio},
  booktitle={Computer Vision and Pattern Recognition},
  year={2017}
}