Abstract
Deep neural networks are typically too computationally expensive to run in real-time on consumer-grade hardware and low-powered devices. In this paper, we investigate reducing the computational and memory requirements of neural networks through network pruning and quantisation. We examine their efficacy on large networks like AlexNet compared to recent compact architectures: ShuffleNet and MobileNet. Our results show that pruning and quantisation compresses these networks to less than half their original size and improves their efficiency, particularly on MobileNet with a 7x speedup. We also demonstrate that pruning, in addition to reducing the number of parameters in a network, can aid in the correction of overfitting.
Introduction
Modern deep neural networks have achieved remarkable performance across various tasks, but their massive computational and memory requirements pose significant deployment challenges. These "heavy" models are often unsuitable for consumer-grade hardware, smartphones, or embedded systems. Beyond hardware constraints, the environmental impact is substantial; training a single large NLP model can emit as much $CO_2$ as five cars over their lifetime.
This research explores two primary paths to efficiency: compressing large, over-parameterized networks (such as AlexNet) versus further optimizing natively compact architectures (such as MobileNet and ShuffleNet). We specifically investigate whether removing redundant parameters through pruning can serve a dual purpose: shrinking the model size while acting as a regulariser to improve generalisation and correct overfitting.
Methods
We employ two primary compression techniques to reduce model footprint and increase inference speed:
- Iterative Pruning: This involves a three-step cycle. First, a network is fully trained. Second, connections with weights below a specific threshold—deemed the "least important"—are removed. Third, the remaining sparse network is retrained to recover any lost accuracy. This cycle repeats until a target sensitivity or compression ratio is achieved.
- Network Quantisation: This technique reduces the precision of weights and activations. By using per-channel quantisation to map 32-bit floating-point values to lower-bit integers, we significantly reduce the memory footprint and enable hardware-level speedups.
These methods were tested on AlexNet, representing legacy large-scale models, and two modern compact architectures: MobileNetV2 (utilizing depthwise separable convolutions) and ShuffleNetV2 (utilizing grouped convolutions and channel shuffling).
Experimental Setup
The efficacy of these techniques was evaluated using two standard computer vision benchmarks:
- CIFAR-10: 60,000 32x32 color images across 10 distinct classes.
- FashionMNIST: 70,000 grayscale images of clothing items, providing a more challenging alternative to the original MNIST dataset.
Results and Discussion
Sensitivity and Model Robustness
Our experiments reveal that large networks are significantly less sensitive to pruning than their compact counterparts. AlexNet, due to its inherent over-parameterization, allowed for the removal of up to 90% of its parameters on FashionMNIST without substantial accuracy loss. In contrast, natively compact models like MobileNet are more sensitive because they possess fewer redundant parameters from the start.
As seen in Figure 1, AlexNet (purple) maintains its performance plateau much longer than the compact architectures as the percentage of pruned parameters increases.
Pruning as a Regulariser
A key finding of this study is that pruning can improve model quality by removing parameters that essentially "memorize" noise in the training data. On the FashionMNIST dataset, we observed that overfitted models actually saw an increase in test accuracy after being pruned. For instance, an overfitted MobileNet improved from 90.55% to 91.26% accuracy, while AlexNet improved from 91.32% to 92.11%.
Efficiency and the Quantisation "Tax"
Quantisation provided significant physical size reductions. AlexNet's size was reduced from 217.6 MB to 54.6 MB. MobileNet achieved a 7.3x speedup on CIFAR-10, reducing inference time from 34.80ms to 4.74ms. However, we noted a "quantisation tax" on highly optimized architectures like ShuffleNet, which suffered accuracy drops and increased inference times when quantised, suggesting that hand-optimized models have less "slack" for precision reduction.
Conclusion
While large networks can be compressed by up to 10x, natively compact architectures like MobileNet still provide a superior accuracy-to-size ratio. Pruning proved to be a powerful tool not just for compression, but for correcting overfitting.
Future work will address the limitations of weight-level sparsity, which requires specialized hardware to realize speedups. We intend to explore filter pruning—removing entire convolutional filters—to maintain dense structures that are more compatible with standard hardware accelerators.
Summary updated