Learning Robust Representations for Defending White-Box Adversarial Attacks in Continual Learning

Yusen Chen, Fei Ye, Qihe Liu, Adrian G. Bors, shijie zhouNeurIPS 2026

TL;DR

Teaching a neural network to continuously learn new defenses against evolving adversarial attacks usually triggers "catastrophic forgetting"—learning to block Attack B makes it vulnerable to Attack A, or worse, ruins its accuracy on normal, unperturbed images. This paper introduces a framework that solves this tug-of-war not at the final prediction layer, but deep inside the network's internal feature space. By forcing clean and attacked images to share the same geometric representation across time, the model learns to shrug off new white-box attacks while actually improving its memory of older tasks.

What Problem Does This Paper Address?

Imagine deploying a vision model in a security-critical environment. In the real world, attackers don’t use a single static trick; their attack patterns evolve. This brings us to Continual Adversarial Defense (CAD). Unlike standard continual learning—where a model learns new object categories over time—a CAD model faces a sequence of different adversarial attacks (specifically, dangerous "white-box" attacks that have full access to the model's gradients to craft invisible, malicious pixel noise).

The challenge is a brutal three-way tug-of-war:

  1. Plasticity: The model must adapt to defend against a newly arrived attack.
  2. Stability: It cannot forget how to defend against yesterday's attacks (catastrophic forgetting).
  3. Clean Accuracy: Adversarial training notoriously degrades performance on normal, unperturbed ("clean") data.

Existing CAD methods mostly rely on replaying old data or regularizing final output logits (predictions). However, locking down predictions doesn't stop the internal feature representations from drifting wildly as attacks change, leaving the model fragile.

Methods

Instead of playing whack-a-mole at the output layer, the authors propose the Learning Robust Representation Framework (LRRF). The core philosophy is geometric: keep the internal feature distributions aligned across layers, tasks, and classes. To measure and minimize the distance between feature distributions without needing explicit probability densities, LRRF relies heavily on a standard statistical tool called Maximum Mean Discrepancy (MMD) in kernel space.

Figure 1: The LRRF framework includes three core mechanisms (left to right): (1) The Dynamic Rep- resentation Matching (DRM) mechanism yields gradient-based adversarial perturbations and aligns the representations of clean and adversarial examples via representational distance minimization. (2) The Cross-Task Invariant Representation (CTIR) mechanism fuses task-invariant features from prior tasks into novel task optimization to improve feature stability. (3) The Knowledge Consolidation Optimization (KCO) aligns category-consistent feature distributions between clean and adversarial samples to enhance structural robustness.

What’s new is how LRRF orchestrates MMD across three hierarchical levels alongside standard adversarial training and memory replay:

  • Dynamic Representation Matching (DRM) [Intra-task]: Within theinitial task, DRM generates gradient-based adversarial examples and uses MMD across all network layers to pull the feature distributions of clean and adversarial images together. This builds a shared, robust decision boundary without sacrificing clean accuracy.
  • Cross-Task Invariant Representation (CTIR) [Cross-task]: When a new attack arrives, LRRF freezes a copy of the previous task's feature extractor (acting as a historical anchor). CTIR minimizes the MMD distance between the active network's features and this frozen network's features on the new data, ensuring newly learned defenses remain compatible with historical ones.
  • Knowledge Consolidation Optimization (KCO) [Class-conditional]: Using a compact memory buffer of clean images, KCO pairs incoming adversarial images with clean buffered images of the exact same class, using MMD to pull their representations together and preserve category structure over time.

Datasets

The authors evaluate LRRF on five standard image classification benchmarks, spanning low-to-high complexity, using both CNN (ResNet-18) and Vision Transformer (ViT) backbones:

  • CIFAR10 & CIFAR100
  • CUB200 (fine-grained bird species)
  • TinyImageNet
  • ImageNet-R (renditions like art, cartoons, and sketches)

To simulate continual adversarial defense, no new static datasets are introduced; instead, each dataset is transformed into a sequential three-task pipeline: Clean Data (None) $\rightarrow$ FGSM Attack $\rightarrow$ PGD Attack (two standard gradient-based white-box attacks).

Key Insights and Ideas

  • Output alignment isn't enough; geometry matters: Regularizing logits (predictions) still allows underlying features to fracture under new attacks. Aligning multi-layer representations creates genuinely attack-invariant features.
  • Learning new defenses can actively heal old ones: Usually, continual learning is about minimizing damage (forgetting). On CIFAR10, LRRF achieves a $-1.0\%$ forgetting rate—meaning training on subsequent, harder attacks actually improved performance on earlier tasks (positive backward transfer).
  • Cross-generalization across attacks: Models trained under single-step FGSM attacks using LRRF generalized remarkably well when suddenly hit with multi-step PGD perturbations ($72.83\%$ accuracy on CIFAR10, beating the runner-up by $7.73\%$).

Key Results

LRRF establishes new state-of-the-art results across nearly all adversarial task sequences compared to strong replay-based (e.g., DER, DER++) and robustness-aware (e.g., AIR, DER++AFLC) baselines.

Table 1: The average classification accuracy of various models on low-to-medium complexity datasets.
  • Massive gains under FGSM: On CIFAR100, LRRF hits $78.05\%$ average accuracy during the FGSM phase—an absolute jump of $17.46\%$ over the next best method (DEF at $60.59\%$).
  • Holding the line on PGD: Under the harder PGD phase, LRRF outperforms the strongest baselines by $5.0\%$ on CIFAR10 ($58.83\%$ vs. $53.83\%$) and $3.13\%$ on CUB200 ($54.15\%$ vs. $51.02\%$).
  • High-complexity resilience: On ImageNet-R, LRRF sweeps all three stages (Clean: $78.67\%$, FGSM: $68.56\%$, PGD: $53.76\%$). (Note: On TinyImageNet's final PGD stage, baselines like DEF and DER+++ do retain higher accuracy—$64.24\%$ vs. LRRF's $50.31\%$—highlighting how tough plasticity-stability trade-offs remain on certain distributions).
  • Every piece pulls its weight: Ablations on CIFAR10 show steady average accuracy climbs from a base model ($43\%$) when sequentially adding DRM ($+11.43\%$), CTIR ($+5.57\%$), and KCO ($+4.64\%$).

Limitations and Future Work

  • Classification only: The authors note that LRRF is currently formulated and tested strictly on image classification tasks. Expanding this representation-alignment philosophy to downstream tasks like object detection or segmentation is left for future work.
  • Distance metrics & theoretical bounds: While MMD worked well, exploring alternative probabilistic distance metrics remains open. Additionally, the authors candidly note in their theoretical analysis that minimizing marginal MMD on the current task does not automatically guarantee bounded risk drift on old tasks without strong assumptions holding on those prior distributions.

Summary updated

Abstract

Continual learning under adversarial perturbations remains underexplored, despite its importance in security-critical deployments where attack patterns evolve over time. Existing continual adversarial defense methods mainly rely on replay or prediction-space regularization, but often fail to preserve robust representations across sequentially arriving attack types. In this paper, we study continual adversarial defense, where a model receives a sequence of tasks induced by different white-box attacks and must acquire robustness to new attacks without forgetting previously learned defenses. We address this challenging learning scenario by proposing the Learning Robust Representation Framework (LRRF), a representation-centric framework that improves robustness through hierarchical alignment at three complementary levels. First, we introduce the Dynamic Representation Matching (DRM) mechanism that aligns clean and adversarial feature distributions within each task to reduce the clean-robustness trade-off. Second, a Cross-Task Invariant Representation (CTIR) mechanism is proposed to regularize the current representation network against an accumulated network from previous tasks, encouraging attack-invariant features to persist over time. Third, a Knowledge Consolidation Optimization (KCO) mechanism is proposed to match class-consistent clean and adversarial features using replayed samples, which further stabilizes category structure across tasks. The empirical results show that the proposed approach achieves state-of-the-art performance.
BibTeX
@inproceedings{chen2026learning,
  author = {Yusen Chen and Fei Ye and Qihe Liu and Adrian G. Bors and shijie zhou},
  title = {{Learning Robust Representations for Defending White-Box Adversarial Attacks in Continual Learning}},
  booktitle = {Advances in Neural Information Processing Systems},
  year = {2026},
  url = {https://openreview.net/forum?id=3KoSZdy13A},
}
Figure