Regularizing Hard Examples Improves Adversarial Robustness
Authors: Hyungyu Lee, Saehyung Lee, Ho Bae, Sungroh Yoon
Organizations: Electrical and Computer Engineering Interdisciplinary Program in Artificial Intelligence Seoul National University, Seoul 08826, Republic of Korea · Department of Cyber Security Ewha Womans University, Seoul 03760, Republic of Korea · Electrical and Computer Engineering Interdisciplinary Program in Artificial Intelligence AIIS, ASRI, INMC, and ISRC, Seoul National University Seoul National University, Seoul 08826, Republic of Korea
Recent studies have validated that pruning hard-to-learn examples from training improves the generalization performance of neural networks (NNs). In this study, we investigate this intriguing phenomenon -- the negative effect of hard examples on generalization -- in adversarial training. Particularly, we theoretically demonstrate that the increase in the difficulty of hard examples in adversarial training is significantly greater than the increase in the difficulty of easy examples. Furthermore, we verify that hard examples are only fitted through memorization of the label in adversarial training. We conduct both theoretical and empirical analyses of this memorization phenomenon, showing that pruning hard examples in adversarial training can enhance the model's robustness. However, the challenge remains in finding the optimal threshold for removing hard examples that degrade robustness performance. Based upon these observations, we propose a new approach, difficulty proportional label smoothing (DPLS), to adaptively mitigate the negative effect of hard examples, thereby improving the adversarial robustness of NNs. Notably, our experimental result indicates that our method can successfully leverage hard examples while circumventing the negative effect.
Figures & tables
Figure 1: The test accuracy (for clean examples) of the standard (STD) models and the test accuracy (for adversarial examples) of the adversarial (PGD ( Madry et al., 2017 ) ) models trained on the subsets of CIFAR-10. On pruning hard examples from training, test accuracy increases both in the STD and PGD models, but the increase in the PGD model is greater than that in the STD model.
Figure 2: The schematic illustration of easy ( x2 ) and hard examples ( x1 ).
Figure 3: Average error vector norm (EL2N score ( Paul et al., 2021 ) ) of training examples.
Figure 4: (a) and (b) show the training and test accuracy curves in the STD and PGD models, respectively. (c) shows the training accuracy of hard examples and test accuracy of the models with different adversarial budgets ϵ .
Model
Std.
Rob.
None
87.19
51.80
Easy pruning
87.27
49.71
Hard pruning
84.70
53.36
Table 1: Performance of models with and without pruning 10k hard or easy examples.
Figure 5: Comparison of the memorization property in adversarial training. Only hard examples exhibit the memorization property.
Method
STD
PGD
Std.
Rob.
Normal
78.46
61.63
39.56
Hard
77.60
19.92
8.68
Table 2: Performance of models trained with 10k examples.
Figure 6: The standard and robust accuracies of the models whose labels of subsets are corrupted.
Figure 7: (a) and (b) show the standard and robust accuracies of STD and PGD models where subset of training data is pruned. (c) shows the results that repeat the experiment (a) or (b) for different adversarial budgets.
Figure 8: (a) the test standard accuracy and (b) robust accuracy of the PGD LS models. (c) the performance comparisons of the PGD LS and pruning models.
Table 3: Performance of the models for mitigation methods. The best results are indicated in bold.
Figure 9: The training and test accuracy curves of the PGD and the PGD with DPLS model on CIFAR-10.
Table 13
Appendix figures & tables21 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 10: Test accuracy of PGD models trained with subsets of CIFAR-10.
Figure 11: Average error vector norm (EL2N score) of hard and easy examples.
Figure 12: (a) presents the training and test loss curves in the PGD model. (b) shows the training and test accuracy in the PGD models with ϵ=4 . (c) shows the training and test accuracy in the PGD models with ϵ=2 .
Figure 13: Memorization of easy and hard examples in each setting. Clean example results for a standard setting and adversarial example results for adversarial settings.
Method
STD
PGD ( ϵ=2 )
PGD ( ϵ=4 )
PGD ( ϵ=8 )
Std.
Rob.
Std.
Rob.
Std.
Rob.
Std.
Rob.
Easy
78.46
-
75.66
62.00
69.65
51.51
61.63
39.56
Hard
77.60
-
45.47
22.54
32.17
9.04
19.92
8.68
Appendix
Table 7: Performance of models trained with 10k examples.
Dataset
PGD
TRADES
Std.
Robust
Robust
Std.
Robust
Robust
(PGD)
( A3 )
(PGD)
( A3 )
Normal
86.82
50.25
46.07
84.83
51.43
46.69
Corrupted
82.31
49.32
45.67
82.11
50.64
46.15
Pruned
85.99
52.36
48.81
84.71
53.44
48.78
Appendix
Table 8: Performance comparison of the final accuracy for models with label corruption.
Dataset
Model
Method
λ (smoothing factor)
Avg. smoothing
CIFAR-10
PGD
LS
0.900
0.900
DPLS
0.500
0.897
TRADES
LS
0.900
0.900
DPLS
0.500
0.893
CIFAR-100
PGD
LS
0.900
0.900
DPLS
0.700
0.862
Appendix
Table 9: The smoothing factor λ and the average of label smoothing factor for each model in Table 3(c) in the main paper.
Method
PGD
TRADES
Std.
Robust
Robust
Std.
Robust
Robust
(PGD)
( A3 )
(PGD)
( A3 )
-
87.19
56.44
51.8
85.66
58.46
54.08
C-score
88.05
57.58
52.9
86.6
59.0
54.71
CE loss
87.51
57.47
52.73
86.02
58.64
54.45
EL2N
87.27
58.89
53.38
86.94
58.94
54.32
Appendix
Table 10: Performance of DPLS according to various difficulty measurement losses.
Table 22
Figure 14: The class distributions of 10k easy and 10k hard examples in CIFAR-10 selected by using accumulated 0-1 loss difficulty.
Figure 15: The 0-1 loss distributions of the each training dataset: CIFAR-10, CIFAR-100, and SVHN.
Figure 16: Easy and hard examples in CIFAR-10 Krizhevsky et al. (2009) selected by using accumulated 0-1 loss difficulty. Original denotes the ground-truth class of images and prediction denotes the most frequently predicted class of images at each epoch of training until the calculation epoch.
Method
Std.
Robust (PGD)
Robust ( A3 )
PGD
87.19
56.44
51.8
+DPLS
86.17
58.14
53.98
PGD (*)
86.75
56.24
51.81
+Reweight (*)
25.91
22.16
21.93
+Adaptive Target (*)
86.04
58.21
52.87
+Reweight+Adaptive Target (*)
30.49
25.81
25.6
Appendix
Table 13: Performance comparison with the methods in Liu et al. (2021) . The models trained using the code in Liu et al. (2021) are denoted as (*).
Table 27
Model
λ (smoothing factor)
Avg. smoothing
Standard
Robust (PGD)
Robust ( A3 )
PGD
-
1.0
87.19
56.44
51.8
0.9
0.98
87.73
56.8
52.37
0.7
0.939
87.25
57.58
53.17
0.5
0.898
87.13
58.43
54.03
0.3
0.857
86.09
58.51
54.29
0.1
0.816
85.2
58.36
53.92
Appendix
Table 16: Performance of DPLS applying to the PGD model on CIFAR-10 according to the smoothing factor λ .
Model
λ (smoothing factor)
Avg. smoothing
Standard
Robust (PGD)
Robust ( A3 )
TRADES
-
1.0
85.66
58.46
54.08
0.9
0.979
85.49
58.74
54.39
0.7
0.935
85.41
59.08
54.8
0.5
0.893
85.36
59.33
55.19
0.3
0.85
84.95
59.29
55.22
0.1
0.807
84.06
59.25
55.38
Appendix
Table 17: Performance of DPLS applying to the TRADES model on CIFAR-10 according to the smoothing factor λ .
Method
PGD
TRADES
Std.
Robust
Robust
Std.
Robust
Robust
(PGD)
( A3 )
(PGD)
( A3 )
-
87.19
56.44
51.8
85.66
58.46
54.08
DPR
86.1
57.32
53.2
84.63
58.54
54.88
DPLS
87.13
58.43
54.03
85.36
59.33
55.19
Appendix
Table 18: Performance comparison of DPLS with reweighting methods.
Model
Method
Balancing
Standard
Robust (PGD)
Robust (CW)
Robust ( A3 )
TRADES
-
-
85.66
58.46
56.53
54.08
C-score
\lx@scalerel@obj◯
85.2
57.87
56.72
53.97
C-score
×
85.35
58.52
56.82
54.25
CE loss
\lx@scalerel@obj◯
83.7
57.49
56.76
54.01
CE loss
×
83.82
58.37
57.31
54.45
EL2N
\lx@scalerel@obj◯
83.8
57.76
56.89
54.07
Appendix
Table 19: Performance of pruning models according to various difficulty losses with and without balancing the excluded data number of each class.
Model
Method
PGD
PGD (easy)
PGD (hard)
A3
A3 (easy)
A3 (hard)
PGD
-
56.54
70.5
42.58
51.8
67.62
35.98
DPLS
58.49
71.82
45.16
54.05
68.66
39.44
TRADES
-
58.52
71.42
45.62
54.08
68.64
39.52
DPLS
59.32
72.9
45.74
55.19
70.22
40.16
Appendix
Table 20: Robustness performance against adversarial attacks for easy class and hard class subsets of CIFAR-10.
Method
PGD
TRADES
Std.
Robust
Robust
Robust
Std.
Robust
Robust
Robust
(MD)
(RayS)
( A3 )
(MD)
(RayS)
( A3 )
-
87.19
51.93
61.13
51.80
85.66
54.17
60.84
54.08
DPLS
87.13
54.07
62.14
54.03
85.36
55.25
62.11
55.19
Appendix
Table 21: Performance evaluation of DPLS using MD ( Jiang et al., 2020 ) and RayS ( Chen and Gu, 2020 ) attacks.
Dataset
PGD
TRADES
Std.
Robust
Std.
Robust
( A3 )
( A3 )
Baseline
88.28
53.32
86.13
56.05
Baseline + DPLS
86.72
56.25
85.15
56.84
Baseline + DiffPure
88.28
66.87
87.11
66.80
Baseline + DPLS + DiffPure
87.50
68.61
86.72
71.09
Appendix
Table 22: Performance evaluation of DPLS combined with Diffpure ( Nie et al., 2022 ) on RobustBench ( Croce et al., 2020 )