NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Diagnosing Vulnerability of Variational Auto-Encoders to Adversarial Attacks

Anna Kuzina, Max Welling, Jakub M. TomczakarXiv 2021

Abstract

Variational Autoencoders (VAEs) are widely used for tasks like anomaly detection and data compression due to their ability to learn meaningful latent representations. This paper demonstrates that VAEs, including state-of-the-art hierarchical models like NVAE, are highly susceptible to adversarial attacks. By applying tiny, nearly invisible perturbations to an input image, an attacker can "hijack" the model’s latent representation, forcing it to encode the image into a completely different part of the latent space or mimic the features of a specific target image. We analyze the impact of $\beta$-VAE and hierarchical structures, finding that they provide insufficient protection against determined attacks.

Introduction

While adversarial attacks on image classifiers—such as making a model misidentify a "dog" as a "toaster"—are well-documented, the vulnerability of generative models like VAEs is less understood. VAEs learn a compressed mathematical representation of data features, known as the latent space. If these representations are fragile, downstream applications fail. For instance, an anomaly detection system could be fooled into seeing a malicious input as perfectly normal. This research diagnoses exactly how vulnerable these models are and whether common modifications like $\beta$-VAE or hierarchical structures (NVAE) provide inherent protection.

Methodology

The authors propose two types of adversarial attacks designed to manipulate the latent space:

  1. Supervised Attack: Given a "reference" image and a "target" image, the goal is to find a tiny perturbation ($\epsilon$) to add to the reference image so that the VAE encodes it into the same latent position as the target image. This is achieved by minimizing the symmetric Kullback-Leibler (KL) divergence between the latent distributions of the perturbed input and the target.
  2. Unsupervised Attack: Without a specific target, the goal is to move the latent representation as far as possible from the original. This is implemented efficiently using a linear approximation involving the Jacobian of the encoder's output.
Conceptual overview of the supervised adversarial attack, showing how a reference image is perturbed to match a target's latent representation and reconstruction.

To measure robustness, the researchers use the MSSSIM (Multi-Scale Structural Similarity Index) to ensure the adversarial image still looks like the original to a human, and a metric called $\Omega$ to quantify the shift in the latent representation.

Key Insights and Results

The researchers evaluated their attacks on two standard benchmarks: Fashion MNIST (for standard and $\beta$-VAEs) and CelebA (for the hierarchical NVAE).

The $\beta$ Trade-off

In $\beta$-VAEs, increasing the $\beta$ parameter is often thought to improve robustness by "disentangling" features. The authors found that while higher $\beta$ values do increase latent space robustness (making it harder to move the representation), they do not stop successful attacks. Even at high $\beta$, an attacker can still force the model to produce a reconstruction that looks like the target image.

Comparison of adversarial reconstructions for different $\beta$ values. While higher $\beta$ increases resistance, the model can still be forced to reconstruct target-like features.

Attacking the Hierarchy

The most striking finding involves NVAE, which uses a hierarchy of latent variables. The authors discovered that to successfully attack these deep models, they only needed to target the higher-order latent variables. These top-level variables control semantic features (like face orientation or hairstyle), while lower-level ones handle fine details. By perturbing just the "top" of the hierarchy, they could drastically change the meaning of the image while maintaining an MSSSIM of over 0.97 relative to the original image.

Conclusion

This paper serves as a "call to arms" for researchers using VAEs in security-sensitive applications. Across all models, the noise added by the attack is essentially imperceptible to humans, yet it allows for total "hijacking" of the latent space. While $\beta$-VAEs offer a slight increase in robustness, it is clearly not enough to stop a determined attack. Future research should focus on defining better robustness measures and developing new training objectives that specifically protect the latent space from these types of distributional shifts.

Summary updated

BibTeX
@misc{kuzina2021diagnosing,
  author = {Anna Kuzina and Max Welling and Jakub M. Tomczak},
  title = {{Diagnosing Vulnerability of Variational Auto-Encoders to Adversarial Attacks}},
  year = {2021},
  eprint = {2103.06701},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2103.06701},
}
Figure