Pixel Recurrent Neural Networks

PixelRNN and PixelCNN make image generation a tractable autoregressive density modeling problem by factorizing an image into ordered pixel conditionals.

Metadata

FieldValue
PaperPixel Recurrent Neural Networks
AuthorsAaron van den Oord, Nal Kalchbrenner, Koray Kavukcuoglu
Year2016
VenueICML 2016
arXiv1601.06759
PMLRv48/oord16
Statusseed note started

One-Line Takeaway

PixelRNN shows that images can be modeled with exact likelihood by predicting each pixel from previous pixels under a fixed raster ordering, while PixelCNN replaces slower recurrent dependencies with masked convolutions.

Question

For an image:

a generative model should define:

The problem is that the joint distribution over all pixels is high-dimensional. PixelRNN asks:

Can a neural network model the exact image likelihood by decomposing the image into sequential conditional distributions?

Autoregressive Factorization

Flatten the image into an ordered sequence:

Then:

Training minimizes negative log-likelihood:

This is exact under the chosen ordering. There is no adversarial discriminator, no variational lower bound, and no approximate reverse process.

Architecture Contract

ComponentRole
pixel orderingdefines which pixels are visible when predicting each target pixel
masked dependencyprevents access to future pixels
recurrent or masked-convolutional stackcomputes context-aware hidden state
output distributionpredicts discrete pixel intensity probabilities
teacher forcingtrains all pixel conditionals in parallel over observed images
ancestral samplinggenerates pixels one at a time

The model is a density estimator:

Sampling is slower:

PixelRNN

PixelRNN uses recurrent layers over spatial dimensions so each pixel representation can depend on previous pixels:

The architecture contribution is not recurrence in time, but recurrence over a 2D image ordering. This gives expressive dependencies but makes training and sampling expensive.

PixelCNN

PixelCNN replaces explicit recurrence with masked convolutions. A masked convolution computes:

where the mask removes positions that would reveal the current or future pixel.

The causal mask enforces:

so the likelihood factorization remains valid.

The tradeoff:

ModelStrengthCost
PixelRNNstrong sequential dependency modelingslower recurrent computation
PixelCNNmore parallel training through masked convolutionreceptive field and blind-spot issues require careful design

Output Distribution

For 8-bit pixels, the output can be a categorical distribution:

For RGB, the channel ordering can also be autoregressive:

The key is that every generated unit has a normalized conditional probability.

Why It Matters

PixelRNN/PixelCNN is a canonical example of autoregressive modeling outside text.

ContributionWhy it persisted
exact image likelihoodlets image generative models be evaluated as density models
masked spatial dependencygeneral recipe for causal convolution over non-text data
discrete pixel modelingavoids Gaussian blur from simple regression losses
likelihood/sample tradeoffshows exact likelihood does not guarantee fast sampling

It also becomes important as a prior or decoder in later latent models, including VQ-VAE.

What To Watch

  • The likelihood is exact only for the chosen ordering and output discretization.
  • Raster ordering is convenient but not necessarily semantically natural.
  • Sampling is sequential and can be slow at high resolution.
  • Good likelihood and visually pleasing samples are related but not identical.
  • PixelCNN as a decoder can become powerful enough to ignore weak latents unless the latent interface is designed carefully.