Source-linked AI summary

Explaining in Style: Training a GAN to explain a classifier in StyleSpace

Oran Lang, Yossi Gandelsman, Michal Yarom, Yoav Wald, Gal Elidan, Avinatan Hassidim, William T. Freeman, Phillip Isola, Amir Globerson, Michal Irani, Inbar Mosseri

arXiv:2104.13369v2cs.CVcs.LGcs.NEeess.IVstat.ML

TL;DR

Classifier explanations need to identify and visualize interpretable attributes, but standard generative models may omit attributes important to a classifier. StylEx incorporates the classifier into StyleGAN training to learn a classifier-specific StyleSpace and uses it for image-specific counterfactual explanations. Across multiple domains, it finds semantic attributes that affect classifier outputs and produces explanations reported as meaningful and human-interpretable.

  • Problem

    Classifier decisions can depend on multiple semantic attributes, while standard StyleGAN training may not represent classifier-important attributes or may represent irrelevant ones.

  • Method

    StylEx incorporates the classifier into StyleGAN training, learns a classifier-specific StyleSpace, and selects attributes through independent or joint prediction-effect searches.

  • Results

    Across varied domains, StylEx extracts semantic attributes salient for classification and generates meaningful image-specific explanations understood by human users.

  • Takeaways & Limitations

    Multiple-attribute counterfactuals provide insights into opaque classification processes and may help detect and mitigate previously unknown classifier biases.

  • Takeaways & Limitations

    StylEx explains classifier outputs rather than true labels, so modified outputs may reflect classifier-training biases instead of real label-attribute correlations.

Abstract

from arXiv · show

Image classification models can depend on multiple different semantic attributes of the image. An explanation of the decision of the classifier needs to both discover and visualize these properties. Here we present StylEx, a method for doing this, by training a generative model to specifically explain multiple attributes that underlie classifier decisions. A natural source for such attributes is the StyleSpace of StyleGAN, which is known to generate semantically meaningful dimensions in the image. However, because standard GAN training is not dependent on the classifier, it may not represent these attributes which are important for the classifier decision, and the dimensions of StyleSpace may represent irrelevant attributes. To overcome this, we propose a training procedure for a StyleGAN, which incorporates the classifier model, in order to learn a classifier-specific StyleSpace. Explanatory attributes are then selected from this space. These can be used to visualize the effect of changing multiple attributes per image, thus providing image-specific explanations. We apply StylEx to multiple domains, including animals, leaves, faces and retinal images. For these, we show how an image can be modified in different ways to change its classifier output. Our results show that the method finds attributes that align well with semantic ones, generate meaningful image-specific explanations, and are human-interpretable as measured in user-studies.

1. Introduction

The paper presents StylEx as a classifier-aware generative approach for discovering and visualizing interpretable attributes through counterfactual explanations. It targets opaque classifier decisions by adapting StyleGAN2’s StyleSpace to capture classifier-specific attributes and demonstrates the approach across multiple domains.

  • Motivation: Classifier explanations matter because they can expose model biases, support human decision makers, and aid scientific discovery in high-impact settings.The paper emphasizes medical imaging and autonomous driving as contexts where human oversight is critical.
  • Motivation: Useful counterfactual explanations require interpretable attribute changes rather than arbitrary images or transformations that alter many features simultaneously.Examples include attributes such as pupil size or an open mouth, which can isolate features relevant to a classifier’s output.
  • Approach: StyleGAN2’s disentangled StyleSpace offers a way to find and control semantic image attributes, but standard GAN training may miss attributes relevant to the classifier.The paper therefore incorporates the classifier into StyleGAN training to promote a classifier-specific StyleSpace.
  • Approach: Classifier-aware GAN training is crucial when classification depends on subtle details, because an unaware generator may fail to produce those details.The paper highlights retinal fundus images as an example domain where fine details matter.
  • Results and scope: Across varied domains, StylEx extracts semantically salient attributes and produces explanations understood by human users.The paper also notes that the method explains what classifiers learn, including potential biases from biased training data, rather than necessarily explaining the true label.
  • Approach: StylEx discovers classifier-related StyleSpace coordinates and uses them to generate counterfactual explanations that modify selected attributes.The method is designed to provide multi-attribute, image-specific explanations rather than changing all relevant attributes at once.

2. Related Work

Related explanation methods either localize salient regions without specifying attribute changes or generate counterfactuals that alter multiple attributes together.

  • Heatmap explanations: Heatmap methods identify salient regions but poorly explain non-spatial attributes such as size and color, and do not specify how those attributes should change.They can indicate areas affecting classification without providing the direction of modification.
  • Generative counterfactuals: Generative counterfactual methods produce alternative inputs, but their visualizations change all relevant attributes at once.This limits isolation of the features underlying a classifier’s decision.
  • Multi-attribute explanations: Unsupervised multi-attribute methods based on superpixels or classifier mid-layer activations do not use generative models to create counterfactual images.They demonstrate attributes through relevant patches or superpixels instead.

3. Method

StylEx trains a classifier-conditioned StyleGAN2 with an encoder to learn classifier-specific StyleSpace attributes, then selects and edits those attributes to produce image-specific counterfactual explanations.

  • StylEx architecture: StylEx jointly trains a generator, discriminator, and encoder so generated reconstructions preserve image content while incorporating classifier information.The encoder maps an input image to w, which is concatenated with C(x) before producing StyleSpace vectors; reconstruction and adversarial losses guide training.
  • Classifier-guided training: The method conditions generation on classifier outputs and adds a KL classifier loss so StyleSpace captures attributes relevant to the classifier.The classifier loss matches C(x′) to C(x), discouraging the generator from ignoring classification-relevant details or collapsing to one label.
  • Classifier-guided training: The overall training objective combines adversarial, path-regularization, reconstruction, and classifier losses.The reconstruction terms include image, LPIPS, and latent-style reconstruction components.
  • Attribute discovery: AttFind searches StyleSpace coordinates whose directional changes increase a target class probability across selected images.It iteratively evaluates coordinates, selects the largest-effect coordinate, removes explained images, and repeats until no images remain or M attributes are found.
  • Image-specific explanations: StylEx generates image-specific explanations by identifying attributes that affect one image’s classifier decision and visualizing their edits.Independent selection ranks individual effects, whereas subset selection searches for jointly effective attribute sets.

4. Evaluation and Results

StylEx is evaluated across diverse classifiers and domains by testing semantic coherence, classifier effects, multi-class explanations, and image-specific counterfactuals. The results show interpretable attributes, domain-aligned concepts, and strong dependence on classifier-specific training.

  • StylEx was tested on diverse classifiers based on MobileNet, each achieving at least 95% test accuracy, across multiple domains.
  • Qualitative Evaluation: Top attributes for retina DME and sick/healthy leaf classifiers align with known disease indicators.
  • Qualitative Evaluation: For a 200-class CUB-2011 classifier, StylEx detects brewer blackbird attributes corresponding to the CUB taxonomy.
  • Qualitative Evaluation: The extracted attributes correspond to clear visual concepts and significantly change classifier outputs without manual attribute selection.Attributes were selected automatically by AttFind.
  • Image-Specific Explanations: Image-specific explanations identify attributes with large individual effects or combine smaller effects to flip a classifier decision.The examples use Independent and Subset selection methods, respectively.
  • User Study: A user study compared the coherence and distinctness of the top six StyleSpace coordinates extracted by StylEx and Wu et al.The study asked users to identify attribute effects from animated examples.
  • User Study: StylEx attributes received more consistent semantic descriptions than Wu et al. attributes: all descriptions shared a common word for all but one StylEx coordinate, versus fewer than half for Wu et al.
  • Sufficiency: Classifier-specific training has a dramatic effect on explanation performance in retina and plants, where standard GAN training can collapse generated retina images to the healthy class.

5. Conclusion

The paper presents StylEx as a technique for generating different counterfactual explanations for a classifier on a given image. Its results connect discovered attributes to visual concepts and classifier decisions, while motivating applications to bias mitigation and scientific discovery.

  • StylEx generates different counterfactual explanations for a given classifier and image.
  • The discovered attributes correspond to clear visual concepts and directly affect classifier decisions.
  • The authors identify potential uses in detecting and mitigating previously unknown classifier biases and supporting scientific discovery.
Loading 2104.13369v2…