Adversarial Robustness through the Lens of Causality

Yonggang Zhang, Mingming Gong, Tongliang Liu, Gang Niu, Xinmei Tian, Bo Han, Bernhard Schölkopf, Kun Zhang

Introduction

Deep neural networks (DNNs) have achieved remarkable success across various domains, yet they remain notoriously brittle. A human-imperceptible perturbation to an input image—an adversarial attack—can easily trick a state-of-the-art model into misclassifying a "cat" as a "toaster." While numerous defense mechanisms have been proposed, a fundamental understanding of why these vulnerabilities exist remains elusive.

This research posits that adversarial vulnerability stems from a model's reliance on spurious correlations rather than the true underlying causes of a label. Humans recognize a cat by its physical structure (causal features), whereas DNNs often exploit "shortcuts" like background texture or lighting (nuisance factors). Adversarial attacks exploit these non-causal statistical associations. To address this, the authors introduce CausalAdv, a framework that leverages causal modeling to force models to ignore nuisance factors and focus on invariant content.

The CausalAdv Framework

The core of CausalAdv is a causal generative model that formalizes the relationship between image features and labels.

Causal graph of the generative process, where $C$ is content, $S$ is style, and $E$ is the adversarial intervention.

As shown in the causal graph above, an image ($X$) is viewed as a composition of two independent factors: Content ($C$), which is the direct cause of the label ($Y$), and Style ($S$), representing nuisance factors. In this framework, an adversarial perturbation ($E$) is treated as an "intervention" that manipulates the style factor to alter the model's perception without changing the underlying content.

Adversarial Distribution Alignment

The authors argue that vulnerability arises when a model's prediction depends too heavily on the style factor $S$. To mitigate this, CausalAdv employs a training objective that aligns the model's behavior on natural and adversarial data. Technically, the model's internal representations are decomposed into "content" and "style" components using orthogonal projections. The training process then penalizes the model if its predictions fluctuate significantly when the "style" component of the representation is perturbed. This mechanism encourages the model to extract and rely upon invariant "content" features.

Experimental Evaluation

The effectiveness of CausalAdv was evaluated on three standard benchmarks: MNIST, CIFAR-10, and CIFAR-100. The models were subjected to a battery of white-box attacks, including the Fast Gradient Sign Method (FGSM), Projected Gradient Descent (PGD) with 20 and 40 iterations, and the Carlini & Wagner (C&W) attack.

CausalAdv was implemented as an enhancement to two prominent defense methods: Madry’s Adversarial Training (CausalAdv-M) and TRADES (CausalAdv-T).

Key Results and Insights

The experimental results demonstrate that incorporating causal reasoning consistently improves adversarial robustness across different datasets and architectures.

Robustness results on CIFAR-10 comparing CausalAdv against Madry and TRADES baselines.

As detailed in the table above for the CIFAR-10 dataset (using a ResNet-18 architecture), CausalAdv-T achieved a robust accuracy of 54.55% against PGD-20 attacks, outperforming the standard TRADES baseline of 53.64%. Similarly, CausalAdv-M showed improvements over the Madry baseline. On the more complex CIFAR-100 dataset, CausalAdv-M reached 27.62% robust accuracy, a notable increase from the 25.15% achieved by the standard Madry method.

Beyond raw accuracy, a key insight is that CausalAdv helps mitigate "robust overfitting"—a common phenomenon where a model's robustness on test data declines late in the training cycle. By focusing on the underlying causal structure of the data rather than specific noise patterns, the model achieves better generalization.

Conclusion and Future Directions

CausalAdv provides a novel perspective on adversarial machine learning by framing attacks as interventions in a causal system. By explicitly modeling the distinction between content and style, the method guides DNNs toward more "human-like" reasoning.

While promising, the current approach relies on a simplified causal graph where content and style are independent. Future work may explore more complex, "tangled" feature relationships found in real-world data. Additionally, the authors suggest that incorporating counterfactual reasoning—asking "what if" the background were different—could further enhance both the robustness and the explainability of deep learning models.

Summary updated

BibTeX
@inproceedings{zhang2022adversarial,
  author = {Yonggang Zhang and Mingming Gong and Tongliang Liu and Gang Niu and Xinmei Tian and Bo Han and Bernhard Schölkopf and Kun Zhang},
  title = {{Adversarial Robustness through the Lens of Causality}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=i70LLzMMwXZ},
}
Figure