Deep Kernelized Autoencoder (dkAE)
- Deep Kernelized Autoencoder (dkAE) is a neural network that integrates user-specified kernel priors to achieve controllable, similarity-preserving representations.
- The architecture jointly optimizes reconstruction loss and kernel alignment, enabling explicit mappings between input space and kernel-induced feature space.
- Empirical results on datasets like MNIST and CIFAR-10 demonstrate dkAE’s competitive performance in classification, denoising, and visualization compared to traditional methods.
A Deep Kernelized Autoencoder (dkAE) is a neural network architecture that generalizes the conventional autoencoder framework by explicitly incorporating user-specified kernel structure into the learned representation. Through joint optimization of reconstruction loss and a kernel alignment objective on the code (latent) representations, the dkAE enables the explicit approximation of mappings from input space to kernel-induced feature space and vice versa. This structure provides controllable similarity-preserving embeddings and supports efficient out-of-sample extensions, while retaining non-linear reconstruction capabilities (Kampffmeyer et al., 2017, Kampffmeyer et al., 2018).
1. Architecture and Mapping Functions
The dkAE architecture extends the standard stacked autoencoder by integrating an additional kernel-alignment term. Let denote an input vector. The encoder mapping is given by
and the decoder by
where is a nonlinear activation (e.g., sigmoid), and are weights, and is the code dimension. In practice, a deep, stacked architecture is used, typically of the form , with tied weights and unsupervised pretraining.
The encoder approximates the (often implicit) mapping 0 associated with the user-specified kernel, while the decoder 1 serves as an explicit back-projection from code space back to input space, achieving a primal-dual formulation absent in conventional kernel methods (Kampffmeyer et al., 2017).
2. User-Specified Kernel Priors
The dkAE requires a positive semi-definite (PSD) kernel matrix 2, specified over the training set 3. In the canonical implementation, this kernel is constructed using the Probabilistic Cluster Kernel (PCK):
4
where 5 is the posterior over mixture components from a Gaussian Mixture Model with 6 components and random initialization 7, and 8 is a normalization constant (Kampffmeyer et al., 2017, Kampffmeyer et al., 2018). Arbitrary kernel matrices can be supplied as the prior 9, allowing users to inject specific notions of similarity into the learned embedding.
3. Loss Functions and Training Objective
The dkAE trains on a composite loss consisting of a reconstruction term and a kernel alignment term. The per-sample reconstruction loss is
0
The kernel alignment loss is based on aligning the Gram matrix of code representations 1, where 2, to the prior kernel 3:
4
with the kernel alignment score 5.
The overall training objective is
6
where 7 controls the trade-off between input reconstruction and kernel alignment. When 8, the model reduces to a standard autoencoder; increasing 9 increases alignment to the kernel prior at the expense of reconstruction. Empirically, 0 offers a favorable balance (Kampffmeyer et al., 2017, Kampffmeyer et al., 2018).
4. Optimization and Training Procedure
The dkAE is trained using mini-batch stochastic optimization (batch size 1, e.g., 2), evaluating the loss on per-batch code Gram matrices 3 and corresponding kernel submatrices 4:
5
Layer-wise unsupervised pretraining is performed for 30 epochs per layer, with the kernel alignment term already active. Full network fine-tuning is then conducted for 100 epochs using the Adam optimizer, Glorot-uniform initialization, and weight-tying for stability (Kampffmeyer et al., 2017, Kampffmeyer et al., 2018). This mini-batch strategy effectively keeps per-batch memory and computational costs at 6, enabling scalability well beyond traditional kernel approaches.
5. Explicit Kernel-Feature Embedding and Inverse Mapping
A principal advantage of dkAE is the provision of explicit forward and reverse mappings between the input space and the kernel-induced feature (RKHS) space. The encoder 7 yields representations 8 that approximate 9, supporting out-of-sample extension and the direct application of linear methods (e.g., PCA, SVM) in the learned code space. The decoder 0 approximates a pre-image, allowing inverse transformations from code vectors back to the input domain. This bidirectionality enables nonlinear transformations, denoising, and traversals in input space following manipulations in the kernel-aligned code domain (Kampffmeyer et al., 2017, Kampffmeyer et al., 2018).
6. Empirical Results and Performance Characteristics
Experiments conducted on MNIST, CIFAR-10, Cloud, and Reuters datasets in (Kampffmeyer et al., 2017, Kampffmeyer et al., 2018) demonstrate:
- Sensitivity to Loss Trade-off: As 1 increases, kernel alignment loss 2 decreases and reconstruction error 3 increases, confirming the anticipated trade-off. The method is robust for 4.
- Code Size Effect: Increasing 5 (code dimension) uniformly reduces both losses, enhancing both reconstruction and kernel alignment.
- Reconstruction and Alignment: For 6, 7, reconstructions are visually faithful to inputs, and the code Gram matrix 8 is well-aligned with the prior kernel 9. Alignment to an "ideal" supervised kernel 0 is superior for 1 compared to 2 or the code Gram of a conventional AE.
- Kernel PCA Approximation: For 3 (number of classes), the dkAE's code Gram matrix 4 approximates the prior better than kernel PCA (kPCA) with 5 leading components. As 6 approaches 7, kPCA recovers 8 exactly, but dkAE remains competitive under low-rank constraints.
- Classification: Linear SVMs trained on code space (cSVM) generally outperform both kernel SVMs in input space and standard linear SVMs. For example, on MNIST: cSVM 94.8%, kSVM 93.8%, linear SVM 90.6%. Supervised alignment further increases these results.
- Denoising: On noisy two-class MNIST data, dkAE+PCA+decode achieves mean squared error (MSE) 9 compared to kPCA+pre-image 0, with visually sharper denoised outputs.
- Visualization and Traversals: Code-space representations support effective dimensionality reduction and visualization (e.g., 1-NN in 2D after PCA yields 39.6% on MNIST, superior to ISOMAP and KECA). Linear interpolations in code space decode to smooth input-space transitions, illustrating controllable generation and class morphing (Kampffmeyer et al., 2017, Kampffmeyer et al., 2018).
| Method | MNIST cSVM | kSVM | Linear SVM | CIFAR-10 cSVM | 1-NN in 2D |
|---|---|---|---|---|---|
| dkAE | 94.8% | 93.8% | 90.6% | 38.17% | 39.6% |
| KECA | - | 29.5% | - | - | 29.5% |
| ISOMAP | - | - | - | - | 36.8% |
| AE+PCA | - | - | - | - | 30.5% |
| DAE+PCA | - | - | - | - | 31.2% |
Select performance metrics from (Kampffmeyer et al., 2018)
7. Limitations and Practical Considerations
dkAE inherits several practical constraints:
- Batch Memory and Computational Trade-offs: Per-batch 1 memory usage limits the maximum practical batch size 2, although this is still considerably more scalable than 3 storage required by classical kernel methods.
- Dependency on Kernel Selection: The kernel prior 4 critically determines the geometry of the learned embedding. The final encoding quality and downstream task performance are influenced by this choice; any PSD kernel is admissible.
- Generalization and Hyperparameter Sensitivity: The method is robust to 5 and 6 within standard ranges, but extremely large network sizes or loss trade-offs may necessitate validation. More comprehensive evaluations of out-of-sample generalization and performance on deeper unsupervised tasks remain open problems (Kampffmeyer et al., 2017).
- Flexible but not Universally Optimal: While dkAE empirically matches or outperforms kPCA and standard autoencoders on reconstruction, classification, and denoising, explicit denoising autoencoders can yield lower MSE when trained specifically for noise removal (Kampffmeyer et al., 2018).
References
- (Kampffmeyer et al., 2017) "Deep Kernelized Autoencoders"
- (Kampffmeyer et al., 2018) "The Deep Kernelized Autoencoder"