How Well Does Self-Supervised Pre-Training Perform with Streaming Data?

Dapeng Hu, Shipeng Yan, Qizhengqiu Lu, Lanqing Hong, Hailin Hu, Yifan Zhang, Zhenguo Li, Xinchao Wang, Jiashi Feng

Self-supervised learning (SSL) has traditionally relied on a "big bang" approach to training: collecting massive, static datasets and processing them all at once. However, real-world data rarely arrives on a silver platter. It is often decentralized or collected continuously in a streaming fashion.

This paper investigates a critical question: Can we pre-train SSL models on streaming data without sacrificing performance? The findings reveal that sequential self-supervised pre-training is not only highly efficient but also naturally resistant to the "catastrophic forgetting" that plagues traditional supervised learning.

The Problem: Joint vs. Sequential Training

Most state-of-the-art SSL models are developed using Joint Training (JT), where a model is trained on a massive pile of unlabeled data simultaneously. While effective, this is computationally cumbersome and inflexible when new data becomes available.

When traditional supervised models are trained sequentially—learning from new chunks of data over time—they suffer from catastrophic forgetting. They learn the new information but overwrite and "forget" the features of the old data. The authors set out to determine if SSL suffers from this same fate, and whether Sequential Training (ST) could serve as a viable replacement for the standard JT paradigm.

Experimental Setup and Data Streams

To thoroughly test this, the researchers conducted a massive empirical study, training over 500 models (primarily using the MoCo-v2 contrastive learning framework) to compare ST against JT. They evaluated these models across 12 diverse downstream classification datasets and the Pascal VOC dataset for object detection.

Crucially, they tested four distinct types of data streams to simulate varying levels of "distribution shift" (how much the data changes between chunks):

  1. Instance Incremental: Randomly split, independent and identically distributed (IID) data.
  2. Random Class Incremental: Chunks containing different sets of random classes.
  3. Distant Class Incremental: Chunks containing semantically distinct classes (e.g., animals in one chunk, vehicles in the next).
  4. Domain Incremental: Chunks from entirely different visual domains (e.g., sketches vs. real photos).
Illustration of the four different streaming data setups used to evaluate sequential pre-training.

Key Insights: SSL is a Natural Continual Learner

The most striking finding is that SSL maintains high performance across data streams, acting as a natural "continual learner."

Unlike supervised learning (SL), which falls off a cliff when trained sequentially, the performance gap between Sequential Training and Joint Training is remarkably small for SSL. On data streams with mild distribution shifts, Sequential SSL performed almost identically to Joint SSL.

Average accuracy comparison showing that Sequential SSL (SSL-ST) closely tracks Joint SSL (SSL-JT), whereas Sequential Supervised Learning (SL-ST) suffers heavily from catastrophic forgetting compared to its joint counterpart.

Even when faced with severe distribution shifts (like switching from sketches to real photos), the researchers found that simple continual learning techniques—such as Data Replay (keeping just 10% of old data) or MAS (Memory Aware Synapses, a parameter regularization method)—almost entirely eliminated the remaining performance gap between ST and JT.

Why Does SSL Resist Forgetting?

To understand why SSL behaves so differently from supervised learning, the authors analyzed the models' feature representations and loss landscapes:

  • Flatter Minima: Through landscape analysis, they discovered that SSL tends to converge to "flatter" minima in the loss landscape. Flat minima are known to generalize better and are harder to disrupt when learning new tasks, which helps explain why SSL resists forgetting old features.
  • Representation Stability: Using CKA similarity to compare feature representations, the authors showed that SSL features evolve more slowly and stay more similar to the initial model than supervised features, effectively preserving prior "knowledge."
  • Less Negative Transfer: SSL models are less likely to be "confused" by irrelevant or out-of-distribution data added later in the stream compared to supervised models.

Efficiency is the Killer App

Beyond performance parity, the practical benefit of sequential SSL is efficiency. Because the model doesn't need to re-process the entire accumulated historical dataset every time a new chunk of data arrives, sequential training scales much better for production environments. In the study's 4-chunk experiments, sequential training was approximately 4x faster than joint training.

Conclusion and Future Work

This research demonstrates that the cumbersome joint training paradigm in SSL can largely be replaced by sequential learning. This opens up a much broader spectrum of real-world applications where data is decentralized or continuously streaming.

While the empirical results are robust, the theoretical understanding of exactly why SSL naturally finds these flatter, more resilient minima remains an open question. Future work may involve developing specialized continual learning algorithms tailored to self-supervised objectives, testing on even longer sequences (hundreds of chunks), and exploring if these properties hold true in other modalities like NLP or audio.

Summary updated

BibTeX
@inproceedings{hu2022how,
  author = {Dapeng Hu and Shipeng Yan and Qizhengqiu Lu and Lanqing HONG and Hailin Hu and Yifan Zhang and Zhenguo Li and Xinchao Wang and Jiashi Feng},
  title = {{How Well Does Self-Supervised Pre-Training Perform with Streaming Data?}},
  booktitle = {International Conference on Learning Representations},
  year = {2022},
  url = {https://openreview.net/forum?id=EwqEx5ipbOu},
}
Figure