Overview
This paper introduces the Gated PixelCNN, an evolution of the autoregressive PixelCNN architecture that matches the performance of the more complex PixelRNN while remaining significantly faster to train. By introducing gated activations and a "two-stack" architecture to eliminate receptive field blind spots, the authors demonstrate state-of-the-art conditional image generation. The model successfully creates everything from diverse ImageNet objects to novel portraits of unseen faces based on latent embeddings.
The Challenge: Blind Spots and Slow Training
Generative modeling of natural images is notoriously difficult because images contain both complex, high-level structures (objects, scenes) and fine-grained local dependencies (pixel-to-pixel transitions).
Earlier work by the same authors introduced PixelRNN and PixelCNN. PixelRNNs used LSTMs to model pixels sequentially, yielding high-quality results but suffering from high computational costs because LSTMs are difficult to parallelize. The original PixelCNN was much faster—utilizing standard convolutions—but performed worse. This performance drop was partly due to a "blind spot" in its receptive field: a structural flaw where the model literally could not "see" certain neighboring pixels that should have informed its predictions.
Furthermore, most generative models at the time were unconditional. This paper seeks to make PixelCNNs both more powerful and conditional, allowing them to generate images based on specific inputs like class labels or latent embeddings.
Architectural Innovations
The authors propose three major architectural improvements to overcome the limitations of the original PixelCNN:
1. Eliminating the Blind Spot
To fix the receptive field issue, the authors split the architecture into two distinct "stacks."
- Vertical Stack: Conditions on all rows above the current pixel.
- Horizontal Stack: Conditions on the pixels to the left of the current pixel in the current row.
Combining these ensures that every pixel in the neighborhood is accounted for without "cheating" by looking at future pixels, effectively eliminating the blind spot.
2. Gated Convolutional Layers
Instead of using standard ReLU activations, the authors introduce a gated activation unit: $$y = \tanh(W_{k,f} * x) \odot \sigma(W_{k,g} * x)$$ This structure, inspired by LSTMs, allows the model to control the flow of information more effectively, modeling more complex interactions between pixels. This shift from ReLUs to gated units was the primary driver in closing the performance gap between CNN-based and RNN-based autoregressive models.
3. Conditional Modeling
They inject conditional information (like a class label or a face embedding vector $h$) into every layer of the network. This is achieved by adding a learned transformation of $h$ to the activations before the gated nonlinearity.
Key Insights and Results
The model was evaluated on standard benchmarks including CIFAR-10, ImageNet (32x32 and 64x64), and a Flickr Portraits dataset.
- State-of-the-Art Performance: On ImageNet 32x32, Gated PixelCNN achieved 3.83 bits/dim, outperforming the more complex PixelRNN (3.86 bits/dim).
- Training Efficiency: The model achieved these results in less than half the training time of PixelRNN.
- Qualitative Diversity: Class-conditional ImageNet samples (e.g., "African Elephant," "Coral Reef") showed remarkable diversity in composition, lighting, and perspective while maintaining clear object identity.
- PixelCNN as a "Smart" Decoder: When used as a decoder in an autoencoder, PixelCNN doesn't just try to recreate the input pixel-for-pixel. Instead, it uses the latent vector for high-level "instructions" and relies on its own autoregressive power to fill in the low-level textures. This results in sharper, more realistic reconstructions from 10- or 100-dimensional bottlenecks compared to standard convolutional decoders.
- Invariance via Conditioning: By conditioning on a latent embedding of a face, the model can generate "new" images of the same person. This demonstrates that the model has learned to separate the identity of the person (provided by the embedding) from the style (lighting, pose, expression), which it generates stochastically.
Limitations and Future Directions
While training is fast because convolutions are parallelizable, sampling (generating an image) remains slow. Because the model is autoregressive, it must generate pixels one by one ($O(N)$ for $N$ pixels), making it difficult to use for high-resolution, real-time applications. Additionally, while the model is excellent at local textures and medium-scale structure, it can still struggle with long-range global symmetry (e.g., generating a face with two slightly different eyes).
Future work suggests combining Conditional PixelCNNs with Variational Autoencoders (VAEs) to improve the decoder's ability to handle complex, multimodal distributions and improve global coherence.
Summary updated