Bayesian Learning-driven Prototypical Contrastive Loss for Class-Incremental Learning

Nisha L. Raichur, Lucas Heublein, Tobias Feigl, Alexander Rügamer, Christopher Mutschler, Felix Ott

Abstract

The primary objective of methods in continual learning is to learn tasks in a sequential manner over time (sometimes from a stream of data), while mitigating the detrimental phenomenon of catastrophic forgetting. This paper proposes a method to learn an effective representation between previous and newly encountered class prototypes. We propose a prototypical network with a Bayesian learning-driven contrastive loss (BLCL), tailored specifically for class-incremental learning scenarios. We introduce a contrastive loss that incorporates novel classes into the latent representation by reducing intra-class and increasing inter-class distance. Our approach dynamically adapts the balance between the cross-entropy and contrastive loss functions with a Bayesian learning technique. Experimental results conducted on the CIFAR-10, CIFAR-100, and ImageNet100 datasets for image classification and images of a GNSS-based dataset for interference classification validate the efficacy of our method, showcasing its superiority over existing state-of-the-art approaches.

Introduction: The Challenge of Catastrophic Forgetting

In Class-Incremental Learning (CIL), neural networks are tasked with learning a sequence of new classes over time. However, standard deep learning models suffer from "catastrophic forgetting," where training on new data leads to the erasure of previously acquired knowledge. While contrastive learning offers a way to build robust feature representations by grouping similar instances, balancing it with standard classification objectives is difficult. Over-emphasizing contrastive loss can degrade classification accuracy, while neglecting it leads to poorly defined feature clusters that are easily forgotten.

Methodology: The BLCL Framework

The proposed Bayesian Learning-driven Prototypical Contrastive Loss (BLCL) addresses these challenges through three core components:

  1. Dynamic Specialized Blocks: Building on the MEMO architecture, BLCL utilizes a shared "generalized" backbone and task-specific "specialized" blocks. Crucially, the model dynamically adjusts the depth of these specialized blocks based on task similarity. High similarity encourages knowledge reuse with fewer layers, while distinct tasks trigger expansion to capture unique features.
  2. Prototypical Contrastive Loss (CL): The model maps inputs into a latent space where instances are pulled toward their class "prototype" (center) and pushed away from others, ensuring well-separated clusters.
  3. Bayesian Dynamic Weighting: To avoid manual hyperparameter tuning, the model employs homoscedastic uncertainty to weight the Cross-Entropy (CE) and Contrastive Loss (CL) functions. By treating these weights as learnable parameters representing task noise, the model automatically balances representation learning and decision boundary refinement throughout the training process.
Overview of the BLCL framework across sequential tasks, showing the model architecture and evolving feature representations.

Experimental Setup and Datasets

The efficacy of BLCL was evaluated across four diverse datasets:

  • CIFAR-10 & CIFAR-100: Standard benchmarks for image classification.
  • ImageNet100: A subset of ImageNet used to evaluate scalability to larger class sets.
  • GNSS Interference Dataset: A real-world application involving spectrograms of Global Navigation Satellite System signals, requiring the detection of subtle interference patterns like jamming and spoofing.

Key Results and Discussion

BLCL consistently outperforms state-of-the-art (SOTA) baselines, including DER, FOSTER, and the original MEMO. On CIFAR-100, BLCL achieved a final accuracy of 70.43%, a significant improvement over standard replay-based methods. On the specialized GNSS dataset, it reached an accuracy of 96.16%.

Performance comparison of BLCL against state-of-the-art methods on CIFAR-100.

Quantitative analysis using Davies-Bouldin (DB) and Caliński-Harabasz (CH) scores confirms that BLCL produces tighter and more discriminative feature clusters. This improved organization in the latent space is a key factor in mitigating forgetting, as classes remain distinct even as new ones are added.

Conclusion and Future Work

BLCL demonstrates that dynamic architectural adaptation combined with Bayesian-driven loss balancing can significantly enhance CIL performance. However, the method still relies on a small memory buffer of "exemplars" from previous tasks. Future research will focus on achieving similar performance in exemplar-free settings and further refining the automated layer selection process to reduce reliance on predefined similarity thresholds.

Summary updated

BibTeX
@article{raichur2025bayesian,
  author = {Nisha L. Raichur and Lucas Heublein and Tobias Feigl and Alexander Rügamer and Christopher Mutschler and Felix Ott},
  title = {{Bayesian Learning-driven Prototypical Contrastive Loss for Class-Incremental Learning}},
  journal = {Accepted by TMLR},
  year = {2025},
  url = {https://openreview.net/forum?id=dNWaTuKV9M},
}
Figure