Skip to main content
QUICK REVIEW

[Paper Review] LiBRe: A Practical Bayesian Approach to Adversarial Detection

Zhijie Deng, Xiao Yang|ArXiv.org|Mar 27, 2021
Adversarial Robustness in Machine LearningComputer Science67 references7 citations
TL;DR

LiBRe proposes a lightweight Bayesian refinement method that equips pre-trained deep neural networks with adversarial detection capability by transforming only the final layers into a few-layer deep ensemble variational Bayesian network. It achieves state-of-the-art detection performance across diverse attacks with minimal computational cost, maintaining high predictive accuracy and efficient inference through pre-training, fine-tuning, and uncertainty regularization without adversarial example injection.

ABSTRACT

Despite their appealing flexibility, deep neural networks (DNNs) are vulnerable against adversarial examples. Various adversarial defense strategies have been proposed to resolve this problem, but they typically demonstrate restricted practicability owing to unsurmountable compromise on universality, effectiveness, or efficiency. In this work, we propose a more practical approach, Lightweight Bayesian Refinement (LiBRe), in the spirit of leveraging Bayesian neural networks (BNNs) for adversarial detection. Empowered by the task and attack agnostic modeling under Bayes principle, LiBRe can endow a variety of pre-trained task-dependent DNNs with the ability of defending heterogeneous adversarial attacks at a low cost. We develop and integrate advanced learning techniques to make LiBRe appropriate for adversarial detection. Concretely, we build the few-layer deep ensemble variational and adopt the pre-training & fine-tuning workflow to boost the effectiveness and efficiency of LiBRe. We further provide a novel insight to realise adversarial detection-oriented uncertainty quantification without inefficiently crafting adversarial examples during training. Extensive empirical studies covering a wide range of scenarios verify the practicability of LiBRe. We also conduct thorough ablation studies to evidence the superiority of our modeling and learning strategies.

Motivation & Objective

  • To address the limitations of existing adversarial defense methods that sacrifice universality, effectiveness, or efficiency.
  • To enable practical adversarial detection in pre-trained task-specific DNNs without retraining from scratch.
  • To improve Bayesian uncertainty estimation for adversarial detection while maintaining predictive performance and inference speed.
  • To eliminate the need for adversarial example crafting during training by introducing a novel uncertainty correction strategy.

Proposed method

  • Introduces Few-lAyer Deep Ensemble (FADE), a variational Bayesian method that applies deep ensemble only to the last few layers of a DNN, preserving deterministic weights in earlier layers.
  • Employs a pre-training and fine-tuning paradigm, initializing FADE with pre-trained deterministic weights to accelerate convergence and improve posterior quality.
  • Applies a stochasticity-injected learning principle in FADE to encourage diverse function modes and reduce gradient variance.
  • Introduces uncertainty regularization (R) to correct predictive uncertainty for adversarial detection without relying on crafted adversarial examples.
  • Uses instance-wise stochastic estimation of expected log-likelihood (L*) instead of batch-wise MC estimation to improve training stability and uncertainty calibration.
  • Leverages feature variance as uncertainty measure, which is more robust than softmax variance for detecting out-of-distribution and adversarial inputs.
Figure 1 : Given a pre-trained DNN, LiBRe converts its last few layers (excluding the task-dependent output head) to be Bayesian, and reuses the pre-trained parameters. Then, LiBRe launches several-round adversarial detection-oriented fine-tuning to render the posterior effective for prediction and
Figure 1 : Given a pre-trained DNN, LiBRe converts its last few layers (excluding the task-dependent output head) to be Bayesian, and reuses the pre-trained parameters. Then, LiBRe launches several-round adversarial detection-oriented fine-tuning to render the posterior effective for prediction and

Experimental results

Research questions

  • RQ1Can a Bayesian refinement approach be both effective and efficient for adversarial detection across diverse tasks and attacks?
  • RQ2How can Bayesian uncertainty be improved for adversarial detection without relying on adversarial example injection during training?
  • RQ3Does using feature variance instead of softmax variance yield better adversarial detection performance?
  • RQ4To what extent does uncertainty regularization (R) and instance-wise likelihood estimation (L*) improve detection quality?
  • RQ5Can a lightweight Bayesian method maintain high predictive accuracy while enabling real-time adversarial detection?

Key findings

  • LiBRe achieves AUROC scores of 1.000, 0.985, 0.994, and 1.000 on FGSM, C&W, PGD, and DIM attacks, respectively, outperforming all baselines.
  • On COCO object detection, LiBRe maintains mAP@.5 and mAP@.5:.95 of 0.545 and 0.344 while achieving 0.957–0.972 AUROC across four attack types.
  • LiBRe is only slightly slower than deterministic inference (MAP), with inference time per 32-image batch at ~1.2s on RTX 2080 Ti, enabling real-time deployment.
  • Visualization confirms that the FADE posterior exhibits high diversity among ensemble members, indicating no mode collapse.
  • Ablation studies show that softmax variance yields significantly worse detection (AUROC ~0.01–0.76) than feature variance, which is more robust to perturbations.
  • Removing uncertainty regularization (R) or using batch-wise MC estimation (L) reduces detection AUROC by up to 50%, confirming the importance of these components.
Figure 2 : The histograms for the feature variance uncertainty of normal and adversarial examples given by LiBRe or the baselines.
Figure 2 : The histograms for the feature variance uncertainty of normal and adversarial examples given by LiBRe or the baselines.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.