Joint Pruning on Activations and Weights for Efficient Neural Networks

Qing Yang, Wei Wen, Zuoguan Wang, Hai LiarXiv 2019

Abstract

Deep Neural Networks (DNNs) are notoriously resource-intensive, complicating deployment on edge devices. While weight pruning reduces model size, it often fails to significantly decrease inference latency or account for activation sparsity. This paper introduces JPnet, a framework for joint regularization of both weights and activations. By learning sparse connections and dynamic activation masks concurrently, JPnet achieves up to a 12.3× reduction in weights and a 5.2× reduction in activations, leading to a total Multiply-Accumulate (MAC) reduction of up to 98.8% with minimal accuracy loss.

Introduction

The deployment of powerful DNNs on resource-constrained hardware remains a significant challenge. Traditional compression techniques primarily focus on weight pruning—removing redundant connections to shrink the model's footprint. However, this approach has limitations: it often struggles with convolutional layers, can inadvertently decrease natural activation sparsity, and fails to address models using non-ReLU activation functions (like Leaky ReLU) that lack intrinsic zeros.

The authors propose that pruning weights and activations in isolation is sub-optimal. Instead, they advocate for a joint approach that treats both as interdependent variables in the optimization process.

Methodology: Joint Regularization and Dynamic Masking

The core of the JPnet framework is Joint Regularization, an end-to-end training strategy that learns sparse weights and sparse neuron responses simultaneously.

Figure 1: The JPnet framework utilizes static weight masks and dynamic activation masks to prune the network. The workflow involves activation analysis, joint regularization, and final finetuning.

Loss Function and Masks

The framework modifies the standard loss function to include $l_1$ regularization for weights and $l_0$ regularization for activations. This objective forces the network to maintain high accuracy while maximizing sparsity across both domains.

A key distinction is made between the two types of pruning:

  1. Static Weight Masks: Connections are pruned once during training and remain fixed during inference.
  2. Dynamic Activation Masks: Because activations are input-dependent, JPnet employs dynamic masks that identify "winner" neurons—those with the highest magnitudes for a specific input—and suppresses the rest at runtime.

To mitigate the computational overhead of sorting activations to find these "winners," the authors use a down-sampling technique to predict a winner threshold ($θ$) based on a subset of activations.

Experimental Results

JPnet was evaluated across several benchmarks, including MNIST, CIFAR-10, and ImageNet, using architectures ranging from simple MLPs to complex ResNets.

Computational Efficiency

The most significant impact of joint pruning is seen in the reduction of Multiply-Accumulate (MAC) operations. By pruning both weights and activations, the total computation required is drastically reduced compared to weight-only pruning (WP).

Figure 4: Comparison of MAC percentage across various architectures. JPnet (JP) consistently achieves significantly lower MAC counts than weight-only pruning (WP).

As shown in the results, JPnet reduced MAC operations to between 1.2% and 27.7% of the original dense models. For instance, in LeNet-4, JPnet achieved an 83.3× reduction in MACs.

Accuracy and Sparsity

Despite the aggressive pruning, accuracy remained high. Most models experienced an accuracy drop of less than 0.4%. Notably, JPnet successfully induced sparsity in models using Leaky ReLU, which typically has 0% sparsity. A ResNet-32 model reached ~70% activation sparsity with only a 0.4% drop in accuracy. Furthermore, in some large-scale models like AlexNet and ResNet-50, the regularization effect of joint pruning actually led to slight improvements in accuracy.

Conclusion

JPnet demonstrates that joint regularization of weights and activations is a powerful paradigm for DNN compression. By exploiting the interdependence between connections and responses, and utilizing dynamic masking for activations, the framework achieves state-of-the-art reductions in computational cost. While full realization of these gains in convolutional layers may require specialized hardware accelerators, the software-level speedups and massive MAC reductions provide a clear path toward more efficient edge AI deployment.

Summary updated

BibTeX
@misc{yang2019joint,
  author = {Qing Yang and Wei Wen and Zuoguan Wang and Hai Li},
  title = {{Joint Pruning on Activations and Weights for Efficient Neural Networks}},
  year = {2019},
  eprint = {1906.07875},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1906.07875},
}
Figure