TL;DR
iNNvestigate is an open-source library that unifies a wide variety of neural network feature attribution and analysis methods under a clean, standardized Keras interface. By framing diverse techniques—ranging from classic saliency maps to Layer-wise Relevance Propagation (LRP) and PatternAttribution—as layer-wise backpropagation rules, it enables researchers to easily apply, compare, and quantitatively evaluate explainability methods on modern deep learning architectures.
What Problem Does This Paper Address?
Deep neural networks have achieved remarkable performance across vision, speech, and scientific discovery, but their internal decision-making remains notoriously opaque. While the machine learning community has proposed dozens of methods to analyze or "explain" network predictions (e.g., Saliency Maps, Integrated Gradients, Guided Backprop, LRP), researchers face significant friction when trying to use or evaluate them:
- No common interface: Implementations are scattered across isolated repositories, written in different frameworks, and utilize incompatible APIs.
- Missing reference implementations: Crucial methods like PatternNet and PatternAttribution lacked canonical open-source implementations.
- Difficulty in comparison: Because theoretical justification alone cannot establish which attribution method is best, systematic empirical and quantitative benchmarking is essential—yet previously required massive engineering effort.
Methods
The authors introduce iNNvestigate, an open-source library built on top of Keras (using the TensorFlow backend) providing:
- A Unified 3-Step API: Instantiating an analysis method is as simple as:
python analyzer = innvestigate.create_analyzer('analyzer_name', model) analyzer.fit(X_train) # If data-dependent (e.g., PatternNet) analysis = analyzer.analyze(X_test) - Modular Layer-Wise Computations: Rather than rewriting ad-hoc backpropagation passes, iNNvestigate breaks algorithms down into layer-wise forward and backward propagation routines over the computation graph, leveraging automatic differentiation.
- Analyzer Wrappers: Modifications can be layered hierarchically. For example, SmoothGrad is realized cleanly by combining a Gaussian noise wrapper over a standard gradient analyzer.
- Supported Methods: Gradient Saliency Maps, SmoothGrad, Integrated Gradients, Deconvnet, Guided Backprop, PatternNet, PatternAttribution, DeepTaylor, and multiple Layer-wise Relevance Propagation variants (LRP-Z, LRP-$\epsilon$, LRP-$\alpha\beta$, PresetA).
- Quantitative Evaluation: The library includes an implementation of perturbation analysis (also known as "PixelFlipping"), which objectively scores analyzers by measuring how quickly model confidence drops as the most "important" pixels identified by an analyzer are perturbed.
Datasets
- ImageNet (Deng et al., 2009): Used to demonstrate scalability by training data-dependent patterns for PatternNet and PatternAttribution, as well as to showcase qualitative attribution maps across multiple vision models (e.g., classifying images of baseballs).
- Evaluated Architectures: VGG16, InceptionV3, ResNet50, InceptionResNetV2, DenseNet, and NASNet.
- Note: No new datasets were introduced in this software paper.
Key Insights and Ideas
- Neutral Framing: The authors explicitly choose the word "analyzing" instead of "explaining" or "interpreting" to prevent anthropomorphic assumptions and separate algorithmic mechanics from human subjective interpretation.
- Shared Propagation Mechanics: Despite differing theoretical derivations (Taylor approximations, signal/noise decomposition, gradient integration), most attribution algorithms share the same structural pattern: backward propagation of a signal through the graph with modified rules at nonlinearities.
- Data-Conditioned Attribution at Scale: Methods like PatternNet and PatternAttribution rely on learning neuron signal and noise directions from training data. iNNvestigate demonstrates that these statistics can be computed efficiently on massive datasets without bespoke infrastructure.
Key Results
- Computational Scalability: Training data-dependent signal/noise directions for PatternNet and PatternAttribution over the large-scale ImageNet benchmark completes in less than one hour on a single GPU.
- Cross-Architecture Support: The library successfully executes attributions across complex modern vision backbones (VGG16, InceptionV3, ResNet50, DenseNet, NASNet).
- Architecture Caveats Highlighted: The qualitative side-by-side comparison reveals that not all methods generalize seamlessly out-of-the-box to advanced topological elements (such as arbitrary residual or multi-branch connections in NASNet or ResNet), leaving visible gaps where certain methods fail to support specific architectures.
Limitations and Future Work
- Framework Constraints: At publication, iNNvestigate was strictly limited to Keras with the TensorFlow backend (Python 2 and 3), excluding native PyTorch models.
- Architecture Incompatibilities: Certain specialized attribution rules (e.g., specific LRP presets or backpropagation modifications) do not natively support complex graph structures (such as NASNet branches) without custom adaptations.
- Extensibility: The authors positioned the codebase as a foundation for community contributions to integrate newly emerging interpretability and attribution methods over time.
Summary updated