# iCaRL: Incremental Classifier and Representation Learning

iCaRL learns new classes incrementally while updating its representation

Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, Christoph H. Lampert · arXiv · 2016-11-23

- **Problem** Neural networks trained on classes as they arrive forget earlier classes. Storing all past data avoids this but breaks memory limits.
- **Method** iCaRL keeps a small set of stored exemplar images per class and classifies by nearest class mean. It trains the network with a distillation loss on old-class outputs, so features and classifier learn together.
- **Results** On iCIFAR-100 with 2 classes per batch, iCaRL reached 57.0 average accuracy against 11.7 for LwF.MC.

## Why class-incremental learning breaks ordinary training

The setting asks for a learner that can be trained on a stream in which examples of different classes arrive at different times. At every point it should still give a competitive multi-class classifier over the classes seen so far, and its memory and computation should stay bounded or grow slowly with the number of classes. Storing every training example and retraining an ordinary classifier from scratch meets the accuracy requirement but breaks the resource requirement.

The obvious alternative, training a classifier on class-incremental data with stochastic gradient descent, suffers from catastrophic forgetting: accuracy on earlier classes deteriorates quickly. The effect was described for connectionist networks in the late 1980s, where new training data overwrote what had been learned from earlier data.

Most existing class-incremental techniques fix the data representation, which rules them out for deep architectures that learn features and classifiers at the same time. iCaRL is designed to learn the classifier and the representation together while meeting all three requirements.

## The three parts of iCaRL and how they fit

iCaRL combines a nearest-mean-of-exemplars classifier, exemplar selection based on herding, and representation learning that uses knowledge distillation together with rehearsal of stored exemplars. The network is a convolutional feature extractor \\(\\phi\\) followed by one sigmoid output per observed class, and all feature vectors are L2-normalized.

Each class output is \\( g\_y(x) = \\frac{1}{1+\\exp(-a\_y(x))} \\) with \\( a\_y(x) = w\_y^\\top \\phi(x) \\), where the weight vectors \\(w\_y\\) are part of the network parameters. These outputs serve representation learning only, and classification does not use them.

Memory consists of the feature extractor parameters, up to K stored exemplar images, and one weight vector per observed class. Since the number of weight vectors grows with the classes, an unbounded stream would require either more resources or fewer exemplars per class, and each class needs at least one exemplar and one weight vector.

## Classifying with mean-of-exemplars prototypes

For each observed class y, the prototype is the average of \\(\\phi\\) over the exemplars in \\(P\_y\\): \\( \\mu\_y = \\frac{1}{\|P\_y\|}\\sum\_{p\\in P\_y}\\phi(p) \\). A query image x receives the label of the nearest prototype, \\( y^\* = \\arg\\min\_{y=1,\\dots,t} \\\|\\phi(x)-\\mu\_y\\\| \\), with t the number of classes observed so far.

The usual rule for a network takes the largest sigmoid output, and because the sigmoid is monotone this equals the largest \\( w\_y^\\top\\phi(x) \\). The weight vectors are separate parameters, so every change to \\(\\phi\\) would force all of them to be updated, and otherwise the outputs drift and forgetting appears. Prototypes avoid this, because they are recomputed from exemplars under the current feature extractor and therefore move with the representation.

The true class mean would need all training data stored, so the average over a chosen set of exemplars replaces it. With normalized features the nearest-prototype rule equals an argmax of \\( \\mu\_y^\\top\\phi(x) \\), so it can be read as a linear classifier whose weights follow the representation.

## Selecting and shrinking the exemplar sets

With t classes observed and a budget of K exemplars, each class receives m = K/t exemplars, up to rounding. Reducing a class from m' to m exemplars keeps the first m entries of its ordered list, which needs no earlier training data.

New classes are selected greedily: at step k the example is added that makes the mean of the k selected feature vectors closest to the class mean, \\( p\_k = \\arg\\min\_{x\\in X}\\left\\\|\\mu-\\frac{1}{k}\\left\[\\phi(x)+\\sum\_{j=1}^{k-1}\\phi(p\_j)\\right\]\\right\\\| \\). The result is a prioritized list in which earlier entries matter more. Herding, the procedure this follows, was shown to need fewer samples than random subsampling to reach a given approximation quality.

Removal is data independent: entries are dropped from the end, so the selection step must ensure that every prefix already approximates the class mean. Exemplars are stored as images rather than feature vectors, so they can be passed through the current network after each update.

## Updating the network with the exemplars and distillation

When data for new classes arrives, the training set combines the new examples with the stored exemplars of earlier classes. Before the update, the current network's outputs \\(q\_{yi}=g\_y(x\_i)\\) for each old class are recorded for every training image.

The network is trained by minimizing the following loss over the combined set D. \\\[ \\ell(\\Theta) = -\\sum\_{(x\_i,y\_i)\\in D}\\Big\[\\sum\_{y=s}^{t}\\delta\_{y=y\_i}\\log g\_y(x\_i)+\\delta\_{y\\neq y\_i}\\log(1-g\_y(x\_i)) + \\sum\_{y=1}^{s-1}\\big(q\_{yi}\\log g\_y(x\_i)+(1-q\_{yi})\\log(1-g\_y(x\_i))\\big)\\Big\] \\\] The first sum pushes the outputs of the new classes toward their labels, which is the classification loss, and the second pushes the outputs of old classes toward the recorded values, which is the distillation loss.

Because the loss carries a leading minus sign, minimizing it maximizes the sum of log terms inside the brackets.

Distillation was proposed by Hinton and colleagues to transfer knowledge between separate networks, whereas here it is applied inside one network across two time points. Learning without Forgetting used the same principle for several tasks, but a multi-class learner must choose among all observed classes, which is a different prediction problem.

All methods are trained with standard backpropagation, minibatches of size 128 and a weight decay of 0.00001.

## How the benchmarks are set up

Since no agreed protocol existed, classes are arranged in a fixed random order, each method is trained class-incrementally, and it is evaluated after each batch on the test data of the classes seen so far. When a single number is needed, the accuracies over the batches are averaged into average incremental accuracy.

On iCIFAR-100 all 100 classes arrive in batches of 2, 5, 10, 20 or 50, measured with multi-class accuracy on the test set, and each benchmark is run ten times with different class orders. iCaRL uses a 32-layer ResNet with a memory of K = 2000 exemplars and 70 epochs per step on this benchmark.

On ILSVRC 2012 a 100-class subset arrives in batches of 10, and all 1000 classes arrive in batches of 100, measured with top-5 accuracy on the validation part. That setting uses an 18-layer ResNet with K = 20000 exemplars and 60 epochs per class batch.

The baselines are Finetuning, Fixed representation and LwF.MC. Finetuning has no measure against forgetting; Fixed representation freezes the features after the first batch and trains only the weight vectors of new classes; LwF.MC uses distillation without exemplars and classifies with the network outputs.

## Accuracy against the baselines

On both benchmarks iCaRL is clearly the most accurate method, and its lead grows as the setting becomes more incremental, that is, as fewer classes arrive per batch. At 2 classes per batch on iCIFAR-100 iCaRL reached 57.0 against 11.7 for LwF.MC.

LwF.MC is second best in most settings, and Fixed representation takes that place on iILSVRC-full. Fixed representation scores below LwF.MC in every setting except iILSVRC-full.

Finetuning is the lowest method in all reported settings, which the authors read as confirming that catastrophic forgetting is the main obstacle.

For reference, the same network trained with all data available reached 68.6% multi-class accuracy. The authors state that iCaRL stays below systems trained in the batch setting.

## Which component carries the gain

Three hybrid variants each change one part of iCaRL: hybrid1 classifies with network outputs, hybrid2 drops the distillation loss, and hybrid3 uses neither distillation nor exemplars for classification. LwF.MC serves as the reference with distillation and without exemplars.

Classifying with network outputs (hybrid1) costs the most at small batches, with 36.6 against 57.0 at 2 classes, but reaches 68.2 against 68.6 at 50 classes. The mean-of-exemplars classifier is therefore most useful when batches are small and the representation is updated more often.

Hybrid2 is slightly above iCaRL at 2 classes per batch, 57.6 against 57.0, but below it at 5 classes, 57.9 against 61.2, and at 50 classes, 65.3 against 68.6. Distillation can hurt accuracy at very small batch sizes and is clearly useful for larger batches.

Hybrid3 reaches 57.0 at 2 classes per batch, against 11.7 for LwF.MC, which points to exemplars during training as the main way forgetting is reduced. At 50 classes per batch hybrid3 reaches 61.5 while LwF.MC reaches 64.5, so this advantage depends on the batch size. The hybrids mostly fall between iCaRL and LwF.MC, although hybrid3 at 50 classes is below LwF.MC.

## Nearest class mean and memory budget

A nearest class mean classifier computed from all training data serves as a diagnostic, and it is not class-incremental because it needs all data stored. Its class means are recomputed after every representation update, using the current feature extractor of iCaRL.

The nearest class mean classifier is slightly higher than iCaRL at every batch size in Table 1b, from 59.3 against 57.0 at 2 classes to 68.7 against 68.6 at 50 classes. The authors read the small gap as evidence that the exemplar selection picks representative exemplars.

Memory budgets between 100 and 5000 exemplars were tested with 10 classes per batch. All three classifiers improve with more memory, and from at least 1000 prototypes the mean-of-exemplars classifier performs similarly to the nearest class mean classifier, while classifying with network outputs is not competitive.

## Where the errors fall across classes

The confusion matrix of iCaRL for the 100-class model trained in batches of 10 is spread fairly evenly over classes, both on correct predictions and on errors. The authors read this as iCaRL having no intrinsic bias toward classes learned early or late.

LwF.MC has many more non-zero entries toward recently learned classes. The finetuned network predicts only labels from its last batch, while Fixed representation prefers classes from the first batch, which was used to learn the representation.

Confusion matrices for iILSVRC show the same patterns, and they are given in the appendix.

## Limitations

iCaRL's performance remains lower than what systems achieve when all training examples of all classes are available at the same time, and the authors plan to study the reasons. Only a finite number of classes can be learned unless resources are added over time, since each class needs one exemplar and one weight vector.

Other architectures could benefit from combining network parameters with exemplars, a hypothesis the authors state, but only ResNets were used in the experiments. They identify the stored exemplar images as the main reason for the strong results. Smaller learning rates may be needed with a softmax layer, and no softmax variant is reported.

Experiments cover only CIFAR-100 and ImageNet ILSVRC 2012, and the two benchmarks use different metrics, multi-class accuracy and top-5 accuracy, so their numbers are not directly comparable. Settings in which the classifier cannot store any training data in raw form were not studied.

## Paper info

- **Authors**: Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, Christoph H. Lampert
- **Venue**: arXiv · Preprint
- **First published**: 2016-11-23
- **Added**: 2026-11-12
- **Updated**: 2017-4-14
- **Version**: v2
- **arXiv**: 1611.07725
- **Category**: cs.CV · cs.LG · stat.ML
- **Original paper terms**: [arXiv non-exclusive 1.0](https://arxiv.org/licenses/nonexclusive-distrib/1.0/)
- **What we show**: Paper info and commentary

[Original paper ↗](https://arxiv.org/abs/1611.07725v2) · [PDF ↗](https://arxiv.org/pdf/1611.07725v2)

AI commentary is a separate explanation from the original paper and may contain errors. The original paper and figures follow each source's terms of use and any rights noted separately.

## Quote from the paper

Sylvestre-Alvise Rebuffi, Alexander Kolesnikov, Georg Sperl, Christoph H. Lampert (2016). iCaRL: Incremental Classifier and Representation Learning. arXiv:1611.07725v2. https://arxiv.org/abs/1611.07725v2

**BibTeX**

```
@misc{rebuffi2016icarl,
  title = {{iCaRL: Incremental Classifier and Representation Learning}},
  author = {Sylvestre-Alvise Rebuffi and Alexander Kolesnikov and Georg Sperl and Christoph H. Lampert},
  year = {2016},
  eprint = {1611.07725},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1611.07725v2}
}
```

## Other paper commentary

- [Exploring Simple Siamese Representation Learning](https://refivu.com/en/papers/d32975a6-8149-4095-86b6-ad11d1642a75-exploring-simple-siamese-representation-learning.md)
- [Unsupervised Cross-lingual Representation Learning at Scale](https://refivu.com/en/papers/6b2842f9-6ee4-433e-84ed-ae8dc85bdb0a-unsupervised-cross-lingual-representation-learning-at-scale.md)
- [DeepWalk: Online Learning of Social Representations](https://refivu.com/en/papers/dd05ed66-43b8-4f25-93ca-264ea076a439-deepwalk-online-learning-of-social-representations.md)
- [Representation Learning: A Review and New Perspectives](https://refivu.com/en/papers/b38149f8-9f53-4406-8d25-bb93c21c4bc9-representation-learning-a-review-and-new-perspectives.md)
- [Representation Learning with Contrastive Predictive Coding](https://refivu.com/en/papers/cd05bbc6-eff6-4b02-b9ef-45070ef6704a-representation-learning-with-contrastive-predictive-coding.md)
- [GloVe: Global Vectors for Word Representation](https://refivu.com/en/papers/d4308808-78ba-4fc7-a70c-6e67f906e337-glove-global-vectors-for-word-representation.md)
- [Ward's Hierarchical Clustering Method: Clustering Criterion and Agglomerative Algorithm](https://refivu.com/en/papers/f6ffd1cf-34b4-43fb-8682-2d02bbee1019-ward-s-hierarchical-clustering-method-clustering-criterion.md)
- [DARTS: Differentiable Architecture Search](https://refivu.com/en/papers/e93ed790-8383-46f1-928b-765de23e1c42-darts-differentiable-architecture-search.md)
- [Simple and Scalable Predictive Uncertainty Estimation using Deep Ensembles](https://refivu.com/en/papers/e87c2499-044c-4894-99c5-2fcf0e56d999-simple-and-scalable-predictive-uncertainty-estimation-using.md)
- [StarGAN: Unified Generative Adversarial Networks for Multi-Domain Image-to-Image Translation](https://refivu.com/en/papers/b61e89a8-05ef-4482-bc67-b5bed59283d8-stargan-unified-generative-adversarial-networks-for-multi.md)
- [A Survey on Evaluation of Large Language Models](https://refivu.com/en/papers/46dfd405-ef56-4804-b283-8d9be353baaf-a-survey-on-evaluation-of-large-language-models.md)
- [Are Transformers Effective for Time Series Forecasting?](https://refivu.com/en/papers/a7a6536f-e2ff-47d4-b119-2c6e9038e858-are-transformers-effective-for-time-series-forecasting.md)

## Terms in this paper

- [ResNet](https://refivu.com/en/terms/ca7e0121c7a8-resnet)
- [CIFAR-100](https://refivu.com/en/terms/5afa3b877d18-cifar-100)
- [Image classification](https://refivu.com/en/terms/e15c43f3bb32-image-classification)
- [Convolutional Neural Network](https://refivu.com/en/terms/610f2c09337d-convolutional-neural-network)
- [knowledge distillation](https://refivu.com/en/terms/b8544f4ba83e-knowledge-distillation)
- [catastrophic forgetting](https://refivu.com/en/terms/0039a430b4e3-catastrophic-forgetting)
- [top-5 accuracy](https://refivu.com/en/terms/6de0752ac469-top-5-accuracy)
- [feature extractor](https://refivu.com/en/terms/d73e930d7b50-feature-extractor)
- [Finetuning](https://refivu.com/en/terms/0a951298207b-finetuning)
- [multi-class accuracy](https://refivu.com/en/terms/abab52b00964-multi-class-accuracy)
- [rehearsal](https://refivu.com/en/terms/64266365e7c5-rehearsal)

---

AI-written text can contain mistakes. [Refivu](https://refivu.com/en/papers/1de3af5b-26d7-4577-82d5-dabe37a7e63a-icarl-incremental-classifier-and-representation-learning)
