Tackling Online One-Class Incremental Learning by Removing Negative Contrasts

Nader Asadi, Sudhir Mudur, Eugene Belilovsky

TL;DR

This paper tackles the extreme challenge of online one-class incremental learning, where a machine learning model must learn from a continuous stream of data introducing only one class at a time. By adapting self-supervised learning techniques that eliminate the need for "negative pairs," the authors introduce two methods—SupBYOL and Continual Contrast of Class Prototypes (CCP)—that prevent catastrophic forgetting without requiring multi-class training batches.

What Problem Does This Paper Address?

In online continual learning (OCL), a model processes a non-stationary stream of data, learning new concepts on the fly while trying not to forget old ones (a dilemma known as catastrophic forgetting). Typically, OCL methods rely on experience replay, storing a small buffer of old samples to mix with incoming data. Recent state-of-the-art methods use contrastive learning to push different classes apart in the model's feature space.

However, these methods suffer from a major flaw: they critically rely on having negative contrasts (samples from different classes) present within the incoming batch. If the data stream delivers only one class at a time (one-class incremental learning), these contrastive methods completely break down. They cannot learn effective representations because they have nothing to contrast the new class against.

Methods

To unlock this constraint, the authors look to self-supervised learning—specifically BYOL (Bootstrap Your Own Latent)—which is famous for learning high-quality representations without using negative pairs. They adapt this into two distinct approaches for supervised OCL:

  1. Supervised BYOL (SupBYOL): This method introduces a twin-network architecture (an online network and a target network). The online network learns from the incoming batch by predicting the target network’s representations of different augmented views of the same class. This allows the model to learn a new class in complete isolation from others.
  2. Continual Contrast of Class Prototypes (CCP): While SupBYOL works, it has a large computational footprint and can suffer from representation collapse (where the model maps all inputs to a constant vector). To fix this, CCP replaces the twin-network architecture with randomly initialized class prototypes (cluster centers in the embedding space).

As shown in the objective function below, CCP minimizes intra-class variance by pulling samples toward their respective prototype, while enforcing inter-class variance by pushing the prototypes themselves apart. Crucially, to protect past knowledge, old prototypes are not updated via direct gradients; instead, they receive stable, slow momentum updates using replayed buffer samples.

Datasets

The authors evaluated their methods on two standard computer vision benchmarks, adapted for both one-class ($S=1$) and multi-class ($S>1$) streaming scenarios:

  • Split CIFAR-10: Partitioned into 10 distinct tasks (1 class per task) for the one-class setting, and 5 tasks (2 classes per task) for the multi-class setting.
  • Split CIFAR-100: Partitioned into 100 distinct tasks for the one-class setting, and 20 tasks (5 classes per task) for the multi-class setting.

Testing was conducted across various memory buffer sizes ($M = 5, 20, 50, 100$).

Key Insights and Ideas

  • Borrowing from Self-Supervised Learning: The core "aha moment" is realizing that the architectural tricks used to prevent representation collapse in self-supervised learning (like BYOL's predictor head and exponential moving averages) are uniquely suited to solve the one-class data bottleneck in continual learning.
  • Prototypes as Proxies for Negatives: Instead of needing a diverse batch of actual images to contrast against, CCP contrasts class prototypes. This provides the necessary "push-apart" force to maintain distinct class boundaries without requiring multi-class data in the current stream.

Key Results

In the strict one-class incremental setting, existing contrastive methods like ER-AML and ER-ACE cannot function. Compared to standard Experience Replay (ER) and other baselines, SupBYOL and CCP achieve massive performance leaps.

  • Split CIFAR-10 (One-Class, Buffer = 100): CCP achieved 39.1% accuracy, nearly doubling standard Experience Replay (21.2%). It also slashed forgetting to 21.9% compared to ER's 45.7%.
  • Split CIFAR-100: As shown in the evaluation plots below, both SupBYOL and CCP dominate the one-class setting (left plot) while remaining highly competitive with state-of-the-art multi-class methods like ER-AML in the multi-class setting (right plot).
Figure 1: Split CIFAR-100 anytime evaluation results in one-class(left) and multi-class(right) incremental settings with M = 100. SupBOYL and CCP greatly outperform the existing methods in one-class setting while being competitive with the top performing methods in multi-class setting. Note that ER-ACE and ER-AML cannot be applied in one-class setting since they require more than one class in the incoming data.

Limitations and Future Work

While CCP successfully reduces the computational overhead of SupBYOL, managing representation collapse in a purely online, single-pass data stream remains a delicate balancing act. Additionally, the authors note that their current work focuses strictly on the online budget-constrained setting; they suggest that exploring how these negative-free contrastive mechanisms behave in offline one-class incremental learning is a promising direction for future research.

Summary updated

Abstract

Recent work studies the supervised online continual learning setting where a learner receives a stream of data whose class distribution changes over time. Distinct from other continual learning settings the learner is presented new samples only once and must distinguish between all seen classes. A number of successful methods in this setting focus on storing and replaying a subset of samples alongside incoming data in a computationally efficient manner. One recent proposal ER-AML achieved strong performance in this setting by applying an asymmetric loss based on contrastive learning to the incoming data and replayed data. However, a key ingredient of the proposed method is avoiding contrasts between incoming data and stored data, which makes it impractical for the setting where only one new class is introduced in each phase of the stream. In this work we adapt a recently proposed approach (\textit{BYOL}) from self-supervised learning to the supervised learning setting, unlocking the constraint on contrasts. We then show that supplementing this with additional regularization on class prototypes yields a new method that achieves strong performance in the one-class incremental learning setting and is competitive with the top performing methods in the multi-class incremental setting.
BibTeX
@misc{asadi2021tackling,
  author = {Nader Asadi and Sudhir Mudur and Eugene Belilovsky},
  title = {{Tackling Online One-Class Incremental Learning by Removing Negative Contrasts}},
  year = {2021},
  eprint = {2203.13307},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2203.13307},
}
Figure