https://github.com/compvis/invariances

Making Sense of CNNs: Interpreting Deep Representations & Their Invariances with Invertible Neural Networks

https://github.com/compvis/invariances

Science Score: 10.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.7%) to scientific vocabulary
Last synced: 10 months ago · JSON representation

Repository

Making Sense of CNNs: Interpreting Deep Representations & Their Invariances with Invertible Neural Networks

Basic Info
Statistics
  • Stars: 58
  • Watchers: 5
  • Forks: 6
  • Open Issues: 0
  • Releases: 0
Created almost 6 years ago · Last pushed over 5 years ago
Metadata Files
Readme License

README.md

Making Sense of CNNs: Interpreting Deep Representations & Their Invariances with Invertible Neural Networks

PyTorch code accompanying the ECCV 2020 paper

Making Sense of CNNs: Interpreting Deep Representations & Their Invariances with Invertible Neural Networks
Robin Rombach*, Patrick Esser*, Björn Ommer
* equal contribution

teaser
arXiv | BibTeX | Project Page

Table of Contents

Requirements

A suitable conda environment named invariances can be created and activated with:

conda env create -f environment.yaml conda activate invariances

Optionally, you can then also conda install tensorflow-gpu=1.14 to speed up FID evaluations.

Demos

teaser

To get started you can directly dive into some demos. After installing the requirements as described above, simply run

streamlit run invariances/demo.py

Please note that checkpoints will be downloaded on demand, which can take a while. You can see the download progress displayed in the terminal running the streamlit command.

We provide demonstrations on

  • visualization of adversarial attacks
  • visualization of network representations and their invariances
  • revealing the texture bias of ImageNet-CNNs
  • visualizing invariances from a video (resulting in image to video translation)
  • image mixing via their network representations

Note that all of the provided demos can be run without a dataset, and you can add your own images into data/custom.

Training

Data

If not present on your disk, all required datasets (ImageNet, AnimalFaces and ImageNetAnimals) will be downloaded and prepared automatically. The data processing and loading rely on the autoencoders package and are described in more detail here.

Note: If you already have one or more of the datasets present, follow the instructions linked above to avoid downloading them again.

Invariances of Classifiers

ResNet

To recover invariances of an ResNet classifier trained on the AnimalFaces dataset, run

edflow -b configs/resnet/animalfaces/base.yaml configs/resnet/animalfaces/train/<layer>.yaml -t

where <layer> is one of input, maxpool, layer1, layer2, layer3, layer4, avgpool, fc, softmax. To enable logging to wandb, adjust configs/project.yaml and add it to above command:

edflow -b configs/resnet/animalfaces/base.yaml configs/resnet/animalfaces/train/<layer>.yaml configs/project.yaml -t

AlexNet

To reproduce the training procedure from the paper, run

edflow -b configs/alexnet/base_train.yaml configs/alexnet/train/<layer>.yaml -t

where <layer> is one of conv5, fc6, fc7, fc8, softmax. To enable logging to wandb, adjust configs/project.yaml and add it to above command:

edflow -b configs/alexnet/base_train.yaml configs/alexnet/train/<layer>.yaml configs/project.yaml -t

Evaluation

Evaluations run automatically after each epoch of training. To start an evaluation manually, run

edflow -p logs/<log_folder>/configs/<config>.yaml

and, optionally, add -c <path to checkpoint> to evaluate a specific checkpoint instead of the last one.

Pretrained Models

Pretrained models (e.g. autoencoders and classifiers) will be downloaded automatically on their first use in a demo, training or evaluation script.

BibTeX

@inproceedings{rombach2020invariances, title={Making Sense of CNNs: Interpreting Deep Representations \& Their Invariances with INNs}, author={Rombach, Robin and Esser, Patrick and Ommer, Bj{\"o}rn}, booktitle={Proceedings of the European Conference on Computer Vision}, year={2020} }

Owner

  • Name: CompVis - Computer Vision and Learning LMU Munich
  • Login: CompVis
  • Kind: organization
  • Email: assist.mvl@lrz.uni-muenchen.de
  • Location: Germany

Computer Vision and Learning research group at Ludwig Maximilian University of Munich (formerly Computer Vision Group at Heidelberg University)

GitHub Events

Total
  • Watch event: 4
Last Year
  • Watch event: 4

Issues and Pull Requests

Last synced: over 1 year ago

All Time
  • Total issues: 0
  • Total pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Total issue authors: 0
  • Total pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels

Dependencies

environment.yaml pypi
  • albumentations ==0.4.3
  • imageio ==2.9.0
  • imageio-ffmpeg ==0.4.2
  • opencv-python ==4.1.2.30
  • pudb ==2019.2
setup.py pypi
  • numpy *
  • requests *
  • torch *
  • tqdm *