CARSO: Counter-Adversarial Recall of Synthetic Observations

Emanuele Ballarin, Alessio Ansuini, Luca Bortolussi · OpenReview

Abstract

In this work, we propose a novel adversarial defence mechanism for image classification - CARSO - blending the paradigms of adversarial training and adversarial purification in a synergistic robustness-enhancing way. The method builds upon an adversarially-trained classifier, and learns to map its internal representation associated with a potentially perturbed input onto a distribution of tentative clean reconstructions. Multiple samples from such distribution are classified by the same adversarially-trained model, and an aggregation of its outputs finally constitutes the robust prediction of interest. Experimental evaluation by a well-established benchmark of strong adaptive attacks, across different image datasets, shows that CARSO is able to defend itself against adaptive end-to-end white-box attacks devised for stochastic defences. Paying a modest clean accuracy toll, our method improves by a significant margin the state-of-the-art for CIFAR-10, CIFAR-100, and TinyImageNet-200 $\ell_\infty$ robust classification accuracy against AutoAttack.

Introduction

Deep neural networks are notoriously fragile when faced with adversarial attacks—carefully crafted, often invisible perturbations designed to trick a model into misclassification. Currently, the field is split into two main defensive camps: Adversarial Training (AT), which trains models directly on perturbed examples, and Adversarial Purification (AP), which uses generative models to "clean" inputs before classification. While AT is the current gold standard, it often hits a performance ceiling. Conversely, AP frequently fails against "end-to-end" white-box attacks or suffers from gradient obfuscation.

CARSO (Counter-Adversarial Recall of Synthetic Observations) identifies a missed opportunity in treating these methods as separate stages. Instead, it creates a defense where the purifier and the classifier work in a tight, organic loop, leveraging the classifier's internal knowledge to drive the purification process.

The CARSO Framework

CARSO consists of two main components: a standard, state-of-the-art adversarially trained classifier (e.g., WideResNet) and a conditional Variational Autoencoder (cVAE) acting as the purifier.

The CARSO architecture: Internal representations from an adversarially-trained classifier guide a cVAE to reconstruct clean samples for robust aggregation.

The Workflow

  1. Internal Representation Extraction: When a potentially perturbed image enters the classifier, CARSO extracts the internal activations (the "trace") from various layers. The core insight is that internal layers often amplify adversarial perturbations, making them useful "hints" for the purifier.
  2. Representation-Conditional Purification: The cVAE uses these internal activations to reconstruct a distribution of plausible clean versions of the input.
  3. Stochastic Sampling: At inference time, the purifier generates multiple (e.g., 8) different purified reconstructions for a single input.
  4. Robust Aggregation: Each reconstruction is fed back into the same AT classifier. The resulting logits are combined using a novel normalised doubly-exponential logit product. This mathematical choice makes it extremely difficult for an attacker to flip the final prediction by successfully attacking only a subset of the generated samples.

Experimental Results

The authors evaluated CARSO on three standard computer vision benchmarks: CIFAR-10, CIFAR-100, and TinyImageNet-200. Testing against the rigorous AutoAttack benchmark (including Expectation over Transformation to account for stochasticity), CARSO set new records for $\ell_\infty$ robust accuracy:

  • CIFAR-10: Reached 76.13% robust accuracy, surpassing previous AT-only models (~73.7%).
  • CIFAR-100: Achieved a significant jump to 66.65% robust accuracy, compared to the previous SOTA of ~42.7%.
  • TinyImageNet: Improved robust accuracy to 53.56%, up from ~31.3%.

While CARSO achieves state-of-the-art robustness, it does incur a "clean accuracy penalty." For instance, on CIFAR-10, clean accuracy dropped from ~92% to ~86%. For safety-critical applications, however, this trade-off is often justified by the massive gains in security.

Discussion and Future Work

CARSO demonstrates that the synergy between adversarial training and purification can overcome the limitations of either method used in isolation. By making the entire pipeline differentiable, the defense avoids the pitfalls of gradient obfuscation, ensuring the robustness is genuine.

Future research directions include:

  • Improving Reconstruction: Utilizing more powerful generative models, such as Diffusion Models, to reduce the clean accuracy penalty.
  • Computational Efficiency: Running multiple reconstructions and classification passes increases overhead; optimizing this for real-time applications is a priority.
  • Feature Selection: Identifying a smaller, more informative subset of internal layers to improve scalability without sacrificing defensive strength.

Summary updated

BibTeX
@article{ballarin2025carso,
  author = {Emanuele Ballarin and Alessio Ansuini and Luca Bortolussi},
  title = {{CARSO: Counter-Adversarial Recall of Synthetic Observations}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=40BXthYscW},
}
Figure