Knapsack Pruning with Inner Distillation

Yonathan Aflalo, Itamar Friedman, Asaf Noy, Lihi Zelnik-Manor, Ming Lin

Introduction

Deep neural networks like ResNet and EfficientNet have revolutionized computer vision but come with high computational costs that hinder deployment on edge devices. While pruning—the removal of redundant parameters—is a standard solution, it often relies on heuristics that ignore the actual cost-to-benefit ratio of individual neurons. Researchers from Alibaba DAMO Academy have introduced a novel "one-shot" pruning method that treats channel removal as a Knapsack Problem, combined with Inner Knowledge Distillation (IKD) to recover accuracy by leveraging the structural similarity between the original and pruned models.

The Pruning Challenge

Existing pruning methods typically face two hurdles. First, Heuristic Selection often removes neurons based on simple rules (like weight magnitude) without considering the computational budget (FLOPs). Second, Wasted Knowledge occurs when fine-tuning only uses final output labels, ignoring the rich internal feature maps of the original "teacher" network that are structurally compatible with the pruned "student."

Methodology

1. The Knapsack Formulation

The authors frame pruning as a classic optimization problem. They estimate the "Value" of each channel using a first-order Taylor expansion of the loss function to determine how its removal impacts accuracy. The "Weight" is the computational cost (FLOPs) of that channel. The goal is to maximize the total importance of remaining channels under a specific FLOPs budget. To maintain structural consistency in complex architectures like ResNet (with skip-connections) or EfficientNet (with depth-wise convolutions), they employ Block Grouping to ensure connected layers are pruned in sync.

2. Inner Knowledge Distillation (IKD)

To recover lost accuracy, the pruned network is fine-tuned using IKD. Unlike standard distillation, IKD supervises the student using internal feature maps from the unpruned parent. Since the student has fewer channels, a learnable linear transformation maps its features back to the teacher’s dimensions. This "internal tutoring" allows the pruned network to mimic the original model's mapping patterns far more effectively than final-layer supervision alone.

Figure 2: Top-1 Accuracy vs. FLOPs on ImageNet for ResNet-50. The proposed method (triangles) consistently achieves higher accuracy at lower computational costs compared to other state-of-the-art methods.

Experimental Results

The method was evaluated on ImageNet, CIFAR-10, and CIFAR-100, demonstrating significant improvements in both efficiency and accuracy.

  • State-of-the-Art Performance: On ImageNet, a pruned ResNet-50 achieved 78.2% Top-1 accuracy with 2.46B FLOPs, significantly outperforming methods like TAS and FPGM.
  • Efficiency Gains: The fine-tuning process is remarkably fast—roughly 12x faster than competing Neural Architecture Search (NAS) based methods (e.g., 19 GPU hours vs. 236 hours for ResNet-18).
  • Hardware Real-World Speed: Beyond theoretical FLOPs, the method produces models that are faster in practice. A pruned EfficientNet-B0 achieved 1% higher accuracy than the original while maintaining the same FLOPs and running faster on a GPU.
Figure 6: Detailed comparison of pruning results on ResNet-18, 50, and 101. The proposed method ("Ours") consistently shows lower accuracy drops and better prune ratios across different model scales.

Conclusion

By combining the mathematical rigor of the Knapsack Problem with the rich supervisory signal of Inner Knowledge Distillation, this approach offers a highly efficient way to compress deep models. The researchers suggest that future AI development should focus on training "inflated" over-parameterized networks designed specifically to be pruned, rather than manually designing small, efficient architectures from scratch.

Summary updated

BibTeX
@misc{aflalo2020knapsack,
  author = {Yonathan Aflalo and Itamar Friedman and Asaf Noy and Lihi Zelnik-Manor and Ming Lin},
  title = {{Knapsack Pruning with Inner Distillation}},
  year = {2020},
  eprint = {2002.08258},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2002.08258},
}
Figure