Maintaining Adversarial Robustness in Continuous Learning

Xiaolei Ru, Gang Yan, Xiaowei Cao, Wenjia Wei, Xia Zhu, Jack Murdoch Moore, Xin-Ya Zhang · Submission to ICLR 2025 · Rejected

TL;DR

While deep neural networks can learn sequential tasks without catastrophic forgetting, they rapidly lose their adversarial robustness on earlier tasks when weights update. This paper introduces Double Gradient Projection (DGP), a continual learning method that projects weight updates to be orthogonal to both layer-wise output representations and input-sample gradients. By stabilizing sample gradient smoothness across tasks without revisiting past data, DGP prevents adversarial vulnerability from creeping back in.

What Problem Does This Paper Address?

In continual learning, models must learn a sequence of tasks without "catastrophically forgetting" previous ones—ideally without storing or revisiting raw historical data. In parallel, adversarial defense techniques (like Input Gradient Regularization [IGR] or Adversarial Training [AT]) train networks so that small, imperceptible input perturbations do not fool the model.

However, the intersection of these two areas—robust continual learning—faces an overlooked dilemma: even when existing continual learning techniques retain high classification accuracy on older tasks, their adversarial defenses rapidly erode as new tasks are learned. Naively stacking defenses onto continual learning methods (such as EWC or GEM + IGR) causes gradient conflicts, rendering the defenses or the continual learning mechanisms ineffective.

Methods

DGP builds on the intuition that adversarial defense methods primarily work by smoothing the loss landscape w.r.t. the inputs ($\partial \hat{y} / \partial x$). If weight updates on new tasks distort these smoothed gradients on past tasks, the model becomes fragile again.

  1. Two-Fold Orthogonal Projection: Standard Gradient Projection Memory (GPM) prevents catastrophic forgetting by projecting weight updates orthogonal to the subspace spanned by historical layer activations ($X^l$). DGP doubles down by constraining weight updates $\Delta W^l$ to simultaneously satisfy two conditions:

  2. Output representation stability: $X^l \Delta W^l \approx 0$ (preserves clean accuracy).

  3. Input gradient stability: $\frac{\partial X^l}{\partial X} \Delta W^l \approx 0$ (preserves smoothed sample gradients).
  4. Weak Guarantee Approximation: Computing exact input-sample Jacobian matrices $\frac{\partial X^l}{\partial X} \in \mathbb{R}^{(n m_1) \times m_l}$ for SVD is prohibitively expensive. The authors apply a column-wise summation at the first-layer Jacobian, compressing the target matrix to $\mathbb{R}^{n \times m_l}$. This stabilizes the sum of gradients w.r.t. all input features rather than each individual feature, which provides sufficient empirical stability at a fraction of the computational cost.

  5. Convolutional & Batch Normalization Adaptations: The authors reshape convolutional Jacobians into $(n h_{l+1} \omega_{l+1}, c_l k_l k_l)$ matrices so that the resulting basis vectors directly constrain convolution kernel weights. They also optimize memory requirements for batch normalization layers by decomposing their large Jacobian across channels.

Datasets

The authors evaluate DGP across four supervised image classification benchmarks split into 10 sequential tasks:

  • Permuted MNIST (10 tasks with randomly permuted pixels)
  • Rotated MNIST (10 tasks with random image rotations)
  • Split-CIFAR100 (10 subsets of 10 disjoint classes each)
  • Split-miniImageNet (10 subsets of 5 disjoint classes each)

Key Insights and Ideas

  • The Fragility of Robustness: Retaining clean classification performance does not imply robustness is preserved. Methods like GEM or GPM preserve output predictions well, but their sample gradients drift significantly, allowing attacks like PGD and AutoAttack to easily dismantle defenses on earlier tasks.
  • Mutual Interference of Naive Combinations: Directly adding IGR or adversarial training to loss-regularization methods like EWC creates competing gradient objectives that degrade clean performance to near naive SGD levels.
  • Gradient Smoothness as the Invariant: Explicitly constraining weight updates to lie in the null space of historical input gradients preserves the low-curvature properties established by initial adversarial defense training.

Key Results

Under FGSM, PGD, and AutoAttack (the strongest test suite):

  • Permuted MNIST: Under AutoAttack after 10 tasks, DGP paired with IGR maintains 81.6% accuracy, compared to 70.4% for GPM, 12.1% for GEM, and 14.1% for naive SGD.
  • Rotated MNIST: DGP achieves 81.6% AutoAttack accuracy (and a positive backward transfer of +0.02), whereas GPM drops to 68.8% and GEM falls to 11.9%.
  • Split-CIFAR100: DGP sustains 36.6% AutoAttack accuracy versus GPM's 34.4% and GEM's 21.2%.
  • Adversarial Training Compatibility: When paired with Adversarial Training (AT) rather than IGR on PMNIST, DGP similarly avoids the catastrophic collapse seen in GEM and GPM against PGD and AutoAttack.

Limitations and Future Work

  • Trade-off with Network Plasticity: By storing two distinct sets of basis vectors per task, DGP consumes available subspace dimensions twice as fast. This narrower null space limits model plasticity on later tasks (e.g., clean ACC on Split-CIFAR100 was 48.0% for DGP vs. 53.7% for standard GPM).
  • Subspace Saturation: If the orthogonal basis matrix reaches full rank over long task sequences, rank-reduction via SVD approximation is required, which may compromise earlier constraints.
  • Reduced Attack Perturbation Budgets: Because combining continual learning with robustness is exceptionally challenging, perturbation magnitudes ($\epsilon$) had to be scaled slightly lower than standard static benchmarks (e.g., $\epsilon = 2/255$ for CIFAR100 AutoAttack) to avoid immediate collapse across all baseline models.

Summary updated

BibTeX
@misc{ru2024maintaining,
  author = {Xiaolei Ru and Gang Yan and Xiaowei Cao and Wenjia Wei and Xia Zhu and Jack Murdoch Moore and Xin-Ya Zhang},
  title = {{Maintaining Adversarial Robustness in Continuous Learning}},
  year = {2024},
  eprint = {2402.11196},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2402.11196},
}
Figure