Skip to main content

XAI: Sanity Checks for Saliency Maps

-By Julius Adebayo, Justin Gilmer, Michael Muelly, Ian Goodfellow, Moritz Hardt, Been Kim Google Brain 
University of California Berkeley



This blog post is the fourth part of the Explainable Artificial Intelligence (XAI) series. Refer previous posts link. The post discusses on Salience Mapping techniques, performance, and metrics.


Salience Mapping

source: Analytics India Magazine

The salience map approach is exemplified by occlusion procedure by Zeiler, where a network is repeatedly tested with portions of the input occluded to create a map showing which parts of the data actually have an influence on the network output.

Abstract
Saliency methods have emerged as a popular tool to highlight features in an input deemed relevant for the prediction of a learned model. Several saliency methods have been proposed, often guided by visual appeal on image data. This paper proposes an actionable methodology to evaluate what kinds of explanations a given method can and cannot provide. they found that reliance, solely, on visual assessment can be misleading. Through extensive experiments show some existing saliency methods are independent both of the model and of the data generating process. Consequently, methods that fail the proposed tests are inadequate for tasks that are sensitive to either data or model, such as, finding outliers in the data, explaining the relationship between inputs and outputs that the model learned, or debugging the model. They interpret findings through an analogy with edge detection in images, a technique that requires neither training data nor model. Theory in the case of a linear model and a single-layer convolutional neural network supports our experimental findings.


 Methods


In the formal setup, an input is a vector x R d . A model describes a function S : R d → R C , where C is the number of classes in the classification problem. An explanation method provides an explanation map E : R d → R d that maps inputs to objects of the same shape. 

Paper briefly describe some of the explanation methods that were examined. The supplementary materials contain an in-depth overview of these methods (Ref paper). The goal is not to exhaustively evaluate all prior explanation methods, but rather to highlight how our methods apply to several cases of interest. 

The gradient explanation for an input x is Egrad(x) = ∂S ∂x . The gradient quantifies how much a change in each input dimension would a change the predictions S(x) in a small neighborhood around the input. 

Gradient Input. 

Another form of explanation is the element-wise product of the input and the gradient, denoted x    ∂S ∂x , which can address “gradient saturation”, and reduce visual diffusion. 

Integrated Gradients (IG) 

IG also addresses gradient saturation by summing over scaled versions of the input. IG for an input x is defined as EIG(x) = (x − x¯) × R 1 0 ∂S(¯x+α(x−x¯) ∂x dα, where x¯ is a “baseline input” that represents the absence of a feature in the original input x. 

Guided Backpropagation (GBP) 

GBP builds on the “DeConvNet” explanation method and corresponds to the gradient explanation where negative gradient entries are set to zero while backpropagating through a ReLU unit. 

Guided GradCAM. 

Introduced by Selvaraju et al. , GradCAM explanations correspond to the gradient of the class score (logit) with respect to the feature map of the last convolutional unit of a DNN. For pixel level granularity GradCAM can be combined with Guided Backpropagation through an element-wise product. 

SmoothGrad (SG) 

SG seeks to alleviate noise and visual diffusion for saliency maps by averaging over explanations of noisy copies of an input. For a given explanation map E, SmoothGrad is defined as Esg(x) = 1 N PN i=1 E(x+gi), where noise vectors gi N (0, σ2 )) are drawn i.i.d. from a normal distribution.



Model Randomization Test

For the model randomization test, we randomize the weights of a model starting from the top layer, successively, all the way to the bottom layer. This procedure destroys the learned weights from the top layers to the bottom ones. We compare the resulting explanation from a network with random weights to the one obtained with the model’s original weights. Below we show the evolution of saliency masks from different methods for a demo image from the ImageNet dataset and the Inception v3 model.


Figure: Cascading randomization on Inception v3 (ImageNet). The figure shows the original explanations (first column) for the Junco bird. Progression from left to right indicates complete randomization of network weights (and other trainable variables) up to that ‘block’ inclusive. We show images for 17 blocks of randomization. Coordinate (Gradient, mixed_7b) shows the gradient explanation for the network in which the top layers starting from Logits up to mixed_7b have been reinitialized. The last column corresponds to a network with completely reinitialized weights.

Data Randomization Test

In our data randomization test, we permute the training labels and train a model on the randomized training data. A model achieving high training accuracy on the randomized training data is forced to memorize the randomized labels without being able to exploit the original structure in the data. We now compare saliency masks for a model trained on random labels and one trained true labels. We present examples below on MNIST and Fashion MNIST.


Figure: Explanation for a true model vs. model trained on random labels. Top Left: Absolute value visualization of masks for digit 0 from the MNIST test set for a CNN. Top Right: Saliency masks for digit 0 from the MNIST test set for a CNN shown in diverging color. Bottom Left: Spearman rank correlation (with absolute values) bar graph for saliency methods. We compare the similarity of explanations derived from a model trained on random labels, and one trained on real labels. Bottom Right: Spearman rank correlation (without absolute values) bar graph for saliency methods for MLP. See appendix for corresponding figures for CNN, and MLP on Fashion MNIST


Conclusion


The goal of the experimental method is to give researchers guidance in assessing the scope of model explanation methods. Authors envision these methods to serve as sanity checks in the design of new model explanations. The results show that visual inspection of explanations alone can favor methods that may provide compelling pictures, but lack sensitivity to the model and the data generating process. Invariances in explanation methods give a concrete way to rule out the adequacy of the method for certain tasks. 

Comments

Popular posts from this blog

ABOD and its PyOD python module

Angle based detection By  Hans-Peter Kriegel, Matthias Schubert, Arthur Zimek  Ludwig-Maximilians-Universität München  Oettingenstr. 67, 80538 München, Germany Ref Link PyOD By  Yue Zhao   Zain Nasrullah   Department of Computer Science, University of Toronto, Toronto, ON M5S 2E4, Canada  Zheng Li jk  Northeastern University Toronto, Toronto, ON M5X 1E2, Canada I am combining two papers to summarize Anomaly detection. First one is Angle Based Outlier Detection (ABOD) and other one is python module that  uses ABOD along with over 20 other apis (PyOD) . This is third part in the series of Anomaly detection. First article exhibits survey that covered length and breadth of subject, Second article highlighted on data preparation and pre-processing.  Angle Based Outlier Detection. Angles are more stable than distances in high dimensional spaces for example the popularity of cosine-based sim...

Ownership at Large

 Open Problems and Challenges in Ownership Management -By John Ahlgren, Maria Eugenia Berezin, Kinga Bojarczuk, Elena Dulskyte, Inna Dvortsova, Johann George, Natalija Gucevska, Mark Harman, Shan He, Ralf Lämmel, Erik Meijer, Silvia Sapora, and Justin Spahr-Summers Facebook Inc.  Software-intensive organizations rely on large numbers of software assets of different types, e.g., source-code files, tables in the data warehouse, and software configurations. Who is the most suitable owner of a given asset changes over time, e.g., due to reorganization and individual function changes. New forms of automation can help suggest more suitable owners for any given asset at a given point in time. By such efforts on ownership health, accountability of ownership is increased. The problem of finding the most suitable owners for an asset is essentially a program comprehension problem: how do we automatically determine who would be best placed to understand, maintain, ev...

Hybrid Approach to Automation, RPA and Machine Learning

- By Wiesław Kopec´, Kinga Skorupska, Piotr Gago, Krzysztof Marasek  Polish-Japanese Academy of Information Technology Paper Link Courtesy DZone   Abstract One of the more prominent trends within Industry 4.0 is the drive to employ Robotic Process Automation (RPA), especially as one of the elements of the Lean approach.     The full implementation of RPA is riddled with challenges relating both to the reality of everyday business operations, from SMEs to SSCs and beyond, and the social effects of the changing job market. To successfully address these points there is a need to develop a solution that would adjust to the existing business operations and at the same time lower the negative social impact of the automation process. To achieve these goals we propose a hybrid, human-centred approach to the development of software robots. This design and  implementation method combines the Living Lab approach with empowerment through part...