Introduction
Deep Neural Networks (DNNs) face a significant hurdle in sequential learning known as catastrophic forgetting. When a model is trained on a new task, the optimization process typically overwrites weights essential for previous tasks, leading to a sharp decline in prior performance. Kernel-wise Soft Mask (KSM) is a novel framework designed to enable efficient continual learning by adapting a fixed backbone network to multiple tasks without forgetting.
Problem Statement
Existing solutions to catastrophic forgetting generally fall into two categories, each with inherent trade-offs:
- Mask-based methods (e.g., Piggyback) apply binary masks to fixed backbone weights. While computationally efficient and storage-friendly, their limited representational capacity often results in lower accuracy for complex tasks.
- Dynamic Architecture methods (e.g., CPG) involve pruning, retraining, and expanding the network for each new task. These achieve high accuracy but are computationally intensive and slow, making them unsuitable for edge devices.
KSM aims to bridge this gap by providing a method that matches the speed of masking with the accuracy of model expansion.
Methodology
KSM introduces a differentiable, hybrid soft mask at the kernel level. The approach is built on three primary innovations:
Kernel-wise Mask Sharing
Unlike traditional element-wise masks where every weight has a corresponding mask bit, KSM applies a single mask value to an entire convolutional kernel (e.g., a 3x3 block). This strategy reduces mask storage requirements by a factor of 9x with negligible impact on accuracy, significantly enhancing hardware efficiency.
The Soft Mask Mechanism
KSM moves beyond strictly binary (0 or 1) masks. It utilizes a hybrid "soft" mask that combines a binary mask with a real-valued scaling tensor for weights that would otherwise be masked out. This allows the model to repurpose "unimportant" weights by scaling them, effectively increasing the network's modeling capacity without adding new neurons.
Differentiable Optimization via the Softmax Trick
To overcome the non-differentiability of binary masks, KSM employs a continuous logistic function and a "softmax trick." This formulation makes the mask learning process fully differentiable, allowing for smoother optimization and superior final accuracy compared to heuristic methods like the Straight-Through Estimator (STE).
Experimental Results
The framework was evaluated on two major benchmarks: ImageNet-to-Sketch (6 tasks) and CIFAR-100 (20 sequential tasks).
- Efficiency: KSM achieves approximately 10x faster training speeds compared to CPG, the leading dynamic architecture method.
- Accuracy: On the 20-task CIFAR-100 challenge, KSM reached an average accuracy of 79.2%, surpassing Piggyback (77.1%) and even slightly exceeding the performance of the much slower CPG (78.7%).
- Resource Management: The kernel-level granularity ensures that the model remains lightweight, making it ideal for deployment on resource-constrained edge devices.
Conclusion
KSM represents a significant advancement in continual learning by optimizing the trade-off between computational efficiency and model capacity. By leveraging kernel-wise soft masks and differentiable training, it enables fast adaptation to new tasks while preserving knowledge from previous ones. Future work will focus on addressing the linear growth of mask storage as task counts scale and optimizing the method for specific hardware accelerators.
Summary updated