Abstract
Traditional autoencoders (AEs) typically minimize the Euclidean distance (Mean Squared Error) between input and reconstruction. However, Euclidean distance is often poorly suited for discriminative tasks as it is highly sensitive to non-semantic variations like illumination and minor rotations. We introduce the Supervised COSMOS Autoencoder, a novel framework that replaces the standard loss with a combination of Cosine similarity, Mahalanobis distance, and Mutual Information-based supervision. Our results demonstrate that this multi-objective approach learns more robust, discriminative features, achieving state-of-the-art performance in image classification, face attribute prediction, and face identification.
Introduction: The Euclidean Limitation
The primary goal of a standard autoencoder is to learn a compressed representation of data by reconstructing the input. The standard metric for reconstruction quality is the Euclidean distance. While effective for simple reconstruction, this metric fails in classification contexts because it treats all pixel-level differences equally. For instance, in face recognition, a change in lighting can result in a larger Euclidean distance between images of the same person than between images of different people in similar lighting. This sensitivity hinders the model's ability to learn invariant features necessary for downstream tasks.
Methodology
The Supervised COSMOS Autoencoder addresses these limitations by optimizing a multi-component loss function:
- Cosine Similarity (CO): By measuring the angle between feature vectors rather than their magnitude, the model becomes invariant to global illumination changes.
- Mahalanobis Distance (MOS): This scale-invariant metric accounts for the data's distribution and covariance, helping the model ignore minor spatial manipulations like rotations.
- Mutual Information (MI) Supervision: Unlike unsupervised AEs, COSMOS incorporates class labels via a Mutual Information penalty. This forces the latent representation to be inherently discriminative.
Architectural Innovations
To further enhance performance, the model employs tessellation, dividing input images into nine overlapping patches. Features are learned locally for each patch and then aggregated using sum-rule fusion, preserving fine-grained spatial details. The optimization process uses an alternating minimization approach to update network weights, the Mahalanobis distance matrix, and classifier parameters.
Experimental Results
The framework was rigorously evaluated across seven benchmark datasets, spanning digit recognition to "in-the-wild" face identification.
- Object and Digit Recognition: On MNIST, the model achieved a 0.21% error rate, matching top-tier results.
- Facial Attribute Prediction: On the CelebA dataset, COSMOS reached 94.14% accuracy, outperforming previous CNN-based state-of-the-art models.
- Age and Gender Classification: On the Adience dataset, gender classification accuracy improved to 95.07%, representing a significant 2.57% increase over existing methods.
- Face Identification: On the challenging IJB-A dataset, the model achieved a Rank-1 identification accuracy of 0.976, placing it among the highest-performing models for unconstrained face recognition.
Ablation studies confirmed that each component (CO, MOS, and MI) contributes incrementally to the final performance, with the full COSMOS suite providing the most substantial gains.
Conclusion
The Supervised COSMOS Autoencoder demonstrates that moving "beyond Euclidean" is essential for learning high-quality, discriminative representations. By integrating direction-based and distribution-based metrics with label-driven supervision, the model overcomes common pitfalls of traditional autoencoders. Future work will explore extending this philosophy to generative models like VAEs and GANs to improve their stability and feature quality.
Summary updated