{'fraction_non_alphanumeric': 0.032004941434846265, 'fraction_numerical': 0.013268667642752563, 'mean_word_length': 4.761565836298932, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
AdvMask: A Sparse Adversarial Attack Based Data Augmentation Method for Image Classification

Data augmentation is a widely used technique for enhancing the generalization ability of convolutional neural networks (CNNs) in image classification tasks. Occlusion is a critical factor that affects on the generalization ability of image classification models. In order to generate new samples, existing data augmentation methods based on information deletion simulate occluded samples by randomly removing some areas in the images. However, those methods cannot delete areas of the images according to their structural features of the images. To solve those problems, we propose a novel data augmentation method, AdvMask, for image classification tasks. Instead of randomly removing areas in the images, AdvMask obtains the key points that have the greatest influence on the classification results via an end-to-end sparse adversarial attack module. Therefore, we can find the most sensitive points of the classification results without considering the diversity of various image appearance and shapes of the object of interest. In addition, a data augmentation module is employed to generate structured masks based on the key points, thus forcing the CNN classification models to seek other relevant content when the most discriminative content is hidden. AdvMask can effectively improve the performance of classification models in the testing process. The experimental results on various datasets and CNN models verify that the proposed method outperforms other previous data augmentation methods in image classification tasks.


I. INTRODUCTION
Image classification [1], [2] aims to classify digital images automatically, which has been a core topic of computer vision for decades. Image classification can be applied to various fields, such as object detection, video classification and segmentation. Recently, convolutional neural network (CNN) has made tremendous progress in image classification. In order to further improve the classification accuracy, more complex deep neural networks, such as ResNet-152 [3], have been proposed. However, if a model is too complex, for example, when the complexity of neural network is higher than that of training data, over-fitting will damage the classification accuracy. At the same time, images in such tasks often undergo intensive changes in appearance and varying degrees of occlusion, which are the critical influencing factors on the generalization ability of CNNs [4]. As most image datasets only have clearly visible images, the generalization ability of classification models degrades significantly in this case.
Considering the extreme difficulty of data collection in realworld tasks, data augmentation [5]- [9] has been proposed as a very important technique to improve the generalization ability of CNNs by generating more effective data based on the existing data.
Recently, data augmentation methods based on information deletion, such as Cutout [10], Hide-and-Seek (HaS) [11], and Random Erasing [4], have been widely used. It is known that this kind of data augmentation methods can reduce models' sensitivity and strengthen the generalization ability of the models. Especially, they can predict occluded objects when the original training data are all clearly visible. The core idea of the methods based on information deletion is to generate new data by deleting some areas of the image, which can simulate the situation that objects are partially covered and the whole structure is incomplete in the real world. However, if is found that, instead of customizing the mask according to the structural characteristics of the images, the existing data augmentation methods based on information deletion can block some random areas in the images. Although this may improve the classification accuracy because the diversity of training data increases, this kind of mask generation is not targeted and uninterpretable. In the bad situation, the occluded areas are all in the foreground, thus the objects of interest in the image are completely occluded, which seriously damages the generalization ability of CNN models. In addition, different images have different structures. In other words, the key information used by CNN models to classify different images is different. It is much more beneficial to customize the mask for each image according to the structure information. However, random information deletion cannot solve such problems.
Based on the above discussions, we propose a data augmentation method (AdvMask) based on information deletion, which can regularize CNN training and improve the performance of models in image classification. The most important motivation for AdvMask is to simulate the situations where the key information for classification is partly or completely lost. The key information in the image is closely related to the classification results, and the change of those information will lead to misclassification. So we need to locate the points where perturbation would make the classification result different from the truth. Adversarial attack is to deceive the target model by adding adversarial perturbations to the original clean images. In addition, sparse adversarial attack can only perturb the pixels that have the greatest influence on the classification results. Therefore, in AdvMask, we design a  Fig. 1. The framework of proposed AdvMask, which consists of two modules: sparse adversarial attack module and data augmentation module. Given a perturbation, we encode it through a trainable neural network to generate a feature map. Then, we use the scaled sigmoid function to generate an approximately binary attack mask. The attack mask is used to guide the generation of augmentation mask for augmented images. After mask generation, the shapes of generated augmented masks are very diverse. Here we show a few augmented images.
sparse adversarial attack module to find the pixels that have the greatest influence on the classification results. For data augmentation, we generate augmented samples by occluding some of these adversarial attack points in the images. There are three advantages of occlusion on these adversarial attack points. Firstly, the deleted areas generated by AdvMask are based on the adversarial sensitive region, so the deleted areas are not limited to a continuous area, but multiple areas with various shapes. Secondly, the deleted areas generated by AdvMask is customized for each image, rather than randomly generated, so the whole deleted areas are closely related to the image structure, including both foreground and background. Finally, AdvMask uses sparse adversarial attack to find the most sensitive areas in the image, instead of only focusing on the area where the main object is located. At the same time, we also avoid excessive deletion and reservation of continuous regions, in order to balance object occlusion and information retention [12]. Generally speaking, AdvMask consists of two modules: sparse adversarial attack module and data augmentation module, as illustrated in Fig. 1. Using the learned sparse adversarial attack model, we can customize the augmented training samples for each image in the process of model training. In this way, the augmented data can simulate various situations where some key information is lost in the image, which can encourage the model to pay more attention to less sensitive areas with important features.
AdvMask can reduce the influence of over-fitting, enhance the generalization ability of classifier, and thus improve the classification accuracy. To demonstrate the effectiveness of AdvMask, we also conducted experiments on CIFAR10/100 [13] and Tiny-ImageNet [14] for coarse-grained classification, and Oxford Flower Dataset [15] for fine-grained classification and effect visualization.
To summarize, the contributions of this work are featured in the following aspects: • A novel data augmentation method is proposed, which innovatively uses sparse adversarial attack methods for data augmentation. AdvMask first finds key information in the images through sparse adversarial attack module, and then generates customized augmented data for every image. • We design an end-to-end sparse adversarial attack method, which uses the attack to guide the automatic selection of pixels without hand-crafted rules. Compared with other sparse adversarial attack methods, it is competitive in speed and attack success rate. • We develop a data augmentation module based on occlusion suppression in AdvMask. By suppressing the occlusions on key information, classification models can focus more on less sensitive areas with important features. • We further conduct image classification experiments to compare and discuss the proposed method with other data augmentation techniques, and analyze the parameters of our proposed method in more detail by ablation research. Experimental results demonstrate that the proposed data augmentation method achieves superior performance on several datasets, and improves the performance of various popular image classification models. • We are the first to propose the method of sparse adversarial attack in the community of data augmentation. We prove that key points from sparse adversarial attack module are important for image classification, and are very useful for designing data augmentation methods. The reminder of the paper is organized as follows: In Section II, we review related works about sparse adversarial attack and data augmentation methods. Section III elaborates on the proposed data augmentation method based on information deletion for image classification, including sparse adversarial attack module and data augmentation module. Section IV presents the experimental results of the comparisons and evaluations. Ablation experiment results and performance analysis are reported in Sectoin V. Finally, the conclusion is drawn in Section VI.

II. RELATED WORK A. Sparse Adversarial Attack
The main difficulty of sparse adversarial attack is how to determine the pixels to be perturbed. Most of the existing methods can be described by a two-stage pipeline. First, these methods artificially define a measure of pixel importance, such as gradients. Then according to the importance of each pixel, the iterative strategy is applied, which selects the most important pixels to attack until the attack is successful. For example, based on the saliency map, JSMA [16] uses a heuristic strategy to iteratively select the pixels to be perturbed in each iteration. C&W-l 0 [17] first uses the attack under the constraint of l 2norm, and then fixes several least important pixels according to the perturbation magnitudes and gradients. PGD-l 0 + l ∞ [18] projects the perturbations generated by PGD [19] onto the l 0ball to achieve the l 0 version of PGD. The specific projection method is to fix some pixels that do not need to be perturbed according to the perturbation magnitudes and projection loss. SparseFool [20] converts the problem into an l 1 -norm constrained problem, and selects some pixels to perturb in each iteration according to the geometric relationship. Based on the gradient and the distortion map, GreedyFool [21] selects some pixels to be added to the modifiable pixel set in each iteration, and then uses the greedy method to drop as many less important pixels as possible to obtain better sparsity. However, all these methods are trying to find a better way to evaluate the importance of pixels, and use greedy methods to remove as many unimportant pixels as possible to achieve better sparsity. We think that combining these two steps is a better choice.
There are also some methods that go beyond the twostage pipeline. One-Pixel attack uses the differential evolution algorithm to explore the extreme cases where only one pixel is perturbed. However, this method has a low attack success rate. SAPF [22] is similar to our adversarial attack method. This method factorizes the perturbation into the product of the perturbation magnitude and the binary mask, and uses l pbox ADMM [23] to optimize them jointly. Our method also uses the binary mask, but we generate the mask through a trainable neural network. Experimental results show that the adversarial attack points generated by our method have better sparsity.

B. Data Augmentation Methods
Deep neural network often suffers from severe over-fitting, which weakens its generalization ability. Data augmentation is an effective method to solve the problem of over-fitting, and it has long been used in practice. The core idea of data augmentation is to generate more data on the basis of current training set. The baseline method in this work is basic image manipulation, including cropping, translation, and rotation, which are widely used in image classification tasks. Recently, some methods based on information deletion aim at simulating the occlusion in image classification tasks. Random Erasing (RE) [4] reduces the risk of over-fitting and makes the model robust to occlusion by randomly selecting a rectangular region in an image and erasing its pixels with random values. Similarly, Hide-and-Seek (HaS) [11] randomly hides patches in a training image, which can improve the object localization accuracy and enhance the generalization ability of CNN models. Cutout [10] is a simple regularization technique of randomly masking out square regions of input images and can improve the robustness and overall performance of CNN models. More recently, GridMask [12] uses structured dropping regions in the input images, which emphasizes the importance of the balance between information deletion and reservation, and greatly improves the performance of CNN models on several CV tasks. Similar to GridMask, FenceMask [24] overcomes the difficulty of small object augmentation, and improves the performance over baselines by enhancing the sparsity and regularity of the occlusion block. For person re-identification tasks, [25] uses a sliding occlusion mask with specific horizontal and vertical strides to search for discriminative regions which are determined by some network visualization techniques. In contrast to [25], the occluded regions of the augmented samples in our work are based on the adversarial attack points precalculated by our end-to-end sparse adversarial attack module.

III. ADVMASK
As illustrated in the Fig. 1, AdvMask consists of two modules: sparse adversarial attack and data augmentation. First, we distinguish two types of masks in AdvMask: attack mask and augmentation mask. The attack mask is the output of the sparse adversarial attack module, and it indicates the position of the adversarial attack points. The augmentation mask in the data augmentation module is generated according to the attack mask, and it indicates the occluded regions of augmented data.
Firstly, AdvMask takes as input a whole image and a random adversarial perturbation. We then encode the perturbation by a trainable neural network to generate a binary attack mask of the same size. From the binary attack mask, we obtain the points of interest (POI) for the data augmentation module. Finally, AdvMask performs data augmentation based on the POI from the binary mask.

A. Sparse Adversarial Attack
Sparse adversarial attacks can find the most sensitive pixels in the images, because applying invisible perturbations to these pixels will lead to wrong classification. Let f : [0, 1] w×h×c → R K be the classification model, where w, h and c denote the width, height, and the number of channels of the images, respectively. K denotes the total number of classes. The adversarial attack is generally formulated as: where δ ∈ R w×h×c is the adversarial perturbation, · 0 denotes the l 0 -norm that is the number of non-zero elements, and f r (·) denotes the probability that the model classifies the input as class r. x and y true denote the input image and its true label. However, problem (1) does not limit the maximum perturbation magnitude. When the magnitude is large, the attack can be completed by perturbing only a few pixels [26]. Too few perturbed pixels are not helpful for mask generation in the data augmentation module. The sparsity of adversarial attack points is beneficial to data augmentation because these points are more likely to cover both foreground and background. Therefore, it is necessary to constrain the magnitudes of sparse adversarial perturbations. Our work uses l 0 -norm as a distance function to learn sparse adversarial attack. We formulate the sparse adversarial attack as: where denotes the maximum perturbation magnitude allowed, which is the l ∞ -norm of the perturbation.
However, because the l 0 -norm is not differentiable, the difficulty to optimize the problem makes sparse adversarial attack a NP-hard problem [21]. As mentioned in Section II-A, the existing methods use artificially defined importance indicators and greedy strategies, which may not be able to obtain the optimal results. Inspired by the research of neural network pruning, pruning neural network can be regarded as an optimization problem of l 0 -norm which indicates the sparsity of convolution kernels. Early neural network pruning methods also use artificially defined importance index of convolution kernels [27]- [29] . Recently, AutoPruner, an automatic pruning method on neural network, gets rid of the need to manually define the importance of convolution kernels, and automatically selects the convolution kernels that need to be kept in the process of fine-tuning the models. AutoPruner adds a branch in the usual network training process, which outputs a mask to automatically select filters. Based on the intrinsic similarity between network pruning and sparse adversarial attacks, we add a branch that includes encoding and binarization in the usual attack process, which also outputs a mask to automatically select pixels. The branch takes the adversarial perturbation as its input and generates an approximate binary mask with the same size. According to the sparsity and attack effect, the adversarial perturbation and the encoder are jointly optimized. By gradually forcing the scaled sigmoid function to output binary values, the perturbation of some pixels finally becomes 0, thus ensuring the sparsity. a) Encoding: Let H : R w×h×c → R w×h×1 denote the neural network, which is used to encode the perturbation. H(δ) ∈ R w×h×1 represents the tensor obtained by encoding the perturbation δ with H.
When the image size is small, we directly use a fullyconnected layer as the encoder, and its weights are denoted as W ∈ R (whc)×(wh) . However, large image size causes too many weights to be trained. Considering that dimensions of Fig. 2. Illustration of attack mask generated by our sparse adversarial attack module. The first row: original images from ImageNet dataset [31]. The second row: attack masks for images in the first row.
the input and output must be the same, we use the classical image segmentation network U-net [30] as the encoder.
b) Binarization: The elements of the encoded tensor are real numbers, but the elements of the attack mask are binary, in which 1 denotes the key points and 0 denotes otherwise. Therefore, in order to maintain continuity and differentiability, we use the scaled sigmoid function to generate an approximate binary mask: where m ∈ [0, 1] w×h×1 denotes the approximate binary mask and α is the scaling factor that controls the degree of binarization. When α is too small, (3) is not enough to binarize the elements of mask. When α is too large, the selection of pixels has been determined before the training, which degenerates our method into randomly selecting pixels. Therefore, we gradually increase α in the training process to ensure that the elements of mask can converge to binary values, and prevent the method from degenerating into random pixels selection. c) Loss Function: Our goal is to find the most sensitive pixels in the image while these points are sparse. Therefore, the design of loss function is to fool the target model with the pruned perturbations as much as possible, and the key pixels should be as sparse as possible. First we use adversarial attack, such as PGD and MI-FGSM, to calculate the loss of cross entropy with successful attack, L init . We formulate our loss function for sparsity as follows: where denotes the element-wise multiplication, L classify is the adversarial classification loss, usually the cross-entropy loss. Since the elements of m are approximately binary, the second term approximately represents the sparsity of the mask, where N = w × h × 1 represents the size of the mask. λ is a dynamic parameter to balance these two terms, which is calculated by the following formula: where C > 0, a hyperparameter, is the minimum value of λ, m i is the i-th element of the mask, and γ > 0 is a hyperparameter. If the current mask is not sparse enough, our method would pay more attention to improving the sparsity of the mask, otherwise our method would focus on the adversarial attack. d) Update Perturbation and Encoder: Since attack mask is to find sparse POI in the image, we do not need to consider its own sparsity. Therefore, instead of updating the δ with greedy strategies, we can use adversarial attack methods, such as PGD and MI-FGSM, to quickly update δ. Moreover, considering the constrain of δ in problem (2), we can combine PGD and MI-FGSM [32] under the l ∞ -norm constrain. In this way, we can constrain both the l 0 -norm and l ∞ -nrom of the perturbation. Specifically, the update formula of δ is as follows: where L is the loss defined by (4), µ denotes the momentum decay factor, β represents the update step, and Clip {·} is used to project adversarial perturbation into the l ∞ -ball of radius .
To summarize, the perturbation is trained simultaneously with the encoder. The completion of training means the completion of the attack mask generation. Fig. 2 illustrates some examples of attack masks.

B. Data Augmentation
Excessively deleting regions in the image may lead to complete object removal and context information loss, while retaining too many regions may lead to information reduction [12]. Therefore, the key of data augmentation based on information deletion is to balance between deletion and reservation of continuous areas. Our proposed information removal method, AdvMask, utilizes structured dropping regions. As is illustrated in Fig. 1, the attack mask and input image are used for data augmentation. The areas removed by our method are neither continuous areas nor random areas. The core idea of our data augmentation module is to remove the square areas centered on the adversarial attack points from the attack mask, which is indicated by augmentation mask. In augmentation mask M , if M i,j = 1, the pixel at position (i, j) is unchanged; otherwise, we remove it.
We express our setting as: where x ∈ R w×h×c denotes the input image, M ∈ [0, 1] w×h is the binary augmentation mask indicating the pixels to be removed, and means the element-wise multiplication. The augmentation mask M is determined by five parameters:(l min , l max , p min , p max , o max ).
a) Square Length l: From sparse adversarial attack, we can get the position of POI of each image. So we can customize the augmentation masks for each image. For each perturbation point in the attack mask, we design a square S centered on this point. The parameter l is the length of S. The value of l is a random sample within a range: The parameter l is set according to the image sizes. b) Mask Ratio p: Since some recent works [12], [33] revealed that dropping a very small region is useless for convolutional operation, parameter mask ratio p is used to control the proportion of total masked pixels. The larger p is, the more pixels are masked. Considering the balance between information deletion and reservation, the scale range of the masked regions p should be limited. Once the parameter l is determined, the area of total masked regions can be calculated by: where S is the number of squares in the mask. Then, we get: where h and w are the height and width of the image. p can prevent algorithm from removing too many or too few pixels by limiting the number of squares in the mask. Therefore, we set a scale range of p as [p min , p max ]. In this case, the dropping regions can neither be too large nor too small. c) Overlapping Ratio o: Since square S has different length, if two perturbation points are very close, the squares centered on these two points may easily overlap. This situation could deteriorate sharply when the lengths of the squares are large while the perturbation points are dense, which causes the deleted areas to continuously overlap and finally concentrate on a sub-areas. In the worst case, no matter how large l is, the entire object of interest will be deleted. Therefore, by controlling the overlapping ratio o, on the one hand, we can prevent the algorithm from removing continuous areas. On the other hand, we can ensure the structural characteristics of the mask. So for every mask, we set a upper bound of o, and randomly choose o as In this way, the overlapping area of every pair of squares in the augmentation mask is no larger than l 2 × o .
The random values of these five parameters increase the diversity of the augmentation masks and ensure the structural deletion of areas. For every image in each epoch during training, we generate different masks. Even for the same image and its attack mask, every generated augmentation mask is different.

IV. EXPERIMENT
In this section, we report on experiments to evaluate our method and compare it with other data augmentation methods. To prove the effectiveness of our proposed method, the experiments include four image datasets and various popular neural network models in image classification tasks. For the same model trained with different data augmentation methods, we use the same parameter settings, such as learning rate.

A. Datasets and Evaluation Metrics
We conduct experiments on four representative datasets for image classification tasks: CIFAR-10/100, Tiny-ImageNet, and Oxford Flower Dataset.
1) CIFAR-10/100 [13]: Both CIFAR-10 and CIFAR-100 datasets consist of 60000 color images of size 32 × 32 pixels, while the former has 10 distinct classes and the latter has 100. Each dataset is divided into a training set containing 50000 images and a test set containing 10000 images. Experimental results on these datasets demonstrate the superiority of AdvMask for coarsegrained classification on small image sizes. 2) Oxford Flower Dataset: [15] consists of 102 flower categories. Each class contains between 40 and 258 images of size 224 × 224. These images have large scale, and vary greatly in pose and light. In addition, because the images are larger in size and clearer in vision, we present the results of class activation maps (CAM) [34] from models trained with different data augmentation methods. Experiment results on the dataset demonstrate the superiority of AdvMask for coarsegrained classification on large image sizes, and visually prove the effect of the model trained with AdvMask. 3) Tiny-ImageNet: [14] contains 100000 images of 200 classes. Each class has 500 training images, 50 validation images, and 50 test images. Since test images are not labeled, we use validation set to test. Experimental results on the dataset prove the superiority of AdvMask for fine-grained dataset with large image sizes. 4) Evaluation Metric: We use Rank-1 and mean average classification accuracy to evaluate the performance of the proposed method.

B. Implementation Details
Since our adversarial attack module is white-box attack, we first use a trained classification model as the attack target to obtain the attack mask for every image. Based on the attack mask, we then generate augmentation masks in data augmentation module.
For the sparse adversarial attack module, there are some important implementation details to note. As mentioned in Secton III-A, we gradually increase the scaling factor α from α min to α max in the optimization process to make the mask binary. Specifically, α max is set to 100 on CIFAR-10 and CIFAR-100, and 5 on Tiny-ImageNet and Oxford Flower Dataset. The change of α min has little effect on the results, so we just set α min as 0.1 all the time.
For the data augmentation module, the datasets is normalized using per-channel mean and standard deviation, and our algorithm is applied after the image normalization operation.
Inspired by the easy-to-hard learning strategy [35], [36], we propose an incremental generative strategy. Specifically, instead of applying AdvMask to every image in each epoch, the number of augmented occluded samples gradually increases during training, which will make the network more robust to occlusion by learning more and more occlusion samples. The number of augmented samples grows uniformly with epoch until it reaches a constant upper bound. In practice, we set the upper bound to 80% of the total sample size.

C. Results on CIFAR-10 and CIFAR-100
We use ResNet [3] architecture with different size models, including ResNet-18, ResNet-44, and ResNet-50. In addition, we use WideResNet-28-10 [37] and ShakeShake-26-32 [38]. The hyperparameters we use are the same as those reported in the paper [10], [12]. For the basic augmentation, we pad the image to 36 × 36 and randomly crop it into size 32 × 32. The images are normalized using per-channel mean and standard deviation. AdvMask is applied after the normalization. For the basic augmentation, we pad the image to 36 × 36 and randomly crop it into size 32 × 32, then horizontally flipped with the probability of 0.5. The parameters for AdvMask is correlated to the complicity of datasets. Generally, the more complex the dataset is, the larger masked regions is preferred. Therefore, we train with CIFAR-10 using the range of square  We conduct the experiments several times and report the best classification accuracy of different models on CIFAR-10 and CIFAR-100, as summarized in Table I. Notably, Adv-Mask can improve the performance of ResNet18, ResNet44, ResNet50, WideResNet-28-10 and ShakeShake-26-32 on baseline by 1.16%, 1.39%, 1.03%, 1.50%, and 2.12%, respectively. Since the complexity of CIFAR-10 is not high, the accuracy of different methods is not much different.
Especially for ResNet44, WideResNet-28-10, and ShakeShake-26-32, we have improved the classification accuracy on CIFAR-100 by 1.64%, 1.74% and 3.31%, respectively. AdvMask achieves best results on these 5 classification models, which shows the superior to previous data augmentation methods. Meanwhile, for average classification accuracy, AdvMask is the state-of-the-art method among different models.

D. Results on Oxford Flower Classification Dataset
We randomly divide the Oxford FLower Classification Dataset into training set, validation set and test set, and use cross validation for experiment. The basic augmentation includes random padding, cropping and horizontal flipping.
From Table. II, in terms of accuracy, AdvMask achieves the state-of-the-art classification accuracy on this dataset. Specifically, compared with baseline, AdvMask improve the accuracy by 11.37%. In addition, because the images are larger in sizes and clearer in visual effect than CIFAR-10/100, we visualize the CAM on ResNet-50 model trained with different data augmentation methods for comparison. It can be seen from Fig. 3 that AdvMask is more inclined to locate and cover relevant parts of the objects than other data augmentation methods. At the same time, AdvMask can indeed achieve the best classification accuracy on ResNet-50 model, which shows that successful data augmentation help models to focus on the discriminative and salient areas in the image. Specifically, in the first row of Fig. 3, the region of interest (ROI) of baseline method just covers part of the flower, even focuses on the background information, which is a manifestation of over-fitting problem. On the contrary, the attention area of the models trained with AdvMask covers almost the whole flower, while the background is neglected, which proves that AdvMask improves the generalization ability of the models.

E. Results on Tiny ImageNet
We also conduct experiments on a larger image dataset Tiny ImageNet. First, we resize the Tiny-ImageNet data into 64 × 64 and initialize all neural models with ImageNet pretrained weight, and then fine-tune the Tiny-ImageNet dataset for some epochs. Therefore, we modify the network architectures to fit the image size and the output of 200 classes, including ResNet-18, ResNet-50 and Wide-ResNet 50-2 [37]. The basic augmentation includes random padding, cropping and horizontal flipping. Images are all normalized to zero, and then AdvMask is applied.
In order to reflect the classification accuracy improvements brought by different data augmentation methods on baseline, in this experiment, we show the relative average accuracy improvements of different data augmentation methods compared with the baseline in Fig. 4. The baseline accuracies of these three models are 61.38%, 73,61% and 81.55%, respectively.
From Fig. 4, we can see that the average accuracy of all data augmentation methods is better than that of baseline. Among all data augmentation methods, AdvMask achieves the highest improvement in accuracy. On ResNet-18, ResNet-50 and WideResNet-50-2, AdvMask improves the accuracy by 3.91%, 6.57%, and 1.30%, respectively. In addition, we also present the error interval of each method. Specifically, for these three classification models, AdvMask has the smallest error interval among all the methods, which proves that the effect of AdvMask is the most stable. For ResNet-18 and ResNet-50, the worst-cases performance is still higher than baseline, which proves the effect of these data augmentation methods. For WideResNet-50-2, although the worst-cases performance of other methods is worse than the average performance of baseline, the worst-cases performance of AdvMask is still better than that of baseline. Therefore, AdvMask is stable and effective.

A. Attack Success Rate of Sparse Adversarial Attack Module
In our proposed method, the sparse adversarial attack module is used to find the key points in the images for the data augmentation module. Therefore, it is very important to successfully find the most important points that are most susceptible to disturbance. We evaluate the overall performance of our adversarial attack module through attack success rate (ASR) and l p -norm (p = 0, 2, ∞). ASR is the proportion of misclassified adversarial samples in the total samples. l 0 -norm is the number of non-zero elements. The lower it is, the fewer pixels are used to apply the perturbations. l 2 is the distance between the adversarial image and the original clean image. l ∞ indicates the maximum value of the perturbation magnitude, and larger it is, the greater the pixels change.
In this subsection, we compare the effect of our proposed adversarial attack module with several state-of-the-art sparse adversarial attack methods on CIFAR-10 and ImageNet [31] dataset under different parameter settings. The sparse adversarial attack methods used include four two-stage methods, such as JSMA, C&W-l 0 , PGD-l 0 + l ∞ , GreedyFool, and onestage method, SAPF. The target classifier on CIFAR-10 is VGG19 model [39] with the input size of 32 × 32 × 3. The average l p norm and ASR under two settings are shown in Table III, and is the maximum perturbation magnitude. For = 8/255, our proposed sparse adversarial attack module can achieve 100% ASR and the l 0 is only 320.1, which means that only 10.42% pixels are perturbed. For large perturbation magnitudes, our method achieves 100% ASR and the l 0norm is only 131.3 (4.27% pixels). We conduct experiments of JSMA and GreedyFool, and specify the l ∞ -norm = .
The ASR of these two methods is not higher than ours, while the l 0 -norm and l 2 -norm are obviously higher than ours, which means that they have to perturb more points to successfully attack. Because PGD-l 0 + l ∞ needs to specify both l 0 -norm and l ∞ -norm, we experiment with these two norms under the condition that l ∞ = to find the appropriate l 0 -norm. However, even a larger l 0 -norm can not achieve 100% ASR. Both C&W-l 0 and SARF can only specify the l 0 -norm, so we conduct experiments with reference to the l 0 -norm of our method. Although the l 0 -norm of these two methods is almost the same as that of other methods, the l ∞norm of our method is much smaller than these two methods. Therefore, the maximum generated perturbation magnitudes are significantly smaller.
We also experiment on ImageNet, as illustrated in Table IV. When = 4/255, our method obtains 100% ASR and the l 0 -norm is just 12855.0, which is the lowest (4.76% pixels). When = 8/255, our method can also achieve 100% ASR, while the l 0 -norm is the lowest (2.08% pixels). In addition, since the l ∞ -norm for PGD-l 0 + l ∞ and GreedyFool can be specified, we conduct the experiments under the same settings. We can see that the ASR of PGD-l 0 + l ∞ is low and the l pnorm of these two methods is larger than ours. These results above all demonstrate the superiority and effectiveness of our proposed adversarial attack module that can indeed find sparse and most sensitive points.

B. The Effect of Generated Mask on the Targeted Points
For AdvMask, on the one hand, the points used for mask generation are obtained by our adversarial attack module. In order to verify the effect of adversarial attack points for data augmentation, we experiment with two point selection strategies, and then use our data augmentation module under the same experimental settings. 1) Random points (RP) selection: We randomly select points in the whole image. 2) Corner points (CP): We use corner detection to find the key points in the image. Results are summarized in Table V. Although both of these point selection schemes can improve the classification accuracy on baseline, our method is obviously superior to the these two point selection strategies on ResNet-18 and ResNet-50. On Resnet-50, AdvMask is 1.08% and 1.28% higher in accuracy than RP and CP, respectively. The results show the effectiveness of our adversarial attack module.
On the other hand, the data augmentation module generates various masks according to the adversarial attack points. In order to verify the effectiveness of data augmentation module, we conduct experiments which use attack masks directly as augmentation masks. Therefore, the masked points are all From Table VI, we can see that the accuracy of using attack mask is obviously lower than that of our method. The accuracy is even worse than baseline on ResNet-18, because the masked region is so small and thus bring noises into the images. Influenced by adversarial attack, the classifier misclassifies many samples, which leads to side effect. Our data augmentation module makes proper use of these adversarial attack points and obtains best accuracy.

C. The Impact of Parameters
When implementing AdvMask on CNN training, we use three parameters to control the mask generation: square length l, mask ratio p, and overlapping ratio θ, which is introduced in Section III-B. In this subsection, to demonstrate the impact of these parameters on the model performance, we conduct experiments on CIFAR-100 under varying parameter settings. When evaluating one of the parameters, we fixed the other two parameters and the model architecture. The fixed values of l, p, and o are: [2,20], [0.03, 0.5], and 0.2, respectively, if not specified.
a) Parameter l: Since the image size of CIFAR-100 is 32 × 32 and AdvMask will pad all images into larger area, we the maximum mask square length 35. Considering that l is a range interval, we set eight disjoint intervals: [0, 2], [2,5], [5,10], [10,15], [15,20], [20,25], [25,30], [30,35]. Under this setting, we can analyze the effect of l in each interval. Results are shown in Fig. 5. Notably, there is a trend of increasing at first and then decreasing. If the mask square length is too small or large, the accuracy will be lower, especially when the mask is too large. Specifically, if l is lower than 2, the accuracy is far lower than that with l in the range of [2,5], which proves that dropping a very small region is useless for convolutional operation, and may even bring noises into the images. When l is in the interval [2,15], the accuracy does not change much. However, if l is further increased, the accuracy drops dramatically. If l ≥ 20, we get the lowest accuracy, even 1.36% lower than the best accuracy. l ≥ 20 means that nearly more than 50% of the image have been removed, so the main object in the image are likely to be removed. On the one hand, when the length of mask square is too small, the mask area is too small to occlude the object of interest in the image. On the other hand, if the mask area is too large, the whole object of interest is more likely to be totally covered, which will bring side effects to the classifier. For example, if l ≥ 32, even the whole image is masked, which has a negative impact on the accuracy. Therefore, the maximum value of l should not be too great while the variety of l is beneficial. b) Parameter p: Similar to the parameter l, we control the total mask area not to be too large or too small by adjusting p, so that the object can neither be completely removed nor completely kept. We set 5 intervals, each with length 20%, from 0 to 100%.
Results are summarized in Fig. 6. When p is relatively small, the difference in accuarcy is not significant. However, when p further increases, accuracy drops sharply. Specifically, when p is highest, we obtain the lowest accuracy. The classification accuracy varies by up to 1.53%. This is because the total masked area is so large that most of the image is masked. As a result, the main object in the image is also removed, which will greatly damage the performance of the classifier. ratio is within the range 0 − 20%, we obtain the relatively better accuracy. When we further increase the o, we get lower accuracies, with a maximum drop of 0.39%. From this experiment, we can see that smaller o is beneficial. This is because that with lower o, we can avoid deletion of continuous regions and preserve the structured information of the images. As a result, the main object is less likely to be fully removed nor reserved.
Experiments on these three parameters verify that any one or two parameters are sufficient to control the AdvMask. Therefore, we design p, l and o to control the generation of masks, so as to balance the object occlusion and information retention.

VI. CONCLUSION
In this paper, we propose a data augmentation method, AdvMask, for image classification. AdvMask first makes use of adversarial attack research to find key points in the image and then randomly occludes a structured region based on key points during each iteration. Neural network models trained with AdvMask can reduce the sensitivity to occlusion and effectively strengthen the generalization ability by paying more attention to less sensitive areas with important features. The experiment results on various image datasets demonstrate the robustness and effectiveness of our method.
In the future work, we will apply our data augmentation method to other CV tasks, such as, object detection and segmentation. Finally, we hope our work provides a new research direction for the development of data augmentation research.