RAID: Randomized Adversarial-Input Detection for Neural Networks

Hasan Ferit Eniser, Maria Christakis, Valentin WüstholzarXiv 2020

TL;DR

RAID detects adversarial attacks on neural networks by training a simple secondary classifier on internal neuron activation patterns. By filtering out uninformative neurons and randomly sampling the rest, it achieves state-of-the-art detection accuracy across diverse attack types and can be extended to thwart detection-aware, adaptive adversaries.

What Problem Does This Paper Address?

Deep neural networks are notoriously fragile against adversarial perturbations—imperceptible changes to an input that trick a model into making confident, incorrect predictions. While many detection mechanisms have been proposed to flag these malicious inputs before they cause harm, they suffer from two major flaws: they either require tedious hyperparameter tuning for every specific type of attack (failing to generalize in the wild where the attack type is unknown), or they fail against high-confidence adversarial examples.

The authors tackle this gap by proposing a detector that generalizes across different attack norms without needing per-attack optimization, while remaining robust against "adaptive" attackers who actively try to bypass the defense.

Methods

The core insight behind RAID (Randomized Adversarial-Input Detection) is that even if an adversarial image looks identical to a benign one to human eyes, it leaves a distinct "activation fingerprint" across the hidden layers of the neural network.

The RAID pipeline consists of four main steps:

  1. Profile Normal Inputs: Pass benign images through the network and record the activation values for all hidden neurons to establish a baseline mean activation.
  2. Profile Adversarial Inputs: Generate adversarial counterparts using known attacks and record their activations.
  3. Neuron Filtering: Calculate the absolute difference in mean activations between normal and adversarial inputs for each neuron. Neurons with negligible differences are discarded as "inessential" (see Figure 1).
  4. Randomized Selection & Training: Randomly select a fixed number of the remaining "essential" neurons to monitor. Train a simple secondary classifier (like a Random Forest) using the activation values of these selected neurons as features.
Figure 1: Differences in neuron activation values between normal and adversarial inputs.

To counter adaptive adversaries (attackers who have full knowledge of the defense mechanism), the authors introduce P-RAID (Pooled RAID). Instead of a single classifier, P-RAID trains a pool of distinct classifiers, each watching a different random subset of essential neurons. At runtime, a classifier is chosen uniformly at random to evaluate the incoming input, creating a moving target that is incredibly difficult for an optimization-based attack to bypass.

Datasets

The authors evaluated RAID using two standard image classification benchmarks:

  • MNIST: A dataset of handwritten digits, evaluated on a 5-layer Convolutional Neural Network (ConvNet).
  • CIFAR-10: A dataset of real-world objects across 10 categories, evaluated on a 12-layer ConvNet.

Adversarial examples were generated using six prominent attacks spanning different distortion norms: PGD, FGSM, BIM ($L_\infty$); DeepFool, Carlini-Wagner ($L_2$); and JSMA ($L_0$).

Key Insights and Ideas

  • Internal Signatures are Robust: Even when an attack successfully fools the final output layer, the ripple effects of the perturbation are visible throughout the internal layers of the network.
  • Not All Neurons Matter: A large portion of neurons behave identically under both benign and adversarial inputs. Filtering out these "inessential" neurons drastically reduces the dimensionality of the problem, allowing simple, lightweight classifiers (like decision trees) to outperform complex neural network detectors.
  • Randomization Beats Adaptation: Deterministic defenses can be mathematically bypassed by strong adaptive attacks. By introducing non-determinism via a pool of randomly specialized classifiers (P-RAID), the defense forces the attacker to solve an intractable multi-objective optimization problem.

Key Results

  • State-of-the-Art Performance: RAID consistently outperformed existing methods like DSA, LSA, and mMutant. On CIFAR-10, RAID outperformed mMutant by up to 88% on iterative attacks like PGD (see Figure 4).
  • Perfect $L_\infty$ Detection: RAID achieved a perfect Area Under the ROC Curve (AUC) of 1.00 against $L_\infty$ attacks (PGD, FGSM, BIM) on both MNIST and CIFAR-10.
  • Strong $L_2$ and $L_0$ Resilience: Against more powerful attacks like Carlini-Wagner (CW) and DeepFool (DF), RAID maintained high AUC scores (e.g., 0.91–0.98 on MNIST, 0.90–0.96 on CIFAR-10).
Figure 4: AUC scores of RAID, DSA, LSA, and mMutant on the CIFAR-10 dataset when tested on all attacks and norms.
  • Zero Performance Penalty for P-RAID: P-RAID achieved virtually identical detection accuracy to standard RAID (within 0.01 AUC), proving that adding security against adaptive attacks doesn't degrade baseline effectiveness.
  • Efficiency: Because the secondary classifier is lightweight (monitoring just 64 neurons), inference takes less than a millisecond, making it highly practical for online deployment.

Limitations and Future Work

While highly effective, the paper notes a few limitations:

  • Scale: The approach was validated on relatively small architectures (5-layer and 12-layer ConvNets) and standard datasets (MNIST, CIFAR-10). Its scalability to massive architectures (like ResNets or Transformers) and complex datasets (like ImageNet) remains to be proven.
  • Domain Specificity: The evaluation is strictly limited to computer vision. The authors express intent to explore how RAID translates to other domains, such as Natural Language Processing (NLP).

Summary updated

BibTeX
@misc{eniser2020raid,
  author = {Hasan Ferit Eniser and Maria Christakis and Valentin Wüstholz},
  title = {{RAID: Randomized Adversarial-Input Detection for Neural Networks}},
  year = {2020},
  eprint = {2002.02776},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.02776},
}
Figure