A Few Large Shifts: Layer-Inconsistency Based Minimal Overhead Adversarial Example Detection

Sanggeon Yun, Ryozo Masukawa, Hyunwoo Oh, Nathaniel D. Bastian, Mohsen Imani
5/19/2025
4 citations
cs.LG

Official code: c0510gy/AFLS-AED (4 stars, Python, last commit 2026-10-31).

Abstract

Deep neural networks (DNNs) are highly susceptible to adversarial examples---small, malicious perturbations that can cause incorrect predictions. We introduce a lightweight, plug-in detector that uses internal layer-wise inconsistencies within the target model and requires only benign data for fitting and calibration.

Show full abstract

The approach is motivated by the A Few Large Shifts Assumption, an empirical hypothesis that adversarial perturbations often produce large, localized growth in representation changes across a small number of consecutive layers, connecting adversarial behavior to layer-wise Lipschitz continuity. We develop two complementary scores---Recovery Testing (RT) for intermediate-layer inconsistency and Logit-layer Testing (LT) for augmentation-induced output instability---and fuse them through RLT. Across CIFAR-10, CIFAR-100, and ImageNet, RLT achieves strong detection performance under standard attacks with substantially lower overhead than detector families requiring external encoders or reference-set retrieval. We further study its behavior under adaptive attacks, at low false-positive operating points, and under benign distribution shifts. The code is available here: https://github.com/c0510gy/AFLS-AED.

View on arXivView PDF

Code Implementations(1)

c0510gy/AFLS-AEDOfficial100%

[TMLR 2026] Implementation of A Few Large Shifts Assumption-based Adversarial Examples Detection

41PythonMay 22, 20251 months ago

Similar Papers

Cite this paper

@article{yun2025large,
  title  = {A Few Large Shifts: Layer-Inconsistency Based Minimal Overhead Adversarial Example Detection},
  author = {Sanggeon Yun and Ryozo Masukawa and Hyunwoo Oh and Nathaniel D. Bastian and Mohsen Imani},
  year   = {2025},
  eprint = {2505.12586},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2505.12586v6}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2505.12586.svg)](https://codeofpaper.com/paper/2505.12586)

Discussion