Abstract
The task of accelerating large neural networks on general purpose hardware has, in recent years, prompted the use of channel pruning to reduce network size. However, the efficacy of pruning based approaches has since been called into question. In this paper, we turn to distillation for model compression—specifically, attention transfer—and develop a simple method for discovering performance enhanced student networks. We combine channel saliency metrics with empirical observations of runtime performance to design more accurate networks for a given latency budget. We apply our methodology to residual and densely-connected networks, and show that we are able to find resource-efficient student networks on different hardware platforms while maintaining very high accuracy. These performance-enhanced student networks achieve up to 10% boosts in top-1 ImageNet accuracy over their channel-pruned counterparts for the same inference time.
Introduction
Deep learning models are increasingly deployed on edge devices, necessitating techniques like channel pruning to reduce computational overhead. Traditionally, researchers have used FLOPs (Floating Point Operations) as a proxy for inference speed, assuming a linear relationship between channel reduction and latency. However, modern hardware (CPUs and GPUs) utilizes parallelism and optimized matrix libraries that do not respond linearly to pruning.
Instead, inference time often follows a staircase pattern. As shown in Figure 1, latency remains constant across ranges of channel widths until a specific threshold is crossed. Standard pruning methods often stop at arbitrary points on these "steps," sacrificing model capacity without gaining any actual speedup. This paper introduces a hardware-aware approach to bridge the gap between theoretical compression and empirical performance.
Methodology
The proposed HAKD pipeline consists of three primary stages designed to maximize representational power within a fixed latency budget:
- Fisher Pruning: The process begins with a pre-trained "teacher" network. Fisher pruning—utilizing a second-order Taylor expansion of the loss function—is used to identify the relative importance of individual channels.
- Staircase Optimization: By empirically benchmarking the target hardware (e.g., ARM CPUs or Nvidia GPUs), the system maps out the latency steps for each layer. Pruned layer widths are then "snapped" to the nearest optimal point—the maximum number of channels possible before triggering the next latency step. This provides "free" capacity that standard pruning would otherwise discard.
- Attention Transfer: The resulting hardware-optimized architecture serves as a "student." Rather than simple fine-tuning, the student is trained using Attention Transfer, where it is encouraged to mimic the spatial attention maps of the original teacher network to recover accuracy lost during pruning.
Experimental Results
The methodology was evaluated on CIFAR-10 (WideResNet, DenseNet) and ImageNet (ResNet-34) using the Nvidia Jetson TX2 platform.
- ImageNet Performance: On a ResNet-34 at 75% compression, the performance-enhanced student achieved a 31.29% Top-1 error, a massive improvement over the 43.43% error of a standard Fisher-pruned model. This represents a 12% accuracy boost for nearly identical inference times (0.040s vs 0.038s).
- Hardware Efficiency: The "Performance Enhanced" ResNet-34 achieved higher throughput (39.50G MACs per picosecond) compared to the baseline (33.77G), demonstrating superior hardware utilization.
- Consistency: Across all tested architectures, HAKD consistently outperformed $\ell_1$-norm and standard Fisher pruning by 0.5% to 1% on CIFAR-10 at every latency budget.
Conclusion
HAKD demonstrates that hardware-blindness in model compression is costly. By identifying and exploiting the "staircase" nature of modern hardware latency, we can design student networks that are significantly more accurate than those produced by traditional pruning. Future work will explore automating the discovery of optimal points from hardware specifications and extending this methodology to tasks beyond image classification, such as object detection.
Summary updated