Supervised COSMOS Autoencoder: Learning Beyond the Euclidean Loss!

Maneet Singh, Shruti Nagpal, Mayank Vatsa, Richa Singh, Afzel NoorearXiv 2018

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.

Retrieval results using a standard Euclidean Autoencoder. Note that images of different individuals (b, c, d) are ranked as more similar to the query (a) than images of the same individual (e, g).

Methodology

The Supervised COSMOS Autoencoder addresses these limitations by optimizing a multi-component loss function:

  1. Cosine Similarity (CO): By measuring the angle between feature vectors rather than their magnitude, the model becomes invariant to global illumination changes.
  2. Mahalanobis Distance (MOS): This scale-invariant metric accounts for the data's distribution and covariance, helping the model ignore minor spatial manipulations like rotations.
  3. 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.
Retrieval results using the Supervised COSMOS Autoencoder. The model correctly identifies images of the same individual (b, d) as the closest matches to the query (a), demonstrating superior robustness to lighting and pose.

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

BibTeX
@misc{singh2018supervised,
  author = {Maneet Singh and Shruti Nagpal and Mayank Vatsa and Richa Singh and Afzel Noore},
  title = {{Supervised COSMOS Autoencoder: Learning Beyond the Euclidean Loss!}},
  year = {2018},
  eprint = {1810.06221},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1810.06221},
}
Figure