---
title: Elastic-Net Attacks on Deep Neural Networks
url: https://www.emergentmind.com/topics/elastic-net-attacks-to-deep-neural-networks-ead
type: topic
---

# Elastic-Net Attacks on Deep Neural Networks

The elastic-net attack to deep neural networks (EAD) is a white-box adversarial attack method that formulates adversarial example generation as an elastic-net regularized (combined $L_1$+$L_2$) optimization problem. EAD generalizes strong $L_2$-based attacks by incorporating an $L_1$ penalty, producing sparse but high-magnitude perturbations and yielding attack instances with greater transferability and complementary value for adversarial training. Empirical results on benchmark datasets demonstrate that EAD achieves high attack success rates (ASR), notably reduced $L_1$ distortion, and superior cross-model transfer compared to strictly $L_2$ or $L_\infty$-constrained attacks [1709.04114][1710.10733].

## 1. Mathematical Formulation

EAD posits adversarial example generation as solving an elastic-net regularized optimization problem under a box constraint. For an original image $x_0 \in [0,1]^p$ (pixel values normalized to $[0,1]$) with ground-truth label $t_0$, and attack target $t \neq t_0$, the elastic-net attack seeks
$$
\min_{x \in [0,1]^p} \; c f(x, t) + \beta \|x - x_0\|_1 + \|x - x_0\|_2^2
$$
where $f(x,t) = \max\left\{ \max_{j \neq t} [\mathrm{Logit}(x)]_j - [\mathrm{Logit}(x)]_t, \ -\kappa \right\}$, with $\kappa \geq 0$ the confidence margin parameter and $c>0$ trading off attack imperceptibility with misclassification success. Setting $\beta=0$ specializes EAD to the Carlini & Wagner (C&W) $L_2$ attack. For non-targeted attacks, $f(x, t)$ can be the negative margin on the true class [1709.04114][1710.10733].

The $L_2$ term penalizes the overall energy of the perturbation, while the $L_1$ term (weighted by $\beta$) imposes sparsity and localizes changes onto a small subset of pixels, capitalizing on visual insensitivity to concentrated alteration.

## 2. Optimization Algorithm

The presence of the non-differentiable $L_1$ term precludes pure gradient-based methods. EAD employs a projected iterative shrinkage-thresholding algorithm (ISTA), and typically its accelerated variant FISTA, to solve the elastic-net program under box constraints:

1. **Subgradient update**: Compute the (sub)gradient of $g(x) = c f(x, t) + \|x - x_0\|_2^2$ at current iterate.
2. **Gradient descent step**: $v^{(k)} = y^{(k)} - \alpha_k \nabla g(y^{(k)})$ with adaptive learning rate $\alpha_k = \alpha_0 / \sqrt{k+1}$.
3. **Proximal shrinkage**: Apply component-wise soft thresholding:
   $$
   u^{(k)}_i = \operatorname{sign}(v^{(k)}_i-x_{0,i}) \max\{|v^{(k)}_i-x_{0,i}| - \beta \alpha_k, 0\} + x_{0,i}
   $$
4. **Box projection**: Clip $u^{(k)}$ to $[0,1]^p$.
5. **FISTA acceleration**: Momentum update for $y^{(k+1)}$.

This inner loop is run up to $I=1000$ times, embedded within a binary search for $c$ over 9 steps, beginning at $c=10^{-3}$. Two decision rules are used for selecting successful adversarial examples: the "EN-rule" (minimum elastic-net objective among $f \leq 0$ iterates), and the "L1-rule" (minimum $L_1$ distortion among $f \leq 0$ iterates). $\beta$ is typically set manually, generally between $10^{-4}$ and $10^{-2}$, with $\beta=10^{-3}$ providing a practical default [1709.04114][1710.10733].

## 3. Empirical Evaluation and Distortion Metrics

Attacks are performed and evaluated on MNIST (LeNet), CIFAR-10 (ResNet-like), and ImageNet (Inception-v3) models using 1,000 randomly selected test samples (MNIST/CIFAR-10) and 100 for ImageNet. Baseline methods include FGM (Fast Gradient Method) and I-FGM in $L_1$, $L_2$, and $L_\infty$ forms, as well as the C&W $L_2$ attack.

The following summarizes mean-case results across datasets (ASR = attack success rate):

| Dataset / Method         | ASR (%) | $L_1$ | $L_2$  | $L_\infty$ |
|-------------------------|---------|-------|--------|------------|
| **MNIST**               |         |       |        |            |
| C\&W ($L_2$)            | 100     | 22.46 | 1.97   | 0.514      |
| I-FGM-$L_1$             | 100     | 32.94 | 2.61   | 0.591      |
| EAD (EN)                | 100     | 17.40 | 2.00   | 0.594      |
| EAD ($L_1$)             | 100     | 14.11 | 2.21   | 0.768      |
| **CIFAR-10**            |         |       |        |            |
| C\&W ($L_2$)            | 100     | 13.62 | 0.392  | 0.044      |
| I-FGM-$L_1$             | 100     | 17.53 | 0.502  | 0.055      |
| EAD (EN)                | 100     | 8.18  | 0.502  | 0.097      |
| EAD ($L_1$)             | 100     | 6.07  | 0.613  | 0.17       |
| **ImageNet**            |         |       |        |            |
| C\&W ($L_2$)            | 100     | 232.2 | 0.705  | 0.030      |
| I-FGM-$L_1$             | 77      | 526.4 | 1.609  | 0.054      |
| EAD (EN)                | 100     | 69.47 | 1.563  | 0.238      |
| EAD ($L_1$)             | 100     | 40.90 | 1.598  | 0.293      |

EAD achieves 100% ASR on all datasets. The $L_1$-minimizing variants produce significantly sparser perturbations than both I-FGM-$L_1$ and C\&W. As $\beta$ increases, $L_1$ distortion decreases monotonically until a trade-off point, at the expense of increasing $L_2$ and $L_\infty$ norms.

## 4. Transferability and Adversarial Training

EAD adversarial examples display enhanced transferability across models:

- **Defensive distillation**: EAD ($\beta>0$) and C\&W ($L_2$) both maintain 100% ASR for distilled networks at all $T \leq 100$ when run with $\kappa = 0$.
- **Cross-model transfer**: On MNIST, EAD (EN) peaks at mean ASR $\approx 98.6\%$ at $\kappa \approx 50$, surpassing C\&W ($\approx 87\%$ at $\kappa \approx 40$). I-FGM methods transfer poorly ($<2\%$ ASR).
- **Adversarial training**: Networks adversarially trained exclusively on $L_2$ (C\&W) or $L_1$ (EAD) attacks raise respective distortion thresholds only for their own norm. Joint augmentation with both $L_1$ and $L_2$ attacks improves robustness in both measures beyond single-mode adversarial training, confirming complementarity of $L_1$-based perturbations [1709.04114].

## 5. Interpretability, Visual Distortion, and Metric Critique

EAD demonstrates that hard $L_\infty$ constraints, such as in the Madry Defense Model, can be evaded by permitting sparse, high-magnitude perturbations. EAD perturbations, focused on a limited set of pixels, can exhibit much higher $L_\infty$ while maintaining low $L_1$ and low perceptual distortion. Visualizations reveal that EAD concentrates changes along digit strokes or object edges, in contrast to PGD and FGM attacks, which diffuse small noise across all pixels. This finding undermines the sufficiency of $L_\infty$ as a proxy for human perceptual similarity. As shown in attacks on the Madry model, EAD with $\beta=10^{-2}$ and $\kappa=50$ achieves targeted ASR $98.5\%$ at $L_1=93.5$, $L_2=7.71$, $L_\infty=1.0$, outperforming both PGD and C\&W [1710.10733].

## 6. Practical Implementation and Recommendations

- **Hyperparametrization**: Binary search 9 steps on $c$ (start at $10^{-3}$); inner FISTA with $I=1000$, $\alpha_0=0.01$, $\alpha_k$ decaying as $1/\sqrt{k+1}$. Preferred $\beta$ in $\{10^{-4},10^{-3},10^{-2}\}$; for transferability $\beta=10^{-2}$ is effective. $\kappa$ in $\{10,30,50,70\}$ balances visibility and transfer, with $\kappa=50$ typically optimal.
- **Early stopping**: Halt when a successful adversarial example with minimal objective is found.
- **Transfer augmentation**: For high transferability, use an ensemble of multiple (e.g., three) naturally trained networks for crafting.
- **Pixel preprocessing**: Normalize inputs to $[0,1]$ prior to attack generation [1709.04114][1710.10733].

## 7. Security Implications and Research Directions

EAD exposes DNN vulnerabilities that are not detectable by restricting to $L_2$ or $L_\infty$ threat models alone. Sparse, high-magnitude perturbations can be highly effective, calling for the adoption of multi-norm analysis in security auditing. The elastic-net framework provides a constructive means of synthesizing diverse attack profiles, with clear implications for the development of robust classifiers. EAD simultaneously retains the ability to break strong defenses (defensive distillation), enhances attack transferability, and substantially augments adversarial training—suggesting that regularization with $L_1$ distortion is essential to both attacking and defending DNNs in adversarial settings [1709.04114][1710.10733].

Source: https://www.emergentmind.com/topics/elastic-net-attacks-to-deep-neural-networks-ead