Robust Learning with Jacobian Regularization

Judy Hoffman, Daniel A. Roberts, Sho YaidaarXiv 2019 · OpenReview

Abstract

Design of reliable systems must guarantee stability against input perturbations. In machine learning, such guarantee entails preventing overfitting and ensuring robustness of models against corruption of input data. In order to maximize stability, we analyze and develop a computationally efficient implementation of Jacobian regularization that increases classification margins of neural networks. The stabilizing effect of the Jacobian regularizer leads to significant improvements in robustness, as measured against both random and adversarial input perturbations, without severely degrading generalization properties on clean data.

Introduction

Deep learning models are notoriously brittle. A tiny, imperceptible change to an input—whether random "white noise" or a calculated "adversarial attack"—can cause a state-of-the-art model to flip its prediction entirely. While standard techniques like $L^2$ regularization (weight decay) help prevent overfitting, they don't necessarily make the model's "decision cells" (the regions in input space where a model predicts a specific class) any larger. Many models have "rugged" decision boundaries where a data point sits dangerously close to the edge. The challenge is to find a way to push these boundaries further away from the training data, increasing the "classification margin" in a way that is computationally feasible for large-scale models.

Methods: Efficient Jacobian Regularization

The authors propose regularizing the input-output Jacobian matrix, which measures how much the output scores change in response to small input shifts. Minimizing the Frobenius norm of this matrix encourages the model to be less sensitive to input perturbations.

Computing the full Jacobian is typically expensive, scaling linearly with the number of output classes ($C$). To overcome this, the authors introduce an unbiased estimator based on random projections. Instead of calculating how every output class changes, they project the output vector onto a random unit vector and compute the gradient of that scalar product. This reduces overhead to a constant factor (1.3x to 2x) regardless of $C$. Empirically, even a single random projection per iteration ($n_{proj} = 1$) is sufficient to achieve performance comparable to the exact Jacobian calculation.

Accuracy of the random projection estimator compared to the exact Jacobian.

Key Insights: Visualizing Decision Cells

A striking visualization of this method's effect shows that while $L^2$ regularization smooths out "rugged" boundaries, Jacobian regularization actually pushes those boundaries outward. This creates much larger "safe zones" or "decision cells" around data points, effectively increasing the classification margin. Unlike adversarial training, which requires generating specific attacks during training, Jacobian regularization is a generic penalty that provides robustness against various types of noise.

Comparison of decision boundaries: (a) without regularization, (b) with L2 regularization, and (c) with Jacobian regularization.

Experimental Results

The method was evaluated on MNIST, CIFAR-10, and ImageNet benchmarks.

  • Adversarial Defense: On MNIST, Jacobian regularization outperformed standard adversarial training against PGD and Carlini-Wagner (CW) attacks.
  • Robustness to Noise: Models showed significantly higher accuracy when faced with increasing levels of Gaussian white noise compared to $L^2$ or Dropout alone.
  • Generalization: In few-shot learning scenarios, Jacobian regularization improved test accuracy, suggesting it helps the model capture the underlying structure of the data rather than just memorizing training points.
  • Clean Data Performance: Crucially, the models maintained high accuracy on unperturbed "clean" data (e.g., ~99% on MNIST and ~78% on CIFAR-10), avoiding the "robustness-accuracy tradeoff" often seen in other defense methods.

Conclusion

Jacobian regularization offers a task-agnostic, computationally efficient way to enhance model robustness. By "embiggening" decision cells, it provides a generic defense against various perturbations without sacrificing performance on clean data. Future work includes exploring hyperparameter tuning for clean-data accuracy and scaling to extremely large-class settings beyond 1000 classes.

Summary updated

Abstract

Design of reliable systems must guarantee stability against input perturbations. In machine learning, such guarantee entails preventing overfitting and ensuring robustness of models against corruption of input data. In order to maximize stability, we analyze and develop a computationally efficient implementation of Jacobian regularization that increases classification margins of neural networks. The stabilizing effect of the Jacobian regularizer leads to significant improvements in robustness, as measured against both random and adversarial input perturbations, without severely degrading generalization properties on clean data.
BibTeX
@misc{hoffman2019robust,
  author = {Judy Hoffman and Daniel A. Roberts and Sho Yaida},
  title = {{Robust Learning with Jacobian Regularization}},
  year = {2019},
  eprint = {1908.02729},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1908.02729},
}
Figure