NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Detachedly Learn a Classifier for Class-Incremental Learning

Ziheng Li, Shibo Jie, Zhi-Hong DengarXiv 2023

Abstract

In continual learning, a model needs to continually learn a feature extractor and classifier on a sequence of tasks. This paper focuses on how to learn a classifier based on a pretrained feature extractor under a continual learning setting. We present a probabilistic analysis showing that the failure of vanilla experience replay (ER) stems from unnecessary re-learning of previous tasks and an inability to distinguish the current task from previous ones, leading to knowledge degradation and prediction bias. To overcome these weaknesses, we propose a novel strategy: Task-Aware Experience Replay (TaER). It rebalances the replay loss and detaches classifier weights for old tasks from the update process, keeping previous knowledge intact and alleviating overfitting on episodic memory. Experimental results show our method outperforms current state-of-the-art methods.

Introduction

Artificial neural networks are notoriously susceptible to "catastrophic forgetting." When trained on a sequence of tasks, they tend to lose previously acquired information to accommodate new data. In the field of Class-Incremental Learning (CIL), the model must learn to distinguish between an ever-growing set of classes. Standard approaches often use Experience Replay (ER), where a small "episodic memory" of old samples is mixed with new data. However, vanilla ER faces two major hurdles: knowledge degradation, where the model's ability to classify old tasks worsens due to updates on unrepresentative memory sets, and prediction bias, where the model favors recent classes due to data imbalance.

Methodology

The authors propose Task-Aware Experience Replay (TaER), which operates on a linear probing paradigm. In this setup, the feature extractor remains frozen, and only the final classification layer is trained. This leverages the stable features provided by powerful pretrained models like ViT or ResNet.

The TaER architecture showing detached weights and dynamic loss balancing.

The core innovations of TaER are:

  • Detached Classifier Weights: When learning a new task $t$, TaER only allows the weights corresponding to the current task's classes to be updated. The weights for all previous tasks ($1$ to $t-1$) are "detached" from the gradient flow. This ensures that the decision boundaries for old classes remain exactly as they were when first learned.
  • Dynamic Loss Balancing: To combat prediction bias, a weighting factor $\lambda$ is introduced for the replay loss. Calculated as the ratio of old classes to total seen classes ($\lambda = |Y_{1:t-1}| / |Y_{1:t}|$), this factor mathematically mimics a class-balanced joint training session.
  • Probabilistic Framework: The authors provide a formal analysis showing that TaER avoids the overfitting inherent in vanilla ER by treating old task distributions as fixed rather than trying to re-learn them from a tiny memory set.

Experimental Setup

The method was evaluated on three standard computer vision benchmarks: CIFAR100, CUB200 (fine-grained bird species), and CORe50 (robotic object recognition). The researchers used ViT-S/16 and ResNet18 backbones, both pretrained on ImageNet, as frozen feature extractors.

Results

TaER consistently outperformed state-of-the-art (SOTA) baselines such as iCaRL, DER++, and UCIR across all benchmarks.

Accuracy comparison on CIFAR100 and CUB200 benchmarks.

Key performance metrics include:

  • CIFAR100: Using a ViT-S/16 backbone, TaER achieved 71.37% average accuracy, significantly higher than SS-IL (65.36%).
  • ResNet18 Performance: Even with a smaller backbone, TaER maintained a massive lead on CIFAR100 (55.50% vs. SS-IL's 36.31%).
  • Scalability: The performance gap grows with the number of tasks. In a 50-task split on CIFAR100, TaER maintained 66.62% accuracy, while others dropped below 50%.

Discussion

The primary insight is that not updating old weights is often superior when using a powerful, frozen pretrained extractor. In traditional CIL, weights must update because features change; however, with stable features, updating on a few memory samples causes more harm than good. By separating intra-task and inter-task learning, TaER perfectly preserves intra-task knowledge and focuses solely on the inter-task boundary. This approach is also highly efficient, as it avoids full-model fine-tuning.

Conclusion

TaER offers a simple yet highly effective strategy for class-incremental learning. While it relies on the quality of the pretrained feature extractor, it effectively eliminates catastrophic forgetting and reduces prediction bias. Future work could explore "exemplar-free" versions or methods to adapt features slightly without triggering forgetting, potentially through adapters or prompt tuning.

Summary updated

BibTeX
@misc{li2023detachedly,
  author = {Ziheng Li and Shibo Jie and Zhi-Hong Deng},
  title = {{Detachedly Learn a Classifier for Class-Incremental Learning}},
  year = {2023},
  eprint = {2302.11730},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2302.11730},
}
Figure