Source-linked AI summary
Gradient Regularization Improves Accuracy of Discriminative Models
Dániel Varga, Adrián Csiszárik, Zsolt Zombori
TL;DR
Gradient regularization has often been applied to adversarial robustness, while its use for classification accuracy—especially with small training sets—is the focus here. The paper presents Jacobian-based regularizers, including Spectral Regularization, and reports improved accuracy and globally controlled gradients beyond training points. It also identifies input-space focus and limited understanding of the interaction with stochastic gradient descent as boundaries for further work.
Problem
Recent gradient-regularization applications focus on adversarial robustness, while its potential for improving classification accuracy, especially with small training sets, is the question addressed here.
Source: §1 · p. 1Method
The paper presents a unified class of Jacobian-based regularizers and focuses on Double Backpropagation and the proposed Spectral Regularizer.
Source: §1 · p. 1Results
Takeaways & Limitations
Spectral Regularization is identified as the most promising gradient-regularization variant, and the authors note that it can be applied to unlabeled inputs in a semi-supervised setting.
Source: §5 · p. 9
Abstract
from arXiv · showhide
Regularizing the gradient norm of the output of a neural network with respect to its inputs is a powerful technique, rediscovered several times. This paper presents evidence that gradient regularization can consistently improve classification accuracy on vision tasks, using modern deep neural networks, especially when the amount of training data is small. We introduce our regularizers as members of a broader class of Jacobian-based regularizers. We demonstrate empirically on real and synthetic data that the learning process leads to gradients controlled beyond the training points, and results in solutions that generalize well.
1 INTRODUCTION
The paper frames gradient regularization as a broad Jacobian-based approach for improving classification accuracy, particularly with small training sets. It focuses on Double Backpropagation and the proposed Spectral Regularizer, while noting that input-space regularization does not address latent-space metrics.
1 INTRODUCTION
- Gradient-norm regularization predates this paper, with roots in Double Backpropagation and related ideas independently rediscovered over time.The paper also connects it to Sobolev regularization and smoothing splines.Source: §1 · p. 1
- Gradient regularization is presented as a way to increase classification accuracy, especially when training data are limited.The authors argue that recent applications have focused more on adversarial robustness.Source: §1 · p. 1
- The paper develops a unified framework for Jacobian-based regularizers that penalize large output changes to enforce a smoothness prior.The regularization can be applied to different variants, including Double Backpropagation and Spectral Regularization.Source: §1 · p. 1
- The two highlighted variants are Double Backpropagation, whose value for modern deep architectures was underappreciated, and Spectral Regularization, proposed by the authors for more complex datasets.The authors characterize Spectral Regularization as the most promising variant for those datasets.Source: §1 · p. 1
- Input-space gradient regularization focuses on the input metric rather than latent-space metrics, a limitation the authors identify as future work.They suggest regularizing gradients with respect to hidden layers as a possible direction.Source: §1 · p. 1
- Experiments on real and synthetic tasks find that stochastic gradient descent rarely reaches locally optimal but globally unproductive solutions, instead producing solutions that generalize well.Despite controlling gradients only at training points, the learning process can lead to globally controlled gradients.Source: §1 · pp. 1–2
2 ANALYSIS
The analysis unifies gradient penalties as Jacobian-based regularizers and compares where they are applied. It analyzes how gradient location affects regularization and how random projections make Jacobian penalties computationally tractable.
2.1 GRADIENT REGULARIZATON SCHEMES
- Gradient regularizers differ by whether they penalize loss, probability, or logit gradients; SpectReg randomly projects the logits Jacobian, while FrobReg penalizes its Frobenius norm.DoubleBack penalizes the loss-gradient norm, whereas JacReg penalizes the probability Jacobian’s squared Frobenius norm.Source: §2.1 · p. 2
2.2 STARTING FROM THE LINEAR CASE
- For a single dense linear layer, FrobReg equals L2 weight decay and SpectReg estimates weight decay; in dense ReLU networks, Jacobian regularization is more data-targeted.The analysis also connects Frobenius-norm regularization to a Lipschitz-like property, while noting equivalent norms can yield different behavior.Source: §2.2 · p. 3
2.3 CHOOSING WHERE THE GRADIENT IS COMPUTED
- As networks converge, probability-based JacReg vanishes while logit-based FrobReg and SpectReg persist; experiments report that FrobReg and SpectReg consistently outperform JacReg.Logit-based regularization is also reported as more robust to hyperparameter choice.Source: §2.3 · pp. 3–4
2.4 COMPUTATIONALLY EFFICIENT REGULARIZATION OF THE JACOBIAN
- Projection-based variants avoid the label-scaled cost of FrobReg/JacReg; spherical SpectReg unbiasedly estimates the squared Frobenius norm of the Jacobian.The unnormalized SpectReg estimator has the same property up to constant scaling.Source: §2.4 · p. 4
3 RELATED WORK
Related work traces input-gradient regularization to early neural-network methods and surveys its variants. It contrasts Jacobian, adversarial, Sobolev, and spectral-norm approaches, while connecting input sensitivity with generalization.
3 RELATED WORK
- Drucker & LeCun (1991) introduced Double Backpropagation, while Simard et al. (1991) used TangentProp to control changes along directions tied to selected invariances.TangentProp can promote rotational invariance using the direction of infinitesimal rotation in pixel space.Source: §3 · p. 4
Jacobian Regularization
- Sokolic et al. (2017) regularize the input Jacobian of softmax outputs, using layer-wise Frobenius regularization for larger networks for performance reasons.Gu & Rigazio (2014) also used layer-wise Frobenius-norm regularization.Source: §3 · p. 4
Robustness to adversarial examples
- Ororbia II et al. (2017) proposed DataGrad, which approximates Double Backpropagation with finite differences and improves robustness to adversarial sampling.Slavin Ross & Doshi-Velez (2017) used symbolically computed Double Backpropagation to improve interpretability and robustness against adversarial noise.Source: §3 · p. 4
Sobolev training
- Czarnecki et al. (2017) studied gradient-informed Sobolev training for distillation and synthetic gradients; this paper reports benefits from pushing gradient norms toward zero without an oracle.Source: §3 · p. 4
Spectral norm regularization
- Yoshida & Miyato (2017) penalize an upper bound on network spectral norm globally, whereas this approach regularizes inputs specifically on the data manifold.The passage notes that the global upper bound may be far from the actual spectral norm.Source: §3 · p. 5
Sensitivity and generalization
- Novak et al. (2018) found that better-generalizing networks tend to have smaller input-Jacobian Frobenius norms, strengthening the motivation for gradient regularization.Source: §3 · p. 5
4 EXPERIMENTS
Experiments on reduced-data vision and synthetic tasks find that DoubleBack and SpectReg improve classification accuracy, with DoubleBack stronger on MNIST and SpectReg on more complex datasets.
4 EXPERIMENTS
- SpectReg and DoubleBack consistently improve baseline accuracy across image-classification datasets when training data is restricted; DoubleBack performs better on MNIST, while SpectReg performs better on more complex datasets.Source: §4 · p. 5
4.1 WEIGHT DECAY AND GRADIENT REGULARIZATION
- On small MNIST, gradient regularization adds more accuracy gain than weight decay, while weight decay matters more on small CIFAR-10/100; SpectReg is the most robust regularizer.DoubleBack slightly outperformed other variants on MNIST in exploratory experiments, but was not tuned to rival SpectReg on CIFAR.Source: §4.1 · p. 5
4.2 GRADIENT REGULARIZATION COMPARED WITH DROPOUT AND BATCH NORMALIZATION
- On small MNIST, DoubleBack and SpectReg each beat Dropout or Batch Normalization alone, and combining Dropout with DoubleBack gives the best result.The MNIST baseline in this comparison uses weight decay only.Source: §4.2 · pp. 5–6, Table 2 · p. 6
4.3 GRADIENT REGULARIZATION VERSUS CONFIDENCE PENALTY
- On small MNIST, DoubleBack performs best and Confidence Penalty gains add with gradient regularization; on small CIFAR-10/100, SpectReg clearly dominates.The paper reports the additive benefits on MNIST and the SpectReg comparison on CIFAR-10/100 separately.Source: Table 3 · p. 6, §4.3 · p. 6, Table 4 · p. 6
4.4 THE EFFECT OF TRAINING SET SIZE
- DoubleBack performs best across MNIST training sizes and regularization remains beneficial up to 20,000 points; SpectReg's advantage over CP fades as data grows.JacReg is consistently worse than its peers.Source: §4.4 · p. 6, Figure 1 · p. 7
4.5 SCALING WITH THE NUMBER OF LABELS
- Gradient regularization works on TinyImageNet-200, and its effect does not fade across 10–200 labels; SpectReg benefits with either 10 or 200 projected rows.The paper reports this projected-row range specifically for SpectReg.Source: §4.5 · p. 6, Table 5 · p. 7
4.6 APPROXIMATING THE FROBENIUS NORM OF THE JACOBIAN DOES NOT DECREASE ACCURACY
- Randomly projecting the logits Jacobian reduces computational burden without reducing accuracy, and logits-based control is more beneficial than probability-based control.On small MNIST, SpectReg ranked best, but after Bonferroni correction only its difference from JacReg was statistically significant.Source: §4.6 · p. 7, Table 6 · p. 7
4.7 LOCAL GRADIENT CONTROL DOES NOT LEAD TO PATHOLOGICAL GRADIENT LANDSCAPE
- Despite training-point-only control, SGD yielded globally smoother functions rather than pathological gradients; tests indicate optimization, not network bandwidth, blocked step-like solutions.On SIN, increasing SpectReg weight smoothened the function globally even though gradients were controlled at 100 training points.Source: §4.7 · p. 8, Figure 2 · p. 8
5 CONCLUSION, FUTURE WORK
The paper presents evidence that gradient regularization can improve classification accuracy, especially with small training sets, and identifies SpectReg as its most promising variant. It also reports globally controlled gradients beyond training points and outlines directions for future work.
5 CONCLUSION, FUTURE WORK
- SpectReg is the most promising gradient-regularization variant, and the paper presents evidence that gradient regularization can improve accuracy, especially with smaller training sets.The conclusion reports this after comparing SpectReg with other gradient-regularization schemes.Source: §5 · p. 9
- Despite controlling gradients only at training points, stochastic gradient descent converges to solutions with globally controlled gradients and smoother data manifolds, even with very small training sets.Source: §5 · p. 9
- Future work includes applying SpectReg to unlabeled inputs, investigating gradients with respect to hidden activations, and better understanding its interaction with stochastic gradient descent.Source: §5 · p. 9
- The authors note that a full theory of gradient regularization’s counterintuitive interaction with stochastic gradient descent may remain out of sight.Source: §5 · p. 9
APPENDIX A TENSORFLOW IMPLEMENTATION OF DOUBLEBACK AND SPECTREG
The appendix presents full TensorFlow implementations of DoubleBack and SpectReg, and notes that modern tensor libraries make gradient-regularization terms easy and fast to calculate and implement.
APPENDIX A TENSORFLOW IMPLEMENTATION OF DOUBLEBACK AND SPECTREG
- Figure 4 shows the full TensorFlow implementations of the DoubleBack and SpectReg regularizers.Source: Appendix A · p. 12, Figure 4 · p. 12
- Modern tensor libraries make gradient-regularization terms easy and fast to calculate and implement.Source: Appendix A · p. 12
APPENDIX B IMPLEMENTED NETWORKS
The appendix reports the model and training configurations used for MNIST, CIFAR-10/CIFAR-100, and TinyImageNet-200, along with regularizer-weight selection by grid search.
APPENDIX B IMPLEMENTED NETWORKS
- For each regularizer, dataset, and training-set size, the optimal weight is selected by grid search over specified intervals.The intervals are DataGrad [0.0003, 100], SpectReg [0.0001, 1], JacReg [0.0001, 1], and CP [0.0001, 1]; other hyperparameters are grid-searched for the baseline and reused as good choices for regularized models.Source: Appendix B · p. 12
B.1 MNIST
- The MNIST baseline is a 61,706-parameter LeNet-5 variant, achieving 99.1% test accuracy on the full dataset without augmentation.It uses maxpooling, ReLU activations, and dropout after the dense hidden layer.Source: §B.1 · p. 12
B.2 CIFAR-10, CIFAR-100
- The CIFAR-10/CIFAR-100 model is a roughly 2.5-million-parameter, three-level ResNet, trained for 50,000 SGD iterations with momentum and weight decay.On the full augmented CIFAR-10 training set, it achieves 93.71% test accuracy.Source: §B.2 · p. 12
B.3 TINYIMAGENET-200
- TinyImageNet-200 uses an approximately 11.3-million-parameter ResNet-18 modified for 200 labels, trained for 75 epochs with Adam.The four levels use 64, 128, 256, and 512 filters; the learning rate is divided by 10 after epochs 25 and 50.Source: §B.3 · pp. 12–13
B.4 SIN
The SIN experiment uses noisy samples of a sine function to visualize learned functions and assess behavior on a clean evaluation grid. Its baseline is a five-layer ReLU MLP.
B.4 SIN
- SIN is generated from f(x) = sin(5x), with 100 uniformly sampled training points from [−1, 1] and Gaussian output noise with σ = 0.1.Source: §B.4 · p. 13
- Evaluation uses 900 fixed grid points over the same [−1, 1] domain with uncorrupted outputs; the added noise highlights how training-set overfitting can damage test performance.Source: §B.4 · p. 13
- The SIN baseline is an MLP with five dense layers of 64 ReLU neurons, followed by a single linear output neuron.Source: §B.4 · p. 13
APPENDIX C EXPERIMENT SPECIFIC HYPERPARAMETERS
Appendix C lists tuned regularizer weights across datasets, methods, and training-set sizes. The reported settings vary by dataset and by whether weight decay is used.
C.1 4.1
- MNIST uses SpectReg weights 0.03 without weight decay and 0.05 with weight decay (0.0005); DataGrad is 50 in both settings.Source: §C.1 · p. 13
- CIFAR-10 uses SpectReg weights 0.001 without weight decay and 0.03 with weight decay (0.0005), while CIFAR-100 uses 0.001 and 0.0003, respectively.Source: §C.1 · p. 13
C.2 4.2
- For Batchnorm, Dropout, and Baseline, the optimal DoubleBack/SpectReg weights are 0.001/0.001, 50/0.01, and 50/0.01, respectively.Source: §C.2 · p. 13
C.3 4.3
- On MNIST, optimal DoubleBack, SpectReg, and CP weights are 50, 0.03, and 0.01; combined CP and DoubleBack uses DoubleBack weight 10.Source: §C.3 · p. 13
- On CIFAR-10, CP, SpectReg, and DoubleBack weights are 0.003, 0.03, and 1; on CIFAR-100, they are 0.00001, 0.00003, and 0.003.Source: §C.3 · p. 13
C.4 4.4; C.5 4.5
- Table 8 reports each regularizer's weight for each training-set size, and TinyImageNet-200 uses SpectReg 20000.0 with weight decay 0.0001 when applied.Source: §C.4 · p. 13, §C.5 · p. 13
C.6 4.6
This section reports optimal weights for three regularizers and identifies Table 8 as the training-set-size-specific weight reference.
C.6 4.6
- The optimal weights for SpectReg, JacReg, and FrobReg are 0.03, 1, and 0.03, respectively.Source: §C.6 · p. 13
- Table 8 presents optimal weights for each regularizer and each training-set size.Source: Table 8 · p. 14
APPENDIX D GRADIENT REGULARIZATION’S EFFECT ON THE MAGNITUDE OF NETWORK PARAMETERS
DoubleBack weight is positively associated with accuracy up to a collapse point, while also changing the network's total weight loss. These effects support a global influence beyond the training-point neighborhoods where gradient norms are regularized.
- Without weight decay, increasing DoubleBack weight decreases trained-network weight loss; with weight decay, DoubleBack counteracts it below the transition and reinforces it above.Source: Appendix D · p. 14, Figure 5 · p. 14
- DoubleBack's effect on total weight loss supports the hypothesis that its influence is global rather than limited to training-point neighborhoods.The paper next demonstrates this phenomenon on a synthetic task.Source: Appendix D · p. 14
- Accuracy rises with DoubleBack weight λ until a phase transition causes collapse; on small MNIST, the transition is around λ = 20 regardless of weight decay.Figure 5 plots weight loss and accuracy across different weight-decay settings.Source: Figure 5 · p. 14, Appendix D · p. 14