Abstract
Deep neural networks are susceptible to adversarial perturbations, often modeled as input noise. This research extends the mathematical framework for calculating the exact output moments (mean and variance) of ReLU-based networks under general Gaussian noise, removing previous zero-mean constraints. By employing a two-stage linearization process, these analytic moments are used to generate structured, sparse, and smooth adversarial attacks. These attacks demonstrate that optimized Gaussian noise can produce perceptually meaningful semantic edits that reliably fool classifiers, offering a more efficient alternative to empirical Monte Carlo sampling for uncertainty quantification and adversarial robustness analysis.
Introduction
Deep neural networks (DNNs) are notoriously vulnerable to adversarial attacks—tiny, carefully crafted perturbations that cause models to make incorrect predictions. Understanding how a network's output distribution changes in response to input noise is critical for both defense and robustness analysis. However, propagating a probability distribution through the non-linear layers of a DNN is mathematically complex.
Previous research derived exact probabilistic moments for simple network blocks (Affine → ReLU → Affine) but relied on the restrictive assumption that input Gaussian noise had a mean of zero. This paper addresses this gap by deriving exact output variance for arbitrary Gaussian inputs. Furthermore, it leverages these closed-form expressions to systematically generate adversarial attacks that resemble natural semantic image edits rather than random high-frequency noise.
Methods
The proposed framework operates in three primary stages: mathematical derivation, network linearization, and attack optimization.
Mathematical Derivation of Moments
Using extensions of Price’s Theorem and Gaussian distribution properties, the authors derived closed-form expressions for the first and second moments of an (Affine, ReLU, Affine) network under general Gaussian noise. This allows for the direct calculation of expected output and variance without relying on expensive sampling methods.
Two-Stage Linearization
To apply these formulas to deep Piecewise Linear DNNs (PL-DNNs), the authors utilize Taylor series approximations. A deep network is locally approximated around a specific input image, effectively collapsing it into a mathematically manageable (Affine, ReLU, Affine) format. To improve computational efficiency, the authors also introduced a clustering approach, linearizing around representative $k$-means centers rather than every individual image.
Sparse-Smooth Attack Optimization
With a differentiable, closed-form equation for the network's expected output, adversarial noise generation becomes an optimization problem. The mean and variance of the input Gaussian are optimized to maximize the network's confidence in an incorrect class. To ensure the resulting attacks are perceptually natural, the objective function includes an $\ell_1$ penalty to enforce sparsity and a Total Variation (TV) regularizer to ensure smoothness.
Key Results and Analysis
The research validated the mathematical derivations and the effectiveness of the generated attacks across MNIST, Facial Emotion Recognition, and ImageNet datasets.
Mathematical Efficiency and Accuracy
The exact formula for output variance involves an infinite series. However, empirical tests showed that truncating this series to just five terms provides a highly accurate approximation.
As shown in the figure above, the absolute error drops significantly with just a few terms, reaching approximately $10^{-4}$ compared to Monte Carlo estimates. Furthermore, when applied to LeNet via linearization, the new general variance expression proved significantly more accurate than previous zero-mean versions, reducing error from $\approx 0.19$ to $\approx 0.07$.
Semantic Adversarial Attacks
A key insight is that Gaussian noise, when properly structured, is a potent adversary. Unlike standard attacks that often appear as random static, the sparse-smooth attacks generated here alter semantic features. For instance, an attack might add a smooth curve to a digit or subtle shadows to a face to change a predicted emotion. On MNIST, altering only 4% of pixels was sufficient to flip predictions, while on ImageNet, only 2% of pixels were needed.
Conclusion and Future Work
This work demonstrates that analytic network moments provide a powerful tool for understanding and exploiting DNN vulnerabilities. By bypassing expensive Monte Carlo sampling, researchers can more efficiently study network behavior under noise.
While the two-stage linearization faces memory constraints due to large Jacobian matrices, the clustering trick offers a path toward scalability. Future research may explore using these analytic moments to train robust networks directly, potentially eliminating the need for computationally intensive adversarial training or data augmentation.
Summary updated