Multi-Head Uncertainty Inference for Adversarial Attack Detection

Yuqi Yang, Songyun Yang, Jiyang Xie, Zhongwei Si, Kai Guo, Ke Zhang, Kongming Liang

TL;DR

Deep neural networks are notoriously fragile when faced with adversarial attacks—tiny, invisible-to-human perturbations that flip a model's prediction. This paper introduces Multi-head Uncertainty Inference (MH-UI), a framework that detects these attacks by placing auxiliary "heads" at different depths of a network. By treating the outputs of these heads as samples from a Dirichlet distribution, the authors can quantify "cognitive uncertainty" and flag suspicious inputs with higher accuracy than existing state-of-the-art methods.

What Problem Does This Paper Address?

Adversarial attacks, such as the Fast Gradient Sign Method (FGSM), exploit the way neural networks process information to cause intentional misclassification. While researchers have developed "Uncertainty Inference" (UI) techniques to detect these anomalies, current approaches have significant trade-offs:

  1. Monte-Carlo (MC) Sampling: Methods like MC Dropout require multiple passes through the network, making them computationally expensive and slow for real-time use.
  2. Direct Estimation: These methods try to predict uncertainty in a single pass but are often overly dependent on the quality of the final layer's features, which may already be "fooled" by the attack.

The authors identify a specific gap: adversarial noise often manifests in the textures of an image, which are primarily processed by the shallower layers of a network. By the time the data reaches the final layer, the "signal" of the attack might be harder to distinguish from legitimate features.

Methods

The authors propose the Multi-head Uncertainty Inference (MH-UI) framework. Its core components include:

  • Multi-head Architecture: Taking inspiration from GoogLeNet, the researchers attach auxiliary classifiers (heads) to various intermediate layers (blocks) of a backbone network (like ResNet or GoogLeNet).
  • Shallow Information Integration: Because shallow layers extract texture information, these auxiliary heads are better positioned to "see" the adversarial noise before it is smoothed out or integrated into high-level semantic features.
  • Dirichlet Distribution Modeling: The framework assumes that the normalized predictions from all these independent heads are samples drawn from a single Dirichlet distribution.
  • Moment Matching: Instead of complex optimization, they use a statistical technique called "moment matching" to estimate the parameters ($\alpha$) of this Dirichlet distribution based on the mean and variance of the heads' outputs.
  • Detection Metrics: Once the distribution is estimated, they calculate the Max Probability and Entropy. If the uncertainty is high (low max probability or high entropy), the system flags the input as an adversarial attack.

Datasets

The framework was evaluated using two standard computer vision benchmarks:

  • CIFAR-10: A collection of 60,000 tiny images across 10 classes (e.g., airplanes, dogs).
  • SVHN (Street View House Numbers): A dataset of digit images cropped from house numbers in Google Street View.

The authors used these datasets to test the model's ability to distinguish between "clean" data and data corrupted by FGSM attacks at various perturbation strengths ($\epsilon$).

Key Insights and Ideas

  • The "Texture" Advantage: The most significant insight is that adversarial perturbations are often "shallow" signals. By forcing the model to look at intermediate representations, the MH-UI framework catches the discrepancy between what a shallow layer sees (noise) and what a deep layer sees (the intended target).
  • Ensemble-lite Efficiency: While MC Dropout acts like an ensemble by sampling different "versions" of the same network, MH-UI acts like an ensemble by using different "depths" of the same network. This provides the robustness of an ensemble without the massive computational overhead of multiple forward passes.
  • Uncertainty Amplification: Adversarial attacks typically aim to make the final prediction confident but wrong. However, these attacks rarely manage to make all intermediate heads agree. This internal disagreement is what the Dirichlet model captures and amplifies, making the attack visible.

Key Results

The MH-UI framework consistently outperformed baseline methods (MC Dropout, DPN, RKL, and DS-UI) in detecting adversarial examples:

  • AUROC Performance: On CIFAR-10, as the attack strength ($\epsilon$) increased, the Area Under the Receiver Operating Characteristic (AUROC) for MH-UI converged toward 99%, significantly higher than the baselines.
  • Backbone Flexibility: The method proved effective across different architectures, showing strong results on both GoogLeNet (with 9 auxiliary heads) and ResNet18 (with 8 auxiliary heads).
  • No Accuracy Trade-off: Crucially, adding these auxiliary heads and the uncertainty inference logic did not degrade the model's classification accuracy on clean, non-attacked data.

Limitations and Future Work

While the results are promising, there are a few areas for further exploration:

  • Attack Diversity: The paper primarily focuses on FGSM, a popular but relatively simple "white-box" attack. It remains to be seen how MH-UI performs against more sophisticated iterative attacks (like PGD) or "black-box" attacks where the attacker doesn't know the model's architecture.
  • Head Placement: The paper uses a somewhat heuristic approach to placing heads (after every block). Future work could investigate the optimal number and placement of heads to balance detection accuracy with computational cost.
  • Dataset Complexity: Testing on larger, more complex datasets like ImageNet would be a valuable next step to ensure the "texture" insight scales to high-resolution imagery.

Summary updated

Abstract

Deep neural networks (DNNs) are sensitive and susceptible to tiny perturbation by adversarial attacks which causes erroneous predictions. Various methods, including adversarial defense and uncertainty inference (UI), have been developed in recent years to overcome the adversarial attacks. In this paper, we propose a multi-head uncertainty inference (MH-UI) framework for detecting adversarial attack examples. We adopt a multi-head architecture with multiple prediction heads (i.e., classifiers) to obtain predictions from different depths in the DNNs and introduce shallow information for the UI. Using independent heads at different depths, the normalized predictions are assumed to follow the same Dirichlet distribution, and we estimate distribution parameter of it by moment matching. Cognitive uncertainty brought by the adversarial attacks will be reflected and amplified on the distribution. Experimental results show that the proposed MH-UI framework can outperform all the referred UI methods in the adversarial attack detection task with different settings.
BibTeX
@inproceedings{yang2023multi,
  author = {Yuqi Yang and Songyun Yang and Jiyang Xie and Zhongwei Si and Kai Guo and Ke Zhang and Kongming Liang},
  title = {{Multi-Head Uncertainty Inference for Adversarial Attack Detection}},
  booktitle = {IEEE International Conference on Acoustics, Speech and Signal Processing},
  year = {2023},
  doi = {10.1109/icassp49357.2023.10097229},
}

Loading related content...

Figure