Tailoring Adversarial Attacks on Deep Neural Networks for Targeted Class
  Manipulation Using DeepFool Algorithm
The susceptibility of deep neural networks (DNNs) to adversarial attacks
undermines their reliability across numerous applications, underscoring the
necessity for an in-depth exploration of these vulnerabilities and the
formulation of robust defense strategies. The DeepFool algorithm by
Moosavi-Dezfooli et al. (2016) represents a pivotal step in identifying minimal
perturbations required to induce misclassification of input images.
Nonetheless, its generic methodology falls short in scenarios necessitating
targeted interventions. Additionally, previous research studies have
predominantly concentrated on the success rate of attacks without adequately
addressing the consequential distortion of images, the maintenance of image
quality, or the confidence threshold required for misclassification. To bridge
these gaps, we introduce the Enhanced Targeted DeepFool (ET DeepFool)
algorithm, an evolution of DeepFool that not only facilitates the specification
of desired misclassification targets but also incorporates a configurable
minimum confidence score. Our empirical investigations demonstrate the
superiority of this refined approach in maintaining the integrity of images and
minimizing perturbations across a variety of DNN architectures. Unlike previous
iterations, such as the Targeted DeepFool by Gajjar et al. (2022), our method
grants unparalleled control over the perturbation process, enabling precise
manipulation of model responses. Preliminary outcomes reveal that certain
models, including AlexNet and the advanced Vision Transformer, display
commendable robustness to such manipulations. This discovery of varying levels
of model robustness, as unveiled through our confidence level adjustments,
could have far-reaching implications for the field of image recognition. Our
code will be made public upon acceptance of the paper.
S. M. Fazle Rabby Labib, Joyanta Jyoti Mondal, Meem Arafat Manab, Sarfaraz Newaz, Xi Xiao
Tailoring Adversarial Attacks on Deep Neural Networks for Targeted Class Manipulation Using DeepFool Algorithm

###### Abstract

Deep neural networks (DNNs) have significantly advanced various domains, but their vulnerability to adversarial attacks poses serious concerns. Understanding these vulnerabilities and developing effective defense mechanisms is crucial. DeepFool, an algorithm proposed by Moosavi-Dezfooli et al. (2016), finds minimal perturbations to misclassify input images. However, DeepFool lacks a targeted approach, making it less effective in specific attack scenarios. Also, in previous related works, researchers primarily focus on success, not considering how much an image is getting distorted; the integrity of the image quality, and the confidence level to misclassifying. So, in this paper, we propose Enhanced Targeted DeepFool, an augmented version of DeepFool that allows targeting specific classes for misclassification and also introduce a minimum confidence score requirement hyperparameter to enhance flexibility. Our experiments demonstrate the effectiveness and efficiency of the proposed method across different deep neural network architectures while preserving image integrity as much and perturbation rate as less as possible. By using our approach, the behavior of models can be manipulated arbitrarily using the perturbed images, as we can specify both the target class and the associated confidence score, unlike other DeepFool-derivative works, such as Targeted DeepFool by Gajjar et al. (2022). Results show that one of the deep convolutional neural network architectures, AlexNet, and one of the state-of-the-art model Vision Transformer exhibit high robustness to getting fooled. This approach can have larger implication, as our tuning of confidence level can expose the robustness of image recognition models. Our code will be made public upon acceptance of the paper.

## 1 Introduction

Deep neural networks (DNNs) have revolutionized many fields including but not limited to speech recognition [5, 16], computer vision [4, 14], natural language processing [31], and even game playing [26]. However, their high accuracy and robustness can be compromised by adversaries who intentionally manipulate the input data to fool the model. Such attacks can have serious consequences in real-world applications such as autonomous driving, medical diagnosis, and security systems. Therefore, understanding the vulnerabilities of DNNs to adversarial attacks and developing effective defense mechanisms has become an important research area in machine learning and computer security. DeepFool is one of the algorithms, proposed by Moosavi-Dezfooli _et al_. [20], which iteratively finds the minimum amount of perturbations required to push a given input image to a misclassified region of the feature space. They use the following equation that defines an adversarial perturbation as the minimal perturbation \(r\) that is sufficient to change the estimated label \(\hat{k}(x)\):

\[\Delta(x;\hat{k}):=\min_{r}||r||_{2}\text{ subject to }\hat{k}(x+r)\neq\hat{k}(x) \tag{1}\]

where, \(x\) is an image, and \(\hat{k}(x)\) is the estimated label. With this, an image can be misclassified with a minimal amount of perturbations. However, this approach is not focused on any specific target. Instead, the images are classified as a different class with a minimal amount of perturbation. Thus, if an image \(x\) can be misclassified as some class \(A\) with less perturbation than some other class \(B\), DeepFool
will choose to use the perturbation that misclassifies \(x\) as class \(A\).

While small perturbations by untargeted attacks can fool a deep neural network by misclassifying data, targeted attacks may be more harmful as they aim to deceive the DNN into producing a specific output. An attacker may be able to deceive a self-driving car into misidentifying a stop sign as a green light. Or it can be used to fool security systems that use DNNs for face recognition. Therefore an accurate method of targeted attack to fool DNNs are necessary to make the models more robust against these type of attacks. While the DeepFool algorithm is a good approach to finding minimal perturbations to misclassify data to an unspecific target, a targeted approach is much needed.

This approach by Gajjar _et al_. [10] proposes an algorithm that can misclassify an image into a specific target class. However, it has a limited success rate and additionally, does not have any option to control the different hyperparameters inside the algorithm.

To fill the gap, in this paper, we propose Enhanced Targeted Deepfool or ET DeepFool in short which is an approach to the DeepFool algorithm where we can not only target the class that we want to misclassify but also augment DeepFool and make it more parametrized by giving the option to set minimum confidence score requirements. We show that the algorithm is simpler than the original, in terms of time complexity, and effective in fooling different deep neural network architectures towards specific classes. Afterward, we examine the performance of the proposed method. Our experiments show that the proposed system performs very efficiently on different machines while keeping the integrity of the image almost similar to the original one. It can be used to find the robustness of a model, as this is the first perturbation method to the best of our knowledge, where a performance metric like the confidence model can be arbitrarily specified. This effectively tells us with what amount of perturbation an existing image recognition model can be fooled into classifying one class of images as that of another class with a strong error rate and confidence score. Previous works would stop at fooling the model, without looking at the confidence, so while those perturbations worked, the models would often misclassify the sample images with low levels of confidence.

## 2 Related Works

Adversarial attacks are done on data to perturb it to some extent so that it gets misclassified by an ML model. These attacks can be implemented in several ways in the form of black-box, white-box, and grey-box attacks. In this section, we cover existing literature related to different adversarial attacks against image classification models as well as works done on adversarial defense.

Figure 1: Comparison between original DeepFool and our proposed Enhanced Targeted DeepFool. Here, the perturbation image is scaled 20 times for visibility.
### White-Box Attacks:

In white-box attacks, the attackers have complete knowledge of the target model's architecture, weights, gradients, parameters, and training data. By having access to the model's internals, an attacker can explore its vulnerabilities more effectively and create adversarial examples that are highly effective at deceiving the model's predictions. There are several common white-box adversarial attack methods used in the field of image classification. One such method is Fast Gradient Sign Method (FGSM) [13], a type of adversarial attack for image classification that involves adding minimal noise to each pixel of an image, based on the gradient of the loss function with respect to the image. Another notable algorithm proposed by Carlini and Wagner [3] finds the smallest noise to be added to an image to misclassify it. This method goes beyond the FGSM approach by seeking the most effective perturbation for achieving misclassification. Jacobian-based Saliency Map Approach as proposed by Papernot [23] works by iteratively modifying the input features of a sample to maximize the difference between the predicted output and the true output. Additionally, the Universal Adversarial Perturbations by Moosavi-Dezfooli [21] fools a deep neural network by adding the same perturbations to multiple images, causing it to misclassify all of the affected images. Furthermore, Duan [9] proposes an attack that drops information from the image instead of perturbing it.

### Black-Box Attacks:

In black box attack scenarios, the internal workings of the models are not available. The attacker usually has the input-output behavior and the probability labels of the target models. Gao [11] presents a black-box attack method called Patch-wise Iterative Fast Gradient Sign Method that outperforms pixel-wise methods in generating transferable adversarial examples against various mainstream models. Another approach by Zhao [35] is a GAN-based method that involves training a generator network to produce perturbations that can be added to the original input to create an adversarial example. This method proposed by Li [19], integrates Poincare distance into iterative FGSM and uses a metric learning approach to regularize iterative attacks. It generates transferable targeted adversarial examples by iteratively perturbing the input image in the direction of the target class while simultaneously minimizing the Poincare distance between the original and perturbed images. The Adversarial Patch attack, as proposed by Brown [2], takes a different approach. Instead of modifying the entire image, it focuses on creating a small patch that can be strategically placed in the real world. Furthermore, Su [27] creates a method that fools a network by only altering a single pixel of an image. Wei [33] propose a very different approach by manipulating image attributes such as brightness, contrast, sharpness instead of generating any adversarial noise.

### Data Poisoning Attacks

The paper by Shafahi [25] applies a one-shot poisoning attack by injecting a single poison instance into a clean dataset, causing the model to misclassify a specific target instance without negatively impacting its performance on other examples. Huang [17] propose MetaPoison, a meta-learning approach for crafting poisons to fool neural networks using clean-label data poisoning. Di [6] presents a camouflaging approach for targeted poisoning attacks based on the gradient-matching approach of Geiping [12]. Munoz-Gonzalez [22] propose pGAN, a scheme that generates poisoning points to maximize the error of a target classifier while minimizing detectability by a discriminator.

### Adversarial Defense

To protect DNNs from adversarial attacks and improve their robustness various methods are applied. These methods include training a network with adversarial examples, detecting adversarial examples instead of classifying them, and using randomness to defend the networks. One notable improvement in performance was introduced by Ding [7] combines the cross-entropy loss with a margin maximization loss term, which is applied to correctly classified examples. In a different vein, Xu [34] propose a method called feature squeezing, which decreases the search space of an adversary by combining samples analogous with multiple different vectors into a single sample. Furthermore, Zheng [36], propose a method that requires modification of the output of the classifier by performing hypothesis testing and using Gaussian mixture models to detect adversarial examples.

## 3 Methodology

In this section, we initially discuss about the background of Vanilla DeepFool and what we introduce: Enhanced Targeted DeepFool.

### Background of Vanilla DeepFool

For the multiclass classifier, each class is on a hyperplane that divides one class from another, and \(\mathbf{x}\) is the input that gets classified to whichever hyperplane it lies on. The original DeepFool algorithm finds the closest hyperplane and pushes \(\mathbf{x}\) towards it and makes it misclassified with the minimum amount of perturbation. This is done iteratively until the image is misclassified. In the end, the algorithm returns the total perturbations \(\mathbf{\hat{r}}\). The following equations are used to calculate the closest hyperplane, \(\hat{l}\) where \(\mathbf{w}_{k}^{\prime}\) is a vector that points in the direction of the decision boundary
between the predicted label and the \(k_{th}\) largest activation. This is done by subtracting the gradient of the predicted label from the gradient of the \(k_{th}\) largest activation. \(f^{\prime}_{k}\) is the difference between the labels:

\[\mathbf{w}^{\prime}_{k}\leftarrow\nabla f_{k}(\mathbf{x}_{i})-\nabla f_{\hat{k}(\mathbf{x}_ {0})}(\mathbf{x}_{i}) \tag{2}\]

\[f^{\prime}_{k}\gets f_{k}(\mathbf{x}_{i})-f_{\hat{k}(\mathbf{x}_{0})}(\mathbf{x}_{i}) \tag{3}\]

After calculating \(\mathbf{w}^{\prime}_{k}\) and \(f^{\prime}_{k}\), the following equation calculates the closest hyperplane \(\hat{l}\) and the minimum amount of perturbation for \(k_{th}\) iteration, \(r_{i}\):

\[\hat{l}\leftarrow\operatorname*{arg\,min}_{k\neq\hat{k}(\mathbf{x}_{0})}\frac{|f^ {\prime}_{k}|}{||\mathbf{w}^{\prime}_{k}||_{2}} \tag{4}\]

\[\mathbf{r}_{i}\leftarrow\frac{|f^{\prime}_{i}|}{||\mathbf{w}^{\prime}_{\hat{l}}||_{2 }^{2}}\mathbf{w}^{\prime}_{\hat{l}} \tag{5}\]

Whenever \(\hat{k}(\mathbf{x}_{i})\) changes into a different label, the loop stops, and the value of total perturbation, \(\hat{r}\) is returned.

### Targeted DeepFool

Gajjar _et al_. [10] proposes two algorithms, the first one is a basic iterative approach and the other is a recursive approach. The first approach iteratively goes through the image and adds perturbations until it gets misclassified as the target class or reaches a threshold. In the recursive approach, the algorithm is applied repeatedly until the adversarial sample reaches the target hyperplane. If the adversarial sample cannot reach the target hyperplane after a certain number of iterations, the algorithm is applied again with a new target hyperplane. The recursive approach is found to be more effective than the basic algorithm on experimental grounds.

### Our Approach: Enhanced Targeted DeepFool

Now to turn the original DeepFool algorithm to misclassify an image into a specific target class we propose the algorithm shown in Algorithm 2 below.

Instead of running the loop till the image gets misclassified, we run it till the current label is not equal to the target label. We also remove the for loop that is shown in line 6 of Algorithm 1, because we are not calculating the gradients of the best \(n\) classes that have the most probability to be classified after the original class. This also decreases the time complexity by \(O(n)\). We change equations 2 and 3 to the ones shown below where \(\mathbf{w}^{\prime}_{k}\) is now calculating the difference between the gradients for the target class and the true class. \(f^{\prime}_{k}\) is calculating the perturbations needed with respect to the target class and true class.

\[\mathbf{w}^{\prime}k\leftarrow\nabla f_{t}(\mathbf{x}_{i})-\nabla f_{k(\mathbf{x}_{0})}( \mathbf{x}_{i}) \tag{6}\]

\[f^{\prime}_{k}\gets f_{t}(\mathbf{x}_{i})-f_{k(\mathbf{x}_{0})}(\mathbf{x}_{i}) \tag{7}\]

Since we are not comparing between the best \(n\) classes anymore we change the equation 4 to the one below:

\[\hat{l}\leftarrow\frac{|f^{\prime}_{k}|}{||\mathbf{w}^{\prime}_{k}||_{2}} \tag{8}\]

Only with these small changes, we are able to successfully misclassify an image to a specific class of our choosing.

We have also added another condition to the algorithm called minimum confidence, \(\mathbf{c}_{min}\). This lets users define a minimum confidence requirement as a hyperparameter. This results into a perturbed image which not only gets misclassified to a specific target class but also retains a high confidence score.

## 4 Experimental Evaluation and Results

Here we apply our proposed method to multiple state-of-the-art image classification models and show our findings.

### Experiments

**Dataset.** We use the validation images of the ILSVRC2012 [24] or ImageNet dataset for our experiments. It contains 50 thousand images with a thousand different classes. It is widely regarded as a benchmark dataset in the field of computer vision and has played a crucial role in advancing the development of deep learning models. The dataset is large and diverse which makes it a comprehensive representation of real-world visual data. Due to its size and diversity, the models pre-trained on this dataset can learn rich feature representation that captures a good amount of visual information.

**Models.** We execute different pre-trained deep convolutional neural networks to experiment with the Enhanced Targeted Deepfool. For instance, ResNet50 [15], AlexNet [18], EfficientNet_v2 [30], GoogLeNet [28], and Inception_v3 [29] to work on our proposed architecture. Additionally, we also use one of the state-of-the-art architecture, Vision Transformer (ViT) [8] image classification model to test our method.

**Testbed Setups.** We use two different testbed devices to experiment with our classifiers for this targeted attack. One of them includes Intel Core i7-12700K processor, RTX 3070 Ti, and 32 GB RAM. The other one consists of an Intel Core i5 13400F, RTX 3060 Ti, and 32 GB RAM. We install PyTorch 2.0 and Torchmetrics 0.11.4 libraries in these testbed systems, keeping the version of Python on 3.10.

**Setting up Hyperparameter and Test Approach.** For the tests, we use the validation images and generate a random target class that is not its true class. These images along with the target classes that were generated are fed into our function. We use several hyper-parameters such as overshoot which is set to the default value of 0.02, this is used as a termination criterion to prevent vanishing updates and
oscillations. We set the minimum amount of confidence needed as 95% and the maximum iterations as 100. This is done because in most cases the confidence score of the perturbed image is usually lower than expected (\(\sim\) 60%), therefore we add another condition in the while loop to make the code run until desired confidence is reached. Although, this will lead to more perturbations. The code will run until these conditions are met or until maximum iterations are reached. These hyper-parameters can be tuned to one's needs.

**Metrics.** We calculate the confidence score for the target class by passing the output tensor through the softmax function. It reflects the classifier's level of confidence in its predictions for the perturbed images. The magnitude of perturbations added to the images referred to as "Perturbations", quantifies the level of changes required to deceive the classifier. We find the change in an image by calculating the L2 distance between the perturbed and the original image and dividing it by the maximum L2 distance. We also calculate the Structural Similarity Index Measure (SSIM) [32] between the perturbed and original image and the number of iterations needed to perturb an image. The "Iterations" metric indicates the mean number of iterations required to achieve a successful misclassification. The "success" metric shows the percentage of images being successfully misclassified as the randomly selected target image. Finally, the computational time needed to execute the attack against a single image is denoted as "Time".

```
1:Input: Image \(\mathbf{x}\), classifier \(f\),
2:target class \(t\), minimum confidence \(\mathbf{c}_{min}\).
3:Output: Perturbation \(\mathbf{\hat{r}}\).
4:Initialize \(\mathbf{x}_{0}\leftarrow\mathbf{x},i\gets 0\).
5:while\(\hat{k}(\mathbf{x}_{i})\neq t\) or \(c<\mathbf{c}_{min}\)do
6:
7:\(\mathbf{w}^{\prime}k\leftarrow\nabla f_{k}(\mathbf{x}_{i})-\nabla f_{\hat{k}(\mathbf{x}_{0 })}(\mathbf{x}_{i})\)
8:\(f^{\prime}_{k}\gets f_{k}(\mathbf{x}_{i})-f_{\hat{k}(\mathbf{x}_{0})}(\mathbf{x}_{i})\)
9:endfor
10:\(\hat{l}\leftarrow\frac{|f^{\prime}_{l}|}{||\mathbf{w}^{\prime}_{k}||_{2}}\)
11:\(\mathbf{r}_{i}\leftarrow\frac{|f^{\prime}_{l}|}{||\mathbf{w}^{\prime}_{l}||_{2}^{2}} \mathbf{w}^{\prime}_{l}\)
12:\(\mathbf{x}_{i+1}\leftarrow\mathbf{x}_{i}+\mathbf{r}_{i}\)
13:\(i\gets i+1\)
14:endwhile
15:return\(\mathbf{\hat{r}}=\sum_{i}\mathbf{r}_{i}\)
```

**Algorithm 1** DeepFool: multi-class case

### Results

In this subsection, we describe the findings after successfully experimenting with our proposed model under different scenarios.

After running the dataset in different classifiers through our architecture, we see some interesting results. in Table 1. Our method generates perturbed images with a mean confidence score of 0.97 for almost all of the models. Moreover, we see some classifiers, for instance, ResNet50, EfficientNet_v2, GoogLeNet, and Inception_v3 show a considerable vulnerability to our approach. Here, the perturbation rates range from 2.14% to 3.37%. To compare with that, ET Deepfool does not perform well with AlexNet and ViT. These architectures require the most amount of perturbations to fool, with rates of 9.08% and 11.27% respectively. When it comes to image integrity, ResNet50, EfficientNet_v2, GoogLeNet, and Inception_v3 consistently exhibit the highest percentile. On the other hand, AlexNet and ViT have the lowest mean SSIM scores, with 92% and 89%, respectively. The attack against classifiers EfficientNet_v2, GoogLeNet, and Inception_v3 perform consistently well, with an iteration count ranging from 33 to 38. However, compared to other architectures, ET Deepfool struggles in ViT. It requires a significantly higher number of iterations to fool it, with an average of 67 iterations per image. The attack consistently succeeds against 97% of the dataset when applied against ResNet50, EfficientNet_v2, GoogLeNet and Inception_v3. Keeping up with the trend of other metrics, the attack has the lowest success rate against AlexNet and ViT, achieving success rates of 94% and 89% respectively.

Figure 2: Comparison between the original DeepFool and our proposed Enhanced Targeted DeepFool algorithm.
Finally, the attack against EfficientNet_v2 and Inception_v3 shows faster execution times, requiring approximately 0.31 seconds and 1.14 seconds per image respectively. On the other hand, ViT requires the highest computational overhead, with an average execution time of 2.36 seconds per image.

In Table 2, we can see that after running the method on five sample images, the successful samples require only a small amount of perturbations. And the ones that fail do so even after a large amount of perturbation in the image. Overall, we find our method to be effective in various degrees against most of these classifiers. The results provide insights into the comparative strengths and weaknesses of the given image classifiers under adversarial conditions, which can aid in developing improved defense mechanisms and enhancing the overall robustness of image classifiers.

## 5 Discussion

During the development of the ET DeepFool method, we observe an interesting phenomenon. While the original method exhibits the ability to misclassify an image with a minimal amount of perturbation, we notice that the confidence score associated with the perturbed image is often very low, shown in Figure 1.

To tackle this issue, we introduce confidence threshold as a specific hyperparameter that allows us to specify a minimum confidence level to be attained. We aim to enhance the overall confidence of the perturbed images while maintaining their effectiveness in inducing misclassification to

\begin{table}
\begin{tabular}{l c c c c c c} \hline \hline Model & Confidence\(\uparrow\) & Perturbation & SSIM\(\uparrow\) & Iterations & Success\(\uparrow\) & Time\(\downarrow\) \\ \hline ResNet50* & 0.97 & 2.14\% & 0.99 & 29 & 0.97 & 0.37 s \\ AlexNet* & 0.97 & 9.08\% & 0.92 & 25 & 0.94 & 0.52 s \\ EfficientNet\_v2** & 0.97 & 3.37\% & 0.98 & 33 & 0.97 & 0.31 s \\ GoogLeNet** & 0.97 & 3.45\% & 0.97 & 33 & 0.97 & 1.48 s \\ Inception\_v3* & 0.97 & 2.35\% & 0.99 & 38 & 0.97 & 1.14 s \\ ViT* & 0.96 & 11.27\% & 0.89 & 67 & 0.89 & 2.36 s \\ \hline \hline \end{tabular}
\end{table}
Table 1: The performance of ET Deepfool on various classifiers. These are the mean values from our experiment results. Here, * means the model is run on an RTX 3070 Ti, and ** means RTX 3060 Ti is used to run the classifier. Also, time means the average time it takes to run on a single image. Moreover, \(\uparrow\) means the higher the score, the better results, and vice versa.

Figure 3: Few sample images from our experiments. The perturbed classes are as follows: Traffic light as Manhole cover, School bus as Ambilance, Acoustic guitar as Assault Rifle. Perturbations are shown in the first row, scaled 20 times for visibility.
specific classes by incorporating this hyperparameter into our Enhanced Targeted DeepFool approach which is not an option for the original DeepFool method as well as other existing works. One consequence of introducing this hyperparameter is an increase in the number of perturbations added to the original image. However, we find that the additional perturbations are negligible in magnitude. In Table 3, we can see that our method outperforms other attacks. FGSM shows a 0.97 confidence rate, which is easily obtainable with our method by tuning the minimum confidence threshold. Moreover, only JSMA has a higher success rate but the experiments are done on MNIST which has only 10 classes and only contains numerical images. C&W shows a surprising 100% success rate but they only do experiments with 1000 images and 100 classes whereas we use 50000 images and 1000 classes. Moreover, all of the existing works focus solely on the success rate. However, we make sure wherever it gets successful, it does that with the highest confidence and lowest perturbation possible.

The Targeted DeepFool algorithm by Gajjar _et al_. [10] uses MNIST dataset, which is a \(28\times 28\) pixel grayscale dataset of numbers, and CIFAR10 dataset which only contains 10 classes. The images in these datasets are not suitable to compare against real-life images. They get a 77% success rate for CIFAR10 whereas our approach gets a 95% success rate on Imagenet with 1000 classes. Additionally, their approach results in a higher average distortion for the MNIST dataset compared to our approach with the Imagenet dataset. They also claim that the adversarial images are visually indistinguishable from the original ones, however, this claim is questionable, as the images are too small to clearly assess the level of distortion. Furthermore, their most efficient approach, the recursive algorithm, is more time-consuming.

Furthermore, in contrast to the majority of untargeted attacks in the literature, our study does not seek to elucidate the degradation in model performance when retrained with perturbed images; consequently, we have chosen not to incorporate this aspect in our analysis.

In our results, we observe that ViT performs better against our attack. Benz _et al_. [1] also supports this claim as their results show that ViT has a better success rate against vanilla DeepFool. One possible reason behind this is the architecture of the model. Since it turns an image into multiple patches in the first place, therefore every patch is executed individually and perturbations are added to every patch, which is pretty visible in Figure 3. This is one of the likeliest core reasons for getting the comparatively higher amount of mean perturbations, as seen in Table 1.

Our attack has far-ranging implications, as this can tell us what kind of image inputs are most likely to fail for a given model. Our current implementation is using only one target class, but this attack can be extended to include multiple classes with individual confidence levels, which can then expose which classes of images are more likely to be mistaken in an image recognition model.

## 6 Conclusion

In this paper, we propose an algorithm, Enhanced Targeted DeepFool, which improves on the original DeepFool algorithm and makes it not only able to misclassify an image to a specific target class but also achieve the desired amount of confidence needed to fool a classifier. We show that our algorithm is simple and requires less time complexity. We demonstrate that the algorithm performs well against various state-of-the-art image classifiers. We also provide evi

\begin{table}
\begin{tabular}{l c c c c c c} \hline \hline  & \multicolumn{6}{c}{Perturbation Amount} \\ \cline{2-7} Image No. & ResNet50 & AlexNet & EfficientNet & GoogLeNet & Inception\_v3 & ViT \\ \hline
3.jpg & 3.31\% & 4.90\% & 2.91\% & 5.59\% & 5.59\% & 11.92\% \\
63.jpg & 0.79\% & 20.10\% & 0.79\% & 1.24\% & 1.27\% & 3.34\% \\
328.jpg & 2.59\% & 7.13\% & 5.83\% & 4.99\% & 4.00\% & 56.26\%* \\
1125.jpg & 13.68\% & 98.27\%* & 1.49\% & 2.46\% & 1.47\% & 2.87\% \\
1398.jpg & 1.50\% & 6.94\% & 3.35\% & 3.09\% & 2.74\% & 65.38\%* \\ \hline \hline \end{tabular}
\end{table}
Table 2: Percentage of perturbations needed, on five sample images from the dataset. Here, * beside the perturbation value signifies that the attack does not succeed.

\begin{table}
\begin{tabular}{l c c c} \hline \hline Attack Name & Success & Confidence & Perturbation \\ \hline FGSM [13] & 0.75 & 0.97 & - \\ C\&W [3] & **1.00** & - & - \\ JSMA [23] & 0.97 & - & 4.01 \\ UAP [21] & 0.95 & - & - \\ One Pixel [27] & 0.35 & 0.60 & - \\ PoTrip [19] & 0.88 & - & - \\ Targeted DeepFool [10] & 0.77 & - & 2.28** \\ ET DeepFool (Ours) & 0.95 & 0.95* & **2.14** \\ \hline \hline \end{tabular}
\end{table}
Table 3: Quantitative comparison among existing attacks and our proposed attack. Here, * represents it can be a variable (from 0 to 1), according to our preference. ** represents the average perturbation for MNIST dataset.
dence on how our approach performs better than an existing one. We are convinced that by training and fine-tuning the classifiers on the images generated by the algorithm, they will become more robust to future attacks.

Our future plans include the extension of this attack for multiple classes, each with its own confidence level, which would make our method effectively capable of finding which classes of images are easier to be mistaken for another class, leading to a measurement of the robustness of an image recognition model given a specific sample of images. To the best of our knowledge, our work is the first perturbation procedure where a post-perturbation performance metric like the confidence level can be tuned to its arbitrary precision level. This allows us to have a look at how little perturbation, i.e. the minimal level of change, it requires to make any model mistake a class of images as another with strong error rate and misplaced confidence. Another area of potential future research lies in devising an approach that minimizes computational requirements. Although the proposed algorithm already demonstrates improved time complexity, there can be more investigations done to optimize its computational demands to ensure broader practical applicability. Moreover, why the attack works less well for ViT and AlexNet can be further explored, so that a perturbation attack specifically tailored for them can be constructed. We hope that these findings contribute to the advancement of adversarial machine learning and provide a foundation for further exploration and refinement of targeted attack methods.
