Natural Image Manipulation for Autoregressive Models Using Fisher Scores

Wilson Yan, Jonathan Ho, Pieter AbbeelarXiv 2019

TL;DR

Autoregressive models excel at image generation but lack the intuitive latent spaces of VAEs or GANs needed for smooth image interpolation and editing. This paper introduces a method to extract meaningful embeddings from pre-trained autoregressive models using Fisher scores, enabling high-quality semantic image manipulation and interpolation without needing to retrain the base model.

What Problem Does This Paper Address?

Deep autoregressive models (like PixelCNN) are incredibly powerful tools for density estimation, consistently achieving state-of-the-art performance in modeling complex data distributions. However, they suffer from a major drawback: they do not possess a natural, continuous latent space.

In latent variable models like Variational Autoencoders (VAEs) or Normalizing Flows, you can easily interpolate between two images or perform semantic edits (such as adding a smile or changing hair color) by simply moving vectors around in the latent space. Doing this with an autoregressive model typically requires training a completely new conditional model for every single attribute you want to manipulate—a tedious and computationally expensive process. This paper tackles the challenge of constructing an effective, unconditional latent space post-hoc for a pre-trained autoregressive model.

Methods

The core innovation of this paper is using the Fisher score as an embedding space. The Fisher score is defined as the gradient of the log-probability of a sample with respect to the model parameters:

$$\dot{\ell}(x; \theta) = \nabla_\theta \log p_\theta(x)$$

Intuitively, the Fisher score describes how much each parameter of the network contributes to generating a specific image. Because deep networks contain millions of parameters, this raw score vector is far too massive to work with directly. To make it scalable, the authors employ a two-step dimensionality reduction pipeline:

  1. Sparse Random Projections: Compresses the massive parameter-sized gradient vector down to a fixed dimension (e.g., 16,384) while preserving relative distances between data points.
  2. Principal Component Analysis (PCA): Further reduces the dimensionality to a manageable size (e.g., 4,096).

To map these compressed embeddings back into images, the authors train a separate decoder network (experimenting with standard convolutional networks, WGANs, and conditional RealNVPs) by minimizing reconstruction error.

Datasets

The method was evaluated on two standard image datasets:

  • MNIST: Binarized by sampling from Bernoulli random variables biased by grayscale values, used for initial validation and quantitative testing.
  • CelebA: Cropped and resized to $128 \times 128$ pixels, with color depth reduced to 5-bit to accelerate training. This dataset provides the binary facial attributes needed to test semantic manipulations.

Key Insights and Ideas

  • Parameter Space vs. Activation Space: Standard network activations in autoregressive models primarily encode local image statistics. Fisher scores, however, live in the parameter space and capture global semantic structures.
  • Smooth Transitions: Interpolating in activation space behaves like a naive pixel overlay, resulting in blurry, incoherent intermediate images. Fisher score interpolation yields smooth, realistic morphs between distinct concepts.
Figure 1: CelebA interpolation comparing PixelCNN activations (top row) versus Fisher scores (bottom row) as embedding spaces for autoregressive models
  • Decoder Independence: The semantic meaning is truly preserved within the Fisher scores themselves, not just memorized by the decoder. The authors proved this by showing consistent interpolation quality across vastly different decoder architectures (Conv, WGAN, Pyramid PixelCNN, and RealNVP).

Key Results

  • Quantitative Evaluation via FID: The authors introduced a quantitative metric for interpolation quality by calculating the Fréchet Inception Distance (FID) of interpolated images at various mixing coefficients ($\alpha$). On MNIST at the midpoint ($\alpha = 0.5$), the activation baseline's FID spikes to 25.42 (indicating poor, unrealistic images), whereas the Fisher score method maintains a clean, stable FID of 5.43.
  • Semantic Manipulation: By calculating an attribute vector ($\delta = z_{pos} - z_{neg}$) from binary labels in CelebA, the authors successfully added smiles and glasses to faces. While activation embeddings tended to awkwardly "paste" generic features onto the face, the Fisher score method modified the faces naturally.

Limitations and Future Work

  • Reconstruction Trade-off: While Fisher scores excel at capturing global semantics for interpolation, they are slightly less accurate at perfect pixel-level reconstruction compared to raw network activations. Activations still hold an advantage for preserving fine, local details.
  • Dimensionality Bottleneck: The initial random projection step represents the primary bottleneck in reconstruction quality.
  • Future Directions: The authors suggest exploring more sophisticated dimensionality reduction techniques and extending this Fisher score embedding approach to non-image autoregressive models, such as those used for text or audio.

Summary updated

Abstract

Deep autoregressive models are one of the most powerful models that exist today which achieve state-of-the-art bits per dim. However, they lie at a strict disadvantage when it comes to controlled sample generation compared to latent variable models. Latent variable models such as VAEs and normalizing flows allow meaningful semantic manipulations in latent space, which autoregressive models do not have. In this paper, we propose using Fisher scores as a method to extract embeddings from an autoregressive model to use for interpolation and show that our method provides more meaningful sample manipulation compared to alternate embeddings such as network activations.

Empirical ResultsBrowse all benchmarks →

BenchmarkMethodMetricScoreProtocol / Evidence
MNISTProjected Fisher scores (ours; MNIST projection dimension 1024)FID5.43-19.99 vs baselineprojection-dimension=1024
Source quote
L123: Results\quad Figure~\ref{fig:mnist_recon_interp} shows a comparison between using the PixelCNN activations of the second-to-last convolutional layer and projected Fisher scores as embedding spaces. In general, reconstruction using the activations is slightly more accurate than using Fisher scores. However, for interpolations, using activations produces intermediate images that are similar to interpolations using raw pixel values. On the other hand, interpolations with our method using Fisher scores produces a more natural transition between samples. These qualitative observations are also reflected in our quantitative measurements shown in Figure~\ref{fig:mnist_recon_interp}. The interpolations using activations reaches a much higher FID (25.42) than using interpolation using Fisher scores (5.43). Note that we only show \alpha from 0 to 0.5, as FID scores for \alpha = 0.75 are the same as \alpha = 0.25 since mixing coefficients are symmetric.
Reported baseline / comparator measurements (1)
BenchmarkMethodMetricScoreProtocol / Evidence
MNISTPixelCNN activations (second-to-last convolutional layer) baselineFID25.42backbone=PixelCNN
Source quote
L123: Results\quad Figure~\ref{fig:mnist_recon_interp} shows a comparison between using the PixelCNN activations of the second-to-last convolutional layer and projected Fisher scores as embedding spaces. In general, reconstruction using the activations is slightly more accurate than using Fisher scores. However, for interpolations, using activations produces intermediate images that are similar to interpolations using raw pixel values. On the other hand, interpolations with our method using Fisher scores produces a more natural transition between samples. These qualitative observations are also reflected in our quantitative measurements shown in Figure~\ref{fig:mnist_recon_interp}. The interpolations using activations reaches a much higher FID (25.42) than using interpolation using Fisher scores (5.43). Note that we only show \alpha from 0 to 0.5, as FID scores for \alpha = 0.75 are the same as \alpha = 0.25 since mixing coefficients are symmetric.
BibTeX
@misc{yan2019natural,
  author = {Wilson Yan and Jonathan Ho and Pieter Abbeel},
  title = {{Natural Image Manipulation for Autoregressive Models Using Fisher Scores}},
  year = {2019},
  eprint = {1912.05015},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1912.05015},
}
Figure