Domain Invariant Adversarial Learning

Matan Levi, Idan Attias, Aryeh Kontorovich

Abstract

The phenomenon of adversarial examples illustrates one of the most basic vulnerabilities of deep neural networks. Among the variety of techniques introduced to surmount this inherent weakness, adversarial training has emerged as the most effective strategy for learning robust models. Typically, this is achieved by balancing robust and natural objectives. In this work, we aim to further optimize the trade-off between robust and standard accuracy by enforcing a domain-invariant feature representation. We present a new adversarial training method, Domain Invariant Adversarial Learning (DIAL), which learns a feature representation that is both robust and domain invariant. DIAL uses a variant of Domain Adversarial Neural Network (DANN) on the natural domain and its corresponding adversarial domain. In the case where the source domain consists of natural examples and the target domain is the adversarially perturbed examples, our method learns a feature representation constrained not to discriminate between the natural and adversarial examples, and can therefore achieve a more robust representation. DIAL is a generic and modular technique that can be easily incorporated into any adversarial training method. Our experiments indicate that incorporating DIAL in the adversarial training process improves both robustness and standard accuracy.

Introduction

Deep neural networks are notoriously fragile; small, calculated perturbations—known as adversarial examples—can easily trick them into making incorrect predictions. While Adversarial Training (AT) is the most effective defense, it typically introduces a "robustness-accuracy trade-off," where resilience to attacks comes at the cost of performance on clean, natural data.

The authors of DIAL identify that adversarial perturbations induce significant shifts in the internal feature representations of a network. They argue that if a model can be forced to ignore the differences between natural and adversarial inputs at the feature level, it will become more robust without sacrificing standard performance.

Methodology

The core of the DIAL framework is framing adversarial vulnerability as a domain adaptation problem. It draws inspiration from Domain-Adversarial Neural Networks (DANN), typically used to bridge the gap between different data distributions (e.g., synthetic vs. real images).

The Architecture

DIAL adds a modular "Domain Classifier" head to a standard network architecture, consisting of three main components:

  1. Feature Extractor ($G_f$): Learns the internal representation of the data.
  2. Label Classifier ($G_y$): Predicts the semantic class.
  3. Domain Classifier ($G_d$): Attempts to distinguish between natural and adversarially perturbed inputs.
The DIAL architecture incorporates a domain classifier and a gradient reversal layer to enforce feature invariance between natural and adversarial domains.

Gradient Reversal

The key mechanism is the Gradient Reversal Layer (GRL) placed before the domain classifier. During training, the Domain Classifier learns to identify adversarial examples, while the Feature Extractor—receiving the negative of the domain classifier's gradient—is forced to learn representations that make natural and adversarial examples indistinguishable. This results in two main variants: DIAL-CE (Cross-Entropy) and DIAL-KL (Kullback-Leibler divergence).

Key Insights and Results

DIAL consistently outperforms state-of-the-art defenses like TRADES and MART across benchmarks including MNIST, SVHN, and CIFAR-10/100. By minimizing the "discrepancy distance" between natural and adversarial distributions, the method provides a stronger theoretical upper bound on adversarial error.

Performance Metrics

Experiments demonstrate that DIAL improves both natural accuracy and robustness against various attack vectors. For instance, on CIFAR-10, DIAL-CE significantly boosts natural accuracy while DIAL-KL provides superior robustness against white-box attacks like PGD and Auto-Attack (AA).

Performance comparison on CIFAR-10 showing that DIAL variants improve both natural accuracy and robustness against white-box and black-box attacks compared to standard adversarial training (AT).

Beyond standard benchmarks, DIAL showed a 4.7% average improvement on CIFAR-10-C (natural corruptions), proving that domain-invariant features help with general noise, not just specific mathematical attacks. Furthermore, models trained with DIAL proved to be superior feature extractors for transfer learning tasks.

Conclusion

DIAL offers a modular, "plug-and-play" solution to the robustness-accuracy trade-off by treating adversarial perturbations as a domain shift. While it shares the computational overhead inherent in generating adversarial examples during training, its ability to leverage unlabeled data and its strong performance against unforeseen corruptions make it a promising direction for building truly resilient deep learning systems.

Summary updated

BibTeX
@article{levi2022domain,
  author = {Matan Levi and Idan Attias and Aryeh Kontorovich},
  title = {{Domain Invariant Adversarial Learning}},
  journal = {Accepted by TMLR},
  year = {2022},
  url = {https://openreview.net/forum?id=U8uJAUMzj9},
}
Figure