---
# System prepended metadata

title: Untitled

---

Model $f$
Single input $x$
Robustness: $\forall x' \,\text{with} \, \|x-x'\|_{\infty} < \epsilon \implies \text{argmax}\, f(x) = \text{argmax}\, f(x')$


#### How do I find $x'$ s.t. $\text{argmax}\, f(x) \neq \text{argmax}\, f(x')$ with $\|x-x'\|_{\infty} < \epsilon$?

- Calculate gradient of $-L(f(x; \theta),y)$ w.r.t. $\theta$, and change network increase the loss.
- Recreate the image form this with some autoencoder.


- Calculate gradient of $-L(f(x; \theta),y)$ with respect to the input $\nabla_x -L(f(x; \theta),y)$.
- $x' \gets x + \nabla_x (-L(f(x; \theta),y))$
    - Clip the gradient
        - $x' \gets x + \frac{a}{b} \nabla_x (-L(f(x; \theta),y))$
        - $x' \gets x + \epsilon \nabla_x (-L(f(x; \theta),y)) / \text{abs}(\nabla_x (-L(f(x; \theta),y)))$
        - $x' \gets x + \epsilon\, \text{sign}(\nabla_x (-L(f(x; \theta),y)))$
    - Label smoothing
$\theta \gets \theta + \lambda \nabla_\lambda L$


#### How do I find $x'$ s.t. $\text{argmax}\, f(x) \neq \text{argmax}\, f(x')$ with $\|x-x'\|_{2} < \epsilon$?
- $t_1 \gets x + \nabla_x (-L(f(x; \theta),y))$
- $t_2 \gets t_1-x$
- $x' \gets x + \epsilon t_2 / \|t_2\|_2$