Constrained Few-shot Class-incremental Learning

Michael Hersche, Geethan Karunaratne, Giovanni Cherubini, Luca Benini, Abu Sebastian, Abbas Rahimi

Introduction

Deep learning models typically struggle with a phenomenon known as catastrophic forgetting: when trained on new data, they tend to overwrite the weights associated with previously learned tasks, causing performance on old data to plummet. This challenge is particularly acute in Class-incremental Learning (CIL), where a model must learn a continuous stream of new classes. The difficulty is further compounded in few-shot scenarios (FSCIL), where only 1–5 examples per new class are available.

Presented at CVPR 2022, C-FSCIL (Constrained Few-shot Class-incremental Learning) introduces a framework designed to enable AI agents to learn new concepts on the fly without forgetting, while operating under strict memory and computational limits. By leveraging the mathematical properties of high-dimensional vector spaces, C-FSCIL achieves state-of-the-art accuracy and unprecedented scalability.

Methodology

The core innovation of C-FSCIL is the integration of Hyperdimensional (HD) Computing principles into a standard neural network architecture. The framework is built upon three primary components:

  1. Frozen Feature Extractor: A meta-learned backbone (e.g., ResNet-12) that is frozen after initial training. This prevents "representation drift," ensuring the fundamental feature space remains stable as new classes are added.
  2. Fixed-size Fully Connected Layer (FCL): A trainable layer that maps features into a high-dimensional space.
  3. Explicit Memory (EM): A rewritable memory module that stores class prototypes.

The Power of Quasi-Orthogonality

C-FSCIL exploits the "curse of dimensionality." In high-dimensional spaces (e.g., 512D), any two randomly chosen vectors are almost certainly perpendicular, or quasi-orthogonal. By mapping images to these quasi-orthogonal class prototypes, the model can pack hundreds of distinct classes into a fixed-size model with minimal interference between them.

Operational Modes

The authors propose three distinct modes for updating the model as new classes arrive:

  • Mode 1 (Averaged Prototypes): A simple, one-pass approach that averages the embeddings of new samples to create a prototype. This requires no gradient descent, making it extremely fast.
  • Mode 2 (Bipolarized): Prototypes are converted to bipolar vectors (+1/-1) to maximize separation, followed by a brief retraining of the FCL to align with these vectors.
  • Mode 3 (Nudged): This mode uses a novel loss function to "nudge" prototypes further apart, ensuring maximum orthogonality before retraining the FCL for optimal performance.

To handle these high-dimensional vectors effectively, the authors replace the standard Softmax function with Softabs Attention, a "soft absolute" sharpening function that improves the comparison between query images and stored memory prototypes.

Experimental Results

The framework was evaluated on several major benchmarks, demonstrating both superior accuracy and extreme scalability.

Benchmarks: CIFAR100 and miniImageNet

On the miniImageNet benchmark (60 base classes followed by 40 novel classes), C-FSCIL (Mode 3) achieved a final accuracy of 51.41%. This significantly outperformed previous state-of-the-art methods, such as CEC (47.63%), after all incremental steps were completed.

Extreme Scaling: Omniglot

To test the limits of the system, the authors utilized the Omniglot dataset of handwritten characters. They conducted the largest FSCIL experiment to date, using 1,200 base classes and adding 423 novel classes. C-FSCIL maintained high accuracy throughout, with less than a 1.6% drop from the first session to the final session, proving its robustness at scale.

Key Insights

  • Dimensionality as a Resource: Rather than a burden, high dimensionality provides a massive "address space" where new classes can be stored without overlapping with existing ones.
  • Efficiency: Even Mode 1—which requires zero backpropagation for new classes—outperformed many complex, computationally expensive baselines.
  • Holographic Compression: The research demonstrates that memory can be compressed by 2x using "vector binding" (superimposing two class vectors) with only a negligible (~2%) drop in accuracy.
  • Linear Memory Growth: Because only the Explicit Memory grows (one vector per class), the memory footprint increases linearly and slowly, making it highly suitable for edge devices.

Conclusion and Future Work

C-FSCIL provides a computationally cheap and memory-efficient solution for lifelong learning. While the current model relies on a frozen backbone—which may struggle with significant domain shifts (e.g., moving from natural images to medical X-rays)—its performance on standard benchmarks is a major step forward.

Future work may explore implementing these quasi-orthogonal, bipolar prototypes on emerging In-Memory Computing hardware, such as memristors, to create ultra-low-power AI systems capable of continuous learning in the field.

Summary updated

BibTeX
@inproceedings{hersche2022constrained,
  author = {Michael Hersche and Geethan Karunaratne and Giovanni Cherubini and Luca Benini and Abu Sebastian and Abbas Rahimi},
  title = {{Constrained Few-shot Class-incremental Learning}},
  booktitle = {IEEE/CVF Conference on Computer Vision and Pattern Recognition},
  year = {2022},
  doi = {10.1109/cvpr52688.2022.00885},
}
Figure