Multi-head Uncertainty Inference for Adversarial Attack Detection

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

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.

Introduction

Adversarial attacks, such as the Fast Gradient Sign Method (FGSM), exploit the way neural networks process information to cause intentional misclassification through tiny, invisible-to-human perturbations. While Uncertainty Inference (UI) techniques have been developed to detect these anomalies, current approaches face significant limitations. Monte-Carlo (MC) sampling methods like MC Dropout are computationally expensive, requiring multiple forward passes. Conversely, direct estimation methods often rely too heavily on final layer features that may already be compromised by the attack.

This paper identifies a critical gap: adversarial noise often manifests in image textures processed by shallower layers. By the time data reaches the final layer, these signals are often smoothed out or integrated into high-level semantic features, making them harder to distinguish. The proposed MH-UI framework addresses this by integrating information from multiple depths of the network.

Methodology

The Multi-head Uncertainty Inference (MH-UI) framework places auxiliary classifiers, or "heads," at various intermediate layers of a backbone network, such as ResNet or GoogLeNet.

The MH-UI framework architecture showing auxiliary heads at different depths and the resulting uncertainty estimation for clean vs. attacked data.

Core Components

  • Multi-head Architecture: By attaching heads to different blocks, the model captures a range of features from low-level textures to high-level semantics.
  • Dirichlet Distribution Modeling: The framework assumes that the normalized predictions from these independent heads are samples drawn from a single Dirichlet distribution.
  • Moment Matching: Instead of complex optimization, the parameters ($\alpha$) of the Dirichlet distribution are estimated using moment matching based on the mean and variance of the heads' outputs.
  • 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 captured and amplified by the Dirichlet model, reflecting high "cognitive uncertainty."

Experimental Results

The framework was evaluated using the CIFAR-10 and SVHN benchmarks against FGSM attacks at various perturbation strengths ($\epsilon$). The MH-UI framework consistently outperformed baseline methods, including MC Dropout, DPN, RKL, and DS-UI.

Comparison of AUROC performance for adversarial attack detection across CIFAR-10 and SVHN datasets using Max Probability and Entropy metrics.

Key Findings

  • Superior Detection Accuracy: On CIFAR-10, as the attack strength increased, the Area Under the Receiver Operating Characteristic (AUROC) for MH-UI converged toward 99%, significantly higher than the referred UI methods.
  • Efficiency: MH-UI provides ensemble-like robustness by utilizing different depths of the same network in a single forward pass, avoiding the computational overhead of MC sampling.
  • Backbone Flexibility: The method proved effective across different architectures, showing strong results on both GoogLeNet (9 heads) and ResNet18 (8 heads) without degrading classification accuracy on clean data.

Conclusion and Future Work

MH-UI demonstrates that leveraging intermediate layer information significantly improves the detection of adversarial examples by capturing "shallow" signals that are often lost in deeper layers. While effective against FGSM, future research will investigate the framework's performance against more sophisticated iterative attacks (like PGD) and black-box scenarios. Additionally, optimizing head placement on larger, high-resolution datasets like ImageNet remains a valuable direction for scaling this approach.

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},
}
Figure