Source-linked AI summary

Towards Visually Explaining Variational Autoencoders

Wenqian Liu, Runze Li, Meng Zheng, Srikrishna Karanam, Ziyan Wu, Bir Bhanu, Richard J. Radke, Octavia Camps

arXiv:1911.07389v7cs.CVcs.LG

TL;DR

Classification-oriented visual attention methods do not directly explain generative models such as VAEs. The paper generates gradient-based attention from learned latent dimensions, then applies it to anomaly localization and disentanglement, reporting strong results on MVTec-AD and Dsprites.

  • Problem

    Existing visual-attention explanations are designed for classification and categorization, while explaining generative models remains relatively unexplored.

  • Method

    The paper generates gradient-based visual attention maps conditioned on individual dimensions of a VAE’s learned latent space and introduces an attention disentanglement loss.

  • Results

    The attention maps achieve state-of-the-art anomaly localization on MVTec-AD and improve disentanglement performance on Dsprites.

  • Takeaways & Limitations

    VAE attention maps support both visual explanation and downstream anomaly localization, while attention-based training constraints improve latent-space disentanglement.

Abstract

from arXiv · show

Recent advances in Convolutional Neural Network (CNN) model interpretability have led to impressive progress in visualizing and understanding model predictions. In particular, gradient-based visual attention methods have driven much recent effort in using visual attention maps as a means for visual explanations. A key problem, however, is these methods are designed for classification and categorization tasks, and their extension to explaining generative models, e.g. variational autoencoders (VAE) is not trivial. In this work, we take a step towards bridging this crucial gap, proposing the first technique to visually explain VAEs by means of gradient-based attention. We present methods to generate visual attention from the learned latent space, and also demonstrate such attention explanations serve more than just explaining VAE predictions. We show how these attention maps can be used to localize anomalies in images, demonstrating state-of-the-art performance on the MVTec-AD dataset. We also show how they can be infused into model training, helping bootstrap the VAE into learning improved latent space disentanglement, demonstrated on the Dsprites dataset.

1. Introduction

The paper addresses the limited applicability of classification-oriented visual explanations to generative models by developing gradient-based attention methods for VAEs. It uses these attention maps for anomaly localization and latent-space disentanglement.

  • The paper presents visually consistent explanations for individual latent dimensions across different samples.
  • Classification-oriented attention methods limit visual explanations largely to object categorization, while explaining generative models remains relatively unexplored.
  • The proposed method generates gradient-based visual attention maps from each dimension of a VAE’s learned latent space.The method samples a latent code using the reparameterization trick, backpropagates each latent dimension to convolutional features, and aggregates the gradients.
  • The attention maps provide cues for pixel-level anomaly masks and achieve state-of-the-art anomaly-localization performance on MVTec-AD.
  • The attention disentanglement loss incorporates attention maps into VAE training and improves disentanglement performance on Dsprites.

2. Related Work

Prior work developed visual explanations for CNNs, anomaly-detection methods, and disentangled representations, but the paper introduces an attention-based disentanglement objective for generative models.

  • CNN Visual Explanations: CNN visual-attention methods commonly use gradient-based or response-based approaches to visualize intermediate feature representations.
  • Anomaly Detection: Anomaly detection remains challenging, with recent approaches relying mainly on classification-based or reconstruction-based methods.
  • VAE Disentanglement: Research on VAE disentanglement has pursued methods for separating latent factors through constraints on latent predictability, factorization, or mutual information.
  • VAE Disentanglement: The paper proposes an attention disentanglement learning objective and reports superior quantitative performance compared with existing work.

3. Approach

The approach generates gradient-based visual attention directly from a VAE’s learned latent space, then applies those maps to anomaly localization and latent-space disentanglement. Experiments report accurate anomaly localization and improved disentanglement relative to baseline methods.

  • 3.2. Generating VAE Attention: The method generates VAE attention by backpropagating latent-variable gradients to convolutional feature maps, without requiring an additional classification module.For each latent element, gradients are propagated to the final convolutional feature maps and combined into an attention map.
  • 3.2. Generating VAE Attention: Each latent dimension produces its own attention map, while an overall map can be formed by aggregating the dimension-specific maps.The paper notes that mean aggregation is one possible way to obtain a single attention map.
  • 3.3. Anomaly Localization: For one-class VAEs, anomaly attention is derived from differences between latent representations of normal and abnormal samples.The method samples a latent code from the difference between the inferred distributions before computing the anomaly map.
  • 3.3.1 Results: The attention maps highlight semantically meaningful anomalous regions, such as the top bar of a digit “7” and the top and bottom regions distinguishing a “2” from a “1”.These examples indicate that the maps capture differences represented in the learned latent space.
  • 3.3.1 Results: On UCSD Ped1 and MVTec-AD, the proposed anomaly attention localizes defects more precisely than reconstruction differences and performs better than competing methods on most object categories.The UCSD comparison uses reconstruction-based Vanilla-VAE localization, while the MVTec-AD comparison covers 15 categories and reports ROC AUC and best IOU.
  • 3.4. Attention Disentanglement: The attention disentanglement loss integrates VAE attention into training, with AD-FactorVAE reaching around 0.90 disentanglement versus around 0.82 for FactorVAE and 0.73 for β-VAE.The reported comparison uses the same experimental setting for the proposed loss and the baseline methods.

4. Summary and Future Work

The paper presents gradient-based techniques for visually explaining VAEs and applies the resulting attention maps to anomaly localization and latent-space disentanglement. It also identifies distribution-level attention explanations as a direction for future work.

  • The proposed techniques compute VAE attention maps from the learned latent representation without relying on classification models.The approach uses gradients associated with the latent representation to generate attention maps.
  • VAE attention maps support anomaly localization by producing pixel-level binary anomaly masks from anomaly-related latent-variable behavior.The method uses latent variables that deviate from the standard Gaussian during gradient backpropagation as cues for mask generation.
  • Attention maps from individual latent dimensions can impose disentanglement constraints, improving attention separability and disentanglement performance.The paper applies these constraints to latent-space disentanglement and illustrates attention separation on Dsprites using FactorVAE and AD-FactorVAE maps.
  • Repeated posterior sampling yields a distribution of attention matrices, but more general visual explanations for that full distribution remain future work.
Loading 1911.07389v7…