Introduction
Deep neural networks, particularly residual architectures like ResNet, have achieved state-of-the-art performance across various computer vision tasks. However, their deployment on resource-constrained "edge" devices—such as mobile CPUs and embedded GPUs—remains challenging due to high memory requirements and computational costs. Standard compression techniques like weight pruning and knowledge distillation (KD) often face structural hurdles in ResNets. Specifically, residual connections impose dimensionality dependencies; pruning a filter in one layer can break the element-wise addition operation, rendering the network untrainable. This paper proposes a hybrid pipeline that combines selective pruning with a novel distillation strategy to overcome these limitations.
Methods
The proposed approach consists of a two-stage compression pipeline: selective pruning followed by intermediate-layer knowledge distillation.
- Selective Pruning via Activation Analysis: The authors utilize the Average Percentage of Zeros (APoZ) metric to identify redundant neurons. To maintain architectural integrity, pruning is restricted to "selective" layers that do not impact the dimensions of residual connections. This ensures the network remains functional while reducing initial redundancy.
- Knowledge Distillation with Cosine Distillation Loss (CDL): To further compress layers that are structurally "un-prunable," a smaller student network is introduced. Unlike standard KD which only matches final outputs, the authors propose Cosine Distillation Loss (CDL). This loss function minimizes the cosine similarity between intermediate feature maps of the teacher and student, facilitating the transfer of complex internal representations.
Experimental Results
The method was evaluated on head-pose estimation (regression) using the 300W-LP and AFLW2000 datasets, as well as image classification on Cifar10. For head-pose estimation, the hybrid approach achieved a massive reduction in model size. The baseline ResNet-50 was compressed from 99.2 MB to just 4.9 MB—a 20x reduction. Despite this drastic shrinkage, the Mean Absolute Error (MAE) only increased slightly from 4.22 to 5.25, outperforming several specialized lightweight models.
On edge hardware, the performance gains were significant. Inference time on a Jetson Xavier dropped from 0.03s to 0.005s. Furthermore, the compressed models demonstrated superior robustness to noise (motion blur, low brightness, and occlusion) compared to models like FSA-Net, likely due to maintaining higher input resolutions while reducing internal parameters.
Discussion and Conclusion
A key insight from this work is that redundancy is more prevalent in deeper layers, where zero-activation rates often exceed 90%. By using a pruned model as a teacher, the distillation process avoids transferring "noisy" or redundant information to the student. While currently optimized for ResNet architectures, the selective pruning rules could be adapted for other complex backbones. Future work will explore scaling this method to larger datasets like ImageNet and a broader range of neural network architectures.
Summary updated