A Pitfall of Unsupervised Pre-Training

Marcus LiwickiarXiv 2017 · arXiv

TL;DR

This paper challenges the common assumption that features learned by autoencoders for image reconstruction are automatically good for classification. Through extensive experiments, the authors demonstrate a surprising lack of correlation between reconstruction error and classification accuracy, suggesting that optimizing for low reconstruction error might be a misleading strategy when the ultimate goal is classification.

What Problem Does This Paper Address?

In deep learning, unsupervised pre-training using autoencoders is a popular technique to learn useful feature representations from unlabeled data. The intuition is that if a model can accurately reconstruct an input image, the learned features must capture its essential characteristics, making them suitable for downstream tasks like classification. This approach is widely adopted and even recommended in introductory materials. However, the authors question whether this assumption holds universally, particularly when the same features are used for both reconstruction and classification. They aim to investigate if there's a direct, reliable link between how well an autoencoder reconstructs an image and how well those learned features perform in a classification task.

Methods

The core of the paper's methodology involves training Stacked Convolutional Auto-Encoders (SCAEs) on various datasets. The experiments are structured into four phases:

  1. Unsupervised Pre-training: The SCAEs are trained to reconstruct their input by minimizing the reconstruction error. This is the standard unsupervised pre-training step.
  2. Feature Extraction and Classification: Features extracted from the pre-trained SCAE are used to train a separate classifier (either linear or a small neural network). This phase measures the classification capability of the features as-is.
  3. Fine-tuning: The SCAE's features are used to train a classifier, but this time, the entire SCAE (including its encoder and decoder) is fine-tuned along with the classifier. This explores how adapting the feature extractor to the classification task affects performance.
  4. Decoder Training: The SCAE's decoders are trained independently. This phase is used to isolate the impact of the decoder on reconstruction error and to compare reconstruction capabilities before and after fine-tuning for classification.

The authors analyze the relationship between reconstruction error and classification accuracy across these phases, using various distance metrics (Euclidean, Scaled Offset Invariant, Normalized Correlation, E94, and Mahalanobis) to ensure their findings are robust.

Datasets

The paper evaluates their findings on a diverse set of datasets:

  • MNIST: A well-known dataset for digit recognition.
  • SVHN (Street View House Numbers): Another dataset for digit recognition, often considered more challenging than MNIST due to natural image variations.
  • CIFAR10: A dataset for object recognition, containing images of 10 different classes.
  • IAM-HistDB (Parzival, Sain Gall, G. Washington): Datasets for historical document image analysis, specifically focusing on pixel-level segmentation. These are presented as more challenging and domain-specific benchmarks.

Key Insights and Ideas

  • Reconstruction ≠ Classification: The most significant insight is that there is no inherent, reliable correlation between an autoencoder's ability to reconstruct an image and its features' effectiveness for classification. This directly contradicts a widely held assumption.
  • Reconstruction Error is a Misleading Metric: The paper argues that reconstruction error is a poor metric for evaluating the quality of features for classification. It can be biased by the decoder's quality, and a low reconstruction error doesn't guarantee good class separability.
  • Identity Function Pitfall: An extreme example illustrates that an autoencoder could learn an "identity function" (or something close to it), achieving near-zero reconstruction error but producing features that are no more informative than the raw input for a classifier.
  • Fine-tuning Can Harm Reconstruction: Fine-tuning the SCAE for classification can lead to improved classification accuracy but often at the cost of increased reconstruction error. This suggests that the features learned during fine-tuning might be optimized for discriminative power rather than reconstructive fidelity.
  • "Denoising" Effect in Historical Documents: In the context of historical documents, fine-tuning can lead to features that effectively "denoise" the input, ignoring elements like stains that are irrelevant for classification but might be important for perfect reconstruction.

Key Results

  • No Consistent Correlation: Across multiple datasets and classifier types, the authors found no consistent positive or negative correlation between reconstruction error and classification accuracy, especially after fine-tuning. Table 1 summarizes these correlation coefficients, showing varied and often non-significant results.
  • Low Reconstruction Error ≠ High Accuracy: Figure 4 visually demonstrates this, showing that the highest classification accuracies are not necessarily achieved by SCAEs with the lowest reconstruction errors. Some configurations with very low reconstruction error yielded poor classification performance.
  • Visual Evidence: Figure 2 shows that SCAE reconstructions become noticeably worse after fine-tuning for classification on CIFAR and SVHN datasets, while reconstruction quality for MNIST is less affected. Figure 3 illustrates how fine-tuning can lead to a "denoising" effect on historical document images, where irrelevant details (like stains) are no longer reconstructed.

Limitations and Future Work

  • Limitations: The authors acknowledge that their work doesn't question the general usefulness of unsupervised pre-training. Instead, it focuses on the method of evaluating feature quality. They also note that NaN values in correlation matrices for MNIST and GW datasets were due to singular correlation matrices, likely caused by the prevalence of white pixels.
  • Future Work: The paper calls for a better understanding of the internals of deep learning models, the representations they learn, and their classification potential. They advocate for developing alternative, independent methods to evaluate the classification abilities of learned features, rather than relying solely on reconstruction error.

Summary updated

BibTeX
@misc{liwicki2017pitfall,
  author = {Marcus Liwicki},
  title = {{A Pitfall of Unsupervised Pre-Training}},
  year = {2017},
  eprint = {1712.01655},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1712.01655},
}
Figure