Inferensys

Glossary

iCaRL (Incremental Classifier and Representation Learning)

iCaRL is a class-incremental learning algorithm that combines a nearest-mean-of-exemplars classification rule with knowledge distillation and an exemplar management strategy to learn new classes over time.
Knowledge manager reviewing enterprise knowledge management system on laptop, document library visible, casual office.
CONTINUAL LEARNING ALGORITHM

What is iCaRL (Incremental Classifier and Representation Learning)?

iCaRL is a foundational algorithm for class-incremental learning, a challenging continual learning scenario where a model must learn new classes sequentially without forgetting old ones.

Incremental Classifier and Representation Learning (iCaRL) is a class-incremental learning algorithm that enables a model to learn new object categories over time without catastrophic forgetting. Its core innovation is a three-component system: a nearest-mean-of-exemplars classification rule, knowledge distillation to preserve old knowledge, and a bounded exemplar memory that stores a few representative images per class. This combination allows the model to expand its recognition capabilities incrementally.

The algorithm operates by maintaining a fixed-size memory of real images, known as exemplars. When learning a new set of classes, iCaRL uses knowledge distillation on its own outputs for old classes to prevent representation drift. It then updates the exemplar set via a herding selection process. At inference, classification is performed by comparing a new sample's feature vector to the mean feature vector of each class's stored exemplars, enabling discrimination across all learned classes without a task identifier.

ARCHITECTURAL COMPONENTS

Key Features of the iCaRL Algorithm

iCaRL (Incremental Classifier and Representation Learning) is a seminal algorithm for class-incremental learning. Its effectiveness stems from the synergistic combination of four core components designed to balance stability and plasticity.

01

Nearest-Mean-of-Exemplars Classification

Instead of using a standard linear output layer, iCaRL classifies based on the nearest class mean in the feature space. For each class, a prototype vector is computed as the mean feature vector of its stored exemplars. At inference, an input is assigned to the class whose prototype is closest in L2 distance. This non-parametric rule allows the classifier to scale to an increasing number of classes without retraining the final layer and inherently mitigates the bias toward newly learned classes common in incremental learning.

02

Knowledge Distillation Loss

To preserve knowledge of old classes, iCaRL employs a knowledge distillation penalty. When learning new classes, the model is trained not only with the standard cross-entropy loss for new data but also with a distillation loss that encourages the new model's outputs (logits) for old classes to match the outputs of the previous model. This technique, adapted from Learning without Forgetting (LwF), helps maintain the relative relationships between old classes in the output space, effectively combating catastrophic forgetting without requiring access to the original old data during the new training phase.

03

Exemplar Management via Herding

iCaRL maintains a fixed-size memory buffer of real data samples (exemplars) from past classes. Exemplars are selected using an iterative herding algorithm, which aims to approximate the average feature vector of all training samples for a class. The process:

  • Computes the mean feature vector (prototype) for the class using the feature extractor.
  • Iteratively selects the sample whose feature vector brings the current subset's mean closest to the full class mean. This results in a representative, diverse subset that best preserves the class distribution in feature space, enabling effective rehearsal.
04

Bounded Memory Rehearsal

The algorithm operates under a strict constant memory budget K, which is the total number of exemplars stored across all learned classes. When new classes are added, the budget is redistributed. The standard policy is to allocate an equal number of exemplars per class (m = K / total_classes). As the number of classes grows, the exemplars per class shrinks, simulating a realistic memory-constrained scenario. During training on a new task, the model rehearses by interleaving new class data with a balanced mix of exemplars from all old classes, a form of experience replay that directly counteracts forgetting.

05

Incremental Feature Representation Update

Unlike methods that freeze the feature extractor, iCaRL jointly updates the entire neural network (feature extractor and classifier) when learning new classes. The update is carefully regularized by the combination of distillation loss and rehearsal with exemplars. This allows the representation space to evolve incrementally to accommodate new classes while being anchored by old class exemplars. The evolving representation is crucial for the nearest-mean classifier, as both old and new class prototypes must reside in a coherent, updated feature space.

06

Class-Incremental Learning Protocol

iCaRL is explicitly designed for the challenging class-incremental learning (CIL) setting. Key protocol attributes:

  • No task identifier at test time: The model must distinguish between all classes seen so far without knowing which incremental "task" the input belongs to.
  • Uniform evaluation: Accuracy is measured over all classes encountered, reflecting real-world deployment where data from all periods can appear.
  • Exemplar-only access to past data: After a training phase for a set of classes concludes, only the selected exemplars are retained; the original training data is discarded. This defines iCaRL's approach to the stability-plasticity dilemma.
ALGORITHM COMPARISON

iCaRL vs. Other Continual Learning Approaches

A comparison of the iCaRL algorithm's core mechanisms and performance characteristics against other major families of continual learning methods.

Feature / MetriciCaRL (Incremental Classifier and Representation Learning)Regularization-Based Methods (e.g., EWC, SI)Architectural Methods (e.g., Progressive Nets, HAT)Pure Replay-Based Methods (e.g., ER, GEM)

Primary Mechanism

Hybrid: Nearest-mean-of-exemplars classification + knowledge distillation + exemplar management

Adds a quadratic penalty to the loss function to protect important parameters

Expands model structure or masks parameters to isolate task-specific knowledge

Interleaves training on new data with rehearsal on stored past examples

Explicit Task ID at Inference

Designed for Class-Incremental Learning

Fixed Model Capacity

Requires Storing Raw Data

Mitigates Catastrophic Forgetting Via

Representation stability (distillation) & rehearsal (exemplars)

Parameter importance weighting & regularization

Parameter isolation & dedicated sub-networks

Direct rehearsal of past experiences

Typical Accuracy on Split CIFAR-100 (20 tasks)

44.2% (final avg.)

< 30% (final avg., severe forgetting)

70% (final avg., with task ID)

~50-60% (final avg., depends on buffer size)

Memory Overhead Type

Exemplar storage (raw images)

Parameter importance matrices (per task)

Network parameter growth (per task)

Replay buffer storage (raw images/logits)

Computational Overhead

Moderate (nearest-mean classification, distillation)

Low (additional loss term)

High (multiple forward/backward passes through columns)

Moderate (rehearsal training loops)

Forward Transfer Potential

Low-Medium (shared representation)

Medium (shared, regularized parameters)

High (via lateral connections)

Medium (via shared replay)

Common Weakness

Performance degrades with many classes; exemplar management is critical

Struggles with disjoint tasks (e.g., new classes); importance estimation can drift

Not scalable to many tasks; requires task ID

Performance bounded by replay buffer size & sampling strategy

ICARL

Frequently Asked Questions

iCaRL (Incremental Classifier and Representation Learning) is a foundational algorithm for class-incremental learning. These questions address its core mechanisms, practical implementation, and relationship to other continual learning methods.

iCaRL (Incremental Classifier and Representation Learning) is a class-incremental learning algorithm that enables a model to learn new object classes sequentially over time without catastrophic forgetting of old classes. It operates via three core components: a nearest-mean-of-exemplars classification rule, knowledge distillation for representation stability, and a bounded exemplar management strategy. The model maintains a fixed-size memory buffer of stored examples (exemplars) for each previously learned class. When learning new classes, it uses a distillation loss to preserve its existing feature representations and updates the exemplar set using a herding algorithm to best approximate each class's mean feature vector in the embedding space.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.