PackNet: Adding Multiple Tasks to a Single Network by Iterative Pruning

Arun Mallya, Svetlana Lazebnik

Abstract

PackNet is a novel framework for lifelong learning that addresses catastrophic forgetting by "packing" multiple tasks into a single deep neural network. By leveraging parameter redundancy, the method iteratively prunes unimportant weights and freezes those critical for previous tasks. This approach ensures zero performance degradation on earlier tasks while adding minimal storage overhead through task-specific binary masks.

Introduction

In the field of continual or lifelong learning, the primary challenge is catastrophic forgetting: the phenomenon where fine-tuning a network on a new task overwrites weights essential for previous tasks, causing their performance to plummet. Existing solutions typically fall into two categories: regularization-based methods (like Learning without Forgetting, LwF) which use "soft" constraints that often fail as more tasks are added, or architectural growth methods which prevent forgetting but lead to exploding model sizes. PackNet offers a middle ground, maintaining the performance of a fixed-size architecture without the degradation seen in regularization methods.

Methodology: The PackNet Cycle

PackNet treats the redundant parameters in modern deep networks as a resource that can be allocated to new tasks. The process follows an iterative four-step cycle:

  1. Train & Prune: The network is trained for a task, followed by weight-magnitude pruning to identify and zero out unimportant connections (typically 50-75%).
  2. Re-train: The remaining "important" weights are re-trained to recover any accuracy lost during the pruning stage.
  3. Freeze: These weights are then frozen, becoming the permanent property of that task for the remainder of the network's lifetime.
  4. Repeat: The pruned (zeroed) weights are released to learn the next task. New tasks can utilize both the frozen weights of previous tasks and the newly available parameters.
The iterative process of training, pruning, and freezing weights to accommodate multiple tasks in a single filter.

At inference time, the model uses a task-specific binary mask to identify which weights belong to which task. This allows Task $N$ to benefit from features learned in Tasks $1 \dots N-1$ without modifying them.

Experimental Results

The authors evaluated PackNet across diverse architectures (VGG-16, ResNet-50, DenseNet-121) and datasets including ImageNet, CUBS Birds, Stanford Cars, and Oxford Flowers.

Zero Forgetting

A key advantage of PackNet is its "hard" constraint on weights. While regularization methods like LwF show a steady increase in error for earlier tasks as new ones are added, PackNet maintains perfectly constant performance on all previous tasks.

Comparison of Top-1 Error between LwF and PackNet (Pruning) as tasks are added. PackNet maintains constant error for previous tasks, whereas LwF suffers from catastrophic forgetting.

Performance and Efficiency

PackNet achieves accuracies within 1–3% of dedicated single-task networks. For a 537MB VGG-16 model, adding three fine-grained tasks required only ~34MB of additional storage for binary masks—roughly a 1/16th increase in size, compared to a 300% increase if one were to save separate models. Furthermore, unstructured weight pruning proved more effective than structured filter pruning, allowing for higher compression ratios (up to 90%) without significant accuracy loss. On the Places365 dataset, PackNet even outperformed a model trained jointly on ImageNet and Places, suggesting the pruning process acts as a useful regularizer.

Conclusion and Limitations

PackNet demonstrates that the over-parameterization of modern deep networks can be effectively harnessed for sequential learning. However, the method has limitations: it cannot process batches containing images from different tasks simultaneously, and the network eventually reaches a finite capacity where no more parameters can be pruned. Additionally, pruning ratios currently require manual tuning. Future work may involve automating mask generation to further optimize the packing process.

Summary updated

BibTeX
@inproceedings{mallya2018packnet,
  author = {Arun Mallya and Svetlana Lazebnik},
  title = {{PackNet: Adding Multiple Tasks to a Single Network by Iterative Pruning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2018},
  doi = {10.1109/cvpr.2018.00810},
}
Figure