Prototype Reminding for Continual Learning

Mengmi Zhang, Tao Wang, Joo Hwee Lim, Jiashi FengarXiv 2019

Abstract

Continual learning refers to the ability to acquire and transfer knowledge without catastrophically forgetting what was previously learned. In this work, we consider few-shot continual learning in classification tasks, and we propose a novel method, Variational Prototype Replays, that efficiently consolidates and recalls previous knowledge to avoid catastrophic forgetting. In each classification task, our method learns a set of variational prototypes with their means and variances, where embedding of the samples from the same class can be represented in a prototypical distribution and class-representative prototypes are separated apart. To alleviate catastrophic forgetting, our method replays one sample per class from previous tasks, and correspondingly matches newly predicted embeddings to their nearest class-representative prototypes stored from previous tasks. Compared with recent continual learning approaches, our method can readily adapt to new tasks with more classes without requiring the addition of new units. Furthermore, our method is more memory efficient since only class-representative prototypes with their means and variances, as well as only one sample per class from previous tasks need to be stored. Without tampering with the performance on initial tasks, our method learns novel concepts given a few training examples of each class in new tasks.

Introduction

Deep neural networks frequently struggle with catastrophic forgetting, where learning new tasks leads to the erasure of previously acquired knowledge. This issue is particularly acute in few-shot continual learning, where the model must adapt to new classes using only a handful of examples. Traditional solutions often involve high memory overhead, such as storing large historical datasets or duplicating network parameters (e.g., Elastic Weight Consolidation). Moreover, standard classification architectures require structural changes—adding new output nodes—whenever a new class is introduced, which often leads to overfitting in data-scarce scenarios.

Variational Prototype Replays

The proposed Variational Prototype Replays method addresses these challenges by replacing the standard softmax output layer with a distance-based classifier in a probabilistic latent space.

Overview of the Variational Prototype Replays architecture and latent space representation.

Core Components

  1. Variational Prototypes: A 2D-CNN maps images into a latent space where each class is modeled as a Gaussian distribution defined by a mean ((\mu)) and a variance ((\sigma)).
  2. Nearest-Prototype Classification: Classification is performed by embedding a test image and assigning it to the class of the nearest sampled prototype.
  3. Ultra-Lightweight Replay: To maintain knowledge of past tasks, the system stores only one random exemplar image per class along with its corresponding variational prototype (mean and variance vectors).
  4. Variance-Weighted Distance: During new task training, stored exemplars are replayed. The model is constrained to keep new embeddings of these old images near their original prototypes. Crucially, this distance is weighted by the stored variance; high variance indicates lower feature confidence, allowing the network more flexibility to update those specific features.

Experimental Setup and Datasets

The method was evaluated under strict few-shot protocols (typically 10 training examples per class for new tasks) across three diverse benchmarks.

Experimental protocols for Permuted MNIST, Split CIFAR10, and Split miniImageNet.
  • Permuted MNIST: Tests incremental domain adaptation across 50 tasks with random pixel permutations.
  • Split CIFAR10: An incremental class task starting with 2 classes and adding 1 new class per task for 9 tasks.
  • Split miniImageNet: A complex incremental class task with natural images, involving 10 tasks with 10 classes each.

Key Results and Insights

The Variational Prototype Replays method demonstrated significant improvements in both accuracy and efficiency:

  • Superior Accuracy: On Split CIFAR10, the method consistently outperformed baselines like EWC and Synaptic Intelligence, exceeding L2 regularization by an average of 2.5%.
  • Memory Efficiency: The approach uses approximately 33% less memory than parameter regularization methods. By storing only one image and two vectors per class, it avoids the massive overhead of Fisher information matrices.
  • Feature Confidence: Ablation studies showed that the variance-weighted distance is critical; removing it led to a 1.2% accuracy drop. The variance acts as a guide for "safe" forgetting, identifying which features can be overwritten.
  • Architectural Stability: Because classification is distance-based, the network architecture remains static. This prevents the overfitting typically seen when expanding output layers in few-shot settings.

Conclusion and Future Work

Variational Prototype Replays provide a robust, memory-efficient framework for few-shot continual learning. By representing classes as distributions and using single-exemplar replays, the model balances plasticity and stability. While random exemplar selection is currently effective, future research could explore dynamic selection strategies to better capture class diversity and scaling to larger datasets like the full ImageNet suite.

Summary updated

BibTeX
@misc{zhang2019prototype,
  author = {Mengmi Zhang and Tao Wang and Joo Hwee Lim and Jiashi Feng},
  title = {{Prototype Reminding for Continual Learning}},
  year = {2019},
  eprint = {1905.09447},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1905.09447},
}
Figure