StackNet: Stacking feature maps for Continual learning

Jangho Kim, Jeesoo Kim, Nojun Kwak

Introduction

Continual learning (CL) aims to enable neural networks to learn a sequence of tasks without forgetting previously acquired knowledge. A primary challenge in CL is catastrophic forgetting, where training on a new task overwrites weights essential for prior tasks. Existing solutions generally fall into two categories: regularization-based methods, which often suffer from performance trade-offs, and architectural methods, which allocate specific parameters to tasks. However, architectural methods typically require a "Task ID" at inference time—a significant limitation for autonomous systems that must identify the task context independently.

StackNet addresses these issues by introducing a framework that "stacks" new convolutional filters for each task while freezing previous ones, ensuring zero forgetting. It further incorporates a GAN-based Index Module to automate task identification during testing.

Methods

The StackNet* framework (the asterisk denoting the inclusion of the Index Module) operates through a dual-component architecture designed for both performance stability and autonomy.

Overview of the StackNet* framework including the GAN-based Index Module

1. The StackNet Architecture

The core of the system is the stacking mechanism. When a new task is introduced, the network allocates a set of new, trainable filters. Crucially, the filters from all previous tasks are frozen, preventing any degradation in prior performance.

The conceptual stacking process of filters across sequential tasks (A, B, and C)
  • Parameter Sharing and Initialization: New tasks leverage the frozen feature maps of previous tasks as inputs. The authors found that initializing new parameters using a combination of prior weights and Gaussian noise significantly improves convergence speed and final accuracy compared to random initialization.
  • Expandability: The network can grow dynamically. If the initial capacity is exhausted, additional filters can be appended to the layers, limited only by available hardware memory.

2. The Index Module

To remove the requirement for an external Task ID, StackNet utilizes an Index Module. This module employs a Generative Adversarial Network (GAN) to learn the distribution of each task's data without storing the original images.

  • Pseudo-sample Generation: The GAN generates synthetic "pseudo-samples" representing previous tasks.
  • Task Classification: A binary classifier is trained on these samples to distinguish between tasks. At inference, this classifier predicts the Task ID from the input image, allowing the StackNet to activate the corresponding filter stack automatically.

Experimental Evaluation

The framework was evaluated on several benchmarks, including MNIST, SVHN, and CIFAR-10, as well as complex subsets of ImageNet (ImageNet-A and ImageNet-B). The experiments focused on multi-task sequences (e.g., MNIST → SVHN → CIFAR-10) to assess long-term stability and the accuracy of the Index Module.

Key Results and Insights

  • Zero Forgetting: By freezing parameters, StackNet maintains 100% of its original accuracy on previous tasks.
  • High Accuracy: In the MNIST → SVHN transition, StackNet* achieved an average accuracy of 95.82%, surpassing competing methods like PackNet (95.47%) and LwF (92.34%).
  • Autonomous Task Identification: The Index Module demonstrated near-perfect precision (approx. 100%) on digit datasets and maintained 97% accuracy on more complex transitions like SVHN → CIFAR-10.
  • Memory Efficiency: StackNet is more efficient than masking methods like PackNet, as it only requires storing filter indices rather than binary masks for every parameter.

Conclusion and Future Work

StackNet provides a robust solution for autonomous continual learning by combining architectural freezing with generative task indexing. While highly effective on standard benchmarks, the system's performance is currently bounded by the quality of the GAN. Future research will focus on enhancing generative models for high-resolution, complex datasets to ensure the Index Module remains reliable in diverse real-world environments.

Summary updated

BibTeX
@inproceedings{kim2020stacknet,
  author = {Jangho Kim and Jeesoo Kim and Nojun Kwak},
  title = {{StackNet: Stacking feature maps for Continual learning}},
  booktitle = {Workshops @ CVPR},
  year = {2020},
  doi = {10.1109/cvprw50498.2020.00129},
}
Figure