Rethinking Class-incremental Learning in the Era of Large Pre-trained Models via Test-Time Adaptation

Imad Eddine Marouf, Subhankar Roy, Enzo Tartaglione, Stéphane Lathuilière · OpenReview

Abstract

Class-incremental learning (CIL) is a challenging task that involves continually learning to categorize classes into new tasks without forgetting previously learned information. The advent of large pre-trained models (PTMs) has fast-tracked progress in CIL due to their highly transferable representations. Tuning a small set of parameters often results in state-of-the-art performance compared to traditional CIL methods trained from scratch. However, repeated fine-tuning on each task can destroy the rich representations of PTMs and lead to forgetting. To strike a balance between stability and plasticity, we propose eliminating training on every new task and instead performing test-time adaptation (TTA) directly on test instances. We introduce PLASTIC (Plasticity-Enhanced Test-Time Adaptation in Class-Incremental Learning), a framework that fine-tunes Layer Norm parameters on test instances for task-specific features and resets them to preserve stability. PLASTIC avoids forgetting while benefiting from rich PTM features and demonstrates robustness to common data corruptions.

Introduction

In Class-Incremental Learning (CIL), a model must learn new classes over time without suffering from "catastrophic forgetting" of previously learned information. A popular and efficient strategy in the era of Large Pre-trained Models (PTMs) is First-Session Adaptation (FSA). In FSA, a model is fine-tuned on the very first task and then frozen for all subsequent tasks. While this preserves the model's stability, it severely lacks "plasticity"—the ability to adapt to new, diverse data distributions.

Comparison of traditional CIL and the proposed PLASTIC framework.

While FSA works well if all subsequent tasks are similar (homogeneous), it fails in real-world scenarios where tasks are diverse (heterogeneous). For instance, a model fine-tuned on natural images may struggle when suddenly presented with satellite imagery or medical scans. The proposed PLASTIC framework addresses this by restoring adaptability at inference time without the massive computational cost of retraining or the risk of forgetting.

The PLASTIC Framework

PLASTIC introduces a two-phase approach that shifts the learning burden from a dedicated training phase to the inference phase.

Phase I: First-Session Adaptation

Similar to standard FSA, lightweight "Adapters" are inserted into a Vision Transformer (ViT) backbone. These adapters are trained only on the labeled data of the very first task. This establishes a strong base representation while keeping the majority of the PTM parameters frozen.

Phase II: Continual Test-Time Model Refinement

This is the core innovation of the framework. When the model encounters a batch of unlabeled test images, it performs Test-Time Adaptation (TTA) to bridge the distribution gap.

Overview of the PLASTIC framework showing Phase I (Adapter Training) and Phase II (Test-Time Adaptation).
  • Entropy Minimization: The model performs a single gradient update to make its predictions more confident and invariant to augmentations.
  • LayerNorm Tuning: To prevent the model from "breaking" its pre-trained knowledge, only the LayerNorm parameters are updated. This involves a tiny fraction of the total weights (approximately 0.04M out of 87M).
  • Teacher-Student Distillation: To maintain stability, a "Teacher" model (an exponential moving average of the student) provides stable representations. The student learns from the teacher via a KL-divergence loss.
  • The Reset Mechanism: Crucially, the student model is reset to its original state after each test batch. This prevents error accumulation and ensures the model does not drift into unstable states when encountering noisy data.

Experimental Evaluation

Datasets and Benchmarks

The researchers evaluated PLASTIC across a wide array of benchmarks to test both standard and heterogeneous CIL performance:

  • Standard CIL: CIFAR100, CUB200, ImageNet-R, ImageNet-A, and OmniBench.
  • Heterogeneous CIL: The VTAB benchmark (comprising 19 diverse tasks) and a 5-Datasets sequence (SVHN, MNIST, CIFAR10, NotMNIST, FashionMNIST).
  • Robustness: Corrupted versions of these datasets (e.g., CIFAR100-C) were used to evaluate reliability under 15 types of real-world noise and blur.

Key Results

  • State-of-the-Art Performance: PLASTIC achieved an average accuracy of 83.36% across six major benchmarks, outperforming established methods like ADAM (80.02%) and RanPAC (82.69%).
  • Superior Adaptability: On the highly diverse VTAB benchmark, PLASTIC reached 91.57% accuracy, a significant improvement over the 85.99% achieved by a standard frozen Nearest Class Mean (NCM) classifier.
  • Inherent Robustness: By adapting to the data it sees, PLASTIC is naturally resistant to corruption. On CIFAR100-C, it outperformed the next best method by over 5%.
  • Efficiency: PLASTIC remains highly efficient during the training phase because it only requires training on the initial task.

Discussion and Conclusion

PLASTIC demonstrates that a model does not need a dedicated training phase for every new task to be effective. By treating inference as a mini-learning session, the model can effectively bridge distribution gaps. The findings highlight that updating only LayerNorm parameters provides the optimal balance between flexibility and stability.

However, some limitations remain. The primary drawback is inference latency, as performing gradient updates before predictions is computationally more expensive than a standard forward pass. Currently, the method achieves roughly 8 frames per second (FPS) on an A100 GPU, which may be insufficient for real-time edge applications. Future work will explore advanced sampling strategies to determine which test images require adaptation, potentially increasing processing speed without sacrificing accuracy.

Summary updated

BibTeX
@misc{marouf2023rethinking,
  author = {Imad Eddine Marouf and Subhankar Roy and Enzo Tartaglione and Stéphane Lathuilière},
  title = {{Rethinking Class-incremental Learning in the Era of Large Pre-trained Models via Test-Time Adaptation}},
  year = {2023},
  eprint = {2310.11482},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2310.11482},
}
Figure