Visual Counterfactual Explanations

Bachelor Thesis
Student Project
Master Thesis


Counterfactual examples are an AI explainability technique, which generates hypothetical examples that illustrate how an input sample needs to be modified to generate a different response. For CNNs, counterfactual examples can be generated like adversarial examples [1]. This way, we can compute the minimal modification to an image so that the model produces a desired class response. In the image example on the left, a race car image has been modified so that the model very certainly thinks that the image shows a bee (image was generated using Perturber).



In this work, a student should design, implement, and evaluate an interactive interface for visual exploration of counterfactual image examples as local model explainability method. The project is scalable based on the project type (BA / DA / PR).


  • Strong interest in machine learning, visualization, and human-computer interaction

  • Very good programming skills

  • Experience with Tensorflow and web technologies (JavaScript, d3, three.js...) advantageous


The preferred target platform is the web using visualization platforms like d3.js or three.js. Experience and code to generate adversarial examples using JavaScript is available at the group and can be extended.<


For more information please contact Manuela Waldner.