Abstract
This paper investigates the application of Bayesian uncertainty measures to the problem of adversarial example detection. By leveraging Monte Carlo (MC) Dropout in Bayesian Neural Networks, the authors distinguish between aleatoric uncertainty (inherent data noise) and epistemic uncertainty (model ignorance). The study demonstrates that Mutual Information (MI) is a significantly more robust detector than standard predictive entropy, as it effectively identifies inputs that lie off the training data manifold.
Introduction
Deep neural networks are notoriously overconfident, often assigning high probability to incorrect classifications, particularly when faced with adversarial examples. These examples are carefully crafted inputs that appear normal to humans but trigger errors in models. A prevailing hypothesis is that these adversarial inputs lie "off the manifold" of natural images. While measuring geometric distance in high-dimensional pixel space is difficult, this paper explores whether model uncertainty can serve as a reliable proxy for that distance.
Methodology: Bayesian Uncertainty and MC Dropout
The authors utilize Bayesian Neural Networks (BNNs) approximated via MC Dropout. By keeping dropout active during inference and performing multiple forward passes, the model generates a distribution of predictions. Two primary measures are compared:
- Predictive Entropy: Measures total uncertainty, which is high when an image is ambiguous (e.g., looking like both a '1' and a '7').
- Mutual Information (MI): Measures epistemic uncertainty—the information gain about model parameters. MI is high only when the model has not explored a specific region of the input space.
A key theoretical contribution of the paper is the demonstration that softmax variance—an ad-hoc measure previously used in literature—is actually a first-order Taylor expansion approximation of Mutual Information.
Analysis of Uncertainty Measures
A critical test for these measures is their behavior during interpolations. When moving between two classes in "latent space" (staying on the manifold), Predictive Entropy increases due to class ambiguity, but Mutual Information remains low because the model is familiar with that region. Conversely, interpolating in "pixel space" (moving off the manifold) causes a sharp spike in MI.
As shown in the figure above, the top plot (Entropy) shows peaks during latent transitions (red), while the bottom plot (MI) remains low for latent paths but spikes for the off-manifold image path (blue). This confirms MI as a superior proxy for manifold distance.
Latent Space Visualization
Visualizing uncertainty in a 2D latent space provides further intuition. The model identifies clear clusters for training data, surrounded by regions of high uncertainty. However, the authors discovered "holes" in these maps—regions far from training data where a single dropout model remains spuriously confident because it only captures a single "mode" of the posterior distribution.
To mitigate these blind spots, the authors propose using ensembles of dropout models. By initializing multiple models differently, they capture various modes of the posterior, significantly improving the quality of the uncertainty map and making it harder for adversarial attacks to find "blind spots."
Experimental Results
The methods were tested on MNIST and the ASIRRA (Dogs vs. Cats) dataset against various attacks (FGM, BIM, MIM). On the high-resolution ASIRRA dataset, the results were striking:
- Predictive Entropy failed: In many cases, its Area Under the Curve (AUC) for detection was below 0.1, meaning the model was more confident about adversarial examples than natural ones.
- Mutual Information succeeded: MI achieved much higher AUCs (e.g., 0.728 for BIM attacks), proving it can distinguish adversarial inputs from naturally ambiguous ones.
Conclusion
While MC Dropout is a crude approximation of a true Bayesian posterior, Mutual Information derived from it provides a principled way to detect adversarial examples. Although "white-box" attacks can still bypass these defenses if the attacker is aware of the dropout mechanism, MI-based detection raises the bar for security and provides a clearer understanding of how models perceive out-of-distribution data.
Summary updated