On the Robustness of Quality Measures for GANs

Motasem Alfarra, Juan C. Pérez, Anna Frühstück, Philip H. S. Torr, Peter Wonka, Bernard Ghanem

TL;DR

This paper reveals that popular metrics for evaluating Generative Adversarial Networks (GANs), like FID and IS, are surprisingly brittle and can be easily fooled by subtle image manipulations. The authors propose a more robust version of FID, R-FID, by using adversarially-trained models, which shows improved resilience against these attacks.

What Problem Does This Paper Address?

Generative Adversarial Networks (GANs) have made incredible strides in generating realistic images, but evaluating their performance remains a significant challenge. Metrics like the Inception Score (IS) and Fréchet Inception Distance (FID) are widely used to quantify the quality and diversity of generated images. These metrics are crucial for comparing different GAN models and guiding research. However, the paper questions whether these metrics truly reflect perceptual image quality, especially when faced with adversarial manipulations. The core problem is that if these widely-used metrics can be easily tricked, they might not be reliable indicators of a GAN's true generative capabilities, potentially leading research in the wrong direction.

Methods

The authors investigate the robustness of IS and FID by introducing two main types of attacks:

  • Pixel Perturbations: They apply small, imperceptible pixel-level changes to real images to see if they can artificially inflate or deflate the IS and FID scores. This involves optimizing perturbations to either make "good" images look "bad" to the metrics or "bad" images look "good."
  • Latent Space Perturbations: They explore how manipulating the latent space of a state-of-the-art GAN (StyleGANv2) affects FID scores. This involves adding small perturbations to the latent vectors that are fed into the generator.

To address the identified vulnerabilities, they propose R-FID (Robust FID). This is achieved by replacing the standard, pre-trained Inception model used in FID calculation with an adversarially-trained Inception model. The idea is that a model trained to be robust against adversarial attacks will provide more reliable feature representations, leading to a more robust FID.

Datasets

  • ImageNet: Used for training and evaluating the robustness of the metrics and the proposed R-FID.
  • CIFAR10: Used for some experiments to assess metric robustness.
  • FFHQ: Used as the target dataset for StyleGANv2 in latent space perturbation experiments.

The paper does not introduce new benchmark datasets but rather uses existing ones to test the robustness of established metrics.

Key Insights and Ideas

  • Metrics are Brittle: The most striking insight is that standard GAN quality metrics (IS and FID) are surprisingly easy to fool with small, imperceptible perturbations. This means a GAN could achieve high scores without actually producing high-quality images.
  • "Good" Images, "Bad" Scores & Vice Versa: The authors demonstrate they can create:
  • Images that look perceptually similar to real images but receive very high FID scores (indicating they are very different from the real distribution).
  • Images that are essentially random noise but receive very low FID scores (indicating they are very similar to the real distribution).
  • Latent Space Vulnerability: The vulnerability extends beyond pixel-level attacks; manipulating the latent space of GANs can also lead to misleading FID scores.
  • Robustness through Adversarial Training: Replacing the standard Inception model with an adversarially-trained one (leading to R-FID) significantly improves the metric's resistance to these attacks. This suggests that the choice of the underlying feature extractor is critical for metric reliability.
  • Perceptually Correlated Perturbations: When attacking the R-FID, the generated perturbations are more semantically meaningful and visually correlated with human perception, unlike the more random-looking perturbations that fool the standard FID.

Key Results

  • FID Manipulation: The paper shows that FID can be manipulated to achieve scores as high as ~7900 by adding small pixel perturbations to ImageNet, while also generating random noise images with an FID of ~1.05 to ImageNet.
  • R-FID Improvement: R-FID demonstrates a significant improvement in robustness against pixel perturbations. For instance, with a perturbation budget of $\epsilon = 0.01$, R-FID (with $\kappa=128$) shows an FID of 4, whereas the standard FID reaches ~7900.
  • Latent Space Attack Effectiveness: Attacks on StyleGANv2's latent space can significantly increase FID, highlighting the metric's inconsistency. For example, FID increased from 2.65 to 31.68 for a truncation level of $\alpha=1.0$.
  • R-FID vs. FID on Latent Attacks: R-FID shows a much smaller increase (e.g., 44% increase) under latent space attacks compared to FID (e.g., 1000% increase), indicating better robustness.
  • R-FID Distinguishes Distributions: R-FID is shown to better distinguish between real and generated distributions, providing more meaningful separation than FID, especially when dealing with different truncation levels of StyleGANv2.

Limitations and Future Work

  • Focus on Feature Extraction: The paper primarily addresses the robustness of the feature extraction component (the Inception model) within FID. It acknowledges that the statistical measurement part (e.g., Wasserstein distance) could also be a source of vulnerability and suggests future work to explore more robust statistical measures.
  • Direct Quality Assessment: Current metrics, including the proposed R-FID, indirectly assess quality through feature representations. The authors note that developing metrics that directly assess visual quality remains an open and important problem.
  • Future of R-FID: The authors believe that R-FID, by incorporating robustly-trained models, is a step towards more reliable GAN evaluation metrics and could be part of future solutions. They also suggest exploring the w-space formulation for attacks on R-FID.

Summary updated

BibTeX
@misc{alfarra2022robustness,
  author = {Motasem Alfarra and Juan C. Pérez and Anna Frühstück and Philip H. S. Torr and Peter Wonka and Bernard Ghanem},
  title = {{On the Robustness of Quality Measures for GANs}},
  year = {2022},
  eprint = {2201.13019},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2201.13019},
}
Figure