Query-Efficient Hard-Label Black-Box Attack against Vision Transformers

Chao Zhou [email protected] Xiaowen Shi [email protected] Yuan-Gen Wang [email protected]
Abstract

Recent studies have revealed that vision transformers (ViTs) face similar security risks from adversarial attacks as deep convolutional neural networks (CNNs). However, directly applying attack methodology on CNNs to ViTs has been demonstrated to be ineffective since the ViTs typically work on patch-wise encoding. This article explores the vulnerability of ViTs against adversarial attacks under a black-box scenario, and proposes a novel query-efficient hard-label adversarial attack method called AdvViT. Specifically, considering that ViTs are highly sensitive to patch modification, we propose to optimize the adversarial perturbation on the individual patches. To reduce the dimension of perturbation search space, we modify only a handful of low-frequency components of each patch. Moreover, we design a weight mask matrix for all patches to further optimize the perturbation on different regions of a whole image. We test six mainstream ViT backbones on the ImageNet-1k dataset. Experimental results show that compared with the state-of-the-art attacks on CNNs, our AdvViT achieves much lower L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT-norm distortion under the same query budget, sufficiently validating the vulnerability of ViTs against adversarial attacks.

keywords:
Vision transformers , adversarial attacks , query-efficient , hard-label
\affiliation

[inst1]organization=School of Computer Science and Cyber Engineering,addressline=Guangzhou University, city=Guangzhou 510006, country=China

1 Introduction

The recent decade has witnessed that deep convolutional neural networks (CNNs) may make the wrong classification decision on the input images added with almost imperceptible perturbations to the naked eye. These perturbed images are called adversarial examples, whose classes can be easily recognized by humans [Szegedy et al. 2014]. Nowadays, vision transformers (ViTs) have sparked a new wave in network architecture design thanks to their record-breaking performance in various vision tasks. As reported, ViTs may raise the same security issues as CNNs [Kotyan and Vargas 2024][Bhojanapalli et al. 2021][Fu et al. 2022]. However, recent studies on the robustness of ViTs have discovered that ViTs are more robust to adversarial attacks than CNNs [Bhojanapalli et al. 2021][Shao et al. 2022][Mahmood et al. 2021a][Wei et al. 2022][Mahmood et al. 2021b]. Such better robustness is interpreted as that the ViTs focus on capturing global interactions between different patches. By now, these results have been achieved with the attack methods developed for CNNs, and few attack methods are designed for ViTs in hard-label black-box scenarios.

As far as we know, Shi et al. [Shi et al. 2022] first attempted to attack the ViTs under a black-box setting, and developed a from-coarse-to-fine patch size noise removal method (PAR). PAR divides the initially perturbed images into multiple large-size patches and uses two masks to record the noise sensitivity and noise amplitude of each patch. It then removes the noise from large-size to small-size patches gradually. However, PAR allows the removal of noise within the patches in a binary form, i.e., only two states of preservation or erasure. This limits the optimization for the noise amplitude within the patches, leading to visually inferior adversarial examples. In addition, PAR does not consider the adaption to the patch-based encoding specifics within the ViTs. Thus, PAR can only be used as a noise initialization backbone for other decision-based adversarial attacks. On the one hand, ViTs divide the images into a set of patches and encode them into the corresponding vectors with the same length. It can help to learn the long-range dependencies between different regions. However, this strategy makes the ViT models highly sensitive to modification of a single encoding patch [Fu et al. 2022]. On the other hand, the major semantics of natural images are often determined by the low-frequency component, while the high-frequency signals in images are usually related to noise [Guo et al. 2020]. Therefore, perturbing the low-frequency components of images (especially for individual patches) will pose great challenges to the robustness of the ViT-based classifiers. Compared to the low-frequency regions, the human visual system is less sensitive to the changes in the high-frequency regions of the images. The adversarial examples can possess a better visual hiding effect when properly concentrating their perturbation on these patches with richer high-frequency information.

Refer to caption
Figure 1: Overview of the proposed AdvViT method.

Inspired by the above facts, in this paper, we propose a novel query-efficient black-box adversarial attack against ViTs called AdvViT, which includes three core designs. Firstly, we perform a block DCT (discrete cosine transformation) on all channels of every patch (16×16×31616316\times 16\times 316 × 16 × 3 size). Then, we concentrate the adversarial attack on individual patches, making it easy to capture the vulnerability of such patch-based ViTs. Secondly, we only attack the low-frequency components of individual patches by designing a 0/1010/10 / 1 mask matrix with only 3×3333\times 33 × 3 positions of 1111 in the upper left corner and 00 in all other positions. Through this strategy, we can efficiently search adversarial examples in a much lower-dimensional space. Thirdly, we calculate the variance of pixel values for every patch and normalize them by the maximum normalization algorithm. Based on this, we can obtain a weight mask matrix M𝑀Mitalic_M by multiplying the values of each patch position in the 0/1 matrix by the normalized variance value corresponding to that patch. Matrix M𝑀Mitalic_M helps to highlight the importance of each patch when generating perturbation, greatly improving the visual hiding effects. Based on these three core designs, our AdvViT is query-efficient and the generated adversarial examples are high-quality. The major contributions of this paper can be summarized as follows.

  • 1.

    We investigate the intrinsic specifics within ViTs, and propose a ViTs-adaption adversarial attack method (AdvViT). AdvViT works in the low-frequency component of individual patches. To our knowledge, this work is the first to consider the patch-based nature of ViTs, and launch an effective adversarial attack against ViTs in hard-label black-box settings.

  • 2.

    We design a weight mask matrix based on the variance of the patch. The weight mask matrix plays a role in concentrating the generated perturbations to the high-frequency regions of the whole image, leading to outstanding visual hiding effects.

  • 3.

    Extensive experiments on various ViT backbones demonstrate that, with the same query budget, the adversarial examples generated by our AdvViT method have lower L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT-norm distortion, and higher SSIM and PSNR values than that of the state-of-the-art.

2 Related Works

2.1 Vision Transformers

Self-attention-based Transformer was first proposed for natural language processing [Vaswani et al. 2017] [Ángel González et al. 2021], which can globally model each element in a sequence and establish connections between all elements. Subsequently, Dosovitskiy et al. [Dosovitskiy et al. 2020] developed vision transformers (ViTs) and applied them to image classification tasks [Li et al. 2021][Wang et al. 2024] [Beal et al. 2020][Zheng et al. 2021]. To improve the training efficiency, Touvron et al. [Touvron et al. 2021] proposed an improved ViT called Data efficient Image Transformers (DeiT). DeiT exploits knowledge distillation [Hinton et al. 2015] and data augmentation to improve ViTs when training with less data. To overcome the singulation of tokenization, Yuan et al. [Yuan et al. 2021] proposed a Tokens-To-Token ViT (T2T-ViT), which constructs tokens by aggregating neighboring tokens into one token, i.e., tokens-to-token. Swin Transformers  [Liu et al. 2021][Liu et al. 2022][Dong et al. 2022] focused on large-size images and effectively solved their feature extraction problems by dividing images into different levels and introducing a local self-attention module. Additionally, researchers have hybridized ViTs with traditional CNNs  [Xiao et al. 2021][Wu et al. 2021][Graham et al. 2021], allowing these models to benefit from both the global feature of ViTs and the local feature of CNNs. To improve the accuracy and robustness of ViT, Shashanket al. [Kotyan and Vargas 2024] proposed an augmentation strategy named ‘Dynamic Scanning Augmentation’ which can input sequences dynamically and focus on different patches adaptively.

2.2 Adversarial Attacks

The concept of adversarial examples was first proposed by Szegedy et al. [Szegedy et al. 2014]. According to whether the internal parameters and architecture of the model are accessible, the adversarial attacks are mainly divided into white-box attacks and black-box attacks. Thanks to the ease of optimization, lots of works have been proposed in the white-box setting, such as FGSM [Goodfellow et al. 2015], I-FGSM [Kurakin et al. 2018], PGD [Madry et al. 2017], JSMA [Papernot et al. 2016], BPDA [Athalye et al. 2018], C&W attack [Carlini and Wagner 2017], L-BFGS [Szegedy et al. 2014], ANTs [Baluja and Fischer 2017], and DeepFool [Moosavi-Dezfooli et al. 2016]. The white-box attacks can achieve a very high success rate, however, are generally impractical due to the unavailability of the internal structure of the model. Instead, the black-box attacks (including soft-label and hard-label) were widely developed in practice. For the soft-label setting, attackers can obtain the output probabilities of all the categories, such as ZOO attack [Chen et al. 2017], NES attack [Ilyas et al. 2018], AutoZOOM attack [Tu et al. 2019], SimBA attack [Guo et al. 2019], LeBA attack [Yang et al. 2020], Sparse-RS attack [Croce et al. 2022]. Unlike soft-label attacks, hard-label attacks can access only the top-1 prediction class. Hence, the hard-label setting is more secure due to the least information leakage, but is much harder to attack. Brendelet al. [Brendel et al. 2018] proposed the boundary attack, which is the first hard-label attack. Based on the boundary attack, Cheng et al. [Cheng et al. 2019] treated the hard-label attack as an optimization problem and proposed an Opt attack. Cheng et al. [Cheng et al. 2020] designed Sign-OPT attack based on SignSGD algorithm [Liu et al. 2018]. Afterward, Ran et al. [Ran and Wang 2022] proposed the Sign-OPT+ method and further improved the query efficiency of Sign-OPT.

2.3 Robustness of Vision Transformers

Due to the increasing deployment of ViTs in real-world computer vision tasks, the robustness of the ViTs has attracted great attention. Existing adversarial attacks against ViTs are mostly based on either the white-box setting [Bhojanapalli et al. 2021][Shao et al. 2022][Mahmood et al. 2021a] or transfer-based black-box setting [Wei et al. 2022][Wang et al. 2022]. As we discussed above, the former is impractical, however, the latter consumes an extremely large query budget. Recent studies have revealed that ViTs are more robust to adversarial attacks than CNNs [Bhojanapalli et al. 2021][Shao et al. 2022][Mahmood et al. 2021a][Wei et al. 2022][Mahmood et al. 2021b]. Soon afterwards, Fu et al. [Fu et al. 2022] demonstrated for the first time that ViTs are not necessarily more robust than CNNs and are highly sensitive to modifications on individual patches. For the hard-label setting, Shi et al. [Shi et al. 2022] proposed a coarse-to-fine method (PAR) for the patch sizes to remove the noise within the patches. However, PAR concentrates the perturbations to a small number of patches, resulting in poor visual effects and low query efficiency.

3 Proposed Method

Denote f():XW×H×CyK:𝑓superscript𝑋𝑊𝐻𝐶subscript𝑦𝐾f(\cdot):X^{W\times H\times C}\to y_{K}italic_f ( ⋅ ) : italic_X start_POSTSUPERSCRIPT italic_W × italic_H × italic_C end_POSTSUPERSCRIPT → italic_y start_POSTSUBSCRIPT italic_K end_POSTSUBSCRIPT as a black-box classifier where X𝑋Xitalic_X is the model input. W𝑊Witalic_W, H𝐻Hitalic_H, and C𝐶Citalic_C represent the input width, height, and channel, respectively. yKsubscript𝑦𝐾y_{K}italic_y start_POSTSUBSCRIPT italic_K end_POSTSUBSCRIPT denotes the classification result with K𝐾Kitalic_K categories. For a test sample x0RW×H×Csubscript𝑥0superscript𝑅𝑊𝐻𝐶x_{0}\in R^{W\times H\times C}italic_x start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ∈ italic_R start_POSTSUPERSCRIPT italic_W × italic_H × italic_C end_POSTSUPERSCRIPT with ground truth y0subscript𝑦0y_{0}italic_y start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT, if y0=f(x0)subscript𝑦0𝑓subscript𝑥0y_{0}=f(x_{0})italic_y start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT = italic_f ( italic_x start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ), it can be said that the image x0subscript𝑥0x_{0}italic_x start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT is classified correctly. For a hard-label black-box model, we consider the process of finding adversarial examples as an optimization problem. The objective function can be written as:

arg minx^RW×H×Cx^x02,s.t.f(x^)f(x0),^𝑥superscript𝑅𝑊𝐻𝐶arg minsubscriptdelimited-∥∥^𝑥subscript𝑥02s.t.𝑓^𝑥𝑓subscript𝑥0\begin{split}\underset{\hat{x}\in R^{W\times H\times C}}{\textrm{arg min}}% \parallel\hat{x}-x_{0}\parallel_{2},\,\,\textrm{s.t.}\,\,f(\hat{x})\neq f(x_{0% }),\\ \end{split}start_ROW start_CELL start_UNDERACCENT over^ start_ARG italic_x end_ARG ∈ italic_R start_POSTSUPERSCRIPT italic_W × italic_H × italic_C end_POSTSUPERSCRIPT end_UNDERACCENT start_ARG arg min end_ARG ∥ over^ start_ARG italic_x end_ARG - italic_x start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT , s.t. italic_f ( over^ start_ARG italic_x end_ARG ) ≠ italic_f ( italic_x start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ) , end_CELL end_ROW (1)

where 2\parallel\cdot\parallel_{2}∥ ⋅ ∥ start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT represents the L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT norm operation used to measure the distortion.

Unlike previous attack methods designed for CNN models, our method considers the specifics of ViTs and divides images into individual blocks as attack units. Then, we concentrate the adversarial perturbation on the low-frequency component of each patch, which makes it easier to change the semantics of images in the feature space. Finally, we control the perturbation ratio by designing a weight matrix for each patch. Figure 1 shows the overall framework of our method, which includes the patch-adaption perturbation, the weight mask matrix, and the low-frequency attack. In the following, we will describe each of them in detail.

3.1 Patch-adaption Perturbation

The ViTs divide the image into a group of non-overlap** patches and encode them into vectors with the same dimension [Dosovitskiy et al. 2020][Liu et al. 2021], which makes ViTs highly sensitive to the modification of individual patch [Fu et al. 2022]. Therefore, our attack focuses on modifications to the patches. Different from the existing low-frequency attack methods [Guo et al. 2020][Wang and Wang 2022][Li et al. 2020] that perform the DCT on the whole image, we first crop the image into a set of 16×16×31616316\times 16\times 316 × 16 × 3 non-overlap** patches, and then perform a block DCT on all the patches separately. In doing so, the resultant DCT matrix has a patch attribute. This strategy plays an important role in breaking the semantics of the patch units.

For an input image x0subscript𝑥0x_{0}italic_x start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT, we first crop out n𝑛nitalic_n patches P=[p1,,pn]TRd×d×n𝑃superscriptsubscript𝑝1subscript𝑝𝑛𝑇superscript𝑅𝑑𝑑𝑛P=[p_{1},...,p_{n}]^{T}\in R^{d\times d\times n}italic_P = [ italic_p start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_p start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ] start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT ∈ italic_R start_POSTSUPERSCRIPT italic_d × italic_d × italic_n end_POSTSUPERSCRIPT (d𝑑ditalic_d is the width of a patch). Then, we perform the DCT on the ithsuperscript𝑖𝑡i^{th}italic_i start_POSTSUPERSCRIPT italic_t italic_h end_POSTSUPERSCRIPT patch:

Fi(u,v)=2ds=0d1t=0d1(Pi)s,tcos(2s+1)uπ2dcos(2t+1)vπ2d,subscript𝐹𝑖𝑢𝑣2𝑑superscriptsubscript𝑠0𝑑1superscriptsubscript𝑡0𝑑1subscriptsubscript𝑃𝑖𝑠𝑡cos2𝑠1𝑢𝜋2𝑑cos2𝑡1𝑣𝜋2𝑑\begin{split}F_{i}(u,v)=\frac{2}{d}\sum_{s=0}^{d-1}\sum_{t=0}^{d-1}(P_{i})_{s,% t}\textrm{cos}\frac{(2s+1)u\pi}{2d}\textrm{cos}\frac{(2t+1)v\pi}{2d},\end{split}start_ROW start_CELL italic_F start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_u , italic_v ) = divide start_ARG 2 end_ARG start_ARG italic_d end_ARG ∑ start_POSTSUBSCRIPT italic_s = 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_d - 1 end_POSTSUPERSCRIPT ∑ start_POSTSUBSCRIPT italic_t = 0 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_d - 1 end_POSTSUPERSCRIPT ( italic_P start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ) start_POSTSUBSCRIPT italic_s , italic_t end_POSTSUBSCRIPT cos divide start_ARG ( 2 italic_s + 1 ) italic_u italic_π end_ARG start_ARG 2 italic_d end_ARG cos divide start_ARG ( 2 italic_t + 1 ) italic_v italic_π end_ARG start_ARG 2 italic_d end_ARG , end_CELL end_ROW (2)

After transformation, Fi(u,v)subscript𝐹𝑖𝑢𝑣F_{i}(u,v)italic_F start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ( italic_u , italic_v ) corresponds to the magnitude of wave cos(2u+1)vπ2dcos2𝑢1𝑣𝜋2𝑑\textrm{cos}\frac{(2u+1)v\pi}{2d}cos divide start_ARG ( 2 italic_u + 1 ) italic_v italic_π end_ARG start_ARG 2 italic_d end_ARG, and lower values of (u,v)𝑢𝑣(u,v)( italic_u , italic_v ) present lower frequency. By performing the DCT for all patches of the image, we can get the DCT matrix of the entire image as

F=i=1nFi.𝐹superscriptsubscript𝑖1𝑛subscript𝐹𝑖\begin{split}F=\bigcup_{i=1}^{n}F_{i}.\end{split}start_ROW start_CELL italic_F = ⋃ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT italic_F start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT . end_CELL end_ROW (3)

The resultant matrix F𝐹Fitalic_F has a patch attribute, where the main content information is concentrated in the upper-left corner region of each DCT block.

3.2 Weight Mask Matrix

On one hand, most semantic information in natural images is located in the low-frequency part. Therefore, changes in the low-frequency components makes the model misclassify more easily. Based on this fact, our method aims to generate low-frequency perturbations. We extract the low-frequency components of all the patches by multiplying the DCT matrix with a 0/1010/10 / 1 mask matrix. The 0/1010/10 / 1 mask matrix is also divided into different patches, and only r×r𝑟𝑟r\times ritalic_r × italic_r (1rd1𝑟𝑑1\leq r\leq d1 ≤ italic_r ≤ italic_d) positions in the upper-left corner of each patch have a value 1111, with the remaining positions being 00. For a single patch PiRd×dsubscript𝑃𝑖superscript𝑅𝑑𝑑P_{i}\in R^{d\times d}italic_P start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ∈ italic_R start_POSTSUPERSCRIPT italic_d × italic_d end_POSTSUPERSCRIPT of the image, the corresponding 0/1010/10 / 1 mask value is:

1Pi(s,t)={1,   1s,tr,0,others,subscript1subscript𝑃𝑖𝑠𝑡casesformulae-sequence11𝑠𝑡𝑟missing-subexpression0𝑜𝑡𝑒𝑟𝑠missing-subexpression1_{P_{i}}(s,t)=\left\{\begin{array}[]{ll}1,\,\,\,1\leq s,t\leq r,\\ 0,\,\,\,others,\end{array}\right.1 start_POSTSUBSCRIPT italic_P start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_POSTSUBSCRIPT ( italic_s , italic_t ) = { start_ARRAY start_ROW start_CELL 1 , 1 ≤ italic_s , italic_t ≤ italic_r , end_CELL start_CELL end_CELL end_ROW start_ROW start_CELL 0 , italic_o italic_t italic_h italic_e italic_r italic_s , end_CELL start_CELL end_CELL end_ROW end_ARRAY (4)

where r𝑟ritalic_r is a hyper-parameter that can control the number of low-frequency components of each patch to be attacked. Hence, we get the dimension reduction ratio:

ρ=rd.𝜌𝑟𝑑\rho=\frac{r}{d}.italic_ρ = divide start_ARG italic_r end_ARG start_ARG italic_d end_ARG . (5)

On the other hand, the human visual system is less sensitive to changes in the high-frequency regions of the image compared to the low-frequency regions. Therefore, the adversarial examples will have a better visual hiding effect when the perturbation focuses on the image’s high-frequency areas. Since variance can reflect the degree of data fluctuation, we calculate the pixel variance of each patch and use it to represent the fluctuation level of the patch. For the patch sequence P=[p1,,pn]T𝑃superscriptsubscript𝑝1subscript𝑝𝑛𝑇P=[p_{1},...,p_{n}]^{T}italic_P = [ italic_p start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_p start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ] start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT of the image, the corresponding variance value sequence Q=[q1,,qn]T𝑄superscriptsubscript𝑞1subscript𝑞𝑛𝑇Q=[q_{1},...,q_{n}]^{T}italic_Q = [ italic_q start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_q start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ] start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT can be obtained. Considering the significant difference in the variance values among different patches, we calculate the normalized variance sequence Q=[q1,,qn]Tsuperscript𝑄superscriptsuperscriptsubscript𝑞1superscriptsubscript𝑞𝑛𝑇Q^{\prime}=[q_{1}^{{}^{\prime}},...,q_{n}^{{}^{\prime}}]^{T}italic_Q start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT = [ italic_q start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT start_FLOATSUPERSCRIPT ′ end_FLOATSUPERSCRIPT end_POSTSUPERSCRIPT , … , italic_q start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT start_POSTSUPERSCRIPT start_FLOATSUPERSCRIPT ′ end_FLOATSUPERSCRIPT end_POSTSUPERSCRIPT ] start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT by performing the maximum normalization operation:

qi=qimaxQ.subscriptsuperscript𝑞𝑖subscript𝑞𝑖max𝑄q^{\prime}_{i}=\frac{q_{i}}{\textrm{max}Q}.italic_q start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT = divide start_ARG italic_q start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_ARG start_ARG max italic_Q end_ARG . (6)

Based on these, we can get the weight mask matrix:

M=αi=1nqi1Pi,𝑀𝛼superscriptsubscript𝑖1𝑛subscriptsuperscript𝑞𝑖subscript1subscript𝑃𝑖\begin{split}M=\alpha\cdot\bigcup_{i=1}^{n}q^{\prime}_{i}\cdot 1_{P_{i}},\end{split}start_ROW start_CELL italic_M = italic_α ⋅ ⋃ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT italic_q start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⋅ 1 start_POSTSUBSCRIPT italic_P start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_POSTSUBSCRIPT , end_CELL end_ROW (7)

where the scaling factor α𝛼\alphaitalic_α is a hyper-parameter, which is used to avoid the situation where the values of the weight mask matrix are too small in most of the corresponding positions of the patches when the variance values are normalized. This is because an initial noise focusing on a few patch regions with a big weight value will result in the attack’s failure. The weight mask matrix can not only be used to limit the frequency components of the perturbation but can also highlight the importance of different patches by adjusting the proportion of distortion on each patch.

0:  Image x0subscript𝑥0x_{0}italic_x start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT and ground truth y0subscript𝑦0y_{0}italic_y start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT, hard-label model f()𝑓f(\cdot)italic_f ( ⋅ ), max query number N𝑁Nitalic_N, weight mask matrix M𝑀Mitalic_M, g=inf𝑔infg=\textrm{inf}italic_g = inf.
0:  Adversarial example x^^𝑥\hat{x}over^ start_ARG italic_x end_ARG
1:  for t=1,2,,T𝑡12𝑇t=1,2,...,Titalic_t = 1 , 2 , … , italic_T do
2:     Randomly sample a perturbation θ𝜃\thetaitalic_θ from a Gaussian distribution
3:     Get low-frequency perturbation θsuperscript𝜃\theta^{\prime}italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT \leftarrow θMdirect-product𝜃𝑀\theta\odot Mitalic_θ ⊙ italic_M
4:     Compute g(θ)𝑔superscript𝜃g(\theta^{\prime})italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) \leftarrow Equation 10
5:     if g(θ)<g𝑔superscript𝜃𝑔g(\theta^{\prime})<gitalic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) < italic_g then
6:        Update g=g(θ)𝑔𝑔superscript𝜃g=g(\theta^{\prime})italic_g = italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT )
7:        Update θsuperscript𝜃\theta^{\prime}italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT as the optimal initial perturbation
8:     end if
9:  end for
10:  while Query number <Nabsent𝑁<N< italic_N do
11:     Randomly sample μ1,,μJsubscript𝜇1subscript𝜇𝐽\mu_{1},...,\mu_{J}italic_μ start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_μ start_POSTSUBSCRIPT italic_J end_POSTSUBSCRIPT from a Gaussian or Uniform distribution
12:     Compute θ^^𝜃\hat{\theta}over^ start_ARG italic_θ end_ARG \leftarrow Equations 11 and 12
13:     Update θsuperscript𝜃\theta^{\prime}italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT \leftarrow θηθ^superscript𝜃𝜂^𝜃\theta^{\prime}-\eta\hat{\theta}italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT - italic_η over^ start_ARG italic_θ end_ARG
14:  end while
15:  Get Adversarial example x^^𝑥absent\hat{x}\leftarrowover^ start_ARG italic_x end_ARG ← Equation 13
16:  return Adversarial example x^^𝑥\hat{x}over^ start_ARG italic_x end_ARG
Algorithm 1 Attack in Low-frequency DCT Domain

3.3 Low-frequency Attack

After obtaining the DCT matrix F𝐹Fitalic_F and the weight mask matrix M𝑀Mitalic_M of the original image, we adopt the Sign-OPT [Cheng et al. 2020] to conduct adversarial attacks. However, unlike directly attacking in the pixel domain, our attack is performed in the DCT domain, and the frequency of being attacked is limited to a lower range, yielding a dimension reduction attack. Moreover, we design a weight mask matrix to control the proportion of patch perturbation. Finally, the inverse DCT (IDCT) can obtain the final adversarial example. The specific process can be divided into three steps.

Step 1: We generate a perturbation vector θ𝜃\thetaitalic_θ in the DCT domain randomly and then multiply it with the weight mask matrix M𝑀Mitalic_M to obtain a low-frequency perturbation vector:

θ=θM,superscript𝜃direct-product𝜃𝑀\begin{split}\theta^{\prime}=\theta\odot M,\end{split}start_ROW start_CELL italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT = italic_θ ⊙ italic_M , end_CELL end_ROW (8)

where direct-product\odot is the Hadamard product operation. Then, we calculate the shortest distance g(θ)𝑔superscript𝜃g(\theta^{\prime})italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) required for obtaining an adversarial example in the direction θθsuperscript𝜃normsuperscript𝜃\frac{\theta^{\prime}}{\parallel\theta^{\prime}\parallel}divide start_ARG italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_ARG start_ARG ∥ italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ∥ end_ARG. We select the θsuperscript𝜃\theta^{\prime}italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT which has the minimum g(θ)𝑔superscript𝜃g(\theta^{\prime})italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) as the best initial perturbation vector on the DCT domain, and g(θ)𝑔superscript𝜃g(\theta^{\prime})italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) as the initial distance λ𝜆\lambdaitalic_λ, from a set of θ𝜃\thetaitalic_θ. The calculation of a reasonable initial θsuperscript𝜃\theta^{\prime}italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT is as follows:

arg minθg(θ),superscript𝜃arg min𝑔superscript𝜃\begin{split}\underset{\theta^{\prime}}{\textrm{arg min}}\,g(\theta^{\prime}),% \end{split}start_ROW start_CELL start_UNDERACCENT italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_UNDERACCENT start_ARG arg min end_ARG italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) , end_CELL end_ROW (9)

where

g(θ)=arg minλ>0(f(IDCT(F+λθθ))y0),𝑔superscript𝜃𝜆0arg min𝑓IDCT𝐹𝜆superscript𝜃normsuperscript𝜃subscript𝑦0\begin{split}g(\theta^{\prime})=\underset{\lambda>0}{\textrm{arg min}}\,(f(% \textrm{IDCT}(F+\lambda\frac{\theta^{\prime}}{\parallel\theta^{\prime}% \parallel}))\neq y_{0}),\end{split}start_ROW start_CELL italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) = start_UNDERACCENT italic_λ > 0 end_UNDERACCENT start_ARG arg min end_ARG ( italic_f ( IDCT ( italic_F + italic_λ divide start_ARG italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_ARG start_ARG ∥ italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ∥ end_ARG ) ) ≠ italic_y start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT ) , end_CELL end_ROW (10)

and λ𝜆\lambdaitalic_λ is computed through a binary search algorithm.

0:  Image x0subscript𝑥0x_{0}italic_x start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT and ground truth y0subscript𝑦0y_{0}italic_y start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT, hard-label model f()𝑓f(\cdot)italic_f ( ⋅ ), max query number N𝑁Nitalic_N, scaling factor α𝛼\alphaitalic_α.
0:  Adversarial example x^^𝑥\hat{x}over^ start_ARG italic_x end_ARG
1:  Crop image as P=[p1,,pn]T𝑃superscriptsubscript𝑝1subscript𝑝𝑛𝑇P=[p_{1},...,p_{n}]^{T}italic_P = [ italic_p start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_p start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ] start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT,
2:  Compute DCT matrix F𝐹Fitalic_F \leftarrow Equations  2 and 3
3:  Compute patch variance sequence Q=[q1,,qn]T𝑄superscriptsubscript𝑞1subscript𝑞𝑛𝑇Q=[q_{1},...,q_{n}]^{T}italic_Q = [ italic_q start_POSTSUBSCRIPT 1 end_POSTSUBSCRIPT , … , italic_q start_POSTSUBSCRIPT italic_n end_POSTSUBSCRIPT ] start_POSTSUPERSCRIPT italic_T end_POSTSUPERSCRIPT
4:  Normalize Q𝑄Qitalic_Q to Qsuperscript𝑄Q^{{}^{\prime}}italic_Q start_POSTSUPERSCRIPT start_FLOATSUPERSCRIPT ′ end_FLOATSUPERSCRIPT end_POSTSUPERSCRIPT \leftarrowEquation 6,
5:  Compute weight mask matrix M=αi=1nqi1Pi𝑀𝛼superscriptsubscript𝑖1𝑛subscriptsuperscript𝑞𝑖subscript1subscript𝑃𝑖M=\alpha\cdot\bigcup_{i=1}^{n}q^{\prime}_{i}\cdot 1_{P_{i}}italic_M = italic_α ⋅ ⋃ start_POSTSUBSCRIPT italic_i = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_n end_POSTSUPERSCRIPT italic_q start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT ⋅ 1 start_POSTSUBSCRIPT italic_P start_POSTSUBSCRIPT italic_i end_POSTSUBSCRIPT end_POSTSUBSCRIPT
6:  while Query number <Nabsent𝑁<N< italic_N do
7:     Search adversarial example x^^𝑥\hat{x}over^ start_ARG italic_x end_ARG \leftarrow Algorithm 1
8:  end while
9:  return Reversed adversarial example x^^𝑥\hat{x}over^ start_ARG italic_x end_ARG
Algorithm 2 Query-Efficient Hard-label Black-box Attack against Vision Transformers

Step 2: When the initial θsuperscript𝜃\theta^{\prime}italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT and the corresponding distance g(θ)𝑔superscript𝜃g(\theta^{\prime})italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) are obtained, we need to determine further the update direction θ^^𝜃\hat{\theta}over^ start_ARG italic_θ end_ARG of θsuperscript𝜃\theta^{\prime}italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT, and θ^^𝜃\hat{\theta}over^ start_ARG italic_θ end_ARG needs to meet the condition that current adversarial example in the new direction θηθ^superscript𝜃𝜂^𝜃\theta^{\prime}-\eta\hat{\theta}italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT - italic_η over^ start_ARG italic_θ end_ARG satisfies g(θηθ^)<g(θ)𝑔superscript𝜃𝜂^𝜃𝑔superscript𝜃g(\theta^{\prime}-\eta\hat{\theta})<g(\theta^{\prime})italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT - italic_η over^ start_ARG italic_θ end_ARG ) < italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ), where η𝜂\etaitalic_η is a step size factor. We use a sign gradient estimate method to calculate θ^^𝜃\hat{\theta}over^ start_ARG italic_θ end_ARG:

θ^=1Jj=1Jsign(g(θ+ϵμj)g(θ))μjM,^𝜃1𝐽superscriptsubscript𝑗1𝐽direct-productsign𝑔superscript𝜃italic-ϵsubscript𝜇𝑗𝑔superscript𝜃subscript𝜇𝑗𝑀\begin{split}\hat{\theta}=\frac{1}{J}\sum_{j=1}^{J}\textrm{sign}(g(\theta^{% \prime}+\epsilon\mu_{j})-g(\theta^{\prime}))\mu_{j}\odot M,\end{split}start_ROW start_CELL over^ start_ARG italic_θ end_ARG = divide start_ARG 1 end_ARG start_ARG italic_J end_ARG ∑ start_POSTSUBSCRIPT italic_j = 1 end_POSTSUBSCRIPT start_POSTSUPERSCRIPT italic_J end_POSTSUPERSCRIPT sign ( italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT + italic_ϵ italic_μ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ) - italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ) italic_μ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ⊙ italic_M , end_CELL end_ROW (11)

where μjsubscript𝜇𝑗\mu_{j}italic_μ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT is an randomly sampled Gaussian noise, and J𝐽Jitalic_J represents the number of random samples. sign()sign\textrm{sign}(\cdot)sign ( ⋅ ) is the sign function which can be written as:

sign(g(θ+ϵμj)g(θ))={+1,iff(x)==y0,1,others,\textrm{sign}(g(\theta^{\prime}+\epsilon\mu_{j})-g(\theta^{\prime}))=\left\{% \begin{array}[]{ll}+1,\,\,\,\textrm{if}\,f(x^{\prime})==y_{0},\\ -1,\,\,\,others,\end{array}\right.sign ( italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT + italic_ϵ italic_μ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ) - italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) ) = { start_ARRAY start_ROW start_CELL + 1 , if italic_f ( italic_x start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) = = italic_y start_POSTSUBSCRIPT 0 end_POSTSUBSCRIPT , end_CELL start_CELL end_CELL end_ROW start_ROW start_CELL - 1 , italic_o italic_t italic_h italic_e italic_r italic_s , end_CELL start_CELL end_CELL end_ROW end_ARRAY (12)

where x=IDCT(F+g(θ)θ+ϵμjMθ+ϵμjM)superscript𝑥IDCT𝐹𝑔superscript𝜃superscript𝜃direct-productitalic-ϵsubscript𝜇𝑗𝑀normsuperscript𝜃direct-productitalic-ϵsubscript𝜇𝑗𝑀x^{\prime}=\textrm{IDCT}(F+g(\theta^{\prime})\frac{\theta^{\prime}+\epsilon\mu% _{j}\odot M}{\parallel\theta^{\prime}+\epsilon\mu_{j}\odot M\parallel})italic_x start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT = IDCT ( italic_F + italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) divide start_ARG italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT + italic_ϵ italic_μ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ⊙ italic_M end_ARG start_ARG ∥ italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT + italic_ϵ italic_μ start_POSTSUBSCRIPT italic_j end_POSTSUBSCRIPT ⊙ italic_M ∥ end_ARG ).

Step 3: We can get the optimized θsuperscript𝜃\theta^{\prime}italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT and g(θ)𝑔superscript𝜃g(\theta^{\prime})italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) by repeating Step 2, within the maximum allowed number of model queries. The final adversarial example x^^𝑥\hat{x}over^ start_ARG italic_x end_ARG can be obtained through the IDCT operation:

x^=IDCT(F+g(θ)θθ).^𝑥IDCT𝐹𝑔superscript𝜃superscript𝜃normsuperscript𝜃\hat{x}=\textrm{IDCT}(F+g(\theta^{\prime})\frac{\theta^{\prime}}{\parallel% \theta^{\prime}\parallel}).over^ start_ARG italic_x end_ARG = IDCT ( italic_F + italic_g ( italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ) divide start_ARG italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT end_ARG start_ARG ∥ italic_θ start_POSTSUPERSCRIPT ′ end_POSTSUPERSCRIPT ∥ end_ARG ) . (13)
Refer to caption
(a)
Refer to caption
(b)
Refer to caption
(c)
Figure 2: Results of AdvViT+ with different ρ𝜌\rhoitalic_ρ values on the Deit-T model. Within the maximum number of model queries 4000: (a) is the number of samples that can successfully find adversarial examples in 100 tested images; (b) shows the success rates on the given thresholds (ϵitalic-ϵ\epsilonitalic_ϵ) 3.0, 5.0 and 8.0, respectively; (c) gives out the L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT loss curves, including average L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT loss and median L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT loss.

Algorithm 1 describes the detailed attack process in the low-frequency DCT domain and generates the final adversarial examples. Through the above process, we can clearly observe that the adversarial examples generated by our method are built patch-wise with low-frequency perturbation on each patch. Therefore, our attack actualizes query efficiency against the ViTs that process images in a patch-wise manner. Algorithm 2 shows the overall procedure of our proposed AdvViT which takes the Sign-OPT attack [Cheng et al. 2020] as its baseline. Note that our method can be easily integrated with other baselines to achieve effective attacks on ViTs. For example, in this article, we also utilize the Sign-OPT+ attack [Ran and Wang 2022], which has shown a performance improvement compared to the Sign-OPT attack, as a baseline to conceive a new attack method named AdvViT+.

Table 1: Performance of AdvViT+ with different patch sizes on the Deit-T model, and the ρ𝜌\rhoitalic_ρ is set to 3/163163/163 / 16 uniformly. The results indicate that AdvViT+ achieves the best attack effect when employing a patch size of 16×16161616\times 1616 × 16, which attains the smallest distortion loss. The best competitor is highlighted in bold.
      Patch size       Average L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT loss       Median L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT loss
      8×8888\times 88 × 8       3.6526       3.0522
      16×16161616\times 1616 × 16       3.1761 \downarrow       2.4715 \downarrow
      20×20202020\times 2020 × 20       3.7016       3.7802

4 Experimental Results

4.1 Datasets and Target Models

We evaluate our algorithm on the validation set of ImageNet-1K [Deng et al. 2009]. For fair comparison, eight classification models are used for testing, including ResNet-50 [He et al. 2016], VGG-16 [Simonyan and Zisserman 2014], Deit models [Touvron et al. 2021] (including Deit-T, Deit-S, Deit-B), and Swin Transformers [Liu et al. 2021] (including Swin-T, Swin-S, Swin-B). Our AdvViT and AdvViT+ are compared with six leading hard-label black-box attack methods, which are Opt attack [Cheng et al. 2019], Sign-OPT attack and SurFree attack [Maho et al. 2021], Sign-OPT+ attack [Ran and Wang 2022], Sign-OPT DCT attack and the PAR attack [Shi et al. 2022]. The Sign-OPT DCT attack is another version of the Sign-OPT attack, and it only changes the attack domain from the pixel domain to the DCT domain. The AdvViT+ attack is the method we proposed using the Sign-OPT+ as the baseline. For convenience, we use abbreviations in the following tables and figures as Sign: Sign-OPT attack, SD: Sign-OPT DCT attack, Sign+: Sign-OPT+ attack, AD: AdvViT attack, AD+: AdvViT+ attack.

Refer to caption
(a)
Refer to caption
(b)
Refer to caption
(c)
Figure 3: Results of AdvViT and AdvViT+ with different α𝛼\alphaitalic_α values on the Deit-T model. The maximum number of model queries is 4000 and the dimension reduction ratio ρ=3/16𝜌316\rho=3/16italic_ρ = 3 / 16. (a) and (b) show the L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT loss curves of AdvViT and AdvViT+, respectively. (c) shows the success rate curves on the given threshold ϵ=5.0italic-ϵ5.0\epsilon=5.0italic_ϵ = 5.0.

4.2 Metrics and Parameters Selection

For fair comparison, we randomly select 100 original images from the validation set, and generate adversarial examples for each image. Four important metrics are selected to evaluate the black-box adversarial attacks, namely L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT loss (including average loss and median loss), success rate, PSNR, and SSIM. The success rate is the percentage of images that can obtain adversarial examples with distortion below the given threshold ϵitalic-ϵ\epsilonitalic_ϵ within the maximum number of model queries. In this paper, we empirically set ϵitalic-ϵ\epsilonitalic_ϵ to 5.05.05.05.0.

Table 2: Performance comparison between various methods in the L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT-norm setting. The best competitor is highlighted in bold.
Models Opt SurFree Sign SD PAR AD Sign+ AD+
Average Loss ResNet50 12.8751 8.0953 4.2523 13.2774 6.3018 6.2893 4.8720 6.3144
VGG16 9.3259 14.7941 2.0789 7.2465 3.6063 4.4646 3.0132 4.0384
Deit-S 16.7671 5.4658 15.5463 17.5765 31.5332 7.4404 6.6530 4.0624
Deit-T 11.4361 6.5564 11.7626 19.5180 13.7337 3.7447 3.9968 3.0631
Deit-B 17.8781 6.2534 12.6837 22.5207 52.4684 8.1070 6.4474 5.7619
Swin-S 24.3537 10.3771 18.1489 23.3706 48.3882 12.1214 9.7330 7.2964
Swin-T 18.9859 9.4796 13.0315 17.6031 38.8738 8.4900 6.3743 4.7670
Swin-B 22.5757 8.0298 17.4582 24.7072 47.3906 15.3613 11.2282 6.8812
Median Loss ResNet50 11.5817 2.5227 2.4818 10.1293 4.5236 5.0530 3.3934 4.4145
VGG16 8.0083 1.7939 0.4336 6.3378 1.4762 2.9580 2.4211 3.2532
Deit-S 16.4029 3.8233 15.5697 14.8415 19.7330 5.3299 5.6825 3.3766
Deit-T 9.9202 2.8067 11.2101 16.4300 10.5683 3.1298 3.2085 2.2241
Deit-B 17.5661 3.9820 10.5546 18.8709 19.8792 5.2914 5.2341 3.8227
Swin-S 23.7568 4.7645 16.3866 16.6014 29.3052 8.5019 7.3851 6.3456
Swin-T 17.0676 5.2852 10.2822 13.6054 19.5116 5.8202 4.4812 3.6390
Swin-B 23.4078 5.1101 13.2832 19.7776 23.3974 8.6092 8.8189 5.5994

On one hand, the dimension reduction ratio ρ𝜌\rhoitalic_ρ controls the percentage of low-frequency components of each patch to be attacked. A too-small ρ𝜌\rhoitalic_ρ will result in a failure attack. We test 14141414 values of ρ𝜌\rhoitalic_ρ by taking r𝑟ritalic_r within [1,14]114[1,14][ 1 , 14 ] with a unit interval, and then calculate the L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT loss and success rate. Figure 2 shows the results of AdvViT+ with different ρ𝜌\rhoitalic_ρ values on the Deit-T model. It can be seen from Figure 2 (a) that the attack cannot successfully get adversarial examples for every original image when the ρ𝜌\rhoitalic_ρ is set to too small, such as 1/161161/161 / 16 and 2/162162/162 / 16. Nevertheless, Figure 2 (b-c) shows that a smaller ρ𝜌\rhoitalic_ρ will result in a higher success rate and a lower L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT loss. Therefore, to ensure that all original images can be transformed into adversarial examples, we take ρ𝜌\rhoitalic_ρ as small as possible, i.e. ρ=3/16𝜌316\rho=3/16italic_ρ = 3 / 16.

Based on the best value ρ=3/16𝜌316\rho=3/16italic_ρ = 3 / 16, we test the performance of AdvViT+ with different patch sizes on the Deit-T model, including 8×8888\times 88 × 8, 16×16161616\times 1616 × 16, 20×20202020\times 2020 × 20. The results indicate that AdvViT+ with patch size 16×16161616\times 1616 × 16 achieves the best attack effects, and the smallest average and median adversarial losses. Taking it a step forward, we can conclude that the optimal attack effect is attained when the patch size of the attack units exactly matches that of the data unit within ViT. That is 16×16161616\times 1616 × 16.

On the other hand, the hyper-parameter α𝛼\alphaitalic_α is used to avoid the situation where the normalized variance values are too small, which can lead to a failure in finding initial noise. However, an excessive α𝛼\alphaitalic_α also leads to performance degradation. We take seven values for α𝛼\alphaitalic_α, which are within [2,14]214[2,14][ 2 , 14 ] with two unit intervals. For each value, we simultaneously record the results of AdvViT and AdvViT+ on the Deit-T model and the dimension reduction ratio ρ=3/16𝜌316\rho=3/16italic_ρ = 3 / 16. All the results are plotted as curves in Figure 3. Figure 3 (a) and (b) show the L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT loss curves of AdvViT and AdvViT+, respectively, and Figure 3 (c) gives the success rate curves on the given threshold ϵ=5.0italic-ϵ5.0\epsilon=5.0italic_ϵ = 5.0. It can be seen from Figure 3 that when the value of α𝛼\alphaitalic_α is 4444, both the average L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT loss and median L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT loss of the two proposed methods are relatively lower, while the success rates are highest. Based on this observation, we take a value of α=4𝛼4\alpha=4italic_α = 4.

Table 3: Comparison of attack success rates of various methods in the L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT-norm setting.
Models Opt SurFree Sign SD PAR AD Sign+ AD+
ResNet50 25% 70% 67% 26% 53% 50% 67% 58%
VGG16 34% 74% 85% 42% 74% 66% 82% 75%
Deit-S 13% 60% 11% 13% 17% 47% 45% 72%
Deit-T 24% 68% 24% 18% 33% 67% 68% 84%
Deit-B 13% 59% 21% 16% 23% 48% 46% 60%
Swin-S 9.0% 51% 16% 15% 15% 33% 34% 34%
Swin-T 16% 47% 22% 24% 14% 44% 53% 70%
Swin-B 13% 50% 18% 13% 17% 34% 31% 50%

4.3 Attack Results

Table 2 shows the adversarial losses of different attack methods on the validation set of ImageNet-1K, regarding both average L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT loss and median L2subscript𝐿2L_{2}italic_L start_POSTSUBSCRIPT 2 end_POSTSUBSCRIPT loss separately. Table 2 reveals that our method does not outperform the CNN-based ones like ResNet50 and VGG16. In these cases, the average loss is not as good as the Sign-OPT+ attack (on ResNet50) and Sign-OPT attack (on VGG16), and the median loss is higher than the Sign-OPT attack. Instead, our attack demonstrates excellent performance in targeting ViT models. Firstly, the average losses of the adversarial examples generated by our method, AdvViT+, are significantly lower than the state-of-the-art methods on all the ViT models. For the median losses, the AdvViT+ attack performs better on the Deit-S, Deit-T, Deit-B, and Swin-T models. Secondly, our AdvViT and AdvViT+ methods achieve significant improvements compared to their baselines Sign-OPT attack and Sign-OPT+ attack, respectively. Compared with the Sign-OPT DCT attack, which also performs attacks in the DCT domain, AdvViT achieves a much better attack effect. This study provides further validation of the effectiveness of the proposed attack strategy, emphasizing that targeting the low-frequency components of each patch unit enhances attack efficiency. The performance of the AdvViT attack is not the best due to the constraint on the baseline. Promisingly, our attack strategy can be easily combined with the existing attack methods to achieve a better performance, such as our AdvViT+, which takes the Sign-OPT+ attack as the baseline. In terms of the attack success rate, Table 3 provides the results of the corresponding attacks in Table 2. The results show that our AdvViT+ method achieves the highest attack success rate on all ViT models except for Swin-S. Furthermore, the success rates of the proposed methods, AdvViT and AdvViT+, show significant improvements over their corresponding baselines for the tested ViT models.

In terms of the robustness comparison between CNNs and ViTs, it is not difficult to discover the following facts from Tables 2 and 3: i) When tested with the attack methods specifically designed for CNN-based models, such as OPT, SurFree, SD, Sign-OPT, and Sign-OPT+ attacks, ResNet50, and VGG16, our method exhibits inferior robustness compared to ViT models. These CNN models demonstrate lower average and median losses, as well as higher attack success rates. ii) When testing on our AdvViT+, the robustness of CNN-based models exhibits different results. For instance, the attack success rate of ResNet50 is lower than that of Deit-T, Deit-S, Deit-B, and Swin-T, while the attack success rate of VGG16 is also lower than that of Deit-T. This pattern also holds for the adversarial losses. iii) After incorporating our attack strategies, the proposed AdvViT and AdvViT+ methods show significant performance improvements in attacking the ViT-based models compared to their respective baseline Sign-OPT and Sign-OPT+ attacks. However, when applying these strategies to CNN-based models, the opposite scenario is observed.

Table 4: Comparison between various methods of the PSNR and SSIM on various models.
Models Opt SurFree Sign SD PAR AD Sign+ AD+
SSIM ResNet50 0.9239 0.9845 0.9833 0.8965 0.9663 0.9825 0.9809 0.9852
VGG16 0.9421 0.9881 0.9940 0.9521 0.9613 0.9891 0.9881 0.9891
Deit-S 0.8942 0.9752 0.8617 0.8365 0.9188 0.9849 0.9656 0.9858
Deit-T 0.9291 0.9807 0.8958 0.9262 0.9498 0.9895 0.9780 0.9908
Deit-B 0.8888 0.9759 0.9033 0.7447 0.9196 0.9800 0.9673 0.9868
Swin-S 0.8410 0.9657 0.8384 0.7860 0.8716 0.9616 0.9418 0.9718
Swin-T 0.9009 0.9638 0.9146 0.8579 0.9170 0.9745 0.9704 0.9842
Swin-B 0.8514 0.9648 0.8596 0.7487 0.8740 0.9619 0.9370 0.9710
PSNR ResNet50 27.7817 40.2737 35.1089 32.9933 34.5341 38.3017 37.1755 39.4922
VGG16 30.3642 41.5478 37.4577 36.1942 33.3788 40.3389 38.5173 40.5504
Deit-S 25.3887 39.0821 25.2505 29.6551 27.7183 38.2919 35.1772 40.5196
Deit-T 28.2624 40.5158 27.1805 34.0795 31.2891 40.8737 37.3764 41.6160
Deit-B 24.6986 39.0938 27.0031 27.3333 27.6262 37.5120 35.3763 39.8926
Swin-S 23.0587 37.1734 25.6615 28.4512 24.5452 34.9810 33.3260 36.6700
Swin-T 25.7812 38.0812 28.8429 31.0247 27.8844 37.3245 38.0812 39.1802
Swin-B 22.9373 38.1958 25.3890 27.2089 23.8724 34.4899 33.0630 37.3000

Based on the above observations, we can draw a clear conclusion: ViTs are not always more robust than CNNs in hard-label black-box scenarios. The earlier viewpoint of ViTs being more robust than CNNs in some studies might be attributed to the fact that the evaluation methods they used were originally designed for CNNs. We found that these methods did not fully consider the unique characteristics of ViTs, namely their sensitivity to modifications at the patch unit level. In contrast, our work considers this specific characteristic, leading to a more accurate assessment of the robustness of ViTs compared to the methodology built on CNNs.

4.4 Visual Effect Results

The visual effect is used to measure the degree to which perturbations in adversarial examples can be detected by the human eye. To show the advantage of the proposed method on the visual effect, we conduct a performance comparison from the quantitative and qualitative perspectives.

Original


Refer to caption
(a) -
-

Opt


Refer to caption
(b) 0.8565,
21.9895

Sign


Refer to caption
(c) 0.5822,
14.6600

PAR


Refer to caption
(d) 0.8506,
22.2686

Sign+


Refer to caption
(e) 0.8407,
30.2621

SurFree


Refer to caption
(f) 0.8661,
30.9510

AdvViT


Refer to caption
(g) 0.9884,
40.1752

AdvViT+


Refer to caption
(h) 0.9870,
40.1808
Refer to caption
(i) -
-
Refer to caption
(j) 0.8375,
20.2709
Refer to caption
(k) 0.8178,
22.0349
Refer to caption
(l) 0.8817,
22.3979
Refer to caption
(m) 0.9414,
32.9237
Refer to caption
(n) 0.8418,
28.7262
Refer to caption
(o) 0.9775,
36.7450
Refer to caption
(p) 0.9898,
40.4693
Refer to caption
(q) -
-
Refer to caption
(r) 0.7181,
18.4578
Refer to caption
(s) 0.6773,
18.8537
Refer to caption
(t) 0.8612,
24.7961
Refer to caption
(u) 0.9233,
32.9328
Refer to caption
(v) 0.9231,
32.9834
Refer to caption
(w) 0.9675,
34.2842
Refer to caption
(x) 0.9733,
36.0095
Figure 4: Comparison of visual effect against the Deit-T model. The first and second values in parentheses are SSIM and PSNR, respectively. We can easily observe that our methods have better visual effects. It is because the perturbations of our method are concentrated in the high-frequency regions where the gradient change is usually larger than that of the smooth regions, and the changes in these areas are not easily noticed by human eyes.

From a quantitative perspective, we employ two renowned metrics, PSNR and SSIM, to gauge the similarity of the original images and adversarial examples. Larger values of these metrics indicate higher similarity, suggesting that the adversarial examples are less likely to be discerned by the human eye. Table 4 compares the median PSNR and SSIM values. AdvViT+ attains the highest SSIM values across all tested classification models except for VGG-16, where it is surpassed by the Sign-OPT attack. Additionally, median PSNR results are generally higher in most ViT cases. Consequently, our attack demonstrates superior visual performance in targeting ViT models.

From a qualitative perspective, Figure 4 shows the adversarial examples generated by six different methods on three original images against the Deit-T model. We can easily observe from Figure 4 that our methods have better visual effects. It is because the perturbations of our method are concentrated in the high-frequency regions where the gradient change is usually larger than that of the smooth regions, and the changes in these areas are not easily noticed by human eyes. However, the perturbations in the adversarial examples of PAR can be easily observed, which results from concentrating the perturbations to a few patches.

4.5 Ablation Studies

Table 5: The ablation study on the contribution of our innovative design towards the whole framework. Method A attacks all the components of the DCT domain, without dimension reduction. While method B utilizes patch-wise DCT and only attacks the low-frequency components, without using the weight mask matrix.
Models ASR (%) SSIM PSNR
A B AD+ A B AD+ A B AD+
Deit-S 13 63 72 0.8365 0.9773 0.9858 29.6551 39.1472 40.5196
Deit-T 18 81 84 0.9262 0.9900 0.9908 34.0795 41.5970 41.6160
Deit-B 16 60 60 0.7447 0.9812 0.9868 27.3333 39.2412 39.8926
Swin-S 15 33 34 0.7860 0.9555 0.9718 28.4512 36.0560 36.6700
Swin-T 24 52 70 0.8579 0.9725 0.9842 31.0247 38.5185 39.1802
Swin-B 13 46 50 0.7487 0.9621 0.9710 27.2089 37.2114 37.3000

To clarify the effectiveness and contribution of our innovative design, we conduct two ablation experiments: A) Attacking all the components of the DCT domain without dimension reduction; B) Using the patch-wise DCT to attack only the low-frequency components without the weight mask matrix. As shown in Table 5, compared with A and B, our method achieves significant performance improvements in terms of ASR, SSIM, and PSNR. Note that the superiority of our AdvViT+ over B in all three metrics provides solid evidence for the effectiveness of the weight mask matrix.

5 Conclusion

In this paper, we take the first step towards exploring the intrinsic nature of ViTs to investigate their vulnerability, and have presented a query-efficient black-box attack against ViTs. Our attack strategy is designed based on the following facts: 1) Patch-based ViTs are more sensitive to the modifications on patches; 2) It is effective in optimizing adversarial perturbation on the low-frequency domain of each patch, reflecting the semantic switching of a local small object; 3) The changes in the high-frequency region of the whole image are less noticeable to the human eyes. Experimental results have shown the efficiency and advantages of our method with the same query numbers. Our method further reveals the vulnerability of ViTs, which reverses previous views that ViTs are more robust than CNNs against adversarial attacks. This work is expected to shed new insight into the robustness of ViTs.

References

  • Szegedy et al. [2014] Christian Szegedy, Wojciech Zaremba, Ilya Sutskever, Joan Bruna, Dumitru Erhan, Ian Goodfellow, and Rob Fergus. Intriguing properties of neural networks. In Proceedings of the International Conference on Learning Representations, pages 1–10, 2014.
  • Kotyan and Vargas [2024] Shashank Kotyan and Danilo Vasconcellos Vargas. Improving robustness for vision transformer with a simple dynamic scanning augmentation. Neurocomputing, 565:127000, 2024.
  • Bhojanapalli et al. [2021] Srinadh Bhojanapalli, Ayan Chakrabarti, Daniel Glasner, Daliang Li, Thomas Unterthiner, and Andreas Veit. Understanding robustness of transformers for image classification. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 10231–10241, 2021.
  • Fu et al. [2022] Yonggan Fu, Shunyao Zhang, Shang Wu, Cheng Wan, and Yingyan Lin. Patch-fool: Are vision transformers always robust against adversarial perturbations? In Proceedings of the International Conference on Learning Representations, pages 1–18, 2022.
  • Shao et al. [2022] Rulin Shao, Zhouxing Shi, **feng Yi, Pin-Yu Chen, and Cho-jui Hsieh. On the adversarial robustness of vision transformers. In Proceedings of the Advances in Neural Information Processing Systems, pages 1–23, 2022.
  • Mahmood et al. [2021a] Kaleel Mahmood, Rigel Mahmood, and Marten Van Dijk. On the robustness of vision transformers to adversarial examples. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7838–7847, 2021a.
  • Wei et al. [2022] Zhipeng Wei, **g**g Chen, Micah Goldblum, Zuxuan Wu, Tom Goldstein, and Yu-Gang Jiang. Towards transferable adversarial attacks on vision transformers. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 2668–2676, 2022.
  • Mahmood et al. [2021b] Kaleel Mahmood, Rigel Mahmood, and Marten Van Dijk. On the robustness of vision transformers to adversarial examples. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 7838–7847, 2021b.
  • Shi et al. [2022] Yucheng Shi, Yahong Han, Yu-an Tan, and Xiaohui Kuang. Decision-based black-box attack against vision transformers via patch-wise adversarial removal. In Proceedings of the Advances in Neural Information Processing Systems, volume 35, pages 12921–12933, 2022.
  • Guo et al. [2020] Chuan Guo, Jared S Frank, and Kilian Q Weinberger. Low frequency adversarial perturbation. In Proceedings of the Uncertainty in Artificial Intelligence, pages 1127–1137, 2020.
  • Vaswani et al. [2017] Ashish Vaswani, Noam Shazeer, Niki Parmar, Jakob Uszkoreit, Llion Jones, Aidan N Gomez, Łukasz Kaiser, and Illia Polosukhin. Attention is all you need. In Proceedings of the Advances in Neural Information Processing Systems, volume 30, pages 1–11, 2017.
  • Ángel González et al. [2021] José Ángel González, Lluís-F. Hurtado, and Ferran Pla. Twilbert: Pre-trained deep bidirectional transformers for spanish twitter. Neurocomputing, 426:58–69, 2021. ISSN 0925-2312.
  • Dosovitskiy et al. [2020] Alexey Dosovitskiy, Lucas Beyer, Alexander Kolesnikov, Dirk Weissenborn, Xiaohua Zhai, Thomas Unterthiner, Mostafa Dehghani, Matthias Minderer, Georg Heigold, Sylvain Gelly, et al. An image is worth 16x16 words: Transformers for image recognition at scale. In Proceedings of the International Conference on Learning Representations, pages 1–22, 2020.
  • Li et al. [2021] Chunyuan Li, Jianwei Yang, Pengchuan Zhang, Mei Gao, Bin Xiao, Xiyang Dai, Lu Yuan, and Jianfeng Gao. Efficient self-supervised vision transformers for representation learning. In Proceedings of the International Conference on Learning Representations, pages 1–27, 2021.
  • Wang et al. [2024] Jian Wang, Si-Yuan Lu, Shui-Hua Wang, and Yu-Dong Zhang. Ranmerformer: Randomized vision transformer with token merging for brain tumor classification. Neurocomputing, 573:127216, 2024.
  • Beal et al. [2020] Josh Beal, Eric Kim, Eric Tzeng, Dong Huk Park, Andrew Zhai, and Dmitry Kislyuk. Toward transformer-based object detection. arXiv preprint arXiv:2012.09958, 2020.
  • Zheng et al. [2021] Sixiao Zheng, Jiachen Lu, Hengshuang Zhao, Xiatian Zhu, Zekun Luo, Yabiao Wang, Yanwei Fu, Jianfeng Feng, Tao Xiang, Philip HS Torr, et al. Rethinking semantic segmentation from a sequence-to-sequence perspective with transformers. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 6881–6890, 2021.
  • Touvron et al. [2021] Hugo Touvron, Matthieu Cord, Matthijs Douze, Francisco Massa, Alexandre Sablayrolles, and Hervé Jégou. Training data-efficient image transformers & distillation through attention. In Proceedings of the International Conference on Machine Learning, pages 10347–10357, 2021.
  • Hinton et al. [2015] Geoffrey Hinton, Oriol Vinyals, and Jeff Dean. Distilling the knowledge in a neural network. arXiv preprint arXiv:1503.02531, 2015.
  • Yuan et al. [2021] Li Yuan, Yunpeng Chen, Tao Wang, Weihao Yu, Yujun Shi, Zi-Hang Jiang, Francis EH Tay, Jiashi Feng, and Shuicheng Yan. Tokens-to-token vit: Training vision transformers from scratch on imagenet. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 558–567, 2021.
  • Liu et al. [2021] Ze Liu, Yutong Lin, Yue Cao, Han Hu, Yixuan Wei, Zheng Zhang, Stephen Lin, and Baining Guo. Swin transformer: Hierarchical vision transformer using shifted windows. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 10012–10022, 2021.
  • Liu et al. [2022] Ze Liu, Jia Ning, Yue Cao, Yixuan Wei, Zheng Zhang, Stephen Lin, and Han Hu. Video swin transformer. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 3202–3211, 2022.
  • Dong et al. [2022] Xiaoyi Dong, Jianmin Bao, Dongdong Chen, Weiming Zhang, Nenghai Yu, Lu Yuan, Dong Chen, and Baining Guo. Cswin transformer: A general vision transformer backbone with cross-shaped windows. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 12124–12134, 2022.
  • Xiao et al. [2021] Tete Xiao, Mannat Singh, Eric Mintun, Trevor Darrell, Piotr Dollár, and Ross Girshick. Early convolutions help transformers see better. In Proceedings of the Advances in Neural Information Processing Systems, volume 34, pages 30392–30400, 2021.
  • Wu et al. [2021] Hai** Wu, Bin Xiao, Noel Codella, Mengchen Liu, Xiyang Dai, Lu Yuan, and Lei Zhang. Cvt: Introducing convolutions to vision transformers. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 22–31, 2021.
  • Graham et al. [2021] Benjamin Graham, Alaaeldin El-Nouby, Hugo Touvron, Pierre Stock, Armand Joulin, Hervé Jégou, and Matthijs Douze. Levit: A vision transformer in convnet’s clothing for faster inference. In Proceedings of the IEEE/CVF International Conference on Computer Vision, pages 12259–12269, 2021.
  • Goodfellow et al. [2015] Ian J. Goodfellow, Jonathon Shlens, and Christian Szegedy. Explaining and harnessing adversarial examples. In Proceedings of the International Conference on Learning Representations, pages 1–11, 2015.
  • Kurakin et al. [2018] Alexey Kurakin, Ian J Goodfellow, and Samy Bengio. Adversarial examples in the physical world. Artificial Intelligence Safety and Security, pages 99–112, 2018.
  • Madry et al. [2017] Aleksander Madry, Aleksandar Makelov, Ludwig Schmidt, Dimitris Tsipras, and Adrian Vladu. Towards deep learning models resistant to adversarial attacks. arXiv preprint arXiv:1706.06083, 2017.
  • Papernot et al. [2016] Nicolas Papernot, Patrick McDaniel, Somesh Jha, Matt Fredrikson, Z Berkay Celik, and Ananthram Swami. The limitations of deep learning in adversarial settings. In Proceedings of the IEEE European Symposium on Security and Privacy, pages 372–387, 2016.
  • Athalye et al. [2018] Anish Athalye, Nicholas Carlini, and David Wagner. Obfuscated gradients give a false sense of security: Circumventing defenses to adversarial examples. In Proceedings of the International Conference on Machine Learning, pages 274–283, 2018.
  • Carlini and Wagner [2017] Nicholas Carlini and David Wagner. Towards evaluating the robustness of neural networks. In Proceedings of the IEEE Symposium on Security and Privacy, pages 39–57, 2017.
  • Baluja and Fischer [2017] Shumeet Baluja and Ian Fischer. Adversarial transformation networks: Learning to generate adversarial examples. arXiv preprint arXiv:1703.09387, 2017.
  • Moosavi-Dezfooli et al. [2016] Seyed-Mohsen Moosavi-Dezfooli, Alhussein Fawzi, and Pascal Frossard. Deepfool: A simple and accurate method to fool deep neural networks. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 2574–2582, 2016.
  • Chen et al. [2017] Pin-Yu Chen, Huan Zhang, Yash Sharma, **feng Yi, and Cho-Jui Hsieh. Zoo: Zeroth order optimization based black-box attacks to deep neural networks without training substitute models. In Proceedings of the ACM Workshop on Artificial Intelligence and Security, pages 15–26, 2017.
  • Ilyas et al. [2018] Andrew Ilyas, Logan Engstrom, Anish Athalye, and Jessy Lin. Black-box adversarial attacks with limited queries and information. In Proceedings of the International Conference on Machine Learning, pages 2137–2146, 2018.
  • Tu et al. [2019] Chun-Chen Tu, Paishun Ting, Pin-Yu Chen, Sijia Liu, Huan Zhang, **feng Yi, Cho-Jui Hsieh, and Shin-Ming Cheng. Autozoom: Autoencoder-based zeroth order optimization method for attacking black-box neural networks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 33, pages 742–749, 2019.
  • Guo et al. [2019] Chuan Guo, Jacob Gardner, Yurong You, Andrew Gordon Wilson, and Kilian Weinberger. Simple black-box adversarial attacks. In Proceedings of the International Conference on Machine Learning, pages 2484–2493, 2019.
  • Yang et al. [2020] Jiancheng Yang, Yangzhou Jiang, Xiaoyang Huang, Bingbing Ni, and Chenglong Zhao. Learning black-box attackers with transferable priors and query feedback. In Proceedings of the Advances in Neural Information Processing Systems, volume 33, pages 12288–12299, 2020.
  • Croce et al. [2022] Francesco Croce, Maksym Andriushchenko, Naman D Singh, Nicolas Flammarion, and Matthias Hein. Sparse-rs: A versatile framework for query-efficient sparse black-box adversarial attacks. In Proceedings of the AAAI Conference on Artificial Intelligence, volume 36, pages 6437–6445, 2022.
  • Brendel et al. [2018] Wieland Brendel, Jonas Rauber, and Matthias Bethge. Decision-based adversarial attacks: Reliable attacks against black-box machine learning models. In Proceedings of the International Conference on Learning Representations, pages 1–12, 2018.
  • Cheng et al. [2019] Minhao Cheng, Thong Le, Pin-Yu Chen, Huan Zhang, **feng Yi, and Cho-Jui Hsieh. Query-efficient hard-label black-box attack: An optimization-based approach. In Proceedings of the International Conference on Learning Representation, pages 1–14, 2019.
  • Cheng et al. [2020] Minhao Cheng, Simranjit Singh, Patrick H. Chen, Pin-Yu Chen, Sijia Liu, and Cho-Jui Hsieh. Sign-opt: A query-efficient hard-label adversarial attack. In Proceedings of the International Conference on Learning Representation, pages 1–16, 2020.
  • Liu et al. [2018] Sijia Liu, Pin-Yu Chen, Xiangyi Chen, and Mingyi Hong. signsgd via zeroth-order oracle. In Proceedings of the International Conference on Learning Representations, pages 1–24, 2018.
  • Ran and Wang [2022] Yu Ran and Yuan-Gen Wang. Sign-opt+: An improved sign optimization adversarial attack. In Proceedings of the IEEE International Conference on Image Processing, pages 461–465, 2022.
  • Wang et al. [2022] Yuxuan Wang, Jiakai Wang, Zixin Yin, Ruihao Gong, **gyi Wang, Aishan Liu, and Xianglong Liu. Generating transferable adversarial examples against vision transformers. In Proceedings of the 30th ACM International Conference on Multimedia, pages 5181–5190, 2022.
  • Wang and Wang [2022] Dan Wang and Yuan-Gen Wang. Decision-based black-box attack specific to large-size images. In Proceedings of the Asian Conference on Computer Vision, pages 4681–4696, 2022.
  • Li et al. [2020] Huichen Li, Xiaojun Xu, Xiaolu Zhang, Shuang Yang, and Bo Li. Qeba: Query-efficient boundary-based blackbox attack. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 1221–1230, 2020.
  • Deng et al. [2009] Jia Deng, Wei Dong, Richard Socher, Li-Jia Li, Kai Li, and Li Fei-Fei. Imagenet: A large-scale hierarchical image database. In Proceedings of the IEEE Conference on Computer Vision and Pattern Recognition, pages 248–255, 2009.
  • He et al. [2016] Kaiming He, Xiangyu Zhang, Shaoqing Ren, and Jian Sun. Deep residual learning for image recognition. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 770–778, 2016.
  • Simonyan and Zisserman [2014] Karen Simonyan and Andrew Zisserman. Very deep convolutional networks for large-scale image recognition. arXiv preprint arXiv:1409.1556, 2014.
  • Maho et al. [2021] Thibault Maho, Teddy Furon, and Erwan Le Merrer. Surfree: A fast surrogate-free black-box attack. In Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition, pages 10430–10439, 2021.