All Projects → ramprs → neuron-importance-zsl

ramprs / neuron-importance-zsl

Licence: other
[ECCV 2018] code for Choose Your Neuron: Incorporating Domain Knowledge Through Neuron Importance

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to neuron-importance-zsl

Pytorch Grad Cam
Many Class Activation Map methods implemented in Pytorch for CNNs and Vision Transformers. Including Grad-CAM, Grad-CAM++, Score-CAM, Ablation-CAM and XGrad-CAM
Stars: ✭ 3,814 (+6710.71%)
Mutual labels:  grad-cam, interpretability
Awesome-Weak-Shot-Learning
A curated list of papers, code and resources pertaining to weak-shot classification, detection, and segmentation.
Stars: ✭ 142 (+153.57%)
Mutual labels:  zero-shot-learning
partial dependence
Python package to visualize and cluster partial dependence.
Stars: ✭ 23 (-58.93%)
Mutual labels:  interpretability
ProtoTree
ProtoTrees: Neural Prototype Trees for Interpretable Fine-grained Image Recognition, published at CVPR2021
Stars: ✭ 47 (-16.07%)
Mutual labels:  interpretability
zero shot learning
A Visual-semantic embedding model using word2vec and CNNs
Stars: ✭ 13 (-76.79%)
Mutual labels:  zero-shot-learning
zennit
Zennit is a high-level framework in Python using PyTorch for explaining/exploring neural networks using attribution methods like LRP.
Stars: ✭ 57 (+1.79%)
Mutual labels:  interpretability
tfvaegan
[ECCV 2020] Official Pytorch implementation for "Latent Embedding Feedback and Discriminative Features for Zero-Shot Classification". SOTA results for ZSL and GZSL
Stars: ✭ 107 (+91.07%)
Mutual labels:  zero-shot-learning
FREE
Codes for the ICCV'21 paper "FREE: Feature Refinement for Generalized Zero-Shot Learning"
Stars: ✭ 28 (-50%)
Mutual labels:  zero-shot-learning
deep-eos
General-Purpose Neural Networks for Sentence Boundary Detection
Stars: ✭ 66 (+17.86%)
Mutual labels:  zero-shot-learning
synse-zsl
Official PyTorch code for the ICIP 2021 paper 'Syntactically Guided Generative Embeddings For Zero Shot Skeleton Action Recognition'
Stars: ✭ 14 (-75%)
Mutual labels:  zero-shot-learning
Zero-Shot-Learning
零样本学习
Stars: ✭ 20 (-64.29%)
Mutual labels:  zero-shot-learning
deep-explanation-penalization
Code for using CDEP from the paper "Interpretations are useful: penalizing explanations to align neural networks with prior knowledge" https://arxiv.org/abs/1909.13584
Stars: ✭ 110 (+96.43%)
Mutual labels:  interpretability
Feature-Generating-Networks
Zero Shot Learning with Feature Generating Networks
Stars: ✭ 31 (-44.64%)
Mutual labels:  zero-shot-learning
gzsl-od
Out-of-Distribution Detection for Generalized Zero-Shot Action Recognition
Stars: ✭ 47 (-16.07%)
Mutual labels:  zero-shot-learning
yggdrasil-decision-forests
A collection of state-of-the-art algorithms for the training, serving and interpretation of Decision Forest models.
Stars: ✭ 156 (+178.57%)
Mutual labels:  interpretability
free-lunch-saliency
Code for "Free-Lunch Saliency via Attention in Atari Agents"
Stars: ✭ 15 (-73.21%)
Mutual labels:  interpretability
Natural-language-understanding-papers
NLU: domain-intent-slot; text2SQL
Stars: ✭ 77 (+37.5%)
Mutual labels:  zero-shot-learning
InterpretDL
InterpretDL: Interpretation of Deep Learning Models,基于『飞桨』的模型可解释性算法库。
Stars: ✭ 121 (+116.07%)
Mutual labels:  grad-cam
summit
🏔️ Summit: Scaling Deep Learning Interpretability by Visualizing Activation and Attribution Summarizations
Stars: ✭ 95 (+69.64%)
Mutual labels:  interpretability
sage
For calculating global feature importance using Shapley values.
Stars: ✭ 129 (+130.36%)
Mutual labels:  interpretability

NIWT: Neuron-Importance aware Weight Transfer

Code for the ECCV'18 paper

[Choose-Your-Neuron: Incorporating Domain Knowledge into Deep Networks through Neuron-Importance]
Ramprasaath R. Selvaraju, Prithvijit Chattopadhyay, Mohammed Elhoseiny, Tilak Sharma, Dhruv Batra, Devi Parikh, Stefan Lee

Overview

Usage

This codebase assumes that you have installed Tensorflow. If not, please follow installation instructions from here.
Download data and pretrained checkpoints using sh download.sh and make sure the paths in the arg_config json files are correct. You may also need to create an imagenet_files.pkl which contains a list of (atleast) 3000 randomly sampled imagenet image paths.

Train a Generalized Zero Shot Learning model on AWA2 and CUB (class-level attributes)

python alpha2w.py --config_json arg_configs/vgg16_config_AWA.json
python alpha2w.py --config_json arg_configs/resnet_config_AWA.json
python alpha2w.py --config_json arg_configs/vgg16_config_CUB.json
python alpha2w.py --config_json arg_configs/resnet_config_CUB.json

Train a Generalized Zero Shot Learning model on CUB with captions (class-level)

python alpha2w.py --config_json arg_configs/vgg16_config_CUB_captions.json
python alpha2w.py --config_json arg_configs/resnet_config_CUB_captions.json

Train a GZSL classifier from scratch

Pretrain base model on dataset

To do this, we first finetune the base model (vgg16 or resnet_v1) on a seen class images.

cd seen_pretraining/
sh cnn_finetune.sh 

Extract Neuron Importances (alphas)

Change the ckpt_path from the config_json files to the trained checkpoint (obtained from above) Extract Neuron-Importances (alphas) from the finetuned model.

sh alpha_extraction.sh

Domain knowledge to Neuron Importance:

Here we learn a transformation from domain knowledge (say attributes) to network neuron importances (alphas)

cd ..
python mod2alpha.py --config_json arg_configs/vgg16_config_AWA.json
python mod2alpha.py --config_json arg_configs/resnet_config_AWA.json
python mod2alpha.py --config_json arg_configs/vgg16_config_CUB.json
python mod2alpha.py --config_json arg_configs/resnet_config_CUB.json

Neuron Importance of unseen classes to classifier weights of unseen classes (training a GZSL model)

python alpha2w.py --config_json arg_configs/vgg16_config_AWA.json
python alpha2w.py --config_json arg_configs/resnet_config_AWA.json
python alpha2w.py --config_json arg_configs/vgg16_config_CUB.json
python alpha2w.py --config_json arg_configs/resnet_config_CUB.json
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].