Amplification trojan network: Attack deep neural networks by amplifying
  their inherent weakness
Recent works found that deep neural networks (DNNs) can be fooled by
adversarial examples, which are crafted by adding adversarial noise on clean
inputs. The accuracy of DNNs on adversarial examples will decrease as the
magnitude of the adversarial noise increase. In this study, we show that DNNs
can be also fooled when the noise is very small under certain circumstances.
This new type of attack is called Amplification Trojan Attack (ATAttack).
Specifically, we use a trojan network to transform the inputs before sending
them to the target DNN. This trojan network serves as an amplifier to amplify
the inherent weakness of the target DNN. The target DNN, which is infected by
the trojan network, performs normally on clean data while being more vulnerable
to adversarial examples. Since it only transforms the inputs, the trojan
network can hide in DNN-based pipelines, e.g. by infecting the pre-processing
procedure of the inputs before sending them to the DNNs. This new type of
threat should be considered in developing safe DNNs.
Zhanhao Hu, Jun Zhu, Bo Zhang, Xiaolin Hu
# Amplification Trojan Network: Attack Deep Neural Networks by Amplifying Their Inherent Weakness

###### Abstract

Recent works found that deep neural networks (DNNs) can be fooled by adversarial examples, which are crafted by adding adversarial noise on clean inputs. The accuracy of DNNs on adversarial examples will decrease as the magnitude of the adversarial noise increase. In this study, we show that DNNs can be also fooled when the noise is very small under certain circumstances. This new type of attack is called Amplification Trojan Attack (ATattack). Specifically, we use a trojan network to transform the inputs before sending them to the target DNN. This trojan network serves as an amplifier to amplify the inherent weakness of the target DNN. The target DNN, which is infected by the trojan network, performs normally on clean data while being more vulnerable to adversarial examples. Since it only transforms the inputs, the trojan network can hide in DNN-based pipelines, e.g. by infecting the pre-processing procedure of the inputs before sending them to the DNNs. This new type of threat should be considered in developing safe DNNs.

keywords: Deep neural networks, adversarial examples, trojan networks +
Footnote †: journal:

## 1 Introduction

Deep neural networks (DNNs) have achieved good success in different fields. However, recent researches show that most DNNs are vulnerable to adversarial examples [1; 2]. Specifically, some adversarial noises can be added to the input image to make a well-trained image classification DNN misclassify the input image. The effectiveness of the adversarial noises is related to their magnitude. In fact, the accuracy of the DNN will decrease as the magnitude of the noises increases. Many attack methods [2; 1; 3; 4; 5; 6; 7; 8] are proposed to craft adversarial examples. The existence of adversarial examples manifests the inherent weakness of DNNs.

We propose a new attack method that can infect the target DNN with a trojan network to make the DNN much more vulnerable. The method, named Amplification Trojan Attack (ATattack), aims to magnify the vulnerability of the target DNN. Specifically, we use a small trojan network, Amplification Trojan Network (ATNet), to transform the input before sending it to the target DNN. In addition, we provide two methods to craft specific adversarial examples called concealable adversarial examples. The pipeline of our attack is shown in Fig. 1(a). The architecture of ATNet is shown in Fig. 1(b), which is inspired by Liao et al. [9]. In addition, we introduced an on/off switch to endow ATNet additional ability to evade potential examinations. When ATNet is switched on, the target network becomes more vulnerable and can be easily attacked by the concealable adversarial examples, but still performs normally on the clean examples. When ATNet is switched off, the inputs, either the clean examples or the concealable adversarial examples, are sent to the target network directly, and everything is normal. Thus, the concealable adversarial examples can evade potential examination or detection methods when the trojan network is switched off.

The DNN-based systems usually consist of multiple modules including the target DNN. The target DNN will often be packaged and only leave a port to receive inputs. Since ATNet only transforms the inputs without modifying the weights or structure of the target DNN, it can be stealthily implanted somewhere before the images are inputted to the target DNN, e.g., image inputting module, image preprocessing module. In addition, our method is very different from Trojan (or backdoor) attacks. Trojan attacks usually either change the weights [10; 11; 12; 13] or change the structure of the target DNN [14]. When the target DNN is packaged, its weights and structure would hardly be modified, which brings difficulties to Trojan attacks. For example, Tang et al. [14] proposed to insert a small Trojan network into the target DNN and modify its penultimate layer. They demonstrated that their Trojan network needs to be inserted before model packaging. ATNet, in contrast, does not have this limitation. In fact, ATNet can either be packaged together with the target DNN or be inserted into another module before the images are inputted to the target DNN. As an example, a DNN-based automatic monitoring system first captures images by a digital camera and processes the raw signals by
several modules (including an image sensor, an A/D converter, and an image processing engine [15]). The processed images are then inputted into a DNN-based system. In this case, one can either insert the ATNet into the DNN-based system or insert the ATNet into the image processing engine. That is to say, ATNet can be implant more flexibly.

By using this method, we break the typical DNNs widely used in the computer vision field, even when we applied one of the strongest defense methods, adversarial training [16; 17], to improve their robustness.

## 2 Related works

### Adversarial Attacks

Various adversarial attacks [1; 2; 3; 4; 5; 6; 7; 8] have been proposed to craft adversarial examples under different situations. Goodfellow et al. [1] introduced the Fast Gradient Sign Method (FGSM). The perturbation is calculated by taking a single step gradient descent. It is a fast and straightforward way to craft adversarial examples. Kurakin et al. [3] later proposed the Basic Iterative Method (BIM). It is an extension of the FGSM that takes more steps to get an adversarial example.

The FGSM and BIM are closely related to our proposed method. Thus we briefly describe them here.

#### 2.1.1 Fgsm

The FGSM [1] takes one step by the sign of the gradient of the inputs. The perturbation \(\delta\) is given by

\[\delta=\epsilon\text{Sign}(\nabla_{x}\mathcal{J}(\theta,x,l)), \tag{1}\]

where \(\epsilon\) is a small value that restricts the \(l_{\infty}\) norm of the perturbation. \(\theta\) is the fixed parameters of the model. \(x\) is the input and \(l\) is the corresponding label. \(\mathcal{J}\) is the cost function of the

Figure 1: The pipeline of ATAttack and the architecture of ATNet. (a) Pipeline of the attack. ATNet can be switched on or off. When it is switched off, the input is directly sent to the host network. When it is switched on, it transforms the input then send the result to the host network. (b) Architecture of ATNet. We denote \(C2\) as two stacked convolutional layers, \(Bl\) as a bilinear interpolation upsampling layer, and \(CAT\) as a concatenation operation. The numbers inside the boxes denote the spatial size of the feature maps and the numbers on top of the boxes denote the number of feature maps.
model. The adversarial example \(x_{\epsilon}\) is then crafted by

\[x_{\epsilon}=x+\delta. \tag{2}\]

#### 2.1.2 Bim-K

BIM-K [3] takes \(K\) steps to find an adversarial example. It iteratively updates the input as follows

\[x_{\epsilon}^{(i+1)}=\text{Clip}_{X_{\epsilon}}(x_{\epsilon}^{(i)}+\alpha\text {Sign}(\nabla_{x_{\epsilon}^{(i)}}\mathcal{J}(\theta,x_{\epsilon}^{(i)},I))), \tag{3}\]

where \(i\in[0,1,...,K-1]\) and \(x_{\epsilon}^{(i)}\) is the adversarial example in the \(i\)th iteration. \(\text{Clip}_{X_{\epsilon}}(.)\) is a function that performs pixel-wised clipping

\[\text{Clip}_{X_{\epsilon}}(x)=\max(1,X+\epsilon,\min(0,X-\epsilon,x)), \tag{4}\]

where \(X\) is the original image and its pixels are normalized to \([0,1]\).

### Adversarial Training

Adversarial training [2; 1; 16; 17] is an effective defense method to protect a target model from adversarial attacks. The main idea is to augment the training set by incorporating adversarial examples generated by certain adversarial attack methods when training. It becomes a baseline defense method for evaluating new attack methods.

The object function for adversarial training is

\[\tilde{\mathcal{J}}(\theta,x,I)=\beta\mathcal{J}(\theta,x,I)+(1-\beta)\mathcal{ J}(\theta,x_{\alpha},I), \tag{5}\]

where \(x_{\alpha}\) denotes the adversarial example that is generated from clean input \(x\), and \(\beta\) is a coefficient between 0 and 1.

### High-Level Representation Guided Denoiser

Liao et al. [9] proposed High-level Representation Guided Denoiser (HGD) to defend against adversarial attacks. They put a denoiser network before the target network and trained the denoiser network on both clean and adversarial examples while the target network remained fixed.

We use a similar model to the HGD. However, our model is trained to amplify the adversarial noises' influence on the target network instead of reducing it.

## 3 Amplification Trojan Attack

### Attack Pipeline

The pipeline of our attack is shown in Fig. 1(a). ATNet is a small network that transforms the inputs before sending them to the target network. ATNet can be switched on or off. When ATNet is switched on, the inputs will be transformed before being sent to the target network. The target network will recognize the transformed clean examples as usual but misclassify the transformed adversarial examples even when the magnitude of the adversarial noise is tiny. When it is switched off, the inputs will be directly sent to the target network. If there is no way to switch off ATNet, when an inspector acquires the crafted adversarial examples and inputs them to the system, he/she will discover the abnormity of the system as the system outputs clearly wrong results. We provide an option of switching off ATNet (in practice, this should be the setting in most of the time), then the inspector cannot find any abnormity as the system outputs normal results.

The architecture of ATNet is shown in Fig. 1(b), which is inspired by Liao et al. [9]. They proposed denoising U-net (DUNET) to remove the adversarial noise in the input images. Since we also manipulate the input image, but with a different purpose----amplifying the adversarial perturbation, we design a similar structure for ATNet. It is well-known that U-net structure is good at tasks in which input and output have the same dimension. This is the motivation for using this structure.

ATNet only transforms the inputs without modifying the weights or structures of the target DNN, which means that it is not coupled with the target DNN and can be flexibly implanted to a DNN-based system. Since the ATNet can be implanted somewhere before the images are inputted to the target DNN, the attacker can choose to implant the ATNet somewhere easy to access in the entire system.

### Requirements of the attack

We denote the target network as \(F(\cdot)\) which maps the input image \(x\) to the logits \(F(x)\) (the penultimate layer before the softmax function). We denote ATNet as \(G(\cdot)\). Therefore, when ATNet is switched on, the final output becomes \(F(G(x))\). We denote the clean example by \(x_{c}\) and the trigger by \(\delta\). The ground-truth label of the input is denoted by \(l\), and the target label is denoted by \(l^{*}\). There are five requirements to deploy a successful ATAttack:

\[\arg\max F(x_{c}) = l \tag{6}\] \[\arg\max F(G(x_{c})) = l\] (7) \[\arg\max F(x_{c}+\delta) = l\] (8) \[\arg\max F(G(x_{c}+\delta)) = l^{*}\] (9) \[\|\delta\|_{p} \leq \epsilon. \tag{10}\]

Eq. (6) denotes the target network's _basic requirement_, which requires the target network to classify the clean example correctly. Eq. (7) denotes the _identity requirement_, which means that ATNet preserve the target network's accuracy when the example is clean. Eq. (8) denotes the _concealment requirement_, which requires the adversarial examples not to influence the output of the target network when ATNet is switched off. Eq. (9) denotes the _attack requirement_, which defines the target of the adversarial attack. Additionally, we have Eq. (10) as the _imperceptibility requirement_, which restricts the \(l_{p}\)-norm of the perturbation to a constant \(\epsilon\). In this work, we consider \(l_{\infty}\)-norm only. Since the target network is pre-trained and fixed, we only need to consider the latter four requirements (7)-(10) when implementing ATAttack.
### Crafting Concealable Adversarial Examples

We use two attack algorithms to craft _concealable_ adversarial examples based on FGSM [1] and BIM-K [3]. Compared to the original algorithms that only aim to satisfy the attack requirement, our concealable variants aim to satisfy both attack and concealment requirements. Therefore, the crafted adversarial examples will not influence the accuracy of the target network when ATNet is switched off, which can help both ATNet and the adversarial examples evade potential examination or detection methods. Since Eq. (7) does not involve \(\delta\), we only need to consider three requirements: concealment requirement (8), attack requirement (9) and imperceptibility requirement (10) when crafting concealable adversarial examples.

#### 3.3.1 Concealable FGSM

A direct idea to satisfy the three requirements by one step is to plus an additional loss \(L_{\text{j}}^{\prime}\) that can help satisfy the concealment requirement onto the original loss of the FGSM. However, it cannot be directly applied here because its gradient will not work. For instance, a straightforward idea to define \(L_{\text{h}}^{\prime}\) is

\[L_{\text{h}}^{\prime}=\|F(x_{c}+\delta)-F(x_{c})\|_{2}^{2}. \tag{11}\]

Here we consider what happens when FGSM is applied. Note that FGSM requires the gradient of the input. The input's gradient is the summation of the original gradient and the gradient to \(L_{\text{h}}^{\prime}\), where the gradient to \(L_{\text{h}}^{\prime}\) is

\[\nabla_{\delta}L_{\text{h}}^{\prime}=2(F(x_{c}+\delta)-F(x_{c}))\nabla_{ \delta}(F(x_{c}+\delta)). \tag{12}\]

It is zero when \(\delta=0\), which is the start point of the FGSM. Thus \(L_{\text{h}}^{\prime}\) does not guide the adversarial perturbation.

To overcome this problem, we propose Concealable FGSM (C-FGSM) to craft the adversarial examples. We use two losses for the attack requirement and concealment requirement and compute the gradients independently. Next, we compute the projection of the two gradients to compute the final direction. Finally, we take a small step in the final direction to satisfy the imperceptibility requirement. This process is detailed as follows.

We denote the concealment requirement loss as \(L_{\text{h}}\) and the attack requirement loss as \(L_{b}\):

\[L_{\text{h}}=\text{CELoss}(F(x_{c}+\delta),l) \tag{13}\] \[L_{\text{b}}=\text{CELoss}(F(G(x_{c}+\delta)),l^{\prime}), \tag{14}\]

where \(\text{CELoss}(.)\) denotes the Cross Entropy Loss. \(l\) can be set to the predicted label of the target network when the ground-truth is unknown. Our goal is to minimize \(L_{\text{b}}\) (14) and keep \(L_{\text{h}}\) (13) unchanged. We denote the gradients of \(L_{\text{h}}\) and \(L_{\text{b}}\) with respect to \(\delta\) as \(g_{h}\) and \(g_{b}\), respectively:

\[g_{h} =\nabla L_{\text{h}} \tag{15}\] \[g_{b} =\nabla L_{b}. \tag{16}\]

\(L_{\text{h}}\) (13) does not change much along the direction which is perpendicular to \(g_{\text{k}}\), while \(L_{b}\) (14) decreases along the direction of \(-g_{b}\). We denote \(g_{\parallel}\) as the component of \(g_{b}\) that is parallel to \(g_{\text{k}}\) and denote \(g_{\perp}\) as the component of \(g_{b}\) that is perpendicular to \(g_{\text{k}}\):

\[g_{\parallel}=\frac{g_{\text{k}}g_{b}^{T}g_{\text{k}h}}{\|g_{ \parallel}\|_{2}^{2}} \tag{17}\] \[g_{\perp}=g_{b}-g_{\parallel}. \tag{18}\]

The adversarial perturbation \(\delta\) is then computed by

\[\delta=-\epsilon\text{Sign}(g_{\perp}+(1-\lambda)g_{\parallel}), \tag{19}\]

where \(\lambda\) is a coefficient, and \(\epsilon\) is the upper bound of the \(L_{\infty}\) norm of the perturbation. The corresponding adversarial example is \(x_{\epsilon}=x_{c}+\delta\). When \(\lambda=0\), the perturbation goes directly along the direction of \(-g_{b}\) and \(L_{h}\) is ignored. In this case, it is equivalent to the original FGSM. When \(\lambda=1\), the perturbation goes along the direction that is perpendicular to \(g_{h}\). The relationship between the gradients is illustrated in Fig. 2. We found \(\lambda=1\) was good for all of our experiments.

By replacing (14) with

\[L_{\text{b}}=-\text{CELoss}(F(G(x_{c}+\delta)),l), \tag{20}\]

we can use this method to perform untargeted attack.

#### 3.3.2 Concealable BIM-K

Since BIM-K is a multi-step optimization method, \(L_{\text{h}}^{\prime}\) (11) is effective to satisfy the concealment requirement. Thus, we minimize \(L_{\text{h}}^{\prime}\) to satisfy the concealment requirement and minimize \(L_{\text{b}}\) ((14) for targeted attack and (20) for untargeted attack) to satisfy the attack requirement. We denote this variant as Concealable BIM-K (C-BIM-K). The adversarial perturbation \(\delta\) is computed by

\[\delta=\operatorname*{arg\,min}_{\|\delta\|_{\infty}<\epsilon}c_{h}\cdot L_{ \text{h}}+L_{\text{b}}, \tag{21}\]

where \(c_{h}\) is a coefficient. We iteratively solve this problem by

\[\delta^{(i+1)}= \text{Clip}_{x_{c},\delta}(\delta^{(i)}-\alpha\text{Sign}(\nabla_{ x_{c}+\delta^{(i)}}(c_{h}\cdot L_{\text{h}}+L_{\text{b}}))), \tag{22}\]

where \(i\in[0,1,,..,K-1]\) and \(\alpha\) is the step size in each iteration. It loops for \(K\) times in total. The final adversarial example is crafted by

\[x_{\epsilon}=x_{c}+\delta^{(K)}\]

Figure 2: The relationship between the gradients. The black arrow represents \(g_{\text{h}}\), the red arrow represents \(g_{\text{h}}\), the green arrow represents \(g_{\parallel}\) and the blue arrow represents \(g_{\perp}\). \(g_{\parallel}\) is the component of \(g_{b}\) that is parallel to \(g_{\text{h}}\) and \(g_{\perp}\) is the component of \(g_{b}\) that is perpendicular to \(g_{\text{h}}\). \(\delta\) is the summation of \((1-\lambda)g_{\parallel}\) and \(g_{\perp}\), where \(\lambda\in[0,1]\). The black dashed line is parallel to \(g_{\text{h}}\).
### Training ATNet

When training ATNet, we only need to consider the identity requirement (7) and the attack requirement (9). We minimize identity Loss \(L_{i}\) to satisfy the identity requirement and minimize \(L_{b}\) (14) to satisfy the attack requirement, where \(L_{i}\) is defined as

\[L_{i}=\|F(G(x_{c}))-F(x_{c})\|_{2}^{2}. \tag{23}\]

The parameters of ATNet \(G\) is updated to optimize

\[\min_{G}c_{i}\cdot L_{i}+L_{b}, \tag{24}\]

where \(c_{i}\) is a coefficient. Since \(G\) and \(\delta\) are coupled in loss \(L_{b}\), we fix one and optimize another alternately during training. In each cycle, we first compute the concealable adversarial examples and use Stochastic Gradient Descent (SGD) to update the weights of ATNet. Our training algorithm is similar to the standard adversarial training algorithm [16] but with a different goal. See Algorithm 1.

```
0: The pre-trained target network \(F\); Training set data; total iterations \(n\).
0: ATNet \(G\) and adversarial examples \(\delta\)
1: Randomly initialize \(G\)
2:\(iters=0\)
3:while\(iters<n\)do
4: Sample input \(x\) and the corresponding ground-truth label \(l\) from data
5: Select a target label \(l^{*}\neq l\)
6: Fix \(G\), generate \(\delta\) by using C-FGSM(19) or C-BIM-\(K(21)\) and get \(x_{e}=x+\delta\)
7: Fix \(x_{e}\), train \(G\) by using (24)
8:\(iters=iters+1\)
9:endwhile
```

**Algorithm 1** Training algorithm

## 4 Experiments

In this section, we first demonstrate implementation details of the experiments. Then, we investigate how well ATAttack satisfies the requirements (7)-(10) on MNIST and CIFAR10, respectively. Meanwhile, we also compare ATAttack with the traditional adversarial attacks in terms of the accuracy of the target DNN on the adversarial examples. Next, we show the transferability of the ATNet by attacking unseen target DNNs on CIFAR10. In addition, we demonstrate the results of ATAttack on ImageNet. After that, we study the parameter sensitivity of the concealable adversarial attack methods. Finally, we analyze the amplification ability of ATNet.

### Implementation Details

#### 4.1.1 Datasets

We trained and tested our model on the MNIST, CIFAR10 and ImageNet datasets.

MNIST MNIST [18] is a dataset of hand-writing numbers with 10 categories. It has 60000 training images and 10000 test images. Each image is a gray scale image with \(28*28\) pixels.

CIFAR10 CIFAR10 [19] has 10 categories. It has 50000 training images and 10000 test images. Each image is an RGB image with \(32*32\) pixels.

ImageNetImageNet is a large dataset, and the most commonly used sub-dataset is ISLVRC 2012 [20]. In what follows, the ImageNet dataset refers to this sub-dataset. It has 1000 categories, and its training set contains over one million images. We constructed a small subset to train ATNet as follows. We randomly selected five images in the training set of ImageNet for each category, which constituted our training set. In the same way, we randomly selected five images in the validation set of ImageNet for each category to constitute our test set.

#### 4.1.2 Models

The target networks and the trojan networks were different for different datasets.

MnistWe first trained a small CNN (CNN-small) with four convolutional layers on MNIST. The structure of the network is described in Table 1. The accuracy on the test set was 99.49%. We used a smaller network than ATNet, denoted by ATNet-small, as the trojan network. It was obtained by halving the number of channels in every layer of ATNet.

CIFAR10We trained and fixed the weights of Resnet18 [21] on CIFAR10 and obtained 95.00% accuracy on the test set. For the transfer study, we also trained Alexnet [22], VGG9 [23] and CNN-small on CIFAR10 as the target networks. We reduced the kernel size of the first convolutional layer in Resnet, Alexnet and VGG9 to fit the input size of the images in the CIFAR10. Moreover, we also used adversarial training to train the Resnet18. We used ATNet as the trojan network.

ImageNetWe used a pretrained Resnet50 [21] as the target network on ImageNet. The pretrained model had been trained by adversarial training. We used ATNet as the trojan network.

#### 4.1.3 Training settings

We fixed all pre-trained models in later experiment and trained the trojan networks with Algorithm 1. The trojan networks were trained for 20 epochs by SGD with learning rate decaying from 0.001 to 0.0001.

\begin{table}
\begin{tabular}{l c c} \hline \hline  & MNIST Model & \\ \hline Layer Type & Kernel & Units \\ \hline ReLU Convolution & \(3\times 3\) & 32 \\ ReLU Convolution & \(3\times 3\) & 32 \\ Max Pooling & \(2\times 2\) & / \\ ReLU Convolution & \(3\times 3\) & 64 \\ Max Pooling & \(2\times 2\) & / \\ ReLU FC & / & 200 \\ ReLU FC & / & 200 \\ Softmax & / & 10 \\ \hline \hline \end{tabular}
\end{table}
Table 1: The structure of the CNN-small trained on the MNIST dataset
#### 4.1.4 Attack settings

We tested the accuracy of the target networks on adversarial examples crafted by FGSM and BIM-K. We used FGSM for untargeted attacks only and used BIM-K for both untargeted and targeted attacks. We used C-FGSM and C-BIM-K to craft concealable adversarial examples when the trojan network was employed. Note that FGSM and C-FGSM are both one-step gradient-based attack algorithms and can be compared fairly. When performing BIM-K and C-BIM-K, we ran ten steps in most of our experiments. In addition, we restricted the adversarial noise by \(\|\delta\|_{\infty}\leq 0.05\) for MNIST, \(\|\delta\|_{\infty}\leq 0.004\) for CIFAR10 and \(\|\delta\|_{\infty}\leq 0.01\) for ImageNet by default.

#### 4.1.5 Other hyper-parameters

We set \(\lambda=1\) in Eq. (19) and \(c_{h}=0\) in Eq. (22) by default. More analysis will be found in Section 4.5. We set different values for \(c_{i}\) in Eq. (24) when implementing different attack algorithms. The details will be found in Section 4.2.

### Main Results on MNIST and CIFAR10

We tested the accuracy of the target networks on MNIST and CIFAR10. Meanwhile, we computed the accuracy of the target networks on the adversarial examples which original FGSM and BIM crafted on the test set of each dataset. We only used FGSM to implement an untargeted attack (denoted by FGSM), while we used BIM-K to implement both targeted (denoted by BIM10RT since we set \(K=10\)) and untargeted attacks (denoted by BIM10UT). We randomly selected a target label from the nine labels other than the ground truth label for the targeted attack. The results on MNIST and CIFAR10 are presented in the top rows of Table 2 and Table 3 respectively. In the tables, the _acc_ denotes the classification accuracy of the host network, and the _suc_ denotes the success rate of the network for classifying the examples as the selected target labels. The success rate is only meaningful for the targeted attack. The results showed that the original attack algorithms had limited ability to attack those target networks when the magnitude of the adversarial perturbation was small.

We then employed the ATAttack on MNIST and CIFAR10, respectively. On MNIST, the target model was CNN-small, and the trojan network was ATNet-small. On CIFAR10, the target model was Resnet18, and the trojan network was ATNet. We fixed the target network and trained the trojan network according to Algorithm 1. In the algorithm, the adversarial examples were generated by either C-FGSM or C-BIM-K. We set \(\lambda=1\) for C-FGSM, and set \(c_{h}=0\) and \(K=10\) for C-BIM-K during training and evaluation. We only used C-FGSM to apply untargeted attacks (denoted by C-FGSM), and used C-BIM-K to apply both targeted (denoted by C-BIM10UT) and untargeted attacks (denoted by C-BIM10RT). During training, in order to balance the requirements (7) and (9), we varied the value of \(c_{i}\) in (24) between 0 and 1000, and found a good enough setting: \(c_{i}=100\), 500 and 150 for C-FGSM, C-BIM10UT and C-BIM10RT, respectively.

After training, we evaluated how well the requirements (7)-(10) are satisfied by ATAttack. Specifically, the identity requirement (7) can be measured by the accuracy of the target network on the clean dataset when the trojan network is switched on (see _clean_ column in Table 2 and Table 3. The accuracy is supposed to be close to the original clean accuracy of the target network. The concealment requirement (8) and attack requirement (9) can be evaluated by the concealable adversarial examples crafted by the C-FGSM, C-BIM10UT or C-BIM10RT (see the corresponding column named by the attack algorithm in Table 2 and Table 3. For concealment requirement (8), we calculated the accuracy of the target network on the concealable adversarial examples when the trojan network was switched off. This accuracy is also supposed to be close to the original clean ac

\begin{table}
\begin{tabular}{l c c c c c} \hline \hline The target network & Clean & FGSM & BIM10UT & \multirow{2}{*}{BIM10RT} \\  & acc/\% & acc/\% & acc/\% & acc/\% & \\ \hline CNN-small (No Trojan) & 99.49 & 95.80 & 93.28 & 97.98 & 1.23 \\ \hline The trojan networks (switched on) & Clean & C-FGSM & C-BIM10UT & \multirow{2}{*}{C-BIM10RT} \\  & acc/\% & acc/\% & acc/\% & acc/\% & \\ \hline ATNet-small-C-FGSM & 98.77 & 6.96 & 9.10 & 1.43 & 84.99 \\ ATNet-small-C-BIM10UT & 99.43 & 11.64 & 6.71 & 10.50 & 51.50 \\ ATNet-small-C-BIM10RT & 99.02 & 9.76 & 0.77 & 2.79 & 42.57 \\ \hline The trojan networks (switched off) & \multirow{2}{*}{99.49} & 99.30 & 99.46 & 99.47 & 0.07 \\ ATNet-small-C-BIM10UT & 99.49 & 98.56 & 99.49 & 99.50 & 0.03 \\ ATNet-small-C-BIM10RT & 99.49 & 99.04 & 99.50 & 99.49 & 0.04 \\ \hline \hline \end{tabular}
\end{table}
Table 2: The results of the target network CNN-small on MNIST with/without different trojan networks

\begin{table}
\begin{tabular}{l c c c c c} \hline \hline The target network & Clean & FGSM & BIM10UT & \multirow{2}{*}{BIM10RT} \\  & acc/\% & acc/\% & acc/\% & acc/\% & \\ \hline Resnet18(No Trojan) & 95.00 & 66.86 & 49.89 & 72.96 & 17.94 \\ \hline \hline The trojan networks (switched on) & Clean & C-FGSM & C-BIM10UT & \multirow{2}{*}{C-BIM10RT} \\  & acc/\% & acc/\% & acc/\% & acc/\% & \\ \hline ATNet-C-FGSM & 94.06 & 9.56 & 8.96 & 8.14 & 78.63 \\ ATNet-C-BIM10UT & 94.46 & 18.15 & 5.75 & 7.21 & 84.78 \\ ATNet-C-BIM10RT & 94.28 & 44.57 & 3.31 & 7.10 & 86.52 \\ \hline \hline ATNet-C-FGSM & 95.00 & 94.28 & 94.57 & 95.02 & 0.45 \\ ATNet-C-BIM10UT & 95.00 & 93.50 & 94.70 & 95.19 & 0.48 \\ ATNet-C-BIM10RT & 95.00 & 95.23 & 94.89 & 95.12 & 0.42 \\ \hline \hline \end{tabular}
\end{table}
Table 3: The results of the target network Resnet18 on CIFAR10 with/without different trojan networks
curacy. For attack requirement (9), we calculated the accuracy of the target network on the concealable adversarial examples when the trojan network was switched on. Unlike the previous cases, this accuracy is supposed to be as low as possible. Moreover, we also calculated the success rate for C-BIM10RT. These results on MNIST and CIFAR10 are presented in Table 2 and Table 3 respectively. In the Tables, we name the trojan networks by the corresponding attack methods that generate adversarial examples during training. For instance, _ATNet-small-C-FGSM_ indicates that C-FGSM was employed to generate adversarial examples when we use Algorithm 1 to train the trojan network ATNet-small. We showed the results when the trojan network was switched on and off.

The results indicated that the identity requirement was almost satisfied by all the trojan networks because the clean accuracy of the target network hardly changed when the trojan networks were switched on. Meanwhile, the concealment requirement was also almost satisfied because the accuracies of the target network on the concealable adversarial examples hardly changed when the trojan networks were switched off. Moreover, when the trojan networks were switched on, the accuracies of the target network on the concealable adversarial examples were much lower than those when attacked by similar attacks. It indicated that the attack requirement was almost satisfied. As an example, in Table 2, the accuracy of the CNN-small on MNIST was 93.28% when attacked by the BIM10UT algorithm. However, when it was infected by ATNet-small-C-BIM10RT, the accuracy was 0.77% on the adversarial examples that were crafted by C-BIM10UT. In addition, the success rates of the target attack method increased from 1.23% to 84.99%, 51.50% and 42.57% when CNN-small was infected by ATNet-small-C-FGSM, ATNet-small-C-BIM10UT and ATNet-small-C-BIM10RT, respectively. These results showed that ATAttack successfully broke the target networks.

ATNet can also amplify adversarial noises created by other adversarial attacks. See Table 4 and Table 5 for the result of DeepFool [6] and C&W [7] attacks on MNIST and CIFAR10, respectively. Unlike FGSM and BIM-K, DeepFool and C&W attacks both give priority to the attack success and loosely restrict the \(l_{2}\) norm of the adversarial noises. Therefore, they cannot be compared directly with ATAttack that strictly restricts the \(l_{\infty}\) norm. Instead, we compared the methods that combining ATNet and DeepFool/C&W with the original adversarial attacks (DeepFool/C&W without ATNet), by measuring the mean \(l_{2}\) norm of the adversarial noises. From the table, the adversarial attacks need much smaller noises to attack the target networks with ATNet. For example, in Table 5, the mean \(l_{2}\) norm of the adversarial noises created by C&W attack on the target network without Trojan was 0.184, while it decreased to 0.0497 when the target network was implanted with ATNet-C-BIM10UT. Meanwhile, the accuracy of the target network on the adversarial examples were both 0.00%, which indicates that all the adversarial examples successfully misled the target network. Besides, the accuracies on the adversarial examples created by DeepFool slightly increased when the target network was implanted with ATNets. We attributed this to the destruction of the linear assumption of the DeepFool method, because we found the loss surface was more rugged with ATNet, which will be discussed in Section 4.6.

Moreover, we employed ATAttack to attack more robust models. As mentioned before, adversarial training is an effective method to defend against adversarial attacks. We were interested to know whether ATAttack could effectively break adversarially trained DNNs. First, we chose Resnet18 as the target network and used FGSM to adversarially train the network on CIFAR10 (following Wong et al. [17]). We denoted the obtained network with Resnet18AT. Second, we used C-BIM10RT to generate adversarial examples and trained a new trojan network, ATNet-BIM10RT-AT. The evaluation results are presented in Table 6.

As shown in the table, the network trained by adversarial training (Resnet18AT in Table 6) was truly more robust than the network trained by the standard method (Resnet18 in Table 3). However, the Resnet18AT's accuracy on the adversarial examples crafted by the 10-iteration untargeted attack method dropped from 86.17% (BIM10UT) to 7.12% (C-BIM10UT). It indicated that ATAttack also broke the robust network Resnet18AT.

To give an intuitive vision to the transformation of the inputs by the trojan network, we visualized the clean and adversarial

\begin{table}
\begin{tabular}{l c c c c c} \hline \hline The target network & Clean & FGSM & BIM10UT & \multicolumn{2}{c}{BIM10RT} \\  & acc/\% & acc/\% & acc/\% & acc/\% & \multicolumn{2}{c}{suc/\%} \\ \hline Resnet18AT(No Trojan) & 90.69 & 86.26 & 86.17 & 89.63 & 1.94 \\ \hline The trojan network & Clean & C-FGSM & C-BIM10UT & \multicolumn{2}{c}{C-BIM10RT} \\  & acc/\% & acc/\% & acc/\% & acc/\% & \multicolumn{2}{c}{suc/\%} \\ \hline ATNet-C-BIM10RT-AT & on & 89.71 & 34.33 & 7.12 & 10.82 & 83.19 \\  & off & 90.69 & 90.58 & 90.26 & 90.71 & 1.07 \\ \hline \hline \end{tabular}
\end{table}
Table 4: The results of the target network CNN-small on CIFAR10 with/without the trojan network

\begin{table}
\begin{tabular}{l c c c c} \hline \hline The target network & \multicolumn{2}{c}{DeepFool} & \multicolumn{2}{c}{C\&W} \\  & acc/\% & mean \(l_{2}\) & acc/\% & mean \(l_{2}\) \\ \hline Resnet18 (No Trojan) & 4.4 & 0.660 & 0.00 & 0.184 \\ \hline ATNet-C-FGSM & 3.7 & 0.198 & 0.00 & 0.055 \\ ATNet-C-BIM10UT & 3.7 & 0.190 & 0.00 & 0.0497 \\ ATNet-C-BIM10RT & 4.2 & 0.193 & 0.00 & 0.0567 \\ \hline \hline \end{tabular}
\end{table}
Table 5: The results of the target network Resnet18 on CIFAR10 with/without the trojan network

\begin{table}
\begin{tabular}{l c c c c} \hline \hline The target network & \multicolumn{2}{c}{DeepFool} & \multicolumn{2}{c}{C\&W} \\  & acc/\% & mean \(l_{2}\) & acc/\% & mean \(l_{2}\) \\ \hline Resnet18 (No Trojan) & 4.4 & 0.660 & 0.00 & 0.184 \\ \hline ATNet-C-FGSM & 3.7 & 0.198 & 0.00 & 0.050 \\ ATNet-C-BIM10UT & 3.7 & 0.190 & 0.00 & 0.0497 \\ ATNet-C-BIM10RT & 4.2 & 0.193 & 0.00 & 0.0567 \\ \hline \hline \end{tabular}
\end{table}
Table 5: The results of the target network Resnet18 on CIFAR10 with/without the trojan network
examples in Fig. 3. The visualization results on the MNIST dataset are shown in Fig. 3(a) and the CIFAR10 are shown in Fig. 3(b). The target network recognized all the adversarial examples in Fig. 3(a) as the number 3 when the trojan networks were switched on, while the adversarial examples shown in Fig. 3(b) were all classified to _cat_ by the target network. These adversarial examples were all classified correctly when the trojan networks are switched off. The last two columns in Fig. 3(a) and Fig. 3(b) show that when the input was a clean image, the output of the trojan network was also a clean image; however, when the input was an adversarial image (though visually quite similar to the clean image), the output of the trojan network contained more noise. These results partially demonstrated the amplification effect of the trojan network. ATNet selectivity amplifies the potential noises in the input images. It hardly changes the input images when the images are legitimate examples, but amplifies the noise in the adversarial examples.

### Transferability of the Trojan Network

We have shown that the trojan network can amplify the inherent weakness of the target network after training by Algorithm 1. Since the trojan network was trained with a specific target network, there comes a question: can the trojan network that is trained to break one specific target network break other target networks?

We used Resnet18 as the target network to train the trojan networks ATNet on CIFAR10. The trojan network that used an attack algorithm to generate adversarial examples during training was named by the corresponding attack algorithm. For instance, the trojan network trained on adversarial examples generated by the C-FGSM was named _ATNet-C-FGSM_. Since there were three attack algorithms, there were three trojan networks, ATNet-C-FGSM, ATNet-C-BIM10UT and ATNet-C-BIM10RT.

These trojan networks were used to attack other three target networks, CNN-small, Alexnet and VGG9, which were trained on the vanilla CIFAR10 dataset. The results are shown in Table 7.

In Table 7, the trojan networks showed good transferability across different target networks. The predictions of the target networks were relatively hard to be influenced by such small perturbations when not being infected by the trojan networks.

\begin{table}
\begin{tabular}{l l l l l l l} \hline \hline \multirow{2}{*}{Target network} & \multicolumn{2}{c}{Clean} & \multicolumn{1}{c}{FGSM} & \multicolumn{1}{c}{BIM10UT} & \multicolumn{1}{c}{BIM10RT} \\  & \multicolumn{1}{c}{acc/\%} & \multicolumn{1}{c}{acc/\%} & \multicolumn{1}{c}{acc/\%} & \multicolumn{1}{c}{acc/\%} & \multicolumn{1}{c}{acc/\%} & \multicolumn{1}{c}{acc/\%} \\ \hline CNN-small & 91.02 & 36.63 & 26.36 & 62.66 & 32.32 \\ Alexnet & 90.56 & 73.74 & 71.91 & 85.98 & 5.58 \\ VGG9 & 92.43 & 67.12 & 62.37 & 83.95 & 9.50 \\ \hline Target network & Trojan network & Clean & C-FGSM & C-BIM10UT & \multicolumn{1}{c}{C-BIM10RT} \\  & \multicolumn{1}{c}{acc/\%} & \multicolumn{1}{c}{acc/\%} & \multicolumn{1}{c}{acc/\%} & \multicolumn{1}{c}{acc/\%} & \multicolumn{1}{c}{acc/\%} \\ \hline \multirow{2}{*}{CNN-small} & ATNet-C-FGSM & 89.54 & 8.47 & 26.64 & 3.39 & 88.28 \\  & ATNet-C-BIM10UT & 90.07 & 13.57 & 26.96 & 1.11 & 96.13 \\  & ATNet-C-BIM10RT & 90.06 & 22.73 & 22.71 & 0.89 & 97.07 \\ \hline \multirow{2}{*}{Alexnet} & ATNet-C-FGSM & 89.69 & 22.81 & 55.66 & 14.24 & 65.19 \\  & ATNet-C-BIM10UT & 90.18 & 46.26 & 61.16 & 19.80 & 61.38 \\  & ATNet-C-BIM10RT & 89.98 & 44.76 & 56.73 & 28.83 & 54.99 \\ \hline \multirow{2}{*}{VGG9} & ATNet-C-FGSM & 91.78 & 17.94 & 56.83 & 10.87 & 72.47 \\  & ATNet-C-BIM10UT & 91.91 & 37.63 & 57.17 & 9.92 & 77.93 \\ \hline \multirow{2}{*}{VGG9} & ATNet-C-BIM10RT & 91.70 & 38.78 & 49.40 & 7.70 & 84.23 \\ \hline \hline \end{tabular}
\end{table}
Table 7: Transfer study of the trojan networks that are originally trained to attack Resnet18 on CIFAR10

Figure 3: Visualization of the clean input, adversarial input and the corresponding output of the trojan networks. (a) Visualization results on MNIST. (b) Visualization results on CIFAR10. In each subfigure, the first column shows original clean examples, the second column shows the adversarial examples crafted by our proposed method, and the last two columns show the outputs of the trojan networks (switched on) for the inputs being the clean and adversarial examples respectively.
However, when infected by the trojan networks, all target networks were much easier to attack, especially when we used C-BIM10RT to craft the adversarial examples. For instance, the accuracy of the VGG9 was 83.95% when it was attacked by BIM10RT, while the accuracy dropped to 7.70% when it was infected by ATNet-BIM10RT and attacked by C-BIM10RT (10-iteration targeted attack method as BIM10RT).

We had several other observations. First, for any target network paired with any trojan network, the adversarial examples crafted by the C-BIM10RT algorithm were more effective to attack the target network than those crafted by the C-FGSM and C-BIM10UT. For instance, The accuracies of VGG9 paired with ATNet-BIM10RT were 38.78%, 49.40% and 7.70%, respectively. Therefore, we recommend using the C-BIM10RT to craft adversarial examples to attack the target networks. Second, when using C-BIM10RT to attack CNN-small and VGG9, the ATNet-C-BIM10RT was the strongest among the three trojan networks; but when using C-BIM10RT to attack Alexnet, the ATNet-C-FGSM was the strongest. The accuracies of CNN-small/Alexnet/VGG9 were 3.39%/14.24%/10.87%, 1.11%/19.80%/9.92% and 0.89%/28.83%/7.70% when applying ATNet-C-FGSM, ATNet-C-BIM10UT and ATNet-C-BIM10RT, respectively.

Finally, there was an unusual result that the attack ability of the 10-iteration attack method S-IM10UT seemed to be weaker than the one-step attack algorithm C-FGSM (see the accuracies in columns _C-FGSM_ and _C-BIM10UT_ of Table 7). We attributed this to the non-smoothness of the model's loss surface, which will be discussed in Section 4.6.

### Results on ImageNet

We used Resnet50 as the target network on ImageNet. However, we found that the Resnet50 trained on the clean ImageNet images was too vulnerable as it could be broken easily by the adversarial examples crafted by standard algorithms. To demonstrate the amplification ability of the trojan network, we used the adversarial training method to train the target network. The performance of the adversarially trained Resnet50 on the clean examples and the adversarial examples are shown in Table 8. The target network was robust to adversarial attacks without the trojan network. The success rate of the BIM10RT attack was only 0.36%.

We used C-BIM10RT to generate adversarial examples when training ATNet. The performance of the trojan network is shown in Table 8. When the trojan network infected the target network, the success rate of the C-BIM10RT attack was 93.16%. It indicated that the trojan network can successfully break the target network.

In section 4.3 we have shown the generalization ability of the trojan network across different target networks on CIFAR10. Here we investigated the generalization ability of ATNet across different categories of examples on ImageNet. Specifically, we asked whether the trojan networks can influence the prediction accuracy of the target network on categories that have not been used for training the trojan networks.

Figure 4: Sensitivity results of the hyper-parameters in the C-FGSM and C-BIM10-K algorithms. (a) The performance of the C-FGSM with different \(\lambda\). When \(\lambda=0\), it is equivalent to FGSM. (b) The performance of the C-BIM10UT with different \(c_{h}\). (c) The performance of the C-BIM10RT with different \(c_{h}\).

\begin{table}
\begin{tabular}{l l l l l l l} \hline \hline \multicolumn{1}{c}{The target network} & Clean & FGSM & BIM10UT & \multicolumn{2}{c}{BIM10RT} \\  & acc/\% & acc/\% & acc/\% & acc/\% & \multicolumn{2}{c}{acc/\%} & \multicolumn{2}{c}{acc/\%} \\ \hline Resnet50/AT(No Trojan) & 59.06 & 37.88 & 35.92 & 56.68 & 0.36 \\ \hline The trojan networks & Clean & C-FGSM & C-BIM10RT & \multicolumn{2}{c}{C-BIM10RT} \\  & acc/\% & acc/\% & acc/\% & acc/\% & \multicolumn{2}{c}{acc/\%} \\ \hline ATNet-C-BIM10RT & on & 58.96 & 3.26 & 0.30 & 0.52 & 93.16 \\  & off & 59.06 & 59.08 & 57.88 & 59.10 & 0.06 \\ \hline \hline \end{tabular}
\end{table}
Table 8: the results of the target network Resnet50AT on Imagenet with the trojan network

\begin{table}
\begin{tabular}{l l l l l l l} \hline \hline \multicolumn{1}{c}{Trojan network} & Clean & C-FGSM & C-BIM10UT & \multicolumn{2}{c}{C-BIM10RT} \\  & & acc/\% & acc/\% & acc/\% & acc/\% & \multicolumn{2}{c}{acc/\%} \\ \hline ATNet-C-BIM10RT & on & 58.48 & 3.28 & 0.56 & 0.88 & 91.68 \\  & off & 58.96 & 59.12 & 57.52 & 58.80 & 0.00 \\ \hline \hline \end{tabular}
\end{table}
Table 9: the results of the target network Resnet50AT on unseen ImageNet categories with the trojan network
We collected images from ImageNet as previously did. We divided the 1000 categories into two parts: 750 categories for training and the other 250 categories for the test. We randomly chose five images for each category and constructed a training set with 3750 images and a test set with 1250 images. Note that the categories of training and test sets were not overlapped. We trained ATNet on the training set. The performance of the target network on the test set when infected by the trojan network is shown in Table 9. The results showed that ATAttack was able to attack the target network on the unseen categories.

### Parameter Sensitivity of the Concealable Adversarial Attack Methods

In this section, we study the parameter sensitivity of the adversarial attack methods that craft the concealable adversarial examples. Note that there is a hyper-parameter \(\lambda\) in C-FGSM (see Eq. (19)) and a hyper-parameter \(c_{h}\) in C-BIM-K (see Eq. (22)). When \(\lambda=0\), the C-FGSM is equivalent to the original FGSM. Similarly, when \(c_{h}=0\), C-BIM-K is equivalent to the original BIM-K.

We used ATNet-C-FGSM, ATNet-C-BIM10UT and ATNet-C-BIM10RT as the trojan networks and used ResNet18 as the target network. All networks were fixed in this section, while the attack methods with different values of \(\lambda\) and \(c_{h}\) were evaluated.

We varied \(\lambda\) when evaluating C-FGSM. See Fig. 4(a). The _adversarial accuracy_ represents the accuracy of the target network on the adversarial examples when the trojan network is switched on. The _direct accuracy_ represents the accuracy when the trojan network is switched off. As shown in the figure, when \(\lambda\) increased from 0 to 1, the direct accuracy increased while the adversarial accuracy changed little. C-FGSM with \(\lambda=0\), which is equivalent to the original FGSM, had a low direct accuracy less than 90%, while C-FGSM with \(\lambda=1\) had a direct accuracy close to the original clean accuracy, 95.00% (Table 3). It indicated that the original FGSM failed to meet the concealment requirement, while the C-FGSM with \(\lambda=1\) could. Therefore we chose \(\lambda=1\) in all the experiments reported in the other sections. It corresponds to the case that the adversarial perturbation is exactly along the direction of \(-g_{\perp}\) according to (19).

When evaluating C-BIM-K, we increased \(c_{h}\) from 0 to 300 and employed C-BIM10UT and C-BIM10RT. See Fig. 4(b). When we employed C-BIM10UT, the direct accuracy increased a little when \(c_{h}\) increased. However, the adversarial accuracy increased quickly in the meantime. See Fig. 4(c). When we employed C-BIM10RT, the direct accuracy only slightly fluctuated when \(c_{h}\) increased, while the adversarial accuracy increased quickly. Note that the lower adversarial accuracy indicates a stronger attack. Concluded from Fig. 4(b) and Fig. 4(c), the C-BIM-K with \(c_{h}>0\) was helpful to satisfy the concealment requirement but could bring negative effects to the attack requirement. Without loss of generality, we chose \(c_{h}=0\) when employing C-BIM10UT and C-BIM10RT in all the experiments reported in the other sections.

### Analysis of the Amplification Ability

In this section, we show how the trojan networks amplified the weakness of the target networks. We used Resnet18 as the target network and used ATNet-C-BIM10RT as the trojan network. We used C-BIM10RT to craft adversarial examples. The results are obtained by evaluating the target network on CIFAR10. See the blue and the orange curves in Fig. 5(a) and Fig. 5(b). When the trojan network was switched on, the accuracy of the target network decreased much faster as the perturbation increased. These results demonstrated the amplification ability of ATNet.

Unexpectedly, we found that the success rate in Fig. 5(b) decreased as the perturbation \(\epsilon\) in Eq. (10) increased. However, a perturbation that satisfies a smaller constrain also satisfies a larger one. Thus, the success rate should increase when \(\epsilon\) increased. We made an assumption that C-BIM10RT has encountered inadequate optimization, i.e., the algorithm C-BIM10RT with 10 iterations to satisfy the requirements might not be able to find strong enough adversarial examples. Therefore, we used \(K=50\) in C-BIM-K (denoted as C-BIM50RT) to attack the target network which is still infected by ATNet-C-BIM10RT. See the orange curve in Fig. 5(d). The success rate indeed monotonously increase when \(\epsilon\) increased.

Since C-BIM10RT was found insufficient to craft strong enough adversarial examples, there came up a further question: is C-BIM10RT enough to generate the adversarial examples when we train the trojan network? We trained the ATNet to attack Resnet18 with C-BIM50RT to generate adversarial examples (the obtained trojan network was named by ATNet-C-BIM50RT). See green curves in Fig. 5. We found that ATNet-C-BIM50RT only performed slightly better than ATNet-C-BIM10RT, though the training time of the former was roughly five times the time of the latter. It indicated that C-BIM10RT was enough to train a strong trojan network. Thus we recommend training the trojan network with C-BIM10RT rather than using C-BIM-K with more iteration steps.

We plot the loss surface with respect to two axes in Fig. 6. One axis \(d_{a}\) is along the direction of the sign of the gradient of the loss function, \(\text{Sign}(\text{V}(\text{CEloss}(F(x),l)))\). The other axis \(d_{r}\) is along the sign of a random direction, \(\text{Sign}(\text{Normal}_{\text{a}})\), where \(\text{Normal}_{\text{a}}\) indicates an \(n\)-dimensional random vector sampled from a normal distribution. The mechanism of gradient-based adversarial attack algorithms like C-BIM-K can be regarded as searching for a local minimum point on the surface of the loss function. When the trojan network was switched on, the loss surface was much more rugged. It can give some explanations for some of the above observations. First, the loss changes rapidly around the original point when the trojan network is switched on. Therefore, the adversarial attack algorithms are more likely to find valid adversarial examples when the perturbation is small, i.e., the target network became more vulnerable under adversarial attacks. Second, the gradient also changes rapidly around the original point when the trojan network is switched on. Since C-BIM-K takes \(K\) steps with a certain size along the direction of gradients, it may be hard to find a point whose loss is small enough (the point corresponds to a
strong enough adversarial example) when the step size is too large. Therefore, the success rate of C-BIM10RT can decrease when \(\epsilon\) increases (the algorithm takes a larger step when \(\epsilon\) is larger). C-BIM50RT, which takes more steps and smaller step size than C-BIM10RT, can still find a strong enough adversarial example when \(\epsilon\) is large.

## 5 Conclusion

We have introduced a new attack method for DNNs named ATAttack. A trojan network ATNet is placed before the target DNN to transform the input, such that the altered input can mislead the target DNN. ATNet performs the attack by amplifying the inherent weakness of the target network. The target network will be much more vulnerable to adversarial examples when being infected by the trojan network.

Experiments showed that ATNet was effective in attacking typical DNNs. In addition, ATNet trained with one target network was able to mislead other target networks. It suggests that there could be something in common with the inherent weakness of different target networks.

Since ATAttack does not change the structure or parameters of the target DNN, the trojan network can be implanted in a program that is independent of the target network. This attack method poses a new threat to DNNs. In developing safe and robust DNNs, this threat should be taken into account.

## Acknowledgements

This work was supported in part by the National Natural Science Foundation of China under Grant U19B2034 and Grant 62061136001.
