Imperceptible Adversarial Examples by Spatial Chroma-Shift

Deep Neural Networks have been shown to be vulnerable to various kinds of adversarial perturbations. In addition to widely studied additive noise based perturbations, adversarial examples can also be created by applying a per pixel spatial drift on input images. While spatial transformation based adversarial examples look more natural to human observers due to absence of additive noise, they still possess visible distortions caused by spatial transformations. Since the human vision is more sensitive to the distortions in the luminance compared to those in chrominance channels, which is one of the main ideas behind the lossy visual multimedia compression standards, we propose a spatial transformation based perturbation method to create adversarial examples by only modifying the color components of an input image. While having competitive fooling rates on CIFAR-10 and NIPS2017 Adversarial Learning Challenge datasets, examples created with the proposed method have better scores with regards to various perceptual quality metrics. Human visual perception studies validate that the examples are more natural looking and often indistinguishable from their original counterparts.


INTRODUCTION
Deep Neural Networks have shown impressive performance on several domains such as image classification [13], object detection [30], speech recognition [3] and natural language understanding [6]. However, they are vulnerable to intentionally crafted perturbations called adversarial examples [37] and various methods have been proposed to generate such examples, such as Fast Gradient Sign Method (FGSM) [11], Carlini&Wagner Attack [5] and DeepFool [26].
Although these examples range from adding a crafted noise to the input to changing the overall image brightness, hue or structure by applying a specified function [21], a common approach is to use norm based metrics to limit the perturbation and impose imperceptibility. Although the use of based norms are debatable and neither necessary nor sufficient criteria for human perception [33], they are still effective as long as the examples are kept in small -norm distances to the original images in the pixel space. However, this brings significant restrictions on perturbations that are not crafted in pixel space. Specifically, spatial transformations, even the most simple ones like translation or rotation, result in high values, while the resulting distortions are hardly perceivable by humans.
Xiao et al. have proposed an alternative approach to perturbation in pixel space, Spatially Transformed Adversarial Examples [39], to generate adversarial examples. This approach is based on altering the pixel positions. This is done by applying a flow field regularized by Total Variation based smoothness term, followed by differentiable bilinear interpolation. The prospect that deep networks can be fooled only by pixel shifts in the image has opened a new research path in generation of adversarial examples. The vulnerability of neural networks to such flow field based spatial transformations raises a natural research question: How far the spatially transformed examples can be optimized for better human perception?
It is known that the human vision is more sensitive to information loss in the luminance than the chrominance [19] and the distortions in the pixel brightness would be more noticeable by humans than the distortions in the color. This has been one of the main motivations behind visual media compression standards [24] where the images are first converted into YUV domain, where Y channel is the grayscale image (luminance) and U and V channels (chrominance) hold the color information, and, taking human vision into account, a more lossy compression is applied to the U and V components to reduce the data size without compromising perceptual quality. Sample images for a visual comparison of luminance channel distortions and chroma channel distortions are provided in Figure 2. Our method succeeded to generate spatially transformed adversarial examples while not producing geometric distortions.
We hypothesize that spatial transformations should not alter the luminance of the input image pixels as a precondition and the grayscale image data should be kept intact. On the other hand, while suppressing the grayscale perturbation increases perceptual quality of generated examples, the unnatural colors and color transitions in adjacent pixels still generates examples which are unnaturally looking and distorted [1].
Motivated by these ideas, we propose a method that perturbs the input image by spatial transformations only in the colorspace. We show that the method is still able to successfully create adversarial examples both in CIFAR-10 and NIPS2017 Targeted Adversarial Attack Challenge datasets with competitive fooling rates under

Benign
UV Only Y Only YUV Figure 2: Visual comparison of spatially transformed adversarial examples applied on different channels using the identical parameters with exaggerated perturbations for better illustration of the effects (i.e., higher than necessary to fool the model).
white-box settings while creating much less visible distortion in comparison to both pixel-value based and spatially transformed examples. In addition, the method alleviates the need for smoothness or norm constraints.

RELATED WORK 2.1 Adversarial Attacks
The existence of adversarial examples has been formally demonstrated by Szegedy et al. along with a constrained optimizationbased LBFGS attack [37]. Following that work, the widely used single-step adversarial example generation algorithm Fast Gradient Sign Method (FGSM) [11] was introduced, which was further improved by adding several regularization and optimization methods while remaining a one-step attack [31,38]. Various iterative versions of FGSM were also introduced, which applied the same gradient ascent optimization in multiple steps [9,20,23]. Another widely used attack is DeepFool, which aims to find the smallest perturbation by carrying the benign example to the closest decision boundary [26]. This algorithm was then modified to learn a single perturbation that can force misclassification on any input image [25]. Carlini

Color-based Adversarial Attacks
Hosseini et al. proposed shifting the hue and saturation components of the HSV color space representation of an input image [14]. Another approach is to optimize the perturbations such that the perceptual color distance, which is reported to be a good representation of the human color difference perception. For that, the norm term of the C&W objective function is replaced by CIEDE2000 perceptual color distance [22,42]. cAdv attack works in CIELAB color space and clusters the image in AB channel representation, then perturbs the clusters whose entropy values are relatively high [4]. Similarly, ColorFool uses image semantic segmentation to find the color sensitive regions of an image, and shifts the pixel values in the respective LAB color space representation [32]. On the other hand, ReColorAdv aims to learn a color transformation function that minimizes the adversarial loss, and applies the same function to each pixel of the input image [21]. Aksoy et al. proposed an algorithm in YUV space, where the noise in UV channels are iteratively suppressed. Then Gaussian filters are applied to all the channels to further reduce the 2 distance between the benign and adversarial images [1].

Transformation-based Adversarial Examples
While the most common adversarial attacks are done in the pixel domain, i.e. by directly adding noise to individual pixels, deep classifiers have also been shown to have vulnerabilities against spatial deformations and transformations [10]. Xiao et al. proposed an algorithm that learns a smooth flow field for the pixel values to shift and produces adversarial examples with less disturbing noise [39]. Similarly, ADef attack applies spatial perturbations to the image in an iterative fashion [2]. Zhao et al. proposed an algorithm that takes advantage of both spatial and pixel space distortions [41].

METHODOLOGY 3.1 Flow field Calculation
A flow field consists of a two dimensional vector ( , ) = Δ , Δ for each pixel location ( , ) in the adversarial image x . For each pixel in the adversarial image x ( , ) , a pixel from location ( + Δ , + Δ ) is sampled from the input image. Since the sampled location is not an integer value, 4 neighboring pixels around the location ( + Δ , + Δ ) are (bilinear) interpolated [43] using Eq.

Spatial chroma shift
We aim to generate adversarial examples having little or no visible distortions. To accomplish this, we first convert the input image into YUV representation , , according to BT.470 System M [17], with the linear transformation given in Eq. 1.
Then, we apply a flow field to , to obtain , while keeping intact. After applying the flow field to the chrominance channels, we concatenate the input image luminance and adversarial spatially transformed chrominance , channels to obtain the adversarial example , , . The method is illustrated in Figure  3. Since the process is end-to-end differentiable, the flow field can be optimized by gradient based optimizers. Application of flow field is as explained in [39]. While a local smoothness constraint is applied in [39] to enforce adjacent pixels to move in coherence, our method alleviates the need for such constraint and eliminates the need for optimization of this constraint. It also eliminates the need for norm constraints, commonly used in pixel-based perturbation methods, to limit the perturbation.
In addition, the search space can be further reduced to apply subpixel color changes by parameterizing [27] the applied flow field and optimizing instead, ′ to minimize adversarial loss. This limits the applied flow field vector size to the range (−1, 1) which further reduces visual artifacts of adversarial perturbation without adding any regularization term to the optimized loss value, with a minor decrease in fooling rate.

EXPERIMENTAL EVALUATION
In this section we first quantitatively analyze, and comparatively evaluate the proposed method using learning-based perceptual distance metrics. Then we perform a human perceptual evaluation study for a subjective assessment of the generated adversarial examples. We also evaluate our method against existing defense mechanisms, and compare the results with those of widely known adversarial attacks.
Datasets. We used CIFAR-10 for targeted and NIPS2017 Adversarial Learning Challenge datasets for the untargeted attack evaluations. As the proposed method is designed to work on chroma channels, we excluded the images which are not colorful (i.e., which have a colorfulness measure below the threshold of 15) according to the colorfulness measuring technique in [12]. This resulted in exclusion of 1467 not-colorful images in CIFAR-10 dataset, leaving 8533 images and in exclusion of 97 not-colorful images in NIPS2017 dataset, leaving 903 images.
Attacks. We compare the proposed method against several widely known methods: FGSM [11], Projected Gradient Descent (PGD) attack [23], Carlini & Wagner attack [5], DeepFool [26] and stAdv [39]. We used Foolbox [29] implementations for FGSM, PGD, C&W, DeepFool attacks and re-implemented the stAdv attack. We made the implementation publicly available at https: //github.com/ayberkydn/stadv-torch alongside the implementation of the proposed method. Models and Parameters. We used ResNet50 [13] for the CI-FAR10 test set and Inception-v3 [36] for NIPS2017 dataset against all attack types. We set the number of iterations to 1000 and color threshold to 15 for all attack types to test different attacks on an identical ground. We used the default parameters for the existing attacks implemented in the Foolbox. For the proposed methods, we set the learning rate as 0.005 for the CIFAR10 testset and 0.01 for the NIPS2017 dataset.
Evaluation. Regarding that norm distances are both insufficient for perceptual similarity and not applicable to spatially transformed adversarial examples [33,39], we have tested perceptual loss of our attack with two learning-based perceptual metrics that are applicable to spatially transformed adversarial examples: Learned Perceptual Image Patch Similarity (LPIPS) metric [40] and Deep Image Structure and Texture Similarity (DISTS) index [7]. LPIPS is a technique that measures Euclidean distance of deep representations (i.e. VGG network [34]) calibrated by human perception. LPIPS has been already used on spatially transformed adversarial example studies [18,21]. DISTS is a method that combines texture similarity with structure similarity (i.e., feature maps) using deep networks with the optimization of human perception. We used the implementation of Ding et al. for the both perceptual metrics [8].
Performance Evaluation with Respect to the Objective Metrics. Table 1 shows that the proposed method in subpixel mode has the lowest LPIPS and DISTS perceptual loss results, 0.006 and 0.009 respectively, in comparison to FGSM, PGD, DeepFool, C&W and stAdv attacks on CIFAR10 test set and Table 2 shows our subpixel attack has the lowest LPIPS and DISTS results on NIPS2017 dataset in comparison to stAdv and C&W targeted attacks, 0.008 and 0.008 respectively. In addition to the objective evaluation, we also conducted a human perception experiment, since no perceptual distance metric can accurately represent the human visual perception [5].
Human Perceptual Study. The experiment has been performed for a subjective evaluation, i.e. whether the chroma-shift based adversarial images are, in most cases, indistinguishable from their original counterparts.
Our claim is that the perturbations in chroma-shift based adversarial images not only keep the image in the perceptually realistic domain but also go beyond this by making the differences almost imperceptible to human eye. We aim to test this claim and compare the results with those of stAdv, which was already shown to keep the images in perceptually realistic domain [39]. In our human perception study, we follow a similar protocol to this work with a minor difference that there is no time limit for the participants and images stay on the screen until the participants make their choices. This allows participants to analyze the images in more detail for any visible distortions.
For the experiments, we used the first 10 images from the NIPS 2017 competition dataset. For each original image, we prepared an adversarial images using stAdv and another using the proposed chroma-shift based method, an example image and their adversarial counterparts are shown in Figure 5. The participants are presented with two images, one of which is always the original image and the other one shown alongside is either the same image again, stAdv image, or chroma-shifted image in a random order. The participants are asked the question "Is the image on the right the same with the one on the left or a slightly distorted version of it?" for each pair. This results in 30 annotations per participant.
A total of 77 participants participated in the study, providing a total of 1860 annotations. As shown in Figure 4, the chroma-shift based adversarial examples are perceived frequently the same as the original images. Note that in some cases the original images (i.e., control group) were perceived differently and 87.01% of the total annotations the original vs. original were annotated the same. While this reduced down to 77.53% for the original vs. chroma-shift images, most were still indistinguishable by the participants. For the original vs. stAdv images, the participants were able to spot the distortion with more ease and 50.51% of the total annotations stated that they were the same.
Performance Against Robust Models. We also measured the performance of our attack against adversarially trained ResNet50 models. To test the robustness of our attack against adversarially trained models, we have used 3 robust models that are trained with FGSM, 20-step PGD and ensemble adversarial training methods. The models were attacked in an ∞ setting where budget is set to be 8/255 (in 0-1 scale). Ensemble adversarial training [38] was performed on ResNet50, where the generator models were set to be DenseNet121 [16], GoogLeNet [35] and MobileNet [15]. Table 3 shows the fooling rates obtained by attacking these robust models using different adversarial attacks. Chroma-shift attack, when run in unrestricted mode, has on par or better than C&W attack, it also outperformed stAdv attack against each augmentation based adversarial defense mechanism. Adversarial examples applied only on image colors (i.e., preserving the luminance content and modifying only the chroma channels) are expected to be not robust to conversion to grayscale as mentioned in the study of Laidlaw et al. [21]. As the proposed method is applied to only chrominance (UV) channels, it could be argued that converting the input images from RGB to grayscale could be used as a defence. However, conversion to grayscale may be counterproductive as it has an undesired effect of decreasing the overall accuracy on both benign and adversarial examples. When grayscale versions of the input images are used, CIFAR10 testset accuracy decreases down to 86.3% from 93.7% and NIPS2017 dataset accuracy decreases to 79.5% from 92.6%.

DISCUSSIONS
Our hypothesis was that it is possible to create adversarial examples that contain visually imperceptible perturbations by only shifting the chrominance values of the original image. The results obtained with targeted and untargeted attacks show that our hypothesis is valid, there is a decrease in the perceptual distances with regards to the LPIPS and DISTS metrics with competitive fooling rates. Furthermore, the common expectation would be in the way that 'adversarial energy' are mostly accumulated in the luminance channel, which is where the perturbations naturally appear when adversarial attacks are applied in the RGB space [28]. While this assumption is still valid, our findings suggest that chrominance channels contain sufficient adversarial energy so that the network can be fooled by only perturbing the UV channels. On the other hand, our attack is still disadvantageous in fooling rate compared to C&W attack, which is a pixel space attack whereas our algorithm does optimization in the vector space.
We also validated our hypothesis by performing a human visual study, as despite both perceptual metrics we have used have been shown to be correlated with human vision, no perceptual metric is a precise measure for human vision [5]. Results shown in Figure 4, signify that our algorithm not only makes improvement on quantitative visual metrics, but also performs notably well in practice and it is robust against widely used adversarial training based defense mechanisms.

CONCLUSIONS
In this work, we have shown that small spatial transformations exclusively in the color space can yield adversarial examples that are often indistinguishable from their original counterparts. We compared the proposed attack with widely used attacks, both for standard and adversarially trained models, using different perceptual difference distances. Furthermore, we have evaluated the visual quality of our adversarial examples with a subjective human experiment; which showed that chroma-shifted adversarial examples are indistinguishable from the original images in most cases. While conversion to grayscale at the input could be used as a defence against the proposed attack, it has to be noted that this also results in an overall decrease in the standard accuracy. In the future, to further weaken such defense, the attack could be combined with traditional norm attacks such as the method proposed in [18]. As another alternative, some limited amounts of perturbations in Y channel could be included in addition to the perturbations in UV channels, similar to the implementation of Aksoy et al. [1].