• Stars
    star
    197
  • Rank 191,583 (Top 4 %)
  • Language
    Python
  • License
    Other
  • Created over 4 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Full-gradient saliency maps

Full-Gradient Saliency Maps

This is the reference implementation of the FullGrad saliency method described in our NeurIPS 2019 publication "Full-Gradient Representation for Neural Network Visualization".

This repository implements three methods:

  1. The reference FullGrad saliency method, which aggregates layerwise gradient maps multipled with the bias terms
  2. Simple FullGrad, which omits computation of bias parameters and simply aggregates layerwise gradient maps
  3. Smooth FullGrad, which aggregates noise averaged layerwise gradient maps with the bias terms

The related full-gradient decomposition is implemented within FullGrad. Note that while full-gradient decomposition applies to any ReLU neural network, FullGrad saliency is specific to CNNs.

In addition, the following methods from literature are also implemented:

  1. Input-gradient (paper)
  2. Grad-CAM (paper)
  3. SmoothGrad (paper)

Examples

FullGrad SimpleFullGrad SmoothFullGrad
FullGrad Simple FullGrad Smooth FullGrad
GradCAM Input-Gradient SmoothGrad
Grad-CAM Input-Gradients SmoothGrad

Usage

Simply run python dump_images.py, the saliency maps should be saved consequently in a results folder.

Interfaces

The FullGrad class has the following methods implemented.

from saliency.fullGrad import FullGrad

# Initialize FullGrad object
fullgrad = FullGrad(model)

# Check completeness property
# done automatically while initializing object
fullgrad.checkCompleteness()

# Obtain fullgradient decomposition
input_gradient, bias_gradients = 
fullgrad.fullGradientDecompose(input_image, target_class)

# Obtain saliency maps
saliency_map = fullgrad.saliency(input_image, target_class)

We also introduce variants called SimpleFullGrad and SmoothFullGrad which have no completeness property or decomposition.

from saliency.simple_fullgrad import SimpleFullGrad
from saliency.smooth_fullgrad import SmoothFullGrad

# Initialize Simple / Smooth FullGrad objects
simple_fullgrad = SimpleFullGrad(model)
smooth_fullgrad = SmoothFullGrad(model)

# Obtain saliency maps
saliency_map_simple = simple_fullgrad.saliency(input_image, target_class)
saliency_map_smooth = smooth_fullgrad.saliency(input_image, target_class)

This basic interface is retained for input-gradient, gradcam and smoothgrad methods as well.

Dependencies

torch torchvision cv2 numpy 

Research

If you found our work helpful for your research, please do consider citing us.

@inproceedings{srinivas2019fullgrad,
    title={Full-Gradient Representation for Neural Network Visualization},
    author={Srinivas, Suraj and Fleuret, François},
    booktitle={Advances in Neural Information Processing Systems (NeurIPS)},
    year={2019}
}

More Repositories

1

fast-transformers

Pytorch library for fast transformer implementations
Python
1,564
star
2

importance-sampling

Code for experiments regarding importance sampling for training neural networks
Python
315
star
3

bob

Bob is a free signal-processing and machine learning toolbox originally developed by the Biometrics group at Idiap Research Institute, in Switzerland.
266
star
4

ESLAM

Python
188
star
5

multicamera-calibration

Multi-Camera Calibration Suite
Python
178
star
6

GeoNeRF

Generalizing NeRF with Geometry Priors
Python
104
star
7

attention-sampling

This Python package enables the training and inference of deep learning models for very large data, such as megapixel images, using attention-sampling
Python
97
star
8

acoustic-simulator

Implementation of audio degradation processes
Python
95
star
9

mser

Linear time Maximally Stable Extremal Regions implementation
C++
95
star
10

kaldi-ivector

Extension to Kaldi implementing the standard i-vector hyperparameter estimation and i-vector extraction procedure
C++
88
star
11

mhan

Multilingual hierarchical attention networks toolkit
Python
78
star
12

pkwrap

A pytorch wrapper for LF-MMI training and parallel training in Kaldi
Python
72
star
13

HAN_NMT

Document-Level Neural Machine Translation with Hierarchical Attention Networks
JavaScript
67
star
14

gafro

An efficient c++ library targeting robotics applications using geometric algebra
C++
64
star
15

juicer

Juicer is a Weighted Finite State Transducer (WFST) based decoder for Automatic Speech Recognition (ASR).
C++
60
star
16

facereclib

Compare your face recognition algorithm to baseline algorithms
57
star
17

g2g-transformer

Pytorch implementation of “Recursive Non-Autoregressive Graph-to-Graph Transformer for Dependency Parsing with Iterative Refinement”
Python
57
star
18

model-uncertainty-for-adaptation

Code paper Uncertainty Reduction for Uncertainty Reduction for Model Adaptation in Semantic Segmentation at CVPR 2021
Python
47
star
19

eakmeans

Implementation of fast exact k-means algorithms
C++
45
star
20

ssp

Speech Signal Processing - a small collection of routines in Python to do signal processing
Python
44
star
21

atco2-corpus

A Corpus for Research on Robust Automatic Speech Recognition and Natural Language Understanding of Air Traffic Control Communications
Python
35
star
22

residual_pose

Residual Pose: A Decoupled Approach for Depth-based 3D Human Pose Estimation
Python
32
star
23

potr

Python
31
star
24

CNN_QbE_STD

Implementation of the work presented in "CNN based Query by Example Spoken Term Detection"
Python
31
star
25

w2v2-air-traffic

Python
29
star
26

nnsslm

Neural Network based Sound Source Localization Models
Python
27
star
27

psfestimation

Code for the PyTorch implementation of "Spatially-Variant CNN-based Point Spread Function Estimation for Blind Deconvolution and Depth Estimation in Optical Microscopy", IEEE Transactions on Image Processing, 2020.
Python
26
star
28

gile

A generalized input-label embedding for text classification
Python
24
star
29

IBDiarization

C++ Implementation of the Information Bottleneck System
C++
23
star
30

semiblindpsfdeconv

Code for "Semi-Blind Spatially-Variant Deconvolution in Optical Microscopy with Local Point Spread Function Estimation By Use Of Convolutional Neural Networks" ICIP 2018
Python
23
star
31

IdiapTTS

A Python-based modular toolbox for building Deep Neural Network models (using PyTorch) for statistical parametric speech synthesis
Python
22
star
32

HMMGradients.jl

Enables computing the gradient of the parameters of Hidden Markov Models (HMMs)
Julia
21
star
33

inv-tn

A bunch of scripts exploiting several tools to perform inverse text normalization (ITN)
Shell
21
star
34

deepfocus

Pytorch implementation of "DeepFocus: a Few-Shot Microscope Slide Auto-Focus using a Sample Invariant CNN-based Sharpness Function"
Python
19
star
35

zff_vad

Unsupervised Voice Activity Detection by Modeling Source and System Information using Zero Frequency Filtering
Python
18
star
36

contextual-biasing-on-gpus

Implementation of the contextual biasing for ASR decoding on GPUs without lattice generation. The code supports submission to Interspeech 2023.
C++
18
star
37

icassp-oov-recognition

Data and code related to the ICASSP submission "A comparison of methods for OOV-word recognition"
C++
17
star
38

multimodal_gaze_target_prediction

This repo provides the training and testing code for our paper "A Modular Multimodal Architecture for Gaze Target Prediction: Application to Privacy-Sensitive Settings" published at the GAZE workshop at CVPR 2022
Python
17
star
39

phonvoc

Phonetic and phonological vocoding platform
Shell
16
star
40

asrt

Various scripts that facilitate the preparation of Automatic Speech Recognition related resources
Python
16
star
41

fast_pose_machines

Efficient Pose Machine for Multi-Person Pose Estimation
Python
16
star
42

apam

APAM toolkit is built on PyTorch and provides recipes to adapt pretrained acoustic models with a variety of sequence discriminative training criterions.
Python
14
star
43

libssp

Speech Signal Processing - C++ port of a subset of the Python library SSP
C++
13
star
44

cbrec

Content-based Recommendation Generator
Python
13
star
45

wmil-sgd

Weighted multiple-instance learning algorithm based on stochastic gradient descent
Python
13
star
46

torgo_asr

A Kaldi recipe for training automatic speech recognition systems on the Torgo corpus of dysarthric speech
Shell
13
star
47

sparch

PyTorch based toolkit for developing spiking neural networks (SNNs) by training and testing them on speech command recognition tasks
Python
12
star
48

ttgo

A PyTorch implementation of TTGO algorithm and the applications presented in the paper "Tensor Train for Global Optimization Problems in Robotics"
Jupyter Notebook
12
star
49

iss

Scripts for speech processing
Shell
11
star
50

hypermixing

PyTorch implementation for HyperMixing, a linear-time token-mixing technique used in HyperMixer architecture
Python
11
star
51

DepthInSpace

A PyTorch-based program which estimates 3D depth maps from active structured-light sensor's multiple video frames
Python
10
star
52

rgbd

Python
10
star
53

tracter

Tracter is a data flow framework.
C++
10
star
54

drill

Deep residual output layers for neural language generation
Python
10
star
55

nvib_transformers

Python
9
star
56

bert-text-diarization-atc

Python
9
star
57

pddetection-reps-learning

Supervised Speech Representation Learning for Parkinson's Disease Classification
Python
9
star
58

zentas

Partitional data clustering around centers
C++
8
star
59

linear-transformer-experiments

Experiments using fast linear transformer
Python
8
star
60

emorec

Emotion-based Recommendation Generator
OpenEdge ABL
8
star
61

DocRec

Keyword extraction and document recommendation in conversations
MATLAB
8
star
62

depth_human_synthesis

DepthHuman: A tool for depth image synthesis for human pose estimation
Python
8
star
63

gafar

Geometry-aware Face Reconstruction
Python
8
star
64

nvib

Python
7
star
65

hallucination-detection

Python
7
star
66

cnn-for-voice-antispoofing

CNNs for voice antispoofing detection
MATLAB
7
star
67

wav2vec-lfmmi

Recipes from fine-tuning a pre-trained wav2vec 2.0 model using the espresso tool kit
Python
7
star
68

ilqr_planner

A C++ iLQR library that allows you to solve iLQR optimization problem on any robot as long as you provide an URDF file describing the kinematics chain of the robot
Jupyter Notebook
7
star
69

APT

A reference-based metric to evaluate the accuracy of pronoun translation (APT)
Python
6
star
70

sentence-planner

Python
6
star
71

iss-dicts

ISS scripts for handling pronunciation dictionaries
Python
6
star
72

cncsharedtask

Jupyter Notebook
6
star
73

slog

Similarity Learning on Graph (SLOG) matlab codes
MATLAB
6
star
74

vfoa

Methods to estimate the visual focus of attention
Python
5
star
75

buslr

BuSLR: Build System for Speech and Language Research
CMake
5
star
76

Node_weighted_GCN_for_depression_detection

Node-weighted Graph Convolutional Network for Depression Detection in Transcribed Clinical Interviews
HTML
5
star
77

abroad-re

Towards an end-to-end Relation Extraction system for the natural product literature: datasets, strategies and models
Jupyter Notebook
5
star
78

ML3

ML3 classifier (Multiclass Latent Locally Linear Support Vector Machines)
C++
5
star
79

ssl-caller-detection

Source code for the paper 'Can Self-Supervised Neural Representations Pre-Trained on Human Speech distinguish Animal Callers?' by E. Sarkar and M. Magimai Doss (2023).
Python
5
star
80

sense_aware_NMT

Sense-aware Neural Machine Translation
Python
5
star
81

ExVo-2022

Extracting pre-trained self-supervised embeddings for ICML ExVO 2022 challenge
Python
4
star
82

php-geremo

PHP Generic Registration Module [GPLv3]
PHP
4
star
83

idiap.github.com

Main page for idiap@github
CSS
4
star
84

TIDIGITSRecipe.jl

A Julia recipe for training an ASR system using the TIDIGITS database
Julia
4
star
85

hpca

C
4
star
86

bayesian-recurrence

A Bayesian Interpretation of Recurrence in Neural Networks
Python
4
star
87

rethinking-saliency

Reference implementation of the ICLR 2021 paper "Rethinking the Role of Gradient-Based Attribution Methods for Model Interpretability".
Python
4
star
88

DiscoConn-Classifier

Classifier models and feature extractors for discourse relations
Perl
4
star
89

pydhn

Python
4
star
90

unsupervised_gaze_calibration

Allows to calibrate a gaze estimator in an unsupervised fashion by automatically collecting calibration samples using task-related priors
Python
4
star
91

Attentive_Residual_Connections_NMT

Implementation and output data of "Global-Context Neural Machine Translation through Target-Side Attentive Residual Connections"
JavaScript
4
star
92

FiniteStateTransducers.jl

Play with Weighted Finite State Transducers (WFST) in the Julia language.
Julia
3
star
93

iss-wsj

ISS scripts for the Wall Street Journal task
Shell
3
star
94

archs

Pytorch network architectures for audio perception
Python
3
star
95

dhgen

A Python module for generating District Heating Networks layouts
Python
3
star
96

tinyurdfparser

A lightweight URDF parser library, based on TinyXML2, that converts an [URDF file] into a KDL object
C++
3
star
97

flowestimation

PyTorch implementation of "Estimating Nonplanar Flow from 2D Motion-blurred Widefield Microscopy Images via Deep Learning", submitted to IEEE ISBI, 2021
Python
3
star
98

apkit

Audio processing toolkit
Python
3
star
99

trimed

The trimed algorithm for obtaining the medoid of a set
C++
3
star
100

simple-imager

Linux Imaging and Deployment Made Easy
Shell
3
star