Enhancing Adversarial Training with Second-Order Statistics of Weights

Gaojie Jin, Xinping Yi, Wei Huang, Sven Schewe, Xiaowei Huang
3/11/2022
cs.LG
bayesian

Official code: Alexkael/S2O (26 stars, Python, last commit 2025-06-04).

Abstract

Adversarial training has been shown to be one of the most effective approaches to improve the robustness of deep neural networks. It is formalized as a min-max optimization over model weights and adversarial perturbations, where the weights can be optimized through gradient descent methods like SGD.

Show full abstract

In this paper, we show that treating model weights as random variables allows for enhancing adversarial training through \textbf{S}econd-Order \textbf{S}tatistics \textbf{O}ptimization (S$^2$O) with respect to the weights. By relaxing a common (but unrealistic) assumption of previous PAC-Bayesian frameworks that all weights are statistically independent, we derive an improved PAC-Bayesian adversarial generalization bound, which suggests that optimizing second-order statistics of weights can effectively tighten the bound. In addition to this theoretical insight, we conduct an extensive set of experiments, which show that S$^2$O not only improves the robustness and generalization of the trained neural networks when used in isolation, but also integrates easily in state-of-the-art adversarial training techniques like TRADES, AWP, MART, and AVMixup, leading to a measurable improvement of these techniques. The code is available at \url{https://github.com/Alexkael/S2O}.

View on arXivView PDF

Code Implementations(1)

Alexkael/S2OOfficial100%
262PythonMar 10, 20221 years ago

Similar Papers

Cite this paper

@article{jin2022enhancing,
  title  = {Enhancing Adversarial Training with Second-Order Statistics of Weights},
  author = {Gaojie Jin and Xinping Yi and Wei Huang and Sven Schewe and Xiaowei Huang},
  year   = {2022},
  eprint = {2203.06020},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2203.06020}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2203.06020.svg)](https://codeofpaper.com/paper/2203.06020)

Discussion