Introduction
Deep Generative Models (DGMs), particularly Variational Autoencoders (VAEs), have long promised a solution to the challenge of semi-supervised learning (SSL). By learning the underlying distribution of high-dimensional data, these models should theoretically be able to leverage vast amounts of unlabeled data to improve classification performance on small, labeled subsets. However, traditional approaches often struggle to align the generative goal (reconstruction) with the discriminative goal (classification). This paper introduces CPC-VAEs, a framework that treats label prediction as a hard constraint, ensuring that the features learned for reconstruction are fundamentally relevant to the task of classification.
The Challenge of Sparse Labels
Existing SSL-VAE methods, such as the widely-used "M2" model, often decouple the generative and discriminative processes. A common failure mode occurs when the model prioritizes "style" features (like lighting or stroke thickness) for reconstruction over "content" features (the actual object identity). This misalignment leads to poor classification performance. Furthermore, many current methods are computationally expensive; for instance, the M2 model requires summing over every possible class label for every unlabeled image during training, a cost that scales linearly with the number of categories.
Proposed Framework: CPC-VAE
The authors propose two primary innovations to bridge the gap between generation and classification:
- Prediction-Constrained VAE (PC-VAE): Rather than treating the label-likelihood as a secondary term in the objective function, the authors frame training as a constrained optimization problem. By maximizing the Evidence Lower Bound (ELBO) subject to a prediction error threshold on labeled data, and implementing this via a large Lagrange multiplier ($\lambda$), the model is forced to prioritize accurate classification.
- Consistency Constraints (CPC-VAE): To effectively utilize unlabeled data, the model enforces a consistency rule: the predicted label for an original image $x$ must match the predicted label for its reconstruction $\bar{x}$. This acts as an internal form of data augmentation, forcing the latent space to capture robust, label-relevant features.
Additionally, the framework incorporates a Noise-Normal Likelihood to handle outliers and a Spatial Transformer VAE component. The latter explicitly factors out affine transformations (like rotation and scaling) into a dedicated part of the latent space, allowing the remaining dimensions to focus purely on object identity.
Experimental Evaluation
The framework was evaluated across several benchmarks, including MNIST, SVHN, NORB, and CelebA. A key finding is that treating classification as a hard constraint is significantly more effective than the heuristic weighting used in previous models.
On the SVHN dataset with only 1000 labels, CPC-VAE achieved 94.22% accuracy, a substantial improvement over the M2 model's 83.39%. Beyond accuracy, the model demonstrated superior computational efficiency; empirical tests on MNIST showed that CPC-VAE was approximately 3.3x faster per training step than the M2 model because its cost is independent of the number of classes.
Key Insights and Conclusion
The success of CPC-VAE highlights that constraints are often superior to heuristics in multi-objective learning. By requiring the model to be consistent across its own reconstructions, it learns a more robust mapping from features to labels without the need for manually designed augmentation pipelines. While the model requires some domain knowledge (e.g., specifying label-preserving transformations for the Spatial Transformer), it represents a significant step forward in making deep generative models practical for real-world scenarios where labeled data is a scarce resource.
Summary updated