Adaptive Sharpness-Aware Pruning for Robust Sparse Networks

Anna Bair, Hongxu Yin, Maying Shen, Pavlo Molchanov, Jose M. Alvarez

TL;DR

Adaptive Sharpness-Aware Pruning (AdaSAP) is a novel framework that produces sparse neural networks that are both compact and remarkably robust to unseen real-world corruptions. By strategically using adaptive weight perturbations to "flatten" the loss landscape before and after pruning, AdaSAP effectively closes the performance gap between standard validation accuracy and robust accuracy.

The Challenge: Compactness vs. Robustness

In real-world deployments, deep learning models face two conflicting requirements: compactness (to run efficiently on edge devices like phones or vehicles) and robustness (to handle noisy, out-of-distribution data like rain, snow, or motion blur).

Standard pruning techniques—which remove redundant neurons to make models smaller—often inadvertently destroy a model's ability to generalize. While a pruned model might maintain high accuracy on a clean validation set, its performance typically degrades drastically on corrupted data as the pruning ratio increases. This occurs because pruning exploits specific patterns in the training data, pushing the model into "sharp" regions of the loss landscape where even tiny changes to weights or inputs cause catastrophic failures.

The AdaSAP Methodology

AdaSAP tackles this conflict by unifying pruning and robustness through the lens of network sharpness. The method follows a three-step pipeline designed to proactively manage the loss landscape:

  1. Adaptive Weight Perturbations (Warmup): Before any neurons are removed, the model undergoes a warmup phase. Unlike standard Sharpness-Aware Minimization (SAM), which applies uniform perturbations, AdaSAP uses adaptive perturbations. Neurons deemed "unimportant" (and therefore likely to be pruned) are subjected to larger weight perturbations. This forces the optimization process to move these specific neurons into flatter regions of the loss landscape, ensuring that their eventual removal has minimal impact on overall performance.
  2. Neuron Removal: The model is pruned using standard structured criteria, such as magnitude-based pruning. Because of the adaptive warmup phase, the model is already primed for this structural change.
  3. Robustness Encouragement (Fine-tuning): The newly pruned model is fine-tuned using uniform sharpness-aware optimization. This ensures the remaining sparse network settles into a broad, flat minimum, which serves as a strong proxy for high generalization and robustness.
The three-step AdaSAP process: Adaptive Perturbations, Neuron Removal, and Robustness Encouragement.

Key Insights

  • Sharpness as a Unified Metric: A core insight of AdaSAP is that pruning a neuron is essentially a massive weight perturbation (setting its value to zero). If the loss landscape is flat, this perturbation causes little harm. Similarly, if the landscape is flat, input noise (corruptions) also causes little harm. Thus, optimizing for flatness solves both the pruning and robustness problems simultaneously.
  • Priming the Model: Most pruning methods attempt to repair network damage after pruning has occurred. AdaSAP's adaptive warmup is proactive; it reshapes the landscape so that the act of pruning itself is inherently less destructive.
  • Closing the Robustness Gap: Standard state-of-the-art (SOTA) pruning methods see robust performance fall off a cliff compared to standard validation performance as sparsity increases. AdaSAP significantly flattens this curve, approaching an ideal scenario where robustness scales linearly with accuracy.
Figure 1: AdaSAP (green line) maintains much higher relative robustness as the pruning ratio increases compared to other SOTA methods.

Experimental Results

The authors evaluated AdaSAP across multiple tasks and architectures (ResNet50, MobileNet V1, and MobileNet V2), outperforming recent pruning methods by large margins across various compression ratios:

  • Image Classification: Trained on ImageNet-1K, AdaSAP improved robust accuracy by up to +6% on ImageNet-C (which features 19 types of corruptions) and by up to +4% on ImageNet-V2 (testing for distribution shifts).
  • Object Detection: Trained on Pascal VOC and evaluated on a newly created Pascal VOC-C dataset, AdaSAP achieved a +4% mAP improvement.
  • Versatility: The method is "pruning-agnostic," proving effective whether optimizing for parameter reduction or actual hardware latency.

Limitations and Future Work

The primary limitation of AdaSAP is computational cost. The method requires two backward passes per optimization step to calculate the gradient at the perturbed location, roughly doubling the training time compared to standard SGD.

Additionally, while the paper focuses on structured (channel-wise) pruning for direct hardware speedups, the framework could theoretically be adapted for unstructured pruning. Future work may also involve testing on more diverse, "in-the-wild" datasets to capture real-world variations beyond standard benchmarks like ImageNet-C.

Summary updated

BibTeX
@inproceedings{bair2024adaptive,
  author = {Anna Bair and Hongxu Yin and Maying Shen and Pavlo Molchanov and Jose M. Alvarez},
  title = {{Adaptive Sharpness-Aware Pruning for Robust Sparse Networks}},
  booktitle = {International Conference on Learning Representations},
  year = {2024},
  url = {https://openreview.net/forum?id=QFYVVwiAM8},
}
Figure