Unfolding Local Growth Rate Estimates for (Almost) Perfect Adversarial Detection

Peter Lorenz, Margret Keuper, Janis Keuper

TL;DR

This paper introduces multiLID, a simple and lightweight white-box detector that achieves near-perfect adversarial attack detection across multiple datasets and network architectures. By "unfolding" the traditional Local Intrinsic Dimensionality (LID) metric into a full feature vector and pairing it with a non-linear classifier, the authors retain critical local growth-rate information that standard aggregation discards.

What Problem Does This Paper Address?

Deep Neural Networks (DNNs) are notoriously vulnerable to adversarial examples—inputs modified with tiny, imperceptible perturbations designed to trick models into making incorrect predictions. To defend against these threats, researchers typically use either adversarial training (which is computationally expensive and often overfits to specific attacks) or adversarial detection (which aims to identify and reject malicious inputs at test time).

A popular detection strategy uses Local Intrinsic Dimensionality (LID) to measure the local geometric properties of the data manifold, operating under the premise that adversarial examples live in distinct, highly dimensional sub-spaces. However, standard LID aggregates neighbor distances into a single scalar value per layer. This aggregation acts as an information bottleneck, washing out fine-grained details and making it difficult to separate benign data from sophisticated, low-perturbation attacks.

Methods

The authors propose three simple yet highly effective enhancements to traditional LID to create multiLID:

  1. Unfolding the Metric: Instead of summing up the log-distance ratios of a sample to its $k$-nearest neighbors into a single scalar, multiLID keeps them separate. It constructs a feature vector of length $k$ for each layer, preserving the exact "local growth rate profile" of the neighborhood.
  2. Strategic Layer Selection: Rather than extracting features from arbitrary layers or every single layer in the network, the authors specifically target the activation maps at the output of the last ReLU layer within each residual block.
  3. Non-linear Classification: Standard LID relies on a linear Logistic Regression classifier. Because adversarial and benign manifolds can be highly complex and overlapping, multiLID swaps this out for a Random Forest (RF) classifier to significantly boost discrimination power.

Datasets

The method was evaluated on standard image classification benchmarks using Wide-ResNet (WRN) and VGG-16 architectures:

  • CIFAR10
  • CIFAR100
  • ImageNet (using a pre-trained WRN 50-2)

The detectors were tested against six of the most common adversarial attacks: FGSM, BIM, PGD, AutoAttack (AA), DeepFool (DF), and Carlini & Wagner (CW).

Key Insights and Ideas

  • Aggregation is an Information Bottleneck: Summing up neighborhood distances smooths out the unique geometric signatures of different attacks. Unfolding this summation reveals distinct structural "profiles" for different adversarial perturbations. As seen in the distribution profiles for attacks like PGD or FGSM, adversarial examples tend to skew toward higher dimensionality, but their heavy overlap with clean samples makes linear separation difficult:

PGD LID Distribution FGSM LID Distribution

  • Manifolds Require Non-Linear Boundaries: Linear classifiers fail when the tails of benign and adversarial distributions overlap. Switching to a Random Forest allows the detector to draw complex, non-linear boundaries around these overlapping regions.
  • Not All Layers Are Equal: Features extracted right before residual transitions (the last ReLU of a block) contain the most discriminative structural information regarding the manifold's dimensionality.

Key Results

  • Near-Perfect Detection: On CIFAR10 with a Wide-ResNet, multiLID combined with a Random Forest achieved an AUC and F1-score of 100% (or very close to it, e.g., 99.54% for AutoAttack) across almost all attacks, vastly outperforming standard LID.
  • Robustness to Advanced Attacks: Even against notoriously difficult optimization-based attacks like Carlini & Wagner (CW) and DeepFool (DF)—which typically fool standard LID (dropping its AUC to ~55% on ImageNet)—multiLID maintains high detection rates.
  • Excellent Transferability: When trained on one attack type (e.g., PGD) and tested on another (e.g., AutoAttack or BIM), the Random Forest variant demonstrated remarkably high bidirectional transferability compared to standard linear methods, making it more practical for real-world deployment where the attack type is unknown.

Limitations and Future Work

  • Static Evaluation: The authors acknowledge that their evaluation follows the standard paradigm where each attack is evaluated separately with constant parameters. In real-world scenarios, an adaptive attacker might deploy disguise mechanisms specifically designed to bypass the multiLID detector.
  • Incomplete Transferability on Complex Datasets: While transferability is generally high, certain cross-attack combinations still struggle on large-scale datasets (e.g., transferring from FGSM to CW on ImageNet), indicating that a truly universal detector remains an open challenge.

Summary updated

Abstract

Convolutional neural networks (CNN) define the state-of-the-art solution on many perceptual tasks. However, current CNN approaches largely remain vulnerable against adversarial perturbations of the input that have been crafted specifically to fool the system while being quasi-imperceptible to the human eye. In recent years, various approaches have been proposed to defend CNNs against such attacks, for example by model hardening or by adding explicit defence mechanisms. Thereby, a small "detector" is included in the network and trained on the binary classification task of distinguishing genuine data from data containing adversarial perturbations. In this work, we propose a simple and light-weight detector, which leverages recent findings on the relation between networks' local intrinsic dimensionality (LID) and adversarial attacks. Based on a re-interpretation of the LID measure and several simple adaptations, we surpass the state-of-the-art on adversarial detection by a significant margin and reach almost perfect results in terms of F1-score for several networks and datasets. Sources available at: https://github.com/adverML/multiLID
BibTeX
@inproceedings{lorenz2023unfolding,
  author = {Peter Lorenz and Margret Keuper and Janis Keuper},
  title = {{Unfolding Local Growth Rate Estimates for (Almost) Perfect Adversarial Detection}},
  booktitle = {VISIGRAPP (5: VISAPP)},
  year = {2023},
  doi = {10.5220/0011586500003417},
}
Figure