Skip to main content

Ablation Path Saliency

  • Conference paper
  • First Online:
Explainable Artificial Intelligence (xAI 2023)

Abstract

Various types of saliency methods have been proposed for explaining black-box classification. In image applications, this means highlighting the part of the image that is most relevant for the current decision.

Unfortunately, the different methods may disagree and it can be hard to quantify how representative and faithful the explanation really is. We observe however that several of these methods can be seen as edge cases of a single, more general procedure based on finding a particular path through the classifier’s domain. This offers additional geometric interpretation to the existing methods.

We demonstrate furthermore that ablation paths can be directly used as a technique of its own right. This is able to compete with literature methods on existing benchmarks, while giving more fine-grained information and better opportunities for validation of the explanations’ faithfulness.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 79.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 99.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    For instance in the theory of distributions.

  2. 2.

    The exact definitions of \(\varPi _\text {sat}\) and \(\varPi _\text {pinch}\) are largely arbitrary, what matters are their attractive fixpoints; see Fig. 2

  3. 3.

    This still requires also dedicated mask regularity, as otherwise the adversarial contributions overwhelm and the result appears as mere noise.

  4. 4.

    The pointing game is generally used under the assumption that neither the classifier nor the saliency method have any direct training knowledge about the position annotations, i.e. it is not a test of how well a trained task generalizes but of an extrinsic notion of saliency.

  5. 5.

    By “first 1000” we mean the 1000 images with the lowest ids. Note that the VOC and COCO sets are in random order, so that this should be a reasonably representative and reproducible selection. Comparing the score of Grad-CAM to the one on the full datasets confirms this.

    The astute reader may notice that on the other hand, with only the first 100 images the results are systematically worse. This is less due to these images being more difficult, than artifact of the way the TorchRay benchmark gathers the results: specifically, it counts success rate for each class separately and averages in the end, but rates classes that are not even present in the smaller subset as 0% success.

  6. 6.

    The authors in [5] emphasize that their method avoids hyperparameters, yet their examples rely on no fewer than 5 hard-coded number constants.

  7. 7.

    This can be interpreted as applying prior knowledge of the location of objects in the dataset. However, there are also examples of objects close to the boundary. The window post-processing prevents these from being properly localised, which is why the top pointing-game score is still lower.

  8. 8.

    It is easy to come up with other algorithms for monotonising a (discretised) function. One could simply sort the array, but that is not optimal with respect to any of the usual function norms; or clip the derivatives to be nonnegative and then rescale the entire function, but that is not robust against noise perturbations.

  9. 9.

    Note that the optimum is not necessarily unique.

References

  1. Adebayo, J., Gilmer, J., Muelly, M., Goodfellow, I., Hardt, M., Kim, B.: Sanity checks for saliency maps. In: Bengio, S., Wallach, H., Larochelle, H., Grauman, K., Cesa-Bianchi, N., Garnett, R. (eds.) Advances in Neural Information Processing Systems, vol. 31, pp. 9505–9515. Curran Associates, Inc. (2018). https://papers.nips.cc/paper/8160-sanity-checks-for-saliency-maps.pdf

  2. Ancona, M., Ceolini, E., Öztireli, C., Gross, M.: Towards better understanding of gradient-based attribution methods for deep neural networks. CoRR (2017)

    Google Scholar 

  3. Chockler, H., Kroening, D., Sun, Y.: Explanations for occluded images. In: Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV), pp. 1234–1243 (2021)

    Google Scholar 

  4. Dabkowski, P., Gal, Y.: Real time image saliency for black box classifiers. In: Guyon, I., et al. (eds.) Advances in Neural Information Processing Systems, vol. 30. Curran Associates, Inc. (2017). https://proceedings.neurips.cc/paper/2017/file/0060ef47b12160b9198302ebdb144dcf-Paper.pdf

  5. Fong, R., Patrick, M., Vedaldi, A.: Understanding deep networks via extremal perturbations and smooth masks, pp. 2950–2958 (2019)

    Google Scholar 

  6. Fong, R.C., Vedaldi, A.: Interpretable explanations of black boxes by meaningful perturbation (2017)

    Google Scholar 

  7. Kindermans, P.-J., et al.: The (un)reliability of saliency methods. In: Samek, W., Montavon, G., Vedaldi, A., Hansen, L.K., Müller, K.-R. (eds.) Explainable AI: Interpreting, Explaining and Visualizing Deep Learning. LNCS (LNAI), vol. 11700, pp. 267–280. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-28954-6_14

    Chapter  Google Scholar 

  8. Koh, P.W., Liang, P.: Understanding black-box predictions via influence functions. 70, 1885–1894 (2017). https://proceedings.mlr.press/v70/koh17a.html

  9. Petsiuk, V., Das, A., Saenko, K.: Rise: randomized input sampling for explanation of black-box models. CoRR (2018)

    Google Scholar 

  10. Rudin, C.: Stop explaining black box machine learning models for high stakes decisions and use interpretable models instead. Nat. Mach. Intell. 1(5), 206–215 (2019). https://doi.org/10.1038/s42256-019-0048-x

    Article  Google Scholar 

  11. Sagemüller, J.: Pytorch implementation of the ablation path saliency method (2023). https://github.com/leftaroundabout/ablation-paths-pytorch

  12. Selvaraju, R.R., Cogswell, M., Das, A., Vedantam, R., Parikh, D., Batra, D.: Grad-CAM: visual explanations from deep networks via gradient-based localization (2017)

    Google Scholar 

  13. Simonyan, K., Vedaldi, A., Zisserman, A.: Deep inside convolutional networks: visualising image classification models and saliency maps. CoRR (2013)

    Google Scholar 

  14. Sturmfels, P., Lundberg, S., Lee, S.I.: Visualizing the impact of feature attribution baselines. Distill (2020). https://doi.org/10.23915/distill.00022. https://distill.pub/2020/attribution-baselines

  15. Sundararajan, M., Taly, A., Yan, Q.: Axiomatic attribution for deep networks. 70, 3319–3328 (2017). https://proceedings.mlr.press/v70/sundararajan17a.html

  16. Szegedy, C., et al.: Intriguing properties of neural networks (2014)

    Google Scholar 

  17. Vedaldi, A.: Understanding deep networks via extremal perturbations and smooth masks (2019). https://github.com/facebookresearch/TorchRay

  18. Weller, A.: Transparency: motivations and challenges. In: Samek, W., Montavon, G., Vedaldi, A., Hansen, L.K., Müller, K.-R. (eds.) Explainable AI: Interpreting, Explaining and Visualizing Deep Learning. LNCS (LNAI), vol. 11700, pp. 23–40. Springer, Cham (2019). https://doi.org/10.1007/978-3-030-28954-6_2

    Chapter  Google Scholar 

  19. Zhang, J., Bargal, S.A., Lin, Z., Brandt, J., Shen, X., Sclaroff, S.: Top-down neural attention by excitation backprop. Int. J. Comput. Vis. 126(10), 1084–1102 (2017). https://doi.org/10.1007/s11263-017-1059-x

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Justus Sagemüller .

Editor information

Editors and Affiliations

Appendices

Appendix A Canonical Time Reparametrisation

The function \(m :[0,1] \rightarrow \mathbb {R}\) defined by \(m(t) {:}{=}\int _{\varOmega } \varphi (t)\) is increasing and goes from zero to one (since we assume that \(\int _{\varOmega } 1 = 1\)).

Note first that if \(m(t_1) = m(t_2)\), then \(\varphi (t_1) = \varphi (t_2)\) from the monotonicity property. Indeed, supposing for instance that \(t_1 \le t_2\), and defining the element \(\theta {:}{=}\varphi (t_2) - \varphi (t_1) \) we see that on the one hand \(\int _{\varOmega } \theta = 0\), on the other hand, \(\theta \ge 0\), so \(\theta = 0\) and thus \(\varphi (t_1) = \varphi (t_2)\).

Now, define . Pick \(s \in [0,1]\).

If \(s \in \textsf{M}\) we define \(\psi (s) {:}{=}\varphi (t)\) where \(m(t) = s\) (and this does not depend on which \(t\) fulfills \(m(t) = s\) from what we said above). We remark that \(\int _{\varOmega }\psi (s) = \int _{\varOmega }\varphi (t) = m(t) = s\).

Now suppose that \(s \not \in \textsf{M}\). Define \(s_1 {:}{=}\sup (\textsf{M}\cap [0,s])\) and \(s_2 {:}{=}\inf (\textsf{M}\cap [s,1])\) (neither set are empty since \(0\in \textsf{M}\) and \(1 \in \textsf{M}\)). Since \(s_1\in \textsf{M}\) and \(s_2\in \textsf{M}\), there are \(t_1\in [0,1]\) and \(t_2\in [0,1]\) such that \(m(t_1) = s_1\) and \(m(t_2) = s_2\). Finally define \(\psi (s) {:}{=}\varphi (t_1) + (s - s_1)\frac{\varphi (t_2) - \varphi (t_1)}{s_2 - s_1} \). In this case, \(\int _{\varOmega }\psi (s) = m(t_1) + (s-s_1) \frac{m(t_2) - m(t_1)}{s_2-s_1} = s\). The path \(\psi \) constructed this way is still monotone, and it has the constant speed property, so it is an ablation path.

Appendix B \(\mathcal {L}^{\infty }\)-Optimal Monotonicity Projection

The algorithm proposed in Appendix C for optimising monotone paths uses updates that can locally introduce nonmonotonicity in the candidate \(\hat{\varphi }_1\), so that it is necessary to project back onto a monotone path \(\varphi _1\). The following routineFootnote 8 performs such a projection in a way that is optimal in the sense of minimising the \(\mathcal {L}^{\infty }\)-distanceFootnote 9, i.e.,

$$ \sup _{t}\bigl |\varphi _1(t,\textbf{r}) - \hat{\varphi }_1(t,\textbf{r})\bigr | \le \sup _{t}\bigl |\vartheta (t,\textbf{r}) - \hat{\varphi }_1(t,\textbf{r})\bigr | $$

for all \(\textbf{r}\in \varOmega \) and any other monotone path \(\vartheta \).

The algorithm works separately for each \(\textbf{r}\), i.e., we express it as operating simply on continuous functions \(p: [0,1]\rightarrow \mathbb {R}\).

Algorithm 1
figure b

. Make a function \([0,1] \rightarrow \mathbb {R}\) nondecreasing

The final step effectively flattens out, in a minimal way, any region in which the function was decreasing.

In practice, this algorithm is executed not on continuous functions but on a PCM-discretised representation; this changes nothing about the algorithm except that instead as real numbers, \(l,r\) and \(t\) are represented by integral indices.

Appendix C Path Optimisation Algorithm

As said in Sect. 5, our optimisation algorithm is essentially gradient descent of a path \(\varphi \): it repeatedly seeks the direction within the space of all paths that (first ignoring the monotonicity constraint) would affect the largest increase to \(P(\varphi )\) as per Sect. 4, for any of the defined score functions. Algorithm 2 shows the details of how this is done in presence of our constraints. In case of \({P_{\uparrow \downarrow }}\), the state \(\varphi \) is understood to consist of the two paths \(\varphi _\uparrow \) and \(\varphi _\downarrow \).

As discussed before, the use of a gradient requires a metric to obtain a vector from the covector-differential, which could be either the implicit \(\ell ^2\) metric on the discretised representation (pixels), or a more physical kernel/filter-based metric. In the present work, we base this on the regularisation filter.

Fig. 6.
figure 6

Example view of the monotonisation algorithm in practice. (a) contains decreasing intervals, which have been localised in (b). For each interval, the centerline is then extended to meet the original path non-decreasingly (c). In some cases, this will cause intervals overlapping; in this case merge them to a single interval and re-grow from the corresponding centerline (d). Finally, replace the path on the intervals with their centerline (e).

Unlike with the monotonisation condition, the update can easily be made to preserve speed-constness by construction, by projecting for each \(t\) the gradient \(\textbf{g}\) on the sub-tangent-space of zero change to \(\int _\varOmega \varphi (t)\), by subtracting the constant function times \(\int _\varOmega \textbf{g}(t)\). Note this requires the measure of \(\varOmega \) to be normalised, or else considered at this point.

Then we apply these gradients time-wise as updates to the path, using a scalar product in the channel-space to obtain the best direction for \(\varphi \) itself (as opposed to the corresponding image composite \(x_{\varphi ,t}\)).

The learning rate \(\gamma \) can be chosen in different ways. What we found to work best is to normalise the step size in a \(\mathcal {L}^{\infty }\) sense, such that the strongest-affected pixel in the mask experiences a change of at most 0.7 per step. This is small enough to avoid excessively violating the constraint, but not so small to make the algorithm unnecessarily slow (Fig. 6).

Appendix D Baseline Choice

The baseline image is prominently present in the input for much of the ablation path, and it is therefore evident that it will have a significant impact on the saliency. In line with previous work, we opted for a blurred baseline for the examples in the main paper, but even then there is still considerable freedom in the choice of blurring filter. Figure 7 shows two examples, where the result is not fundamentally, but still notably different.

Algorithm 2
figure c

. Projected Gradient Descent

Fig. 7.
figure 7

An example of paths obtained with different-size blur baselines.

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Sagemüller, J., Verdier, O. (2023). Ablation Path Saliency. In: Longo, L. (eds) Explainable Artificial Intelligence. xAI 2023. Communications in Computer and Information Science, vol 1901. Springer, Cham. https://doi.org/10.1007/978-3-031-44064-9_19

Download citation

  • DOI: https://doi.org/10.1007/978-3-031-44064-9_19

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-031-44063-2

  • Online ISBN: 978-3-031-44064-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics