Time-Series Representation Learning via Temporal and Contextual Contrasting

Emadeldeen Eldele, Mohamed Ragab, Zhenghua Chen, Min Wu, Chee Keong Kwoh, Xiaoli Li, Cuntai Guan

Introduction

Deep learning has revolutionized fields like computer vision, but its "hunger" for labeled data remains a significant barrier in specialized domains. In time-series applications—such as EEG monitoring, IoT sensors, or industrial machinery—labeling is often a complex task requiring expensive domain expertise. Unlike images, where a layperson can identify objects, time-series signals are often unintuitive to the untrained eye.

TS-TCC (Time-Series Temporal and Contextual Contrasting) is a self-supervised framework designed to bridge this gap. By leveraging the inherent temporal dependencies of these signals, it learns powerful representations from unlabeled data, achieving performance comparable to supervised learning even when labeled data is scarce.

The TS-TCC Framework

The TS-TCC framework operates through a three-stage process that emphasizes both local temporal patterns and global context:

  1. Dual-View Augmentation: For every input sample, the model creates two versions: a weak augmentation (adding small variations in scale and jitter) and a strong augmentation (randomly shuffling segments of the signal and adding jitter).
  2. Temporal Contrasting (TC): This module uses a Transformer-based architecture to perform a "tough" cross-view prediction task. The model looks at the past of one view (e.g., the strong augmentation) and attempts to predict the future timesteps of the other view (the weak augmentation). This forces the model to learn robust features that are invariant to specific perturbations.
  3. Contextual Contrasting (CC): While TC focuses on local temporal patterns, the CC module looks at the "big picture." It uses a contrastive loss to ensure that the overall summary (context) of two different views of the same sample are similar, while summaries of different samples are pushed apart in the feature space.
The TS-TCC architecture illustrating the interaction between Temporal and Contextual Contrasting modules.

Experimental Results

The authors evaluated TS-TCC on four diverse real-world datasets: Human Activity Recognition (HAR), Sleep-EDF (EEG), Epilepsy (EEG), and a mechanical Fault Diagnosis (FD) dataset.

Label Efficiency

A key finding is the framework's remarkable label efficiency. In scenarios where labeled data is extremely limited, TS-TCC significantly outperforms traditional supervised methods. For example, on the HAR dataset, it achieved approximately 70% accuracy with just 1% of the labels, whereas supervised learning struggled to reach 50%. With only 10% of labeled data, the model reaches performance levels comparable to supervised models trained on 100% of the data.

Performance comparison of TS-TCC vs. supervised learning under varying labeled data availability.

Transfer Learning and Generalization

TS-TCC also excels in transfer learning. When trained on one industrial "working condition" and tested on another, the framework outperformed supervised training in 8 out of 12 scenarios. This suggests that the learned features are generalizable and capture the underlying dynamics of the data rather than overfitting to specific experimental setups.

Conclusion

TS-TCC demonstrates that self-supervised learning can effectively handle the unique challenges of time-series data. By combining cross-view temporal predictions with global contextual contrasting, the framework provides a robust solution for representation learning in domains where expert labels are a bottleneck. Future work may involve designing more domain-specific augmentations, such as frequency-domain shifts, to further enhance the discriminative power of the learned features.

Summary updated

BibTeX
@inproceedings{eldele2021time,
  author = {Emadeldeen Eldele and Mohamed Ragab and Zhenghua Chen and Min Wu and Chee Keong Kwoh and Xiaoli Li and Cuntai Guan},
  title = {{Time-Series Representation Learning via Temporal and Contextual Contrasting}},
  booktitle = {International Joint Conference on Artificial Intelligence},
  year = {2021},
  doi = {10.24963/ijcai.2021/324},
}
Figure