Semantic Image Attack for Visual Model Diagnosis

Jinqi Luo, Zhaoning Wang, Chen Henry Wu, Dong Huang, Fernando De la TorrearXiv 2023

Abstract

In practice, metric analysis on specific training and testing datasets does not guarantee reliable or fair machine learning models. This is largely due to the difficulty of obtaining balanced, diverse, and perfectly labeled datasets. Rather than relying solely on curated test sets, we propose Semantic Image Attack (SIA), an adversarial framework that generates semantic adversarial images to enable model diagnosis, interpretability, and robustness. SIA combines semantic traceability and perceptual quality via iterative gradient ascent on a predefined semantic attribute space and the image space. We demonstrate SIA's utility in model diagnosis, generating stronger attacks, and improving robustness to imbalanced datasets.

Introduction

Traditional evaluation of computer vision models often relies on aggregate metrics like accuracy or mean Average Precision (mAP). However, these metrics can mask underlying biases. For instance, a model might perform well on a test set that shares the same biases as the training set, only to fail in real-world scenarios when encountering rare attribute combinations. Existing adversarial attacks, such as PGD, typically focus on pixel-level noise that is uninterpretable to humans. Conversely, purely semantic attacks often lack visual realism. Semantic Image Attack (SIA) bridges this gap by creating adversarial examples with interpretable semantic attributes that reveal a model's specific vulnerabilities.

Methodology

The core of SIA is a hybrid optimization strategy that leverages a Generative Adversarial Network (GAN), specifically AttGAN, to manipulate facial attributes. Unlike standard attacks that only perturb pixels, SIA performs iterative gradient ascent on both the image space and a predefined semantic attribute space (e.g., "Bald," "Mustache," "Eyeglasses").

Overview of Semantic Image Attack (SIA) for model diagnosis. The attack perturbs semantic attributes and image pixels to identify model vulnerabilities, visualized through sensitivity histograms.

To stabilize the attack, SIA employs "sign linearization." By updating both the pixel and attribute spaces simultaneously, the pixel-level noise acts as a buffer that prevents semantic changes from becoming visually distorted—a phenomenon known as "synthesis collapse." This approach allows for the generation of high-quality adversarial images that remain semantically meaningful.

Model Diagnosis and Interpretability

A key feature of SIA is its ability to perform "Visual Model Diagnosis." By tracking which semantic attributes are most influential in causing a misclassification or a failure in keypoint detection, the framework generates a sensitivity histogram. This provides a literal map of the model's triggers.

Experiments on the WFLW (Wider Facial Landmark in the Wild) dataset revealed that keypoint detectors are highly sensitive to the presence of mustaches and eyeglasses, while remaining largely indifferent to hair color. This level of interpretability allows researchers to identify and address specific model flaws without requiring perfectly balanced datasets.

Robustness and Data Augmentation

Beyond diagnosis, SIA serves as a powerful tool for improving model performance across various benchmarks, including CelebA and Microsoft Fake-it.

  • Stronger Attacks: SIA achieves higher attack success rates than baseline methods like PGD or FGSM. For an eyeglasses classifier, SIA reached a 68.2% success rate with minimal perturbation (1.5/255), compared to 49.85% for PGD.
  • Adversarial Training: Models trained using SIA-generated examples exhibit improved transferable robustness across different gradient-based attacks.
  • Handling Imbalanced Datasets: SIA can be used for adversarial data augmentation. By generating images that target underrepresented classes (e.g., "Bangs"), researchers can significantly boost minority class accuracy. In experiments, augmenting a minority class that comprised only 1% of the training data improved accuracy from 62.68% to 79.36%.

Conclusion

Semantic Image Attack transforms adversarial attacks from a security threat into a diagnostic and corrective tool. By integrating semantic traceability with high perceptual quality, SIA provides a pathway toward more reliable, fair, and interpretable visual models. While currently focused on the facial domain and white-box settings, future work aims to extend SIA to other domains and black-box scenarios.

Summary updated

BibTeX
@misc{luo2023semantic,
  author = {Jinqi Luo and Zhaoning Wang and Chen Henry Wu and Dong Huang and Fernando De la Torre},
  title = {{Semantic Image Attack for Visual Model Diagnosis}},
  year = {2023},
  eprint = {2303.13010},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2303.13010},
}
Figure