Organizations: Department of Computer Science, University of Exeter, Exeter, UK · National Mobile Communications Research Laboratory, Southeast University, Nanjing, China · Department of Computer Science, University of Liverpool, Liverpool, UK
Adversarial training has emerged as a highly effective way to improve the robustness of deep neural networks (DNNs). It is typically conceptualized as a min-max optimization problem over model weights and adversarial perturbations, where the weights are optimized using gradient descent methods, such as SGD. In this paper, we propose a novel approach by treating model weights as random variables, which paves the way for enhancing adversarial training through Second-Order Statistics Optimization (S2O) over model weights. We challenge and relax a prevalent, yet often unrealistic, assumption in prior PAC-Bayesian frameworks: the statistical independence of weights. From this relaxation, we derive an improved PAC-Bayesian robust generalization bound. Our theoretical developments suggest that optimizing the second-order statistics of weights can substantially tighten this bound. We complement this theoretical insight by conducting an extensive set of experiments that demonstrate that S2O not only enhances the robustness and generalization of neural networks when used in isolation, but also seamlessly augments other state-of-the-art adversarial training techniques. The code is available at https://github.com/Alexkael/S2O.
Figures & tables
Fig. 1: Illustration of the theoretical framework: perturbation bound with consideration of correlated weights. Under this framework, a standard generalization bound is extended to a robust generalization bound with weight correlation matrix, and further to a bound with weight correlation matrix estimated over both clean data and adversarial data.
Fig. 2: Illustration of the optimization framework: Theorem III.2 and Theorem III.5 show the influence of the second-order statistics of weights, over clean and adversarial data, on the robust generalization performance. In Section IV-A , we demonstrate that these statistics can be approximately optimized using the Frobenius norm of the correlation matrix. To simplify this optimization process, we employ the Laplace approximation in Section IV-B and propose our adversarial training methodology, S 2 O, in Section IV-C .
Fig. 3: We sample 10000 9-dimensional correlation matrices and demonstrate (a) ∥Rl,x∥F2 , ∥Rl,x′∥F2 w.r.t Λl,maxc or Λl,maxr ; (b) ∥Rl,x∥F2 , ∥Rl,x′∥F2 w.r.t Λl,minklΛl,maxh2−kl ; (c) ∥Rl,x∥F2 , ∥Rl,x′∥F2 w.r.t Λl,maxc or Λl,maxr ; (d) ∥Rl,x∥F2 , ∥Rl,x′∥F2 w.r.t Λl,minklΛl,maxh2−kl . Note that the horizontal axis represents both ∥Rl,x∥F2 and ∥Rl,x′∥F2 .
Fig. 4: We train PreAct ResNet18 with AT and AT+S 2 O on CIFAR-10, and show the results of partial weights. The results estimated from adversarial data are presented in the top figures , while the bottom figures show the results estimated from clean data. (a) shows the normalized spectral norm of Rc , Rr , and the determinant of R , with sampling estimation and Laplace approximation respectively. (b) and (c) demonstrate the absolute correlation matrix of partial weights, for AT and AT+S 2 O respectively.
Threat
Method
CIFAR-10
CIFAR-100
SVHN
Model
Clean
PGD
Time
Clean
PGD
Time
Clean
PGD
Time
ℓ∞
AT
82.41
52.77
309s
58.02
28.02
307s
93.17
60.91
509s
AT+S 2 O
83.65
55.11
368s
58.45
30.58
371s
93.39
64.83
595s
ℓ2
AT
88.83
68.83
292s
64.21
42.20
290s
94.02
66.76
477s
AT+S 2 O
89.57
69.42
364s
65.32
44.07
366s
94.93
76.19
586s
TABLE I: Adversarial training across datasets on PreAct ResNet18 (%).
Dataset
Method
Model
DDPM Data
Clean
AA
CIFAR-10
Lee et al. (2020) [ 35 ]
WRN-34-10
-
92.56
39.70
Wang et al. (2020) [ 56 ]
WRN-34-10
-
83.51
51.10
Rice et al. (2020) [ 47 ]
WRN-34-20
-
85.34
53.42
Zhang et al. (2020) [ 64 ]
WRN-34-10
-
84.52
53.51
Pang et al. (2021) [ 44 ]
WRN-34-20
-
86.43
54.39
Jin et al. (2023) [ 28 ]
WRN-34-20
-
85.98
54.20
TABLE III: Experiments with DDPM generated data under ℓ∞ attack (%).
Radius
Method
Clean
ℓ∞
ℓ2
ℓ1
Union
ℓ∞:2552ℓ2:0.5ℓ1:12
Croce et al. (2022) [ 11 ]
87.2
73.3
64.1
55.4
55.4
Tramer et al. (2019) [ 55 ]
85.6
72.1
63.6
56.4
56.4
Jiang et al. (2024) [ 25 ]
86.3
73.3
64.9
59.1
59.1
+ S 2 O
87.1
73.6
65.3
59.9
59.9
ℓ∞:2558ℓ2:1.5ℓ1:12
Croce et al. (2022) [ 11 ]
83.5
41.0
25.5
52.9
25.5
Tramer et al. (2019) [ 55 ]
74.6
42.9
35.7
50.3
35.6
TABLE IV: Experiments on CIFAR-10 with multiple ℓp attacks (%).
Method
CIFAR-10
CIFAR-100
Clean
AA
Sum
Clean
AA
Sum
AT
86.06
46.26
132.32
59.83
23.94
83.77
Suzuki et al. (2023) [ 51 ]
90.24
50.20
140.44
73.05
24.32
97.37
Waseda et al. (2025) [ 58 ]
90.89
50.77
141.66
72.51
24.18
96.70
+S 2 O
90.45
53.16
143.61
72.36
27.09
99.45
TABLE V: Experiments on CIFAR to measure the trade-off ( ℓ∞ , %).