Data-Efﬁcient Augmentation for Training Neural Networks
Abstract
Data augmentation is essential to achieve state-of-the-art performance in many deep learning applications.
However, the most effective augmentation techniques become computationally prohibitive for even medium-sized datasets.
To address this, we propose a rigorous technique to select subsets of data points that when augmented, closely capture the training dynamics of full data augmentation.
We ﬁrst show that data augmentation, modeled as additive perturbations, improves learning and generalization by relatively enlarging and perturbing the smaller singular values of the network Jacobian, while preserving its prominent directions.
This prevents overﬁtting and enhances learning the harder to learn information.
Then, we propose a framework to iteratively extract small subsets of training data that when augmented, closely capture the alignment of the fully augmented
Jacobian with labels/residuals.
We prove that stochastic gradient descent applied to the augmented subsets found by our approach has similar training dynamics to that of fully augmented data.
Our experiments demonstrate that our method achieves 6.3x speedup on CIFAR10 and 2.2x speedup on SVHN, and outperforms the baselines by up to 10% across various subset sizes.
Similarly, on TinyImageNet and ImageNet, our method beats the baselines by up to 8%, while achieving up to 3.3x speedup across various subset sizes.
Finally, training on and augmenting 50% subsets using our method on a version of CIFAR10 corrupted with label noise even outperforms using the full dataset.
Introduction
Standard (weak) data augmentation transforms the training examples with e.g. rotations or crops for images, and trains on the transformed examples in place of the original training data.
While weak augmentation is effective and computationally inexpensive, strong data augmentation (in addition to weak augmentation) is a key component in achieving nearly all state-of-the-art results in deep learning applications [31].
However, strong data augmentation techniques often increase the training time by orders of magnitude.
First, they often have a very expensive pipeline to ﬁnd or generate more complex transformations that best improves generalization [4, 13, 19, 36].
Second, appending transformed examples to the training data is often much more effective than training on the (strongly or weakly) transformed examples in-place of the original data.
For example, appending one transformed example to the training data is often much more effective than training on two transformed examples in place of every original training data, while both strategies have the same computational cost ( c.f. Appendix
D.6).
Hence, to obtain the state-of-the-art performance, multiple augmented examples are added for every single data point and to each training iteration [12, 36].
In this case, even if producing transformations are cheap, such methods increases the size of the training data by orders of magnitude.
As a result, state-of-the-art data augmentation techniques become computationally prohibitive for even medium-sized real-world problems.
For example, the state-of-the-art augmentation of [36], which appends every example with its highest-loss transformations, increases the training time of
ResNet20 on CIFAR10 by 13x on an Nvidia A40 GPU ( c.f.
Sec. 6).
To make state-of-the-art data augmentation more efﬁcient and scalable, an effective approach is to carefully select a small subset of the training data such that augmenting only the subset provides similar training dynamics to that of full data augmentation.
If such a subset can be quickly found, it would directly lead to a signiﬁcant reduction in storage and training costs.
First, while standard in-place augmentation can be applied to the entire data, the strong and expensive transformations can be only produced for the examples in the subset.
Besides, only the transformed elements of the subset can be appended to the training data.
Finally, when the data is larger than the training budget, one can train on random subsets (with standard in-place augmentation) and augment coresets (by strong augmentation and/or appending transformations) to achieve a superior performance.
Despite the efﬁciency and scalability that it can provide, this direction has remained largely unexplored.
Existing studies are limited to fully training a network and subsampling data points based on their loss or inﬂuence, for augmentation in subsequent training runs [17].
However, this method is prohibitive for large datasets, provides a marginal improvement over augmenting random subsets, and does not provide any theoretical guarantee for the performance of the network trained on the augmented subsets.
Besides, when the data contains mislabeled examples, augmentation methods that select examples with maximum loss, and append their transformed versions to the data, degrade the performance by selecting and appending several noisy labels.
A major challenge in ﬁnding the most effective data points for augmentation is to theoretically understand how data augmentation affects the optimization and generalization of neural networks.
Existing theoretical results are mainly limited to simple linear classiﬁers and analyze data augmentation as enlarging the span of the training data [36], providing a regularization effect [3, 8, 33, 36], enlarging the margin of a linear classiﬁer [28], or having a variance reduction effect [5].
However, such tools do not provide insights on the effect of data augmentation on training deep neural networks.
Here, we study the effect of label invariant data augmentation on training dynamics of overparameterized neural networks.
Theoretically, we model data augmentation by bounded additive perturbations [28], and analyze its effect on neural network Jacobian matrix containing all its ﬁrst-order partial derivatives [1].
We show that label invariant additive data augmentation proportionally enlarges but more importantly perturbs the singular values of the Jacobian, particularly the smaller ones, while maintaining prominent directions of the Jacobian.
In doing so, data augmentation regularizes training by adding bounded but varying perturbations to the gradients.
In addition, it speeds up learning harder to learn information.
Thus, it prevents overﬁtting and improves generalization.
Empirically, we show that the same effect can be observed for various strong augmentations, e.g., AutoAugment [6], CutOut [9], and AugMix [12].
Next, we develop a rigorous method to iteratively ﬁnd small weighted subsets (coresets) that when augmented, closely capture the alignment between the Jacobian of the full augmented data with the label/residual vector.
We show that the most effective subsets for data augmentation are the set of examples that when data is mapped to the gradient space, have the most centrally located gradients.
This problem can be formulated as maximizing a submodular function.
The subsets can be efﬁciently extracted using a fast greedy algorithm which operates on small dimensional gradient proxies, with only a small additional cost.
We prove that augmenting the coresets guarantees similar training dynamics to that of full data augmentation.
We also show that augmenting our coresets achieve a superior accuracy in presence of noisy labeled examples.
We demonstrate the effectiveness of our approach applied to CIFAR10 (ResNet20, WideResNet28-10), CIFAR10-IB (ResNet32), SVHN (ResNet32), noisy-CIFAR10 (ResNet20), Caltech (ResNet18, ResNet50), TinyImageNet (ResNet50), and ImageNet (ResNet50) compared to random and max-loss baselines [17].
We show the effectiveness of our approach (in presence of standard augmentation) in the following cases:
• When producing augmentations is expensive and/or they are appended to the training data:
We show that for the state-of-the-art augmentation method of [36] applied to CIFAR10/ResNet20 it is 3.43x faster to train on the whole dataset and only augment our coresets of size 30%, compared to training and augmenting the whole dataset.
At the same time, we achieve 75% of the accuracy improvement of training on and augmenting the full data with the method of [36], outperforming both max-loss and random baselines by up to 10%.
• When data is larger than the training budget: We show that we can achieve 71.99% test accuracy on ResNet50/ImageNet when training on and augmenting only 30% subsets forepochs.
Compared to AutoAugment [6], despite using only 30% subsets, we achieve 92.8% of the original reported accuracy while boasting 5x speedup in the training time.
Similarly, on Caltech256/ResNet18, training on and augmenting 10% coresets with AutoAugment yields 65.4% accuracy, improving over random 10% subsets by 5.8% and over only weak augmentation by 17.4%.
• When data contains mislabeled examples: We show that training on and strongly augmenting 50% subsets using our method on CIFAR10 with 50% noisy labels achieves 76.20% test accuracy.
Notably, this yields a superior performance to training on and strongly augmenting the full data.
Additional Related Work
Strong data augmentation methods achieve state-of-the-art performance by ﬁnding the set of transformations for every example that best improves the performance.
Methods like AutoAugment [6],
RandAugment [7], and Faster RandAugment [7] search over a (possibly large) space of transformations to ﬁnd sequences of transformations that best improve generalization [6, 7, 21, 36].
Other techniques involve a very expensive pipeline for generating the transformations.
For example, some use Generative Adversarial Networks to directly learn new transformations [2, 21, 24, 29].
Strong augmentations like Smart Augmentation [19], Neural Style Transfer-based [13], and GAN-based augmentations [4] require an expensive forward pass through a deep network for input transformations.
For example, [13] increases training time by 2.8x for training ResNet18 on Caltech256.
Similarly, [36] generates multiple augmentations for each training example, and selects the ones with the highest loss.
Strong data augmentation methods either replace the original example by its transformed version, or append the generated transformations to the training data.
Crucially, appending the training data with transformations is much more effective in improving the generalization performance.
Hence, the most effective data augmentation methods such as that of [36] and AugMix [12] append the transformed examples to the training data.
In Appendix D.6, we show that even for cheaper strong augmentation methods such as AutoAugment [6], while replacing the original training examples with transformations may decrease the performance, appending the augmentations signiﬁcantly improves the performance.
Appending the training data with augmentations, however, increase the training time by orders of magnitude.
For example, AugMix [12] that outperforms AutoAugment increases the training time by at least 3x by appending extra augmented examples, and [36] increases training time by 13x due to appending and forwarding additional augmented examples through the model.
Problem Formulation
We begin by formally describing the problem of learning from augmented data.
Consider a dataset
D train =
( X train , y train ) , where X train = ( x 1 , · · · , x n
) ∈ R d × n is the set of n normalized data points x i ∈ [0 , 1] d , from the index set V , and y train =
( y 1 , · · · , y n ) ∈ { y ∈ { ν 1 , ν 2 , · · · , ν C }} with { ν j } Cj =1 ∈ [0 , 1] .
The additive perturbation model.
Following [28] we model data augmentation as an arbitrary bounded additive perturbation (cid:15) , with (cid:107) (cid:15) (cid:107)≤ (cid:15) 0 .
For a given (cid:15) 0 and the set of all possible transformations A , we study the transformations selected from S ⊆
A satisfying
[Equation]
While the additive perturbation model cannot represent all augmentations, most real-world augmentations are bounded to preserve the regularities of natural images (e.g. AutoAugment [6] ﬁnds that adegree rotation is optimal for CIFAR10).
Thus, under local smoothness of images, additive perturbation can model bounded transformations such as small rotations, crops, shearing, and pixel-wise transformations like sharpening, blurring, color distortions, structured adversarial perturbation [21].
As such, we see the effects of additive augmentation on the singular spectrum holds even under real-world augmentation settings ( c.f. Fig.
3 in the Appendix).
However, this model is indeed limited when applied to augmentations that cannot be reduced to perturbations, such as horizontal/vertical ﬂips and large translations.
We extend our theoretical analysis to augmentations modeled as arbitrary linear transforms (e.g. as mentioned, horizontal ﬂips) in Appendix B.5.
The set of augmentations at iteration t generating r augmented examples per data point can be speciﬁed, with abuse of notation, as D taug = { (cid:83) ri =
( T ti ( X train ) , y train ) } , where |D taug | = rn and
T ti ( X train ) transforms all the training data points with the set of transformations T ti ⊂ S at iteration t .
We denote X taug = { (cid:83) ri =1 T ti ( X train ) } and y taug = { (cid:83) ri =1 y train } .
Training on the augmented data.
Let f ( W , x ) be an arbitrary neural network with m vectorized (trainable) parameters W ∈ R m .
We assume that the network is trained using (stochastic) gradient descent with learning rate η to minimize the squared loss L over the original and augmented training examples D t = {D train ∪ D taug } with associated index set V t , at every iteration t .
I.e.,
[Equation]
The gradient update at iteration t is given by
[Equation]
) where X t = { X train ∪ X taug } and y t = { y train ∪ y taug } are the set of original and augmented examples and their labels, J ( W , X ) ∈ R n × m is the Jacobian matrix associated with f , and r t
= f
( W t , X ) − y is the residual.
We further assume that J is smooth with Lipschitz constant L .
I.e., (cid:107)J ( W , x i ) −J ( W , x j ) (cid:107)≤
L (cid:107) x
i − x j (cid:107) ∀ x i , x j ∈ X .
Thus, for any transformation T j ∈ S , we have (cid:107)J ( W , x i ) −
J ( W , T j ( x i ))
(cid:107)≤ L(cid:15) 0 .
Finally, denoting J = J ( W , X train ) and ˜ J
= J ( W ,T j ( X train )) ,we get ˜ J
= J + E , where E is the perturbation matrix with (cid:107) E (cid:107) 2 ≤(cid:107)
E (cid:107) F ≤√ nL(cid:15) 0 .
Data Augmentation Improves Learning
In this section, we analyze the effect of data augmentation on training dynamics of neural networks, and show that data augmentation can provably prevent overﬁtting.
To do so, we leverage the recent results that characterize the training dynamics based on properties of neural network Jacobian and the corresponding Neural Tangent Kernel (NTK) [14] deﬁned as Θ = J ( W , X ) J
( W , X ) T .
Formally: r t = n (cid:88) i = [Equation] [Equation] ηλ
[Equation] [Equation] Ti [Equation]
= n (cid:88) i = (
[Equation]
[Equation]
[Equation]
u Ti
[Equation]
(4) where Θ = U Λ U T
= (cid:80) i =
λ i u
i
u
Ti is the eigendecomposition of the NTK [1].
Although the constant NTK assumption holds only in the inﬁnite width limit, [18] found close empirical agreement between the NTK dynamics and the true dynamics for wide but practical networks, such as wide
ResNet architectures [37].
Eq.
(4) shows that the training dynamics depend on the alignment of the
NTK with the residual vector at every iteration t .
Next, we prove that for small perturbations (cid:15) 0 , data augmentation prevents overﬁtting and improves generalization by proportionally enlarging and perturbing smaller eigenvalues of the NTK relatively more, while preserving its prominent directions.
4.1 Effect of Augmentation on Eigenvalues of the NTK
We ﬁrst investigate the effect of data augmentation on the singular values of the Jacobian, and use this result to bound the change in the eigenvalues of the NTK.
To characterize the effect of data augmentation on singular values of the perturbed Jacobian ˜ J , we rely on Weyl’s theorem [35] stating that under bounded perturbations E , no singular value can move more than the norm of the perturbations.
Formally, | ˜ σ i − σ i |≤ (cid:107) E (cid:107) 2 , where ˜ σ i and σ i are the singular values of the perturbed and original Jacobian respectively.
Crucially, data augmentation affects larger and smaller singular values differently.
Let P be orthogonal projection onto the column space of J T , and
P ⊥ =
I − P be the projection onto its orthogonal complement subspace.
Then, the singular values of the perturbed
[Figure]
Jacobian ˜ J T are ˜
[Equation]
2 i , where | µ i |≤ (cid:107) P E (cid:107) 2 , and σ min ( P ⊥ E
[Equation]
≤ ζ i ≤ [Equation] P ⊥ E (cid:107) 2 , σ min the smallest singular value of J T [32].
Since the eigenvalues of the projection matrix P are either 0 or 1, as the number of dimensions m grows, for bounded perturbations we get that on average µ 2 i
= O (1) and ζ 2 i
= O ( m ) .
Thus, the second term dominates and increase of small singular values under perturbation is proportional to √ m .
However, for larger singular values, ﬁrst term dominates and hence ˜
σ i − σ i ∼ = µ i .
Thus in general, small singular values can become proportionally larger, while larger singular values remain relatively unchanged.
The following Lemma characterizes the expected change to the eignvalues of the NTK.
Lemma 4.1.
Data augmentation as additive perturbations bounded by small (cid:15) 0 results in the following expected change to the eigenvalues of the NTK:
[Equation] [Equation]
where p i := P ( ˜ σ i − σ i < 0) is the probability that σ i decreases as a result of data augmentation, and is smaller for smaller singular values.
The proof can be found in Appendix A.1.
Next, we discuss the effect of data augmentation on singular vectors of the Jacobian and show that it mainly affects the non-prominent directions of the Jacobian spectrum, but to a smaller extent compared to the singular values.
4.2 Effect of Augmentation on Eigenvectors of the NTK
Here, we focus on characterizing the effect of data augmentation on the eigenspace of the NTK.
Let the singular subspace decomposition of the Jacobian be J = U Σ V T .
Then for the NTK, we have Θ =
J J T =
U Σ V T V Σ U T =
U Σ 2 U T (since V T V = I ).
Hence, the perturbation of the eigenspace of the NTK is the same as perturbation of the left singular subspace of the Jacobian J .
Suppose σ i are singular values of the Jacobian.
Let the perturbed Jacobian be ˜
J = J + E , and denote the eigengap γ
= min { σ i − σ i
+1 :
i = 1 , · · · , r } where σ r +1 := 0 .
Assuming γ 0 ≥ 2 (cid:107) E (cid:107) 2 , a combination of Wedin’s theorem [34] and Mirsky’s inequality [23] implies
[Equation]
This result provides an upper-bound on the change of every left singular vectors of the Jacobian.
However as we discuss below, data augmentation affects larger and smaller singular directions differently.
To see the effect of data augmentation on every singular vectors of the Jacobian, let the subspace decomposition of Jacobian be J = U Σ V T
=
U s Σ s V
Ts + U n Σ n V Tn , where U s associated with nonzero singular values, spans the column space of J , which is also called the signal subspace, and U n , associated with zero singular values ( Σ n = 0 ), spans the orthogonal space of U s , which is also called the noise subspace.
Similarly, let the subspace decomposition of the perturbed Jacobian be ˜ J
=
˜
U ˜ Σ
˜ V T = ˜
U s ˜ Σ s ˜ V T s + ˜ U n ˜ Σ n ˜ V T n , and ˜ U s =
U s + ∆ U s , where ∆ U s is the perturbation of the singular vectors that span the signal subspace.
Then the following general ﬁrst-order expression for the perturbation of the orthogonal subspace due to perturbations of the
Jacobian characterize the change of the singular directions:
∆ U s =
U n U Tn EV s Σ − 1 s [20].
We see that singular vectors associated to larger singular values are more robust to data augmentation, compared to others.
Note that in general singular vectors are more robust than singular values.
Fig.
1 shows the effect of perturbations with (cid:15)
= 8 , 16 on singular values and singular vectors of the
Jacobian matrix for a 1 hidden layer MLP trained on MNIST, and ResNet20 trained on CIFAR10.
As calculating the entire Jacobian spectrum is computationally prohibitive, data is subsampled fromclasses.
We report the effect of other real-world augmentation techniques, such as random crops, ﬂips, rotations and Autoaugment [6] - which includes translations, contrast, and brightness transforms - in
Appendix C. We observe that data augmentation increases smaller singular values relatively more.
On the other hand, it affects prominent singular vectors of the Jacobian to a smaller extent.
4.3 Augmentation Improves Training & Generalization
Recent studies have revealed that the Jacobian matrix of common neural networks is low rank.
That is there are a number of large singular values and the rest of the singular values are small.
Based on this, the Jacobian spectrum can be divided into information and nuisance spaces [27].
Information space is a lower dimensional space associated with the prominent singular value/vectors of the Jacobian.
Nuisance space is a high dimensional space corresponding to smaller singular value/vectors of the
Jacobian.
While learning over information space is fast and generalizes well, learning over nuisance space is slow and results in overﬁtting [27].
Importantly, recent theoretical studies connected the generalization performance to small singular values (of the information space)
Our results show that label-preserving additive perturbations relatively enlarge the smaller singular values of the Jacobian in a stochastic way and with a high probability.
This beneﬁts generalization in 2 ways.
First, this stochastic behavior prevents overﬁtting along any particular singular direction in the nuisance space , as stochastic perturbation of the smallest singular values results in a stochastic noise to be added to the gradient at every training iteration.
This prevents overﬁtting (thus a larger training loss as shown in Appendix D.5), and improves generalization [7, 8].
Theorem B.1 in the Appendix characterizes the expected training dynamics resulted by data augmentation.
Second, additive perturbations improve the generalization by enlarging the smaller (useful) singular values that lie in the information space , while preserving eigenvectors.
Hence, it enhances learning along these (harder to learn) components.
The following Lemma captures the improvement in the generalization performance, as a result of data augmentation.
Lemma 4.2.
Assume gradient descent with learning rate η is applied to train a neural network with constant NTK and Lipschitz constant L , on data points augmented with additive perturbations bounded by (cid:15) 0 as deﬁned in Sec.
Let σ min be the minimum singular value of Jacobian J associated with training data X train .
With probability 1 − δ , generalization error of the network trained with gradient descent on augmented data X aug enjoys the following bound:
[Equation]
The proof can be found in Appendix A.2.
Effective Subsets for Data Augmentation
Here, we focus on identifying subsets of data that when augmented similarly improve generalization and prevent overﬁtting.
To do so, our key idea is to ﬁnd subsets of data points that when augmented, closely capture the alignment of the NTK (or equivalently the Jacobian) corresponding to the full augmented data with the residual vector, J ( W t , X taug ) T r taug .
If such subsets can be found, augmenting only the subsets will change the NTK and its alignment with the residual in a similar way as that of full data augmentation, and will result in similar improved training dynamics.
However, generating the full set of transformations X taug is often very expensive, particularly for strong augmentations and large datasets.
Hence, generating the transformations, and then extracting the subsets may not provide a considerable overall speedup.
In the following, we show that weighted subsets (coresets) S that closely estimate the alignment of the
Jacobian associated to the original data with the residual vector J T ( W t , X train ) r train can closely estimate the alignment of the Jacobian of the full augmented data and
the corresponding residual
J T ( W t , X taug ) r taug .
Thus, the most effective subsets for augmentation can be directly found from the training data.
Formally, subsets S t ∗ weighted by γ tS that capture the alignment of the full Jacobian
Require: The dataset D = { ( x i , y i ) } ni =1 , number of iterations T .
Ensure: Output model parameters W T .
1: for t = 1 , · · · , T do 2:
X taug = ∅ .
3: for c ∈ { 1 , · · · , C } do 4:
S tc = ∅ , [ G S tc ] i. =
c 1 1 ∀ i .
5: while (cid:107) G S tc (cid:107) F ≥ ξ do (cid:46) Extract a coreset from class c by solving Eq.
S tc = { S tc ∪ arg max s ∈ V \ S tc ( (cid:107) G S tc (cid:107) F −(cid:107) G { S tc ∪{ s }} (cid:107) F ) } 7: end while 8: γ j = (cid:80) i ∈
V c I [ j =arg min j (cid:48) ∈ S (cid:107)J T ( W t , x i ) r
i −J T ( W t , x j (cid:48) )
r j (cid:48) (cid:107) ]
(cid:46)
Coreset weights 9:
X taug = { X aug ∪ {∪ ri =1 T ti ( X S tc ) }} (cid:46) Augment the coreset 10: ρ tj = γ tj /r 11: end for 12:
Update the parameters W t using weighted gradient descent on X taug or { X train ∪ X taug } .
13: end for with the residual by an error of at most ξ can be found by solving the following optimization problem:
[Equation]
Solving the above optimization problem is NP-hard.
However, as we discuss in the Appendix A.5, a near optimal subset can be found by minimizing the Frobenius norm of a matrix G S , in which the i th row contains the euclidean distance between data point i and its closest element in the subset S , in the gradient space.
Formally, [ G S ] i. =
min j (cid:48) ∈ S (cid:107)J T ( W t , x i ) r i − J T ( W t , x j (cid:48) )
r j (cid:48) (cid:107) .
When S = ∅ , [ G S ] i. = c 1 1 , where c 1 is a big constant.
Intuitively, such subsets contain the set of medoids of the dataset in the gradient space.
Medoids of a dataset are deﬁned as the most centrally located elements in the dataset [16].
The weight of every element j ∈ S is the number of data points closest to it in the gradient space, i.e., γ
[Equation]
=
[Equation]
The set of medoids can be found by solving the following submodular 3 cover problem:
[Equation]
The classical greedy algorithm provides a logarithmic approximation for the above submodular maximization problem, i.e., | S |≤ (1 + ln ( n )) .
It starts with the empty set S 0 = ∅ , and at each iteration τ , it selects the training example s ∈ V \ S τ − 1 that maximizes the marginal gain, i.e.,
S
[Equation]
=
[Equation]
s
[Equation] [Equation]
G S
[Equation]
1 (cid:107) F −(cid:107) G { S
[Equation]
− 1 ∪{ s }} (cid:107) F ) } .
The O ( nk ) computational complexity of the greedy algorithm can be reduced to O ( n ) using randomized methods [25] and further improved using lazy evaluation [22] and distributed implementations [26].
The rows of the matrix G can be efﬁciently upper-bounded using the gradient of the loss w.r.t.
the input to the last layer of the network, which has been shown to capture the variation of the gradient norms closely [15].
The above upper-bound is only marginally more expensive than calculating the value of the loss.
Hence the subset can be found efﬁciently.
Better approximations can be obtained by considering earlier layers in addition to the last two, at the expense of greater computational cost.
At every iteration t during training, we select a coreset from every class c ∈
[ C ] separately, and apply the set of transformations { T ti } ri =1 only to the elements of the coresets, i.e., X taug = {∪ ri =1 T ti ( X S t ) } .
We divide the weight of every element j in the coreset equally among its transformations, i.e. the ﬁnal weight ρ tj = γ tj /r if j ∈ S t .
We apply the gradient descent updates in Eq.
(3) to the weighted
Jacobian matrix of X t = X taug or X t
=
{ X train ∪ X taug } (viewing ρ t as ρ t ∈ R n ) as follows:
[Equation]
The pseudocode is illustrated in Alg. 1.
The following Lemma upper bounds the difference between the alignment of the Jacobian and residual for augmented coreset vs. full augmented data.
[Table]
Lemma 5.1.
Let S be a coreset that captures the alignment of the full data NTK with residual with an error of at most ξ as in Eq. 8.
Augmenting the coreset with perturbations bounded by (cid:15) 0 ≤ n 32 √ L captures the alignment of the fully augmented data with the residual by an error of at most
[Equation]
5.1 Coreset vs. Max-loss
Data Augmentation
In the initial phase of training the NTK goes through rapid changes.
This determines the ﬁnal basin of convergence and network’s ﬁnal performance [10].
Regularizing deep networks by weight decay or data augmentation mainly affects this initial phase and matters little afterwards [11].
Crucially, augmenting coresets that closely capture the alignment of the NTK with the residual during this initial phase results in less overﬁtting and improved generalization performance.
On the other hand, augmenting points with maximum loss early in training decreases the alignment between the NTK and the label vector and impedes learning and convergence.
After this initial phase when the network has good prediction performance, the gradients for majority of data points become small.
Here, the alignment is mainly captured by the elements with the maximum loss.
Thus, as training proceeds, the intersection between the elements of the coresets and examples with maximum loss increases.
We visualize this pattern in Appendix D.11.
The following Theorem characterizes the training dynamics of training on the full data and the augmented coresets, using our additive perturbation model.
Theorem 5.2.
Let L i be β -smooth, L be λ -smooth and satisfy the α -PL condition, that is for α > 0 , (cid:107)∇L ( W ) (cid:107) 2 ≥ α L ( W ) for all weights W .
Let f be Lipschitz in X with constant L (cid:48) , and ¯
L = max { L, L (cid:48) } .
Let G 0 be the gradient at initializaion, σ max the maximum singular value of the coreset Jacobian at initialization.
Choosing (cid:15) 0 ≤ 1 σ max √ ¯ Ln and running SGD on full data with augmented coreset using constant step size η = αλβ , result in the following bound:
[Equation]
The proof can be found in Appendix A.4.
Theorem 5.2 shows that training on full data and augmented coresets converges to a close neighborhood of the optimal solution, with the same rate as that of training on the fully augmented data.
The size of the neighborhood depends on the error of the coreset ξ in Eq.
(8), and the error in capturing the alignment of the full augmented data with the residual derived in Lemma 5.1.
The ﬁrst term decrease as the size of the coreset grows, and the second term depends on the network structure.
We also analyze convergence of training only on the augmented coresets, and augmentations modelled as arbitrary linear transformations using a linear model [36] in Appendix B.5.
Experiments
Setup and baselines.
We extensively evaluate the performance of our approach in three different settings.
Firstly, we consider training only on coresets and their augmentations.
Secondly, we investigate the effect of adding augmented coresets to the full training data.
Finally, we consider adding augmented coresets to random subsets.
We compare our coresets with max-loss and random subsets as baselines.
For all methods, we select a new augmentation subset every R epochs.
We note that the original max-loss method [17] selects points using a fully trained model, hence it can only
[Table] [Table]
[Table]
select one subset throughout training.
To maximize fairness, we modify our max-loss baseline to select a new subset at every subset selection step.
For all experiments, standard weak augmentations (random crop and horizontal ﬂips) are always performed on both the original and strongly augmented data.
6.1 Training on Coresets and their Augmentations
First, we evaluate the effectiveness of our approach for training on the coresets and their augmentations.
Our main goal here is to compare the performance of training on and augmenting coresets vs. random and max-loss subsets.
Tab. 1 shows the test accuracy for training ResNet20 and Wide-ResNet on CIFAR10 when we only train on small augmented coresets of size 0 .
1% to 1% selected at every epoch ( R = 1 ), and training ResNet18 on Caltech256 using coresets of size 5% to 50% with R = 5 .
We see that the augmented coresets outperform augmented random subsets by a large margin, particularly when the size of the subset is small.
On Caltech256/ResNet18, training on and augmenting 10% coresets yields 65.4% accuracy, improving over random by 5.8%, and over only weak augmentation by 17.4%.
This clearly shows the effectiveness of augmenting the coresets.
Note that for CIFAR experiments, training on the augmented max-loss points did not even converge in absence of full data.
Generalization across augmentation techniques.
We note that our coresets are not dependent on the type of data augmentation.
To conﬁrm this, we show the superior generalization performance of our method in Tab. 2 for training ResNet18 with R = 5 on coresets vs. random subsets of Caltech256, augmented with CutOut [9], AugMix [12], and noise perturbations (color jitter, gaussian blur).
For example, on 30% subsets, we obtain 28.2%, 29.3%, 20.2% relative improvement over augmenting random subsets when using CutOut, AugMix, and noise perturbation augmentations, respectively.
6.2 Training on Full Data and Augmented Coresets
Next, we study the effectiveness of our method for training on full data and augmented coresets.
Tab. 4 demonstrates the percentage of accuracy improvement resulted by augmenting subsets of size 5%, 10%, and 30% selected from our method vs. max-loss and random subsets, over that of full data augmentation.
We observe that augmenting coresets effectively improves generalization, and outperforms augmenting random and max-loss subsets across different models and datasets.
For example, on 30% subsets, we obtain 13.1% and 2.3% relative improvement over random and max-loss on average.
We also report results on TinyImageNet/ResNet50 ( R =15 ) in Tab. 3, where we show that augmenting coresets outperforms max-loss and random baselines, e.g. by achieving 3.7% and 4.4% relative improvement over 30% max-loss and random subsets, respectively.
Training speedup.
In Fig.
2, we measure the improvement in training time in the case of training on full data and augmenting subsets of various sizes.
While our method yields similar or slightly lower speedup to the max-loss and random baselines, our resulting accuracy outperforms the baselines on average.
For example, for SVHN/Resnet32 using 30% coresets, we sacriﬁce 11% of the relative speedup to obtain an additional 24 .
8% of the relative gain in accuracy from full data augmentation, compared to random baseline.
Notably, we get 3.43x speedup for training on full data and augmenting
[Table]
[Figure]
Augmenting noisy labeled data.
Next, we evaluate the robustness of our coresets to label noise.
Tab. 5 shows the result of augmenting coresets vs. max-loss and random subsets of different sizes selected from CIFAR10 with 50% label noise on ResNet20.
Notably, our method not only outperforms max-loss and random baselines, but also achieves superior performance over full data augmentation.
6.3 Training on Random Data and Augmented Coresets
Finally, we evaluate the performance of our method for training on random subsets and augmenting coresets, applicable when data is larger than the training budget.
We report results on TinyImageNet and ImageNet on ResNet50 (90 epochs, R = 15 ).
Tab. 6 shows the results of training on random subsets, and augmenting random subsets and coresets of the same size.
We see that our results hold for large-scale datasets, where we obtain 7 . 9% , 4 .
9% , and 5 .
3% relative improvement over random baseline with 10% , 20% , 30% subset sizes respectively on TinyImageNet, and 7 . 6% , 2 .
3% , and 1 .
3% relative improvement over random baseline with 10% , 30% , and 50% subset sizes on
ImageNet.
Notably, compared to AutoAugment, despite using only 30% subsets, we achieve 71.99% test accuracy, which is 92.8% of the original reported accuracy, while boasting 5x speedup in training.
[Table]
Conclusion
We showed that data augmentation improves training and generalization by relatively enlarging and perturbing the smaller singular values of the neural network Jacobian while preserving its prominent directions.
Then, we proposed a framework to iteratively extract small coresets of training data that when augmented, closely capture the alignment of the fully augmented Jacobian with the label/residual vector.
We showed the effectiveness of augmenting coresets in providing a superior generalization performance when added to the full data or random subsets, in presence of noisy labels, or as a standalone subset.
Under local smoothness of images, our additive perturbation can be applied to model many bounded transformations such as small rotations, crops, shearing, and pixel-wise transformations like sharpening, blurring, color distortions, structured adversarial perturbation [21].
However, the additive perturbation model is indeed limited when applied to augmentations that cannot be reduced to perturbations, such as horizontal/vertical ﬂips and large translations.
Further theoretical analysis of complex data augmentations is indeed an interesting direction for future work.
Acknowledgements
This research was supported in part by the National Science Foundation CAREER Award 2146492, and the UCLA-Amazon Science Hub for Humanity and AI.