Benford's law: what does it say on adversarial images?
João G. Zago, Fabio L. Baldissera, Eric A. Antonelo, Rodrigo T. Saad
TL;DR
Benford's Law is leveraged as an input-centered detector for adversarial images by transforming inputs with a gradient-magnitude operator and comparing the resulting first-digit distribution to the Benford reference using the KS statistic, with the Benford distribution defined as $P(d)=log_{10}(1+1/d)$ for $d\in\{1,...,9\}$. The authors show that adversarial perturbations cause systematic deviations from Benford's Law, with deviations growing with attack strength, and demonstrate a practical, low-dimensional feature (FAD) based on KS deviation that can detect adversarial inputs with competitive accuracy to full-image CNN detectors but at far lower cost. The work highlights the potential for online monitoring and pre-attack signaling, and points to future extensions to additional attack types and more refined KS-based detection schemes. Overall, the study provides a fast, transformation-based, Benford-deviation signal that can complement existing defenses in adversarial image detection.
Abstract
Convolutional neural networks (CNNs) are fragile to small perturbations in the input images. These networks are thus prone to malicious attacks that perturb the inputs to force a misclassification. Such slightly manipulated images aimed at deceiving the classifier are known as adversarial images. In this work, we investigate statistical differences between natural images and adversarial ones. More precisely, we show that employing a proper image transformation and for a class of adversarial attacks, the distribution of the leading digit of the pixels in adversarial images deviates from Benford's law. The stronger the attack, the more distant the resulting distribution is from Benford's law. Our analysis provides a detailed investigation of this new approach that can serve as a basis for alternative adversarial example detection methods that do not need to modify the original CNN classifier neither work on the raw high-dimensional pixels as features to defend against attacks.
