Abstract
Autoencoders can generate appropriate latent representations of input data; however, representations based solely on intrinsic properties often fail to express semantic information, leading to poor cluster boundaries. We propose the Semantic Autoencoder (SAE), an enhanced architecture that encodes latent representations based on both data content and semantic labels. t-SNE experiments demonstrate that SAE creates superior latent distributions with clear class distinctions, while decoded samples remain visually indistinguishable from those of standard autoencoders. This observation allows for a novel adversarial attack: by injecting incorrect label information into the semantic encoder, we can generate adversarial samples that appear normal but possess radically different latent distributions, highlighting a critical security vulnerability in deep learning applications.
Introduction
Traditional autoencoders are unsupervised models that learn to compress and reconstruct data based on intrinsic features like pixels or textures. While effective for reconstruction, this often results in a "messy" latent space where different categories (e.g., different digits in MNIST) overlap significantly. This lack of semantic structure makes downstream tasks like clustering or classification difficult. The Semantic Autoencoder (SAE) addresses this "semantic gap" by baking high-level category information directly into the latent representation.
Methodology
The core innovation of the SAE is the integration of a parallel classifier into the encoder pipeline. Unlike a standard Encoder $\rightarrow$ Decoder architecture, the SAE encoder is trained using a joint loss function that minimizes both reconstruction error (via the decoder) and categorical cross-entropy (via the classifier).
This dual requirement forces the encoder to organize the latent space into distinct clusters based on class labels rather than just pixel-level similarities. Furthermore, the authors leverage this architecture to design a novel adversarial attack. By injecting incorrect semantic information during the encoding process, they can perturb an original image to shift its position in the latent space while keeping the visual output $I_a$ indistinguishable from the original.
Key Results
The researchers evaluated the SAE on MNIST and CIFAR-10 benchmarks. A primary finding is that adding semantic constraints does not compromise the model's primary function: reconstruction.
On the MNIST dataset, the SAE achieved a PSNR of 25.10 and an SSIM of 95.82%, demonstrating that the classifier does not "break" the reconstruction capability. In terms of latent space organization, t-SNE plots confirmed that SAE points form tight, distinct clusters for each digit, whereas vanilla autoencoder points remain scattered and overlapping.
Regarding adversarial vulnerability, the authors successfully generated samples on CIFAR-10 with a PSNR of 39.93 and SSIM of 96.55%. Despite being virtually identical to the originals to the human eye, these adversarial samples lose their conformality in the latent space, potentially causing downstream machine learning models to fail.
Discussion and Conclusion
The SAE demonstrates that forcing an encoder to learn global semantic features alongside local textures creates a more robust and organized internal representation. However, this "semantic tuning" introduces a unique risk. The ability to significantly alter an image's latent position without changing its visual appearance suggests that models relying on latent distributions are vulnerable to population-shift attacks.
While the current mathematical proof for this attack assumes a degree of linearity in the network, the empirical results on complex datasets like CIFAR-10 suggest broad applicability. Future work will focus on refining these attacks and developing prevention mechanisms to secure deep learning architectures against latent-space manipulation.
Summary updated