Reconstruct & Crush Network

Erinc Merdivan, Mohammad Reza Loghmani, Matthieu GeistNeurIPS 2017

TL;DR

The Reconstruct & Crush Network (RCN) is an energy-based model that learns to represent a specific data class by minimizing reconstruction error for positive samples while actively "crushing" (maximizing error for) negative or unlabeled samples. By using an autoencoder as its backbone, RCN provides a robust way to handle covariate shift and imbalanced data across diverse domains, including images, text, and dialogue systems.

The Problem: Closed-World Assumptions and Covariate Shift

Most deep learning classifiers operate on a "closed-world" assumption: they expect the training and test data to come from the exact same distribution and include all possible classes. However, real-world applications often face covariate shift, where the environment changes, or new, unseen classes appear at test time.

Standard discriminative classifiers (like a typical Convolutional Neural Network) focus on finding the boundaries between classes. If you show them something completely new, they often make high-confidence but incorrect predictions. The authors propose shifting the focus from discriminative features (how class A differs from class B) to intrinsic features (what fundamentally defines class A). This approach is particularly useful for "A vs. not-A" problems, Positive and Unlabeled (PU) learning, and scenarios with highly imbalanced datasets.

Methodology: Energy-Based Models and Adversarial Loss

The authors leverage Energy-Based Models (EBMs). In this framework, the model assigns a scalar "energy" value to every input; low energy means the model "recognizes" the data, while high energy means it does not.

The RCN instantiates this using an Autoencoder. The energy value $N(x)$ is defined as the reconstruction error: the distance between the input $x$ and its reconstructed version after passing through an encoder and decoder.

The core innovation is the adversarial loss function: $$L(x_{pos}, x_{neg}; N) = N(x_{pos}) + \max(0, m - N(x_{neg}))$$

This loss function operates in two distinct phases:

  1. Reconstruct: The first term forces the network to learn a tight manifold for positive samples ($x_{pos}$), resulting in a low reconstruction error. The network learns the "essence" of the target class.
Reconstructing a positive sample
  1. Crush: The second term is a hinge loss. It forces the network to assign a reconstruction error of at least $m$ (a user-defined margin) to negative or unlabeled samples ($x_{neg}$). This actively destroys or "crushes" the representation of non-target data.
Crushing a negative sample (ship)

This adversarial dynamic prevents the autoencoder from simply learning a generic identity mapping and forces it to be highly specific to the positive class.

Experimental Setup and Key Results

The authors evaluated RCN across three distinct modalities to demonstrate its versatility:

  • Images (CIFAR-10 and CIFAR-100): They used a "not-in-training" setting where certain classes (like "ships" or "plates") were withheld during training to test the model's ability to identify unseen data. In identifying the unseen "ship" class as negative, RCN achieved a True Negative Rate (TNR) of 0.793, significantly outperforming a standard CNN (0.755). On CIFAR-100, RCN showed even stronger gains, with a True Positive Rate (TPR) of 0.861 compared to the CNN’s 0.718.
  • Text (Amazon Reviews): This was treated as a PU learning task, where the model is trained on "5-star" reviews (positive) and a mix of unlabeled reviews. Despite not being a specialized PU learning architecture, RCN achieved an F-measure of 0.90, competitive with state-of-the-art methods like Roc-SVM.
  • Dialogue (Facebook bAbI): They tested the model on "next response classification" and "dialogue completion" tasks using a Gated Recurrent Unit (GRU) as the autoencoder backbone. RCN achieved 100% accuracy in both tasks, matching the performance of complex Memory Networks.

Key Insights

  • Intrinsic vs. Discriminative Learning: By focusing on reconstruction rather than classification boundaries, the model becomes much more resilient when the "negative" distribution changes at test time.
  • The Margin as a Regularizer: The margin $m$ is critical. If it's too small, the model treats everything as positive; if it's too large, the model struggles to reconstruct even the positive samples because it's too focused on "crushing" everything else.
  • Handling Imbalance: RCN naturally handles imbalanced data because it doesn't try to balance a decision boundary; it simply learns the manifold of the positive class while pushing everything else away.

Limitations and Future Work

The current iteration of RCN is primarily designed for binary (A vs. not-A) classification. While powerful for anomaly detection or specific class identification, it doesn't natively handle multi-class problems where you need to distinguish between multiple distinct categories simultaneously.

Future work will involve extending RCN to multi-class settings. The authors also propose using the energy value as a more nuanced metric for evaluating dialogue systems, potentially offering a better quality measure than standard word-overlap scores like BLEU.

Summary updated

BibTeX
@inproceedings{merdivan2017reconstruct,
  author = {Erinc Merdivan and Mohammad Reza Loghmani and Matthieu Geist},
  title = {{Reconstruct \& Crush Network}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2017},
  url = {https://openreview.net/forum?id=rJZIQK-O-S},
}
Figure