Training Sparse Neural Networks using Compressed Sensing

Jonathan W. Siegel, Jianhong Chen, Jinchao XuarXiv 2020

Abstract

Pruning the weights of neural networks is an effective and widely-used technique for reducing model size and inference complexity. We develop and test a novel method based on compressed sensing which combines the pruning and training into a single step. Specifically, we utilize an adaptively weighted $\ell^1$ penalty on the weights during training, which we combine with a generalization of the regularized dual averaging (RDA) algorithm in order to train sparse neural networks. The adaptive weighting we introduce corresponds to a novel regularizer based on the logarithm of the absolute value of the weights. We perform a series of ablation studies demonstrating the improvement provided by the adaptive weighting and generalized RDA algorithm. Furthermore, numerical experiments on the CIFAR-10, CIFAR-100, and ImageNet datasets demonstrate that our method 1) trains sparser, more accurate networks than existing state-of-the-art methods; 2) can be used to train sparse networks from scratch, i.e. from a random initialization, as opposed to initializing with a well-trained base model; 3) acts as an effective regularizer, improving generalization accuracy.

1. Introduction

Modern deep learning models are notoriously over-parameterized, containing millions or billions of weights. While this redundancy aids training stability, it presents significant challenges for deployment on edge hardware due to memory and computational constraints. Traditional network pruning—a multi-stage process involving training a dense model, pruning small weights, and fine-tuning—is cumbersome and often requires a pre-trained base model.

We propose a "one-step" approach that integrates pruning directly into the training process. By leveraging principles from compressed sensing, our method enables the training of highly sparse networks from random initialization (from scratch) without sacrificing accuracy.

2. Methodology

Our approach introduces two primary innovations to the standard training pipeline:

2.1 Adaptively Weighted $\ell_1$ Regularization

Standard $\ell_1$ regularization (Lasso) penalizes all weights equally. Drawing from compressed sensing theory, we implement a weighting scheme where the penalty is inversely proportional to a weight's magnitude. This corresponds to a logarithmic regularizer that heavily penalizes small weights—effectively pushing them toward zero—while leaving large, significant weights relatively untouched. To handle varying numerical scales across deep networks, weights are scaled relative to the maximum weight within their specific layer group.

2.2 Extended RDA (xRDA) with Momentum

Stochastic Gradient Descent (SGD) often fails to produce exact zeros because small step sizes cannot overcome the penalty's "plateau." We adapt the Regularized Dual Averaging (RDA) algorithm, originally for convex optimization, to the non-convex landscape of deep learning. Our Extended RDA (xRDA) incorporates an averaging parameter and a momentum term, ensuring robustness for complex architectures like ResNet and VGG.

3. Experimental Results

We evaluated our Compressed Sensing (CS) method against state-of-the-art pruning techniques across three benchmarks: CIFAR-10, CIFAR-100, and ImageNet (ILSVRC 2012).

3.1 Performance on CIFAR-10

On the CIFAR-10 dataset, our method consistently achieved higher compression ratios and better accuracy than competing methods such as Bayesian pruning, Variational Dropout, and Slimming. Notably, for VGG-19, we achieved a 104x compression ratio (less than 1% non-zero weights) while actually improving accuracy from a baseline of 93.60% to 94.18%.

Table 1: Comparison of the proposed CS method against various state-of-the-art pruning and sparse training algorithms on CIFAR-10.

3.2 Large-Scale Evaluation on ImageNet

Our method scales effectively to ImageNet. Using a ResNet-50 architecture, the CS algorithm achieved a 14.7x compression ratio with 76.00% Top-1 accuracy. This significantly outperforms standard pruning and dynamic sparsity methods like RigL and GSM at comparable sparsity levels.

Table 2: Performance comparison on ImageNet using ResNet-50. The CS method achieves superior accuracy at high compression ratios compared to existing baselines.

3.3 Sparsity as a Regularizer

A key finding is that sparse models often outperform their dense counterparts. For instance, on CIFAR-100, a VGG-19 model with only 2.3% non-zero weights reached 75.93% accuracy, compared to the 73.83% accuracy of the dense baseline. This suggests that the weighted $\ell_1$ penalty acts as a powerful regularizer, mitigating overfitting by enforcing a simpler model structure.

4. Discussion and Conclusion

Our compressed sensing-based approach demonstrates that it is possible to train highly accurate, sparse neural networks from scratch in a single step. By overcoming the "magnitude plateau" of standard weight decay through xRDA and utilizing logarithmic regularization, we achieve state-of-the-art results on both small and large-scale datasets.

Future work will explore extending this framework to structured sparsity (pruning entire channels or neurons) to achieve direct hardware acceleration on standard GPUs, as the current unstructured pruning primarily benefits parameter count reduction.

Summary updated

BibTeX
@misc{siegel2020training,
  author = {Jonathan W. Siegel and Jianhong Chen and Jinchao Xu},
  title = {{Training Sparse Neural Networks using Compressed Sensing}},
  year = {2020},
  eprint = {2008.09661},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2008.09661},
}
Figure