CorrAttack: Black-box Adversarial Attack with Structured Search

We present a new method for score-based adversarial attack , where the attacker queries the loss-oracle of the target model . Our method employs a parameterized search space with a structure that captures the relationship of the gradient of the loss function . We show that searching over the structured space can be approximated by a time-varying contextual bandits problem , where the attacker takes feature of the associated arm to make modifications of the input , and receives an immediate reward as the reduction of the loss function . The time-varying contextual bandits problem can then be solved by a Bayesian optimization procedure , which can take advantage of the features of the structured action space . The experiments on ImageNet and the Google Cloud Vision API demonstrate that the proposed method achieves the state of the art success rates and query efficiencies for both undefended and defended models . 1 INTRODUCTION . Although deep learning has many applications , it is known that neural networks are vulnerable to adversarial examples , which are small perturbations of inputs that can fool neural networks into making wrong predictions ( Szegedy et al. , 2014 ) . While adversarial noise can easily be found when the neural models are known ( referred to as white-box attack ) ( Kurakin et al. , 2016 ) . However , in real world scenarios models are often unknown , this situation is referred to as black-box attack . Some methods ( Liu et al. , 2016 ; Papernot et al. , 2016 ) use the transfer-based attack , which generates adversarial examples on a substitute model and transfer the adversarial noise to the target model . However , the transferability is limited and its effectiveness relies highly on the similarity between the networks ( Huang & Zhang , 2020 ) . If two networks are very different , transfer-based methods will have low success rates . In practice , most computer vision API such as the Google Cloud Vision API allow users to access the scores or probabilities of the classification results . Therefore , the attacker may query the black-box model and perform zeroth order optimization to find an adversarial example without the knowledge of the target model . Due to the availability of scores , this scenario is called score-based attack . There have been a line of studies on black-box attack which directly estimate the gradient direction of the underlying model , and apply ( stochastic ) gradient descent to the input image ( Ilyas et al. , 2018 ; 2019 ; Chen et al. , 2017 ; Huang & Zhang , 2020 ; Tu et al. , 2018 ; Li et al. , 2019 ) . In this paper , we take another approach and formulate score-based attack as a time-varying contextual bandits problem . At each state , the attacker may change the adversarial perturbation and get the reward as the reduction of the loss . And the attacker would receive some features about the arms before making the decision . By limiting the action space to image blocks , the associated bandits problem exhibits local correlation structures and the slow varying property suitable for learning . Therefore , we may use the location and other features of the blocks to estimate the reward for the future selection of the actions . Using the above insights , we propose a new method called CorrAttack , which utilizes the local correlation structure and the slow varying property of the underlying bandits problem . CorrAttack uses Bayesian optimization with Gaussian process regression ( Rasmussen , 2003 ) to model the correlation and select optimal actions . A forgetting strategy is added to the algorithm so that the Gaussian process regression can handle the time-varying changes . CorrAttack can effectively find blocks with the largest rewards . The resulting method achieves much lower numbers of average queries and higher success rates than prior methods with a similar action space ( Moon et al. , 2019 ) . It is worth noting that BayesOpt ( Ru et al. , 2020 ) and Bayes-Attack ( Shukla et al. , 2019 ) also employ Bayesian optimization for score-based attack . However , their Gaussian process regression directly models the loss as a function of the image , whose dimension can be more than one thousand . Therefore , their speed is slow especially for BayesOpt , which uses slow additive kernel . CorrAttack , on the other hand , searches over a much limited action space and models the reward as a function of the low dimensional feature . Therefore , the optimization of CorrAttack is more efficient , and the method is significantly faster than BayesOpt . We summarize the contributions of this work as follows : 1 . We formulate the score-based adversarial attack as a time-varying contextual bandits , and show that the reward function has slow varying properties . In our new formulation , the attacker could take advantage of the features to model the reward of the arms with learning techniques . Compared to the traditional approach , the use of learning in the proposed framework greatly improves the efficiency of searching over optimal actions . 2 . We propose a new method , CorrAttack , which uses Bayesian optimization with Gaussian process regression to learn the reward of each action , by using the feature of the arms . 3 . The experiments show that CorrAttack achieves the state of the art performance on ImageNet and Google Cloud Vision API for both defended and undefended models . 2 RELATED WORK . There have been a line of works focusing on black-box adversarial attack . Here , we give a brief review of various existing methods . Transfer-Based Attack Transfer-based attack assumes the transferability of adversarial examples across different neural networks . It starts with a substitute model that is in the same domain as the target model . The adversaries can be easily generated on the white-box substitute model , and be transferred to attack the target model ( Papernot et al. , 2016 ) . The approach , however , depends highly on the similarity of the networks . If two networks are distinct , the success rate of transferred attack would rapidly decrease ( Huang & Zhang , 2020 ) . Besides , we may not access the data for training the substitute model in practice . Score-based Attack Many approaches estimate the gradient with the output scores of the target network . However , the high dimensionality of input images makes naive coordinate-wise search impossible as it requires millions of queries . ZOO ( Chen et al. , 2017 ) is an early work of gradient estimation , which estimates the gradient of an image block and perform block-wise gradient descent . NES ( Wierstra et al. , 2008 ) and CMA-ES ( Hansen , 2016 ) are two evolution strategies that can perform query efficient score-based attack Ilyas et al . ( 2018 ) ; Meunier et al . ( 2019 ) . Instead of the gradient itself , SignHunter ( Al-Dujaili & O ’ Reilly , 2020a ) just estimates the sign of gradient to reduce the complexity . AutoZOOM ( Tu et al. , 2018 ) uses bilinear transformation or autoencoder to reduce the sampling space and accelerate the optimization process . In the same spirit , data prior can be used to improve query efficiency ( Ilyas et al. , 2019 ) . Besides , MetaAttack ( Du et al. , 2020 ) takes a meta learning approach to learn gradient patterns from prior information , which reduces queries for attacking targeted model . Many zeroth order optimization methods for black-box attacks rely on gradient estimation . However , there are some research works using gradient free methods to perform black-box attack . BayesOpt and Bayes-Attack ( Ru et al. , 2020 ; Shukla et al. , 2019 ) employ Bayesian optimization to find the adversarial examples . They use Gaussian process regression on the embedding and apply bilinear transformation to resize the embedding to the size of image . Although the bilinear transformation could alleviate the high dimensionality of images , the dimension of their embeddings are still in the thousands , which makes Bayesian optimization very ineffective and computationally expensive . A different method , PARSI , poses the attack on ` ∞ norm as a discrete optimization problem over { −ε , ε } d ( Moon et al. , 2019 ) . It uses a Lazy-Greedy algorithm to search over the space { −ε , ε } d to find an adversarial example . SimBA ( Guo et al. , 2018 ) also employs a discrete search space targeted at ` 2 norm . Decision-based Attack Decision-based attack assumes the attacker could only get the output label of the model . Boundary Attack and its variants ( Brendel et al. , 2017 ; Chen et al. , 2020 ; Li et al. , 2020 ) are designed for the setting . However , the information received by the attacker is much smaller than score-based attack , and it would take many more queries than score-based attack to successfully attack an image . 3 PRELIMINARIES . A Gaussian process ( Rasmussen , 2003 ) is a prior distribution defined on some bounded set Z , and is determined by a mean function µ : Z → R and a covariance kernel κ : Z × Z → R. Given n observations Dn = { ( zi , f ( zi ) ) } ni=1 , the prior distribution on f ( z1 : n ) is f ( z1 : n ) ∼ Normal ( µ0 ( z1 : n ) , κ0 ( z1 : n , z1 : n ) ) , ( 1 ) where we use compact notation for functions applied to collections of input points : z1 : n indicates the sequence z1 , · · · , zn , f ( z1 : n ) = [ f ( z1 ) , · · · , f ( zn ) ] , µ0 ( z1 : n ) = [ µ0 ( z1 ) , · · · , µ0 ( zn ) ] , κ0 ( z1 : n , z1 : n ) = [ κ0 ( z1 , z1 ) , · · · , κ0 ( z1 , zn ) ; · · · ; κ0 ( zn , z1 ) , · · · , κ0 ( zn , zn ) ; ] . Now we wish to infer the value of f ( z ) at some new point z , the posterior process f ( z ) |Dn is also a Gaussian process ( GP ) with mean µn and covariance σ2n : f ( z ) |Dn ∼ Normal ( µn ( z ) , σ2n ( z ) ) , ( 2 ) µn ( z ) = κ0 ( z , z1 : n ) κ0 ( z1 : n , z1 : n ) −1 ( f ( z1 : n ) − µ0 ( z1 : n ) ) + µ0 ( z ) , σ2n ( z ) = κ0 ( z , z ) − κ0 ( z , z1 : n ) κ0 ( z1 : n , z1 : n ) −1κ0 ( z1 : n , z ) . As a optimization method to maximize a function f , Bayesian optimization models the function to make decisions about where to evaluate the next point z . Assuming we already obtained observations Dt−1 = { ( zi , f ( zi ) ) } t−1i=1 , to determine the next point zt for evaluation , we first use the posterior GP to define an acquisition function ϕt : Z → R , which models the utility of evaluating f ( z ) for any z ∈ Z . We then evaluate f ( zt ) with zt = arg max Z ϕt ( z ) . ( 3 ) In this work , we use the expected improvement ( EI ) acquisition function ( Mockus et al. , 1978 ) ϕt ( z ) = √ σ2n ( z ) ( γ ( z ) Φ ( γ ( z ) ) + φ ( γ ( z ) ) ) with γ ( z ) = µn ( z ) − f ( zbest ) √ σ2n ( z ) , ( 4 ) which measures the expected improvement over the current best value zbest = arg maxzi f ( zi ) according to the posterior GP . Here Φ ( · ) and φ ( · ) are the cdf and pdf of N ( 0 , I ) respectively .

Summary: This work considers an important problem of generating adversarial examples to attack a black-box model. The paper proposes a new approach to consider an adversarial example as a result of a sequence of pixel changes from a benign instance. Therefore, the adversarial generation problem can be considered as a bandit problem, and thus we can leverage Bayesian optimization to search for an instance that maximize the changes on the loss function through a sequence of pixel changes. The evaluation is comprehensive, and demonstrates that fewer number of black-box queries are needed to achieve a higher attack success rate.