Skip to main content
QUICK REVIEW

[Paper Review] Self-Supervised Learning for Time Series: Contrastive or Generative?

Ziyu Liu, Azadeh Alavi|arXiv (Cornell University)|Mar 14, 2024
Time Series Analysis and ForecastingComputer Science3 citations
TL;DR

This paper conducts a comprehensive empirical comparison of contrastive (SimCLR) and generative (MAE) self-supervised learning methods for time series data. It demonstrates that generative models converge faster and outperform on small fine-tuning datasets (~100 samples), while contrastive models slightly outperform on larger datasets, offering practical guidance for method selection based on data availability.

ABSTRACT

Self-supervised learning (SSL) has recently emerged as a powerful approach to learning representations from large-scale unlabeled data, showing promising results in time series analysis. The self-supervised representation learning can be categorized into two mainstream: contrastive and generative. In this paper, we will present a comprehensive comparative study between contrastive and generative methods in time series. We first introduce the basic frameworks for contrastive and generative SSL, respectively, and discuss how to obtain the supervision signal that guides the model optimization. We then implement classical algorithms (SimCLR vs. MAE) for each type and conduct a comparative analysis in fair settings. Our results provide insights into the strengths and weaknesses of each approach and offer practical recommendations for choosing suitable SSL methods. We also discuss the implications of our findings for the broader field of representation learning and propose future research directions. All the code and data are released at \url{https://github.com/DL4mHealth/SSL_Comparison}.

Motivation & Objective

  • To provide a fair, empirical comparison between contrastive and generative self-supervised learning methods in the context of time series.
  • To identify the strengths and weaknesses of each approach under controlled, comparable settings.
  • To offer practical recommendations for selecting SSL methods based on dataset size and downstream task requirements.
  • To explore the implications of findings for broader representation learning and future research directions.

Proposed method

  • Adapted SimCLR for time series using time-sensitive data augmentations to generate positive sample pairs.
  • Implemented Masked Autoencoder (MAE) as a representative generative SSL method, training on masked input sequences with reconstruction loss.
  • Conducted comparative experiments under identical hyperparameters, data splits, and evaluation protocols to ensure fairness.
  • Used downstream classification tasks to evaluate representation quality after pre-training on unlabeled time series data.
  • Applied standard evaluation metrics such as accuracy and F1-score on fine-tuned linear probes to assess representation quality.
  • Analyzed convergence speed, generalization performance, and robustness across varying dataset sizes.
Figure 1: Frameworks of contrastive and generative self-supervised representation learning. The downstream classification task in fine-tuning can be easily extended to other tasks such as forecasting and clustering. In MAE, the gray blocks refer to the masked-out patches.
Figure 1: Frameworks of contrastive and generative self-supervised representation learning. The downstream classification task in fine-tuning can be easily extended to other tasks such as forecasting and clustering. In MAE, the gray blocks refer to the masked-out patches.

Experimental results

Research questions

  • RQ1How do contrastive (SimCLR) and generative (MAE) SSL methods compare in terms of convergence speed and final performance on time series data?
  • RQ2Does the size of the downstream fine-tuning dataset influence which SSL approach performs better?
  • RQ3What are the relative strengths and weaknesses of each method in terms of representation quality and training efficiency?
  • RQ4How do these methods generalize across diverse time series patterns and data distributions?

Key findings

  • Generative SSL (MAE) converges significantly faster than contrastive SSL (SimCLR) during pre-training.
  • On small downstream datasets (~100 samples), MAE achieves superior performance compared to SimCLR.
  • On larger downstream datasets, SimCLR slightly outperforms MAE, indicating better generalization capacity with abundant data.
  • The choice between contrastive and generative SSL should be guided by dataset size: generative for small data, contrastive for large data.
  • Both methods benefit from careful data augmentation and pre-training, but computational efficiency differs, with MAE being more efficient in training time.
  • The study highlights the need for hybrid models that combine the strengths of both approaches for robust time series representation learning.
Figure 2: Performance on the test set (label ratio = 0.1; 100 epochs). (a) Comparison of SimCLR’s performance with and without pre-training. (b) Comparison of MAE’s performance with and without pre-training. (c) A comparative view of SimCLR and MAE, both with pre-training.
Figure 2: Performance on the test set (label ratio = 0.1; 100 epochs). (a) Comparison of SimCLR’s performance with and without pre-training. (b) Comparison of MAE’s performance with and without pre-training. (c) A comparative view of SimCLR and MAE, both with pre-training.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.