NICE: Non-linear Independent Components Estimation

Laurent Dinh, David Krueger, Yoshua Bengio · OpenReview

Introduction

Modeling the probability distribution of high-dimensional data, such as images, is a fundamental challenge in unsupervised learning. Accurately modeling the density $p(x)$ allows us to generate new samples, detect anomalies, and fill in missing data.

Historically, researchers faced a "trilemma" when choosing a generative model:

  1. Intractable Likelihoods: Models like Deep Boltzmann Machines are powerful but require messy approximations to train and evaluate.
  2. Approximate Inference: Variational Auto-encoders (VAEs) are popular but only optimize a lower bound of the likelihood, potentially leading to blurry results.
  3. Evaluation Woes: Generative Adversarial Networks (GANs) generate great images but don't provide a way to calculate the actual probability of a data point.

NICE (Non-linear Independent Components Estimation) addresses this trilemma by using the change of variables formula to create a model that is both deep and exactly tractable. It learns to map complex data into a simple, independent latent space through a perfectly invertible architecture.

Methodology: Normalizing Flows and Coupling Layers

The authors propose a "Normalizing Flow" approach. The goal is to find a non-linear, bijective (one-to-one) mapping $f$ such that the latent representation $h = f(x)$ follows a simple factorized distribution where every dimension is independent.

The core innovation of NICE is the Additive Coupling Layer:

  • The Split: The input $x$ is split into two halves, $x_1$ and $x_2$.
  • The Transformation: The first half stays the same ($y_1 = x_1$). The second half is transformed by adding a complex function of the first half: $y_2 = x_2 + m(x_1)$.
  • The Magic: Because the Jacobian of this transformation is a lower-triangular matrix with ones on the diagonal, its determinant is exactly 1. This means the transformation is volume-preserving.
  • Arbitrary Complexity: The function $m$ can be any neural network (the authors use a ReLU MLP). It doesn't need to be invertible because $x_1$ is always available to "undo" the addition.

To allow the model to actually change the volume—which is essential for modeling varying densities—the authors add a final Scaling Layer. This is simply a diagonal matrix that multiplies each dimension by a learned weight. By stacking multiple coupling layers and alternating which dimensions are transformed, the model learns highly complex, non-linear mappings.

Key Insights

  • Complexity from Simplicity: You don't need a complex Jacobian to get a complex transformation. By composing many simple, volume-preserving layers, you can warp a simple Gaussian distribution into a highly complex "manifold" that fits real-world data.
  • The "Encoder" is the "Decoder": In NICE, inference (finding the latent code) and generation (sampling) use the exact same parameters and functional form. There is no "reconstruction error" because the mapping is perfectly bijective.
  • Exact Likelihood: Unlike VAEs, NICE tells you exactly how likely a data point is. This makes model comparison and hyperparameter tuning much more principled.
Directed graphical models showing the exact bi-directional mapping of NICE.

Experimental Results

The model was evaluated on four standard image benchmarks: MNIST, Toronto Face Dataset (TFD), SVHN (Street View House Numbers), and CIFAR-10. To treat the discrete pixel values as continuous data (a requirement for the change of variables formula), the authors used dequantization by adding a small amount of uniform noise.

  • Log-Likelihood: NICE achieved competitive or superior test log-likelihoods compared to contemporary models like Deep Mixtures of Factor Analysers (Deep MFA) and Gated Restricted Boltzmann Machines (GRBM). For example, on TFD, NICE achieved a log-likelihood of 5514.71, outperforming Deep MFA's 5250.
  • Generation: The model produced clear, unbiased samples for MNIST and TFD. While the color image samples were less sharp than modern standards, they demonstrated that the model successfully learned the underlying structure of the data.
Generated image samples demonstrating the model's generative capacity.
  • Inpainting: By performing gradient ascent on the likelihood of the missing pixels (while keeping observed pixels fixed), the model successfully filled in large occluded areas of images.

Limitations and Future Work

While groundbreaking, NICE has a few limitations:

  • Volume Preservation Constraints: Most of the model is volume-preserving. While the scaling layer helps, this constraint can make it harder for the model to "squash" the probability mass into very thin manifolds (an issue later addressed by the authors in their follow-up paper, RealNVP).
  • Coupling Structure: The choice of how to split the dimensions ($x_1, x_2$) is somewhat arbitrary (e.g., odd vs. even pixels). More sophisticated masking patterns might be needed for different types of data.
  • Spurious Modes: During inpainting, the model occasionally produced "spurious modes"—unnatural-looking artifacts that the model nonetheless assigned high probability.

Ultimately, NICE laid the crucial groundwork for the field of Flow-based Generative Models, proving that we do not have to sacrifice exactness for the sake of deep learning's representational power.

Summary updated

BibTeX
@inproceedings{dinh2015nice,
  author = {Laurent Dinh and David Krueger and Yoshua Bengio},
  title = {{NICE: Non-linear Independent Components Estimation}},
  booktitle = {International Conference on Learning Representations},
  year = {2015},
  url = {http://arxiv.org/abs/1410.8516},
}
Figure