Inverting Supervised Representations with Autoregressive Neural Density Models

Charlie Nash, Nate Kushman, Christopher K. I. WilliamsAISTATS 2019

Abstract

Deep neural networks are often viewed as "black boxes," making it difficult to discern what information is retained or discarded as data progresses through hidden layers. We introduce a method to invert these representations using autoregressive neural density models, specifically PixelCNN++. Unlike traditional Mean Squared Error (MSE) based inversions that produce blurry averages, our probabilistic approach generates a distribution of sharp, plausible inputs. This allows for the visualization of network invariants and provides a quantitative framework to measure mutual information, supporting the empirical validation of the Information Bottleneck theory.

Introduction

A central challenge in deep learning is understanding the transformation of data from input pixels to high-level semantic features. Previous attempts to "invert" hidden representations—reconstructing an input image from a hidden vector—often relied on MSE loss. However, because many distinct images can map to the same hidden representation, MSE-based models produce blurry reconstructions that represent the mean of all possible inputs. This "hedging" obscures the specific features the network has discarded.

Probabilistic Inversion via PixelCNN++

We propose modeling the conditional distribution $p(x|h)$, where $x$ is the input image and $h$ is the hidden representation. By utilizing PixelCNN++, an autoregressive model, we can sample multiple realistic images that the network perceives as functionally identical.

Key Advantages:

  1. Visualizing Uncertainty: Instead of a single blurry image, we observe sample variance. If generated samples vary significantly in color or texture while maintaining the same class identity, we can conclude the network has become invariant to those specific features.
  2. Exact Likelihood and Mutual Information: Autoregressive models provide exact likelihoods, allowing us to calculate a lower bound on the Mutual Information $I(x; h)$. This enables a quantitative study of information flow and compression within the network.

Experimental Results

The method was evaluated on MNIST, SVHN, CIFAR-10, and affNIST datasets.

Visual Fidelity and Invariance

As shown in the reconstructions, the inversion model (IM) produces significantly more realistic and diverse samples than MSE-based methods. In higher layers like FC3, the samples demonstrate the "dark knowledge" preserved by the network. For instance, in MNIST, even at the logits layer, the network retains significant stylistic information about the digits.

Comparison of MSE reconstructions vs. samples from the proposed Inversion Model (IM) across MNIST, SVHN, and CIFAR-10 for the FC3 layer.

Information Bottleneck Analysis

By tracking the mutual information $I(x; h)$ during training, we observed a distinct two-phase process: an initial "fitting" phase where information increases, followed by a "compression" phase where the network discards irrelevant details to improve generalization. This effect was more pronounced in well-regularized models compared to those that overfit small datasets.

Architectural Insights

The inversion tool reveals how specific architectural choices impact representation. For example, the addition of Global Spatial Pooling was visually confirmed to discard approximately 4.5 nats of spatial information, as evidenced by the varied positions of objects in the generated samples compared to the original inputs.

Conclusion

Autoregressive inversion provides a powerful lens into the internal workings of deep networks. By moving from point estimates to distribution modeling, we can both see and measure the "black box." Future work will explore scaling these models to higher-resolution datasets and applying the framework to other domains such as natural language processing.

Summary updated

BibTeX
@inproceedings{nash2019inverting,
  author = {Charlie Nash and Nate Kushman and Christopher K. I. Williams},
  title = {{Inverting Supervised Representations with Autoregressive Neural Density Models}},
  booktitle = {International Conference on Artificial Intelligence and Statistics},
  year = {2019},
}
Figure