Dynamic-Weighted Contrastive Adversarial Training
Abstract
Adversarial training (AT) is a mainstream paradigm for improving the robustness of deep models. However, natural and adversarial examples often exhibit distributional discrepancies in feature space, and fixed-weight contrastive constraints can conflict with classification learning when applied throughout training. To address this issue, we propose Dynamic-weighted Contrastive Adversarial Training (DWCAT). Built on the AT framework, DWCAT treats the natural and adversarial versions of the same image as positive pairs, aligns their representations in the feature space via NT-Xent, and gradually introduces the contrastive term through a staged dynamic weighting scheme, distinct from the fixed-weight strategies commonly adopted in existing contrastive adversarial training methods. Experiments on CIFAR-10 show that DWCAT achieves 82.31% natural accuracy, 51.66% robust accuracy under PGD-10, and a mean robustness score of 52.47%, which is the highest among the compared methods. Ablation studies further confirm the effectiveness of dynamic weighting and the natural-adversarial positive-pair design.