Learning Discriminative Features with Class Encoder

Hailin Shi, Xiangyu Zhu, Zhen Lei, Shengcai Liao, Stan Z. Li

TL;DR

This paper introduces the "class-encoder," a supervised variation of the auto-encoder that reconstructs a sample from another sample of the same class to minimize intra-class variation. By applying this reconstruction at the feature level on top of a CNN (Deep CEC), the model effectively filters out nuisance factors like background and pose, achieving highly competitive face recognition accuracy without the need for computationally expensive hard-negative mining.

What Problem Does This Paper Address?

Unsupervised pre-training methods like auto-encoders (AEs) and Restricted Boltzmann Machines (RBMs) are great at learning data representations, but they don't inherently learn discriminative features. A good reconstruction of an image doesn't guarantee the features will be useful for classifying it.

Furthermore, standard auto-encoders struggle with large, unaligned images. They require massive fully connected layers (leading to parameter explosion) and are highly sensitive to translation (an object moving slightly in the frame ruins the pixel-to-pixel reconstruction). The authors seek a way to combine the generative, manifold-learning power of auto-encoders with supervised learning to create highly discriminative, robust features for complex tasks like face recognition.

Methods

The authors propose three escalating techniques:

  • Class-Encoder: Unlike a standard auto-encoder that reconstructs an image from itself, a class-encoder tries to reconstruct an image from another image of the same class. This forces the network to minimize intra-class variations.
  • Class-Encoding Classifier (CEC): The authors combine the class-encoder's reconstruction loss with a standard softmax classification loss. The class-encoder acts as a constraint/regularizer that forces intra-class features to cluster tightly around the class mean.
  • Deep CEC (DCEC) & Feature-Level Reconstruction: To handle complex, unaligned images, they cascade a Convolutional Neural Network (CNN) with the CEC. Crucially, instead of reconstructing raw pixels, the CEC reconstructs the high-level features extracted by the CNN.

Datasets

  • MNIST: Used for initial validation of the basic class-encoder and CEC models.
  • Webface: A custom dataset collected by the authors containing ~156,000 images across 4,024 identities, used to train the face recognition models.
  • LFW (Labeled Faces in the Wild): The standard benchmark used for evaluating face verification performance.
  • YTF (YouTube Faces): Used for evaluating video-based face recognition.

Key Insights and Ideas

  • Nuisance filtering via cross-sample reconstruction: When you force a network to reconstruct Image A from Image B (where both are the same person), the network learns to ignore the background, lighting, and facial expressions. Because those "nuisance factors" don't match between the two images, the network drops them and only preserves the core, shared identity features.
  • Feature-level > Pixel-level: Reconstructing raw pixels for complex images is a waste of model capacity and introduces noise. Reconstructing CNN feature maps is much more efficient, inherently translation-invariant, and allows the network to focus purely on semantic meaning.
  • No negative pairs needed: Many state-of-the-art face recognition models rely on contrastive or triplet losses, which require carefully mining "hard negative" pairs (images of different people that look similar) to push them apart in the feature space. DCEC only uses intra-class (positive) pairs. The generative nature of the class-encoder implicitly handles the feature space separation, significantly accelerating the training process.

Key Results

  • On MNIST, the CEC model consistently lowered error rates compared to a pure softmax baseline (e.g., dropping the error rate from 1.26% to 1.15% when initialized with a Contractive Auto-Encoder).
  • On LFW, the Deep CEC (DCEC) model achieved 95.87% accuracy. When trained on the exact same Webface dataset, this outperformed a pure softmax baseline (94.21%) and popular contrastive methods like DeepID2 (94.97%) and DeepID2+ (95.33%).
  • Under the stricter BLUFR protocol for LFW (Verification at a False Accept Rate of 0.1%), DCEC achieved 57.22%, vastly outperforming the softmax-only model (38.61%).
  • On YTF, an ensemble of 7 DCEC models achieved 90.2% accuracy, remaining competitive with state-of-the-art models.

Limitations and Future Work

  • Limitations: The authors note that while their method beats models like DeepID2 on a level playing field (using the same training data), the absolute accuracy on LFW is lower than models trained on massive, private datasets (like DeepFace's 4.4 million images).
  • Future Work: The authors suggest that because DCEC does not require inter-class pair mining (negative mining), it represents a highly promising direction for the fast training of large-scale face recognition models. Future work could scale this feature-level reconstruction approach to much larger datasets to see if it maintains its efficiency advantages over triplet-loss architectures.

Summary updated

BibTeX
@inproceedings{shi2016learning,
  author = {Hailin Shi and Xiangyu Zhu and Zhen Lei and Shengcai Liao and Stan Z. Li},
  title = {{Learning Discriminative Features with Class Encoder}},
  booktitle = {Workshops @ CVPR},
  year = {2016},
  url = {https://openreview.net/forum?id=HkZ6eRWO-S},
}
Figure