Autoregressive Perturbations for Data Poisoning
Abstract
The prevalence of data scraping from social media as a means to obtain datasets has led to growing concerns regarding unauthorized use of data.
Data poisoning attacks have been proposed as a bulwark against scraping, as they make data “unlearnable” by adding small, imperceptible perturbations.
Unfortunately, existing methods require knowledge of both the target architecture and the complete dataset so that a surrogate network can be trained, the parameters of which are used to generate the attack.
In this work, we introduce autoregressive (AR) poisoning, a method that can generate poisoned data without access to the broader dataset.
The proposed
AR perturbations are generic, can be applied across different datasets, and can poison different architectures.
Compared to existing unlearnable methods, our AR poisons are more resistant against common defenses such as adversarial training and strong data augmentations.
Our analysis further provides insight into what makes an effective data poison.
Introduction
Increasingly large datasets are being used to train state-of-the-art neural networks [24, 26, 25].
But collecting enormous datasets through web scraping makes it intractable for a human to review samples in a meaningful way or to obtain consent from relevant parties [3].
In fact, companies have already trained commercial facial recognition systems using personal data collected from media platforms [15].
To prevent the further exploitation of online data for unauthorized or illegal purposes, imperceptible, adversarial modifications to images can be crafted to cause erroneous output for a neural network trained on the modified data [12].
This crafting of malicious perturbations for the purpose of interfering with model training is known as data poisoning.
In this work we focus on poisoning data to induce poor performance for a network trained on the perturbed data.
This kind of indiscriminate poisoning, which seeks to damage average model performance, is often referred to as an availability attack [1, 2, 40, 18, 9, 10].
Because we assume the data is hosted on a central server controlled by the poisoner, the poisoner is allowed to perturb the entire dataset, or a large portion of it.
Throughout this work, unless stated otherwise, poisoning refers to the perturbing of every image in the training dataset.
This makes the creation of unlearnable data different from other poisoning methods, such as backdoor [5, 13] and targeted poisoning attacks [28, 43].
We introduce autoregressive (AR) data poisoning for degrading overall performance of neural networks on clean data.
The perturbations that we additively apply to clean data are generated by
AR processes that are data and architecture-independent.
An AR( p ) process is a Markov chain, where each new element is a linear combination of p previous ones, plus noise.
This means AR perturbations are cheap to generate, not requiring any optimization or backpropagation through network parameters.
AR perturbations are generic; the same set of AR processes can be re-used to generate diverse perturbations for different image sizes and new datasets, unlike other poisoning methods which need to train a surrogate network on the target dataset before crafting perturbations.
Our method also provides new insight into why data poisoning works.
We work on top of the result that effective poisons are typically easy to learn [27] and construct AR perturbations which are separable by a manually-specified CNN.
Working under the intuition that highly separable perturbations should be easily learned, we use the manual specification of parameters as a way of demonstrating that
our
AR perturbations are easily separable.
Our manually-specified CNN makes use of what we call AR filters, which are attuned to detect noise from a specific AR process.
AR poisoning’s effectiveness is competitive or better than error-maximizing, error-minimizing, and random noise poisoning across a range of architectures, datasets, and common defenses.
AR poisoning represents a paradigm shift for what a successful indiscriminate poisoning attack looks like, and raises the question of whether strong indiscriminate poisons need to be generated by surrogate networks for a given dataset.
Background & Related Work
Error-minimizing and Error-maximizing Noise.
To conduct poisoning attacks on neural networks, recent works have modified data to explicitly cause gradient vanishing [31] or to minimize the loss with respect to the input image [18].
Images perturbed with error-minimizing noises are a surprisingly good data poisoning attack.
A ResNet-18 (RN-18) trained on a CIFAR-10 [20] sample-wise errorminimizing poison achieves 19 .
9% final test accuracy, while the class-wise variant achieves 16 .
4% final test accuracy after 60 epochs of training [18].
More recently, strong adversarial attacks, which perturb clean data by maximizing the loss with respect to the input image, have been shown to be the most successful approach thus far [10].
An error-maximizing poison can poison a network to achieve 6 .
25% test accuracy on CIFAR-10.
But both error-minimizing and error-maximizing poisons require a surrogate network, from which perturbations are optimized.
The optimization can be expensive.
For example, crafting the main CIFAR-10 poison from [10] takes roughly 6 hours on 4 GPUs.
In contrast, our AR perturbations do not require access to network parameters and can be generated quickly, without the need for backpropagation or a GPU.
We provide a technical overview of error-minimizing and error-maximizing perturbations in Section 3.1.
Random Noise.
Given their simplicity, random noises for data poisoning have been explored as necessary baselines for indiscriminate poisoning.
If random noise, constrained by an ℓ ∞ norm, is applied sample-wise to every image in CIFAR-10, a RN-18 trained on this poison can still generalize to the test set, with ~ 90% accuracy [10, 18].
But if the noise is applied class-wise, where every image of a class is modified with an identical additive perturbation, then a RN-18 trained on this CIFAR-10 poison will achieve around chance accuracy; i .
e .
~ 10% [39, 18, 27].
The random perturbations of [39] consist of a fixed number of uniform patch regions, and are nearly identical to the class-wise poison, called “Regions-16,” from [27].
All the random noises that we consider are class-wise, and we confirm they work well in a standard training setup using a RN-18, but their performance varies across architectures and they are rendered ineffective against strong data augmentations like Cutout [7], CutMix [41], and
Mixup [42].
Conversely, our AR poisons degrade test performance more than error-maximizing, errorminimizing, and random poisons on almost every architecture.
We show that AR perturbations are effective against strong data augmentations and can even mitigate some effects of adversarial training.
Understanding Poisoning.
A few works have explored properties that make for effective poisons.
For example, [27] find that poisons which are learned quickly have a more harmful effect on the poison-trained network, suggesting that the more quickly perturbations help minimize the training loss, the more effective the poison is.
[39] perform a related experiment where they use a single linear layer, train on perturbations from a variety of poisoning methods, and demonstrate that they can discriminate whether a perturbation is error-minimizing or error-maximizing with high accuracy.
We make use of ideas from both papers, designing AR perturbations that are provably separable and Markovian in local regions.
Other Related Work.
Several works have also focused on variants of “unlearnable” poisoning attacks.
[9] propose to employ gradient alignment [11] to generate poisons.
But their method is computationally expensive; it requires a surrogate model to solve a bi-level objective.
[40] propose generation of an unlearnable dataset using neural tangent kernels.
Their method also requires training a surrogate model, takes a long time to generate, and does not scale easily to large datasets.
In contrast, our approach is simple and does not require surrogate models.
[23] propose an invertible transformation to control learnability of a dataset for authorized users, while ensuring the data remains unlearnable for other users.
[35] showed that data poisoning methods can be broken using adversarial training.
[30] and [37] propose variants of error-minimizing noise to defend against adversarial training.
Our AR poisons do not focus on adversarial training.
While adversarial training remains a strong defense, our AR poisons show competitive performance.
We discuss adversarial training in detail in Section 4.3.2.
A thorough overview of data poisoning methods, including those that do not perturb the entire training dataset, can be found in [12].
Autoregressive Noises for Poisoning 3.1 Problem Statement
We formulate the problem of creating a clean-label poison in the context of image classification with
DNNs, following [18].
For a K -class classification task, we denote the clean training and test datasets as D c and D t , respectively.
We assume D c , D t ∼ D .
We let f θ represent a classification DNN with parameters θ .
The goal is to perturb D c into a poisoned set D p such that when DNNs are trained on
D p , they perform poorly on test set D t .
Suppose there are n samples in the clean training set, i.e. D c = { ( x i , y i ) } ni =1 where x i ∈ R d are the inputs and y i ∈ { 1 , ..., K } are the labels.
We denote the poisoned dataset as D p = { ( x ′ i , y i ) } ni = where x ′ i
=
x i + δ
i is the poisoned version of the example x i ∈ D c and where δ i ∈ ∆ ⊂ R d is the perturbation.
The set of allowable perturbations, ∆ , is usually defined by ∥ δ ∥ p < ϵ where ∥ · ∥ p is the ℓ p norm and ϵ is set to be small enough that it does not affect the utility of the example.
In this work, we use the ℓ 2 norm to constrain the size of our perturbations for reasons we describe in Section 3.4.
Poisons are created by applying a perturbation to a clean image in either a class-wise or sample-wise manner.
When a perturbation is applied class-wise, every sample of a given class is perturbed in the same way.
That is, x ′ i
= x i + δ y
i
and δ y i ∈
∆ C = {
δ 1 , ..., δ K } .
Due to the explicit correlation between the perturbation and the true label, it should not be surprising that class-wise poisons appear to trick the model to learn the perturbation over the image content, subsequently reducing generalization to the clean test set.
When a poison is applied sample-wise, every sample of the training set is perturbed independently.
That is, x ′ i
=
x i + δ i and δ i ∈ ∆ S
= { δ 1 , ..., δ n } .
Because class-wise perturbations can be recovered by taking the average image of a class, these should therefore be easy to remove.
Hence, we focus our study on sample-wise instead of class-wise poisons.
We still compare to simple, randomly generated class-wise noises shown by [18] to further demonstrate the effectiveness of our method.
All indiscriminate poisoning aims to solve the following bi-level objective:
[Equation]
Eq. 2 describes the process of training a network on poisoned data; i.e. x i perturbed by δ i .
Eq.states that the poisoned network should maximize the loss, and thus perform poorly, on clean test data.
Different approaches have been proposed to construct δ i .
Both error-maximizing [10] and errorminimizing [18] poisoning approaches use a surrogate network, trained on clean training data, to optimize perturbations.
We denote surrogate network parameters as θ ∗ .
Error-maximizing poisoning [10] proposes constructing δ i that maximize the loss of the surrogate network on clean training data:
[Equation]
whereas error-minimizing poisoning [18] solve the following objective to construct δ i that minimize the loss of the surrogate network on clean training data:
[Equation]
In both error-maximizing and error-minimizing poisoning, the adversary intends for a network, f , trained on the poison to perform poorly on the test distribution D t , from which D c was also sampled.
But the way in which both methods achieve the same goal is distinct.
3.2 Generating Autoregressive Noise
Autoregressive (AR) perturbations have a particularly useful structure where local regions throughout the perturbation are Markovian, exposing a linear dependence on neighboring pixels [38].
This property is critical as it allows for a particular filter to perfectly detect noise from a specific AR process, indicating the noise is simple and potentially easily learned.
We develop a sample-wise poison where clean images are perturbed using additive noise.
For each x i in the clean training dataset, our algorithm crafts a δ i , where ∥ δ i ∥ 2 ≤ ϵ , so that the resulting poison image is x ′ i
= x i + δ i .
The novelty of our method is in how we find and use autoregressive (AR) processes to generate δ i .
In the following, let x t refer to the t th entry within a sliding window of δ i .
An autoregressive (AR) process models the conditional mean of x t , as a function of past observations x t − 1 , x t − 2 , ..., x t − p in the following way:
[Equation]
where ϵ t is an uncorrelated process with mean zero and β i are the AR process coefficients.
For simplicity, we set ϵ t = 0 in our work.
An AR process that depends on p past observations is called an
AR model of degree p , denoted AR( p ).
For any AR( p ) process, we can construct a size p + 1 filter where the elements are β p , ..., β 1 and the last entry of the filter is − 1 .
This filter produces a zero response for any signal generated by the AR process with coefficients β p , ..., β 1 .
We refer to this filter as an AR filter, the utility of which is explained in Section 3.3 and Appendix A.1.
Suppose we have a K class classification problem of H × W × C dimensional images.
For each class label y i , we construct a set
A y i of AR processes, one for each of the C channels.
For each of the C channels, we will be applying an AR process from A y
i inside a V × V sliding window.
Naturally, using an AR process requires initial observations, so we populate the perturbation vector δ i with Gaussian noise for the first V − 1 columns and rows.
The V × V sliding window starts at the top left corner of δ i .
Within this sliding window, we apply the AR( V 2 − 1 ) process: the first V 2 −entries in the sliding window are considered previously generates (or randomly initialized) entries in the 2D array δ i , and the V th entry is computed by Eq.
The window is slid left to right, top to bottom until the first channel of δ i is filled.
We then proceed to use the next AR( V 2 − 1 ) process in
A y i for the remaining C − 1 channels.
Finally, we discard the random Gaussian rows and columns used for initialization, and scale δ i to be of size ϵ in the ℓ 2 -norm.
Note that this sliding window procedure resembles that of a convolution.
That is by design, and we explain why it is important in
Section 3.3.
A high-level overview of this algorithm is illustrated in Figure 2.
Additional details are in Appendix A.3.2.
While we describe our use of AR processes on C -channel images, our method could, in principle, be applied to data other than images.
Note that these AR perturbations are fast to generate, do not require a pre-trained surrogate model, and can be generated independently from the data.
3.3 Why do Autoregressive Perturbations Work?
Perturbations that are easy to learn have been shown to be more effective at data poisoning [27].
Intuitively, a signal that is easily interpolated by a network will be quickly identified and used as a “shortcut,” whereas complex and unpredictable patterns may not be learned until after a network has already extracted useful content-based features [29].
Thus, we seek imperceptible perturbations that are easy to learn.
We propose a simple hypothesis: if there exists a simple CNN that can classify autoregressive signals perfectly, then these signals will be easy to learn.
The signals can then be applied to clean images and serve as a shortcut for learning by commonly-used CNNs.
Autoregressive perturbations, despite looking visually complex, are actually very simple.
To demonstrate their separability, we manually specify the parameters of a simple CNN that classifies AR perturbations perfectly by using AR filters.
In the following, we prove AR filters satisfy an important property.
Lemma 3.1.
Given an AR perturbation δ , generated from an AR( p ) with coefficients β 1 , ..., β p , there exists a linear, shift invariant filter where the cross-correlation operator produces a zero response.
We provide a proof in Appendix A.1.
The construction of an AR filter that produces a zero response for any noise generated from the corresponding AR process is useful because we can construct a CNN which makes use of solely these AR filters to classify signals.
That is, given any AR perturbation, the
AR filter with the zero response correctly designates the AR process from which the perturbation was generated.
We verify this claim in Appendix A.2 by specifying the 3 -layer CNN that can perfectly classify AR perturbations.
Crucially, we are not interested in learning classes of AR signals.
Rather, we are interested in how quickly a model can learn classes of clean data perturbed by AR signals.
Nevertheless, the characterization of our AR perturbations as easy to learn, demonstrated by the manual specification of a 3 -layer CNN, is certainly an indication that, when applied to clean data, AR perturbations can serve as bait for CNNs.
Our experiments will seek to answer the following question: If we perturb each sample in the training dataset with an imperceptible, yet easily learned AR perturbation, can we induce a learning “shortcut” that minimizes the training loss but prevents generalization?
3.4 Finding AR Process Coefficients
We generate AR processes using a random search that promotes diversity.
We generate processes one-at-a-time by starting with a random Gaussian vector of coefficients.
We then scale the coefficients so that they sum to one.
We then append a − 1 to the end of the coefficients to produce the associated
AR filter, and convolve this filter with previously generated perturbations.
We use the norms of the resulting convolution outputs as a measure of similarity between processes.
If the minimum of these norms is below a cutoff T , then we deem the AR process too coherent with previously generated perturbations – the coefficients are discarded and we try again with a different random vector.
Once the AR process coefficients are identified for a class, we use them to produce a perturbation δ i for each image in the class.
This perturbation is scaled to be exactly of size ϵ in the ℓ 2 -norm.
To level the playing field among all poisoning methods, we measure all perturbations using an ℓ 2 norm in this work.
A more detailed description of this process can be found in Appendix A.3.1.
Experiments
We demonstrate the generality of AR poisoning by creating poisons across four datasets, including different image sizes and number of classes.
Notably, we use the same set of AR processes to poison
SVHN [22], STL-10 [6], and CIFAR-10 [20] since all of these datasets are 10 class classification problems.
We demonstrate that despite the victim’s choice of network architecture, AR poisons can degrade a network’s accuracy on clean test data.
We show that while strong data augmentations are an effective defense against all poisons we consider, AR poisoning is largely resistant.
Adversarial training and diluting the poison with clean data remain strong defenses, but our AR poisoning method is competitive with other poisons we consider.
All experiments follow the same general pattern: we train a network on a poisoned dataset and then evaluate the trained network’s performance on clean test data.
A poison is effective if it can cause the trained network to have poor test accuracy on clean data, so lower numbers are better throughout our results.
Experimental Settings.
We train a number of ResNet-18 (RN-18) [14] models on different poisons with cross-entropy loss for 100 epochs using a batch size of 128 .
For our optimizer, we use SGD with momentum of 0 .
9 and weight decay of 5 ×
10 − 4 .
We use an initial learning rate of 0 . 1 , which decays by a factor of 10 on epoch 50 .
In Table 2, we use use the same settings with different network architectures.
4.1 Error-Max, Error-Min, and other Random Noise Poisons
SVHN [22], CIFAR-10, and CIFAR-100 [20] poisons considered in this work contain perturbations of size ϵ = 1 in ℓ 2 , unless stated otherwise.
For STL-10 [6], all poisons use perturbations of size ϵ = 3 in ℓ 2 due to the larger size of STL-10 images.
In all cases, perturbations are normalized and scaled to be of size ϵ in ℓ 2 , are additively applied to clean data, and are subsequently clamped to be in image space.
Dataset details can be found in Appendix A.4.
A sampling of poison images and their corresponding normalized perturbation can be found in Figure 3 and Appendix A.8.
In our results, class-wise poisons are marked with ◦ and sample-wise poisons are marked with • .
Error-Max and Error-Min Noise.
To generate error-maximizing poisons, we use the open-source implementation of [10].
In particular, we use a 250-step ℓ 2 PGD attack to optimize Eq.
To generate error-minimizing poisons, we use the open-source implementation of [18], where a 20-step ℓ 2 PGD attack is used to optimize Eq.
For error-minimizing poisoning, we find that moving in ℓnormalized gradient directions is ineffective at reaching the required universal stop error [18], so we move in signed gradient directions instead (as is done for ℓ ∞ PGD attacks).
Regions-4 and Regions-16 Noise.
Synthetic, random noises are also dataset and network independent.
Thus, to demonstrate the strength of our method, we include three class-wise random noises in our [Table] [Table] experiments.
To generate what we a call a Regions- p noise, we follow [39, 27]: we sample p
RGB vectors of size 3 from a Gaussian distribution and repeat each vector along height and width dimensions, resulting in a grid-like pattern of p uniform cells or regions.
Assuming a square image of side length L , a Regions- p noise contains patches of size L √ p × L √ p .
Random Noise.
We also consider a class-wise random noise poison, where perturbations for each class are sampled from a Gaussian distribution.
4.2 AR Perturbations are Dataset and Architecture Independent
Unlike error-maximizing and error-minimizing poisons, AR poisons are not dataset-specific.
One cannot simply take the perturbations from an error-maximizing or error-minimizing poison and apply the same perturbations to images of another dataset.
Perturbations optimized using PGD are known to be relevant features, necessary for classification [10, 19].
Additionally, for both these methods, a crafting network trained on clean data is needed to produce reasonable gradient information.
In contrast, AR perturbations are generated from dataset-independent AR processes.
The same set of
AR processes can be used to generate the same kinds of noise for images of new datasets.
Building from this insight, one could potentially collect a large set of K AR processes to perturb any dataset of K or fewer classes, further showing the generality of our method.
In Table 1, we use the same 10 AR processes to generate noise for images of SVHN, STL-10, and CIFAR-10.
AR poisons are, in all cases, either competitive or the most effective poison – a poison-trained RN-18 reaches nearly chance accuracy on STL-10 and CIFAR-10, and being the second-best on SVHN and CIFAR-100.
The generality of AR perturbations to different kinds of datasets suggests that AR poisoning induces the most easily learned correlation between samples and their corresponding label.
We also evaluate the effectiveness of our AR poisons when different architectures are used for training.
Recall that error-maximizing and error-minimizing poisoning use a crafting network to optimize the input perturbations.
Because it may be possible that these noises are specific to the network architecture, we perform an evaluation of test set accuracy on CIFAR-10 after poison training VGG- [32], GoogLeNet [33], MobileNet [16], EfficientNet [34], DenseNet [17], and ViT [8].
Our ViT uses a patch size of 4 .
In Table 2, we show that Error-Max and Error-Min poisons generalize relatively [Table] well across a range of related CNNs, but struggle with ViT [Table]
which is a transformer architecture. In contrast [Table] our AR poison is effective across all CNN architectures and is the most effective poison against ViT. Our AR poison is much more effective over other poisons in almost all cases, achieving improvements over the next best poison of 4% on RN-18, 5 .
8% on ViT, and 7 . 5% on GoogLeNet.
The design of AR perturbations is meant to target the convolution operation, so it is surprising to see a transformer network be adversely affected.
We believe our AR poison is particularly effective on
GoogLeNet due to the presence of Inception modules that incorporate convolutions using various filter sizes.
While our AR perturbations are generated using a 3 × 3 window, the use of various filter sizes may exaggerate their separability, as described in Section 3.3.
4.3 AR Perturbations Against Common Defenses 4.3.1 Data Augmentations and Smaller Perturbations
Our poisoning method relies on imperceptible AR perturbations, so it is conceivable that one could modify the data to prevent the learning of these perturbations.
One way of modifying data is by using data augmentation strategies during training.
In addition to standard augmentations like random crops and horizontal flips, we benchmark our AR poison against stronger augmentations like Cutout [7],
CutMix [41], and Mixup [42] in Table 3.
Generally, Mixup seems to be the most effective at disabling poisons.
A RN-18 poison-trained using standard augmentations plus Mixup can achieve a boosts in test set performance of 13 .
68% on Error-Max, 16 .
42% on Error-Min, 19 . 85% on Regions-4, 5 .
05% on Regions-16, and 5 .
19% on Random Noise.
However, a RN-18 poison-trained on our AR poison ( ϵ = 1 ) using standard augmentations plus Cutout, CutMix, or Mixup cannot achieve any boost in test set performance.
We also present results for poisons using perturbations of size ϵ = 0 .
5 to explore just how small perturbations can be made while still maintaining poisoning performance.
Under standard augmentations, going from larger to smaller perturbations ( ϵ = 1 to ϵ = 0 . 5 ), poison effectiveness drops by 8 . 2% for Error-Max, 21 . 13% for Error-Min, 36 .
73% for Regions-4, and 31 .
6% for Regions-16.
Our
AR poison achieves the smallest drop in effectiveness: only 2 .
Random noise can no longer be considered a poison at ϵ = 0 .
5 – it completely breaks for small perturbations.
Under all strong data augmentation strategies at ϵ = 0 . 5 , AR poisoning dominates.
For example, under Mixup, the best runner-up poison is Error-Max with an effectiveness that is more than 23% lower than AR.
Unlike all other poisons, AR poisoning is exceptionally effective for small perturbations.
Note that in all three augmentation strategies pixels are either dropped or scaled.
Our method is unaffected by these augmentation strategies, unlike error-maximizing, error-minimizing, and other randomly noise poisons.
Scaling an AR perturbation does not affect how the corresponding matching
AR filter will respond, 2 and thus, the patterns remain highly separable regardless of perturbation size. [Table]
[Table] [Table] Additionally, AR filters contain values which sum to 0, so uniform regions of an image also produce a zero response.
4.3.2 Adversarial Training
Adversarial training has also been shown to be an effective counter strategy against ℓ p -norm constrained data poisons [18, 10, 9, 35].
Using adversarial training, a model trained on the poisoned data can achieve nearly the same performance as training on clean data [30].
However, adversarial training is computationally more expensive than standard training and leads to a decrease in test accuracy [21, 36] when the perturbation radius, ρ a , of the adversary is large.
In Table [Table] we include adversarial training results on clean data to outline this trade-off where training at large ρ a comes at the cost of test accuracy.
A recent line of work has therefore focused on developing better data poisoning methods that are robust against adversarial training [30, 37] at larger adversarial training radius ρ a .
In Table
[Table]
we compare performance of different poisons against adversarial training.
We perform ℓadversarial training with different perturbation radii, ρ a , using a 7-step PGD attack with a step-size of ρ a / 4 .
We report error-bars by training three independent models for each run.
We also show the performance of adversarial training on clean data.
Data poisoning methods are fragile to adversarial training even when the training radius ρ a is smaller than poisoning radius ϵ [30, 37].
It is desirable for poisons to remain effective for larger ρ a , because the trade-off between standard test accuracy and robust test accuracy would be exaggerated further.
As shown in the Table 4, when the adversarial training radius ρ a increases, the poisons are gradually rendered ineffective.
All poisons are nearly ineffective at ρ a = 0 .
Our proposed AR perturbations remain more effective at smaller radius, i .
e .
ρ a = 0 .
125 and ρ a = 0 .
25 compared to all other poisons.
4.3.3 Mixing Poisons with Clean Data
Consider the scenario when not all the data can be poisoned.
This setup is practical because, to a practitioner coming into control of poisoned data, additional clean data may be available through other sources.
Therefore, it is common to evaluate poisoning performance using smaller proportions of randomly selected poison training samples [10, 18, 30].
A poison can be considered effective if the addition of poisoned data hurts test accuracy compared to training on only the clean data.
In
Table 5, we evaluate the effectiveness of poisons using different proportions of clean and poisoned data.
The top row of Table 5 shows test accuracy after training on only the subset of clean data, with no poisoned data present.
We report error-bars by training four independent models for each run.
Our AR poisons remain effective compared to other poisons even when clean data is mixed in.
AR poisons are much more effective when a small portion of the data is clean.
For example, when 5% of data is clean, a model achieves ~ 75% accuracy when training on only the clean proportion, but using an additional 95% of AR data leads to a ~ 9% decrease in test set generalization.
Our results on clean data demonstrate that AR poisoned data is worse than useless for training a network, and a practitioner with access to the data would be better off not using it.
Conclusion
Using the intuition that simple noises are easily learned, we proposed the design of AR perturbations, noises that are so simple they can be perfectly classified by a 3 -layer CNN where all parameters are manually-specified.
We demonstrate that these AR perturbations are immediately useful and make effective poisons for the purpose of preventing a network from generalizing to the clean test distribution.
Unlike other effective poisoning techniques that optimize error-maximizing or error-minimizing noises, AR poisoning does not need access to a broader dataset or surrogate network parameters.
We are able to use the same set of 10 AR processes to generate imperceptible noises able to degrade the test performance of networks trained on three different 10 class datasets.
Unlike randomly generated poisons, AR poisons are more potent when training using a new network architecture or strong data augmentations like Cutout, CutMix, and Mixup.
Against defenses like adversarial training, AR poisoning is competitive or among the best for a range of attack radii.
Finally, we demonstrated that AR poisoned data is worse than useless when it is mixed with clean data, reducing likelihood that a practitioner would want to include AR poisoned data in their training dataset.
Acknowledgments and Disclosure of Funding
This material is based upon work supported by the National Science Foundation under Grant No.
IIS-1910132 and Grant No. IIS-2212182, and by DARPA’s
Guaranteeing AI Robustness Against
Deception (GARD) program under #HR00112020007.
Pedro is supported by an Amazon Lab126 Diversity in Robotics and AI Fellowship.
Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the
National Science Foundation
A Appendix A.1 Proof of Lemma 3.
Lemma A.1.
Given an AR perturbation δ , generated from an AR( p ) with coefficients β 1 , ..., β p , there exists a linear, shift invariant filter where the cross-correlation operator produces a zero response.
Proof.
Consider any size p + 1 window of the AR perturbation δ where, by definition, the last entry follows Eq.
(5) directly: [ x t − p , x t − ( p − 1) , ..., x t − 1 , x t ] .
We construct a size p + 1 filter where the elements are β p , ..., β 1 and the last entry of the filter is − 1 .
We call this filter an AR filter.
Notice that the dot product of a window of δ with this filter is:
[Equation]
which implies:
[Equation]
where ⋆ denotes the cross-correlation operator.
[Figure]
2 Manually
[Figure] CNN [Figure] Assume AR perturbations are expected to be of size 32 × 32 , as in CIFAR-10.
To illustrate the ease with which a set of AR perturbations can be classified, we construct a set of 10 AR( 8 ) processes
A = ⃗β 1 , ..., ⃗β 10 , where ⃗β i =
[ β i, 1 , ..., β i, 8 ] is a vector of AR( 8 ) coefficients.
Our network consists of 3 layers: a convolutional layer, a max-pool layer, and a fully connected layer.
We specify the parameters of each layer below:
Convolutional Layer: 10 AR filters of size 3 × 3 .
No bias vector.
ReLU activation on output.
The i th AR filter is meant to produce a zero response (See A.1) on noise generated from AR
process with coefficients ⃗β i
[Equation]
Max-Pool layer: Kernel size of 30 × 30 , the same dimensions as the output of the convolutional layer.
Linear layer: We set W = − I and
b = ⃗ 1 , where ⃗ 1 is a vector of all ones.
Softmax activation on output.
To classify AR perturbation from 10 classes, this network outputs a probability distribution overclasses.
This simple CNN works by assigning a high value to the i th logit when the i th AR filter produces a zero response.
For example, when an AR filter outputs a zero response, the activation after ReLU and Max-Pool is still 0 .
The linear layer will then add a bias of 1, so the resulting i th logit will be 1.
Other logits correspond to AR filters which do not match the AR process, and output some nonnegative value, after ReLU and Max-Pool.
The subsequent linear layer subtracts the nonnegative activation from 1, resulting in a logit value that is smaller than 1.
In this way, the softmax activation assigns a high probability to the i th class.
To confirm our network design, we generate 5 , 000 AR perturbations per AR process, and use the network defined above to classify the noises.
The manually-specified network achieves perfect accuracy without any training .
We use this result as a demonstration that AR perturbations are separable.
Note that for other simple, linearly separable image datasets it is non-trivial to manually specify a CNN for perfect accuracy.
Again, our motivation in exploring easily classified noises is that there is substantial work suggesting dataset separability is key to crafting good poisons.
A.3 Algorithms for Generating AR perturbation and Finding Coefficients Algorithm
Search for Coefficients
Input: Number of classes, K Input: Minimum response threshold, T
Output: Set of AR process coefficients,
A 1: A ← {} 2: while | A | ̸ = K do 3: ⃗β ← N (0 , 1) 4: ⃗β ← ⃗β (cid:80) j β j 5: δ ← ARGenerate( ⃗β ) 6: if δ is stable then 7:
Let m store the min response so far.
8: for i in 1,..., | A | do 9: f ← ARFilter( A i ) 10: r ← ConvResponse( δ, f ) 11: m ← min( m, r ) 12: end for 13: if m ≥ T then 14:
A ← A ∪ { β i } 15: end if 16: end if 17: end while 18: return A
Input: Image and label, ( x i , y i ) , where x i ∈
R H × W × C and y i ∈ { 1 , ..., K }
Input: Size of sliding window, V
Input: Set of AR( V 2 − 1 ) processes, A
Input: Size of perturturbation ϵ in ℓ
Output: Poisoned image, x ′ i 1: Sample N (0 , 1) for first V − 1 rows and columns of δ i 2: for k in 1 , ..., C do 3: β 1 , ..., β V 2 − 1 ← A ky i 4: δ ki ← ARGenerate( β 1 , ..., β V 2 − 1 ) 5: end for 6: δ i ← ϵ δ i ∥
δ i ∥7: x ′ i
← x i + δ i 8: return x ′ i
We define important functions and variables of Algorithm 1 and Algorithm 2:
• ⃗β is a vector where the entries are the AR process coefficients β 1 , ..., β p .
• To check whether δ is stable, as in Algorithm 1 Line 6, we check whether the AR process diverges under a few starting signals.
To do this, we check that the ℓ 2 -norm of δ is not large, infinity, or NaN, under 3 different Gaussian starting signals.
If the AR process diverges on any starting signal, then we say δ is not stable, and the Algorithm 1 continues by sampling a new set of AR process coefficients.
• ARGenerate( ⃗β ) takes a set of AR process coefficients and uses the AR process within a sliding window which goes left to right, top to bottom.
The first V − 1 rows and columns of δ i are sampled from a Gaussian.
The output of ARGenerate( ⃗β ) is a two-dimensional array.
The procedure is described in Section 3.2 and illustrated in Figure 2.
Algorithm 2 produces the entire C -channel AR perturbation.
• ARFilter( A i ) takes a set of AR process coefficients and returns the corresponding AR filter, where the entries are the AR coefficients followed by a − 1 .
The AR filter is described in Section 3.2 and used in the construction of our simple AR noise classifier in Appendix A.2. • ConvResponse( δ, f ) takes a signal and filter as input.
It measures a filter f ’s “response” on δ by performing 2D convolution, ReLU, and sum.
A.3.1 Additional Details: Finding AR Process Coefficients
While there exist conditions for AR coefficients for which the AR process converges [38, 4], we found that randomly searching for coefficients was the simplest way to collect a large number of suitable AR processes.
Additionally, using convergence conditions leads to AR processes which converge too quickly.
For our purposes, converging too quickly is not desirable because most of the values in our AR perturbation would be zero.
Instead, we conduct a random search for K sets of converging AR coefficients by randomly sampling values from a Gaussian distribution and ensuring the resulting process is stable; i .
e . does not diverge.
We find that the likelihood of a convergent AR process is much higher when the coefficients are normalized to sum to 1.
Normalizing the coefficients (Algorithm 1 Line 4) is also important because we want AR filters to produce a zero response to uniform regions of an image.
If AR coefficients sum to 1 and the final entry of the AR filter is − 1 , then the 2D cross-correlation operator produces a zero response if pixels in a local window are approximately equal.
We optimize so that every AR process is sufficiently different from other processes already included in our growing set.
We do this by measuring the response of AR filters from AR processes already in our set to noise generated by the currently sampled AR process.
It may be possible to optimize a different criteria, but in our implementation, ConvResponse( δ, f ) measures a filter’s response by performing 2D convolution, ReLU, and sum.
We fully outline this random search for K sets of AR process coefficients in Algorithm 1.
We conduct a search for K = 10 sets of AR coefficients using Algorithm 1 with a threshold T = 10 .
This search took roughly 11 hours running on a single CPU.
For CIFAR-100, we conduct a search for
K = 100 sets of AR coefficients with T = 3 due to the larger number of classes.
This search took roughly 4 hours running on a single GPU.
Because Algorithm 1 samples coefficients independently on every iteration, significant speedups can likely be achieved using parallelized code.
A.3.2 Additional Details: Generating AR Perturbations
In addition to normalizing and scaling AR perturbation after generation, we also find that cropping out the first few columns and rows, where the Gaussian start signal was generated (see Figure 2), leads to more effective AR perturbations.
We tried cropping only the Gaussian start signal, and cropping the start signal plus additional columns and rows.
We found that cropping the start signal plus two extra columns and rows worked best.
The AR perturbations are also less perceptible this way, given that the Gaussian noise starting signal has been removed.
For 32 × 32 dimensional images, we generate AR perturbations of size 36 × 36 and crop the first 4 rows and columns.
For 96 ×dimensional images, we generate AR perturbations of size 100 × 100 and crop the first 4 rows and columns.
A.4 Dataset Details
SVHN [22] contains 10 classes, where 73257 images are for training and 26032 images are for testing.
STL-10 [6] conatins 10 classes, where 5000 are for training and 8000 are for testing.
Both
CIFAR-10 and CIFAR-100 [20] contain 50000 images for training and 10000 images for testing.
Images of CIFAR-10 belong to one of 10 , whereas images from CIFAR-100 belong to one ofclasses.
SVHN, CIFAR-10, and CIFAR-100 contain images of size 32 × 32 × 3 ; STL-10 contains images of size 96 × 96 × 3 .
A.5 Computing Resources
To run all of our experiments, we use an internal cluster.
Jobs were run on a maximum of 4 NVIDIA
GTX 1080Ti.
A.6 AR Poisoning in ℓ ∞
Autoregressive perturbations can be projected onto any ℓ p -norm ball, including ℓ ∞ .
We initially measured the ℓ 2 -norm because AR perturbations may have single entries which are high and violate a strict ℓ ∞ constraint.
To demonstrate that AR poisoning can work in the ℓ ∞ -norm constrained setting, we train a RN-18 on an AR poison with perturbations satisfying ∥ δ ∥ ∞ = 8255 , and report CIFARtest accuracy in Table 6.
[Table]
Importantly, how one fits an AR perturbation δ within the constraint that ∥ δ ∥ ∞ ≤ ϵ = 8255 affects performance.
In this experiment, we simply scale δ by ϵ ∥ δ ∥ ∞ , which may be suboptimal.
Clipping values or taking the scaled sign of δ would make the perturbation no longer autoregressive.
AR perturbations could likely be optimized to perform better in ℓ ∞ by making modifications to how AR coefficients are compared in Algorithm 1.
A.7 Effect of Optimizer Hyperparameters
To evaluate the effect of optimizer and learning rate on our poisoning results, we train an RN-18 on poisons using different optimizers.
We consider 3 optimizers: SGD, SGD+Momentum ( β = 0 . 9 ) and Adam ( β 1 = 0 .
9 , β 2 = 0 .
We also consider 3 different learning-rate schedules: cosine learning-rate, single-step decay (at epoch 50 ) and multi-step decay (at epochs 50 and 75 ) with decay factor of 0 . 1 .
There are a total of 9 optimizer and learning rate combinations.
[Table]
In Table 7, we report mean CIFAR-10 test accuracy over the 9 combinations of optimizers and learning rates. Our Autoregressive poison remains nearly unaffected by the choice of hyperparameters, and performs better than all other poisons. A.8 Samples of CIFAR-10 Poisons We plot a random sample of 30 poison images from each CIFAR-10 poison used in this work.
In each plot, we also illustrate the corresponding normalized perturbation for each image.
The Error-Max poison is shown in Figure 6, Error-Min poison in Figure 7, Regions-4 poison in Figure 8, Regionspoison in Figure 9, Random Noise poison in Figure 10, and our AR poison is shown in Figure 11.
[Figure]
[Figure]
In Figure 12, we use t-SNE to plot the perturbation vectors of Error-Max, Error-Min, and Autoregressive (AR) poisons.
For every poison CIFAR-10 image, we subtract the corresponding clean image and plot only the perturbation vectors using t-SNE.
We find that the clustering of error-minimizing perturbations appears to be more separable than that of AR. A.10 10 effective AR Processes
On the final pages, we provide coefficients for the 10 effective AR( 8 ) processes which are used to generate the AR poisons for SVHN, CIFAR-10, and STL-10.
Samples of perturbations from these
AR processes are shown in Figure 13. Because we apply a different AR process for each channel in 3 -channel images, there are really 30 AR( 8 ) processes (each 3 × 3 array defines an AR( 8 ) process). Each 3 × 3 × 3 dimensional array defines the three AR processes needed to perturb a 3 -dimensional image from a class. We separate each class’ AR process with a newline.
Note that each 3 × 3 array has a zero in the final entry because there are only 8 AR coefficients when operating in a 3 × 3 sliding window.
A.11 Code
Code for generating AR poisons and training models is available at https://github.com/ psandovalsegura/autoregressive-poisoning .
We provide documentation as well as demo
Jupyter notebooks for generating perturbations using AR processes.
AR coefficients from Appendix A.10 and full poisoned AR datasets used in this work are also available for download.
A.12 Limitations
There are a number of modifications which could potentially make for more effective AR perturbations, the exploration of which we leave to future work.
For example, the size of the sliding window or the order of the AR process could potentially lead to perturbation values which converge more slowly.
A higher order AR process could also be applied along the channel dimension.
As described in Section 3.2, poisoning a K -class classification dataset requires K AR processes.
The random search for AR coefficients is certainly an area of improvement; there may exist more efficient ways of finding effective AR coefficients.
Nevertheless, having found a set of K AR processes, Table 1 is evidence that they can be reused for any other classification dataset with K or fewer classes.
A.13 Broader Impact Statement
While data poisoning could be used as an attack, the research community has actively been interested in its use for privacy protection too.
Our work has the potential to protect private data or to allow for the secure release of datasets.
The likelihood that an adversary is able to perturb an entire dataset for the purpose of preventing generalization to a test set is miniscule.
On the other hand, the likelihood that a private entity might want methods that allow them to release a dataset securely is more likely.
Our work is motivated by understanding the kinds of features that deep neural networks choose to learn.
[Table] [Table]