Time-series Change Point Detection with Self-Supervised Contrastive Predictive Coding

Shohreh Deldari, Daniel V. Smith, Hao Xue, Flora D. SalimWWW 2020 · DOI

Introduction

Change Point Detection (CPD) is the process of identifying abrupt transitions in the underlying state of a dynamic system. Applications range from human activity recognition via wearable sensors to monitoring server traffic for anomalies. Despite its importance, CPD research faces two primary challenges: the generalization gap, where methods designed for statistical shifts (e.g., mean/variance) fail to detect temporal motif changes, and label scarcity, as manual annotation of change points in high-frequency data is both expensive and subjective.

To address these hurdles, this paper introduces $TS-CP^2$, a novel self-supervised framework that leverages Contrastive Predictive Coding (CPC) to learn robust representations of time series data without the need for human labels.

The $TS-CP^2$ Methodology

The $TS-CP^2$ framework operates on the principle that adjacent temporal windows should share similar latent representations, while distant windows should be distinct. When the system transitions to a new state, the similarity between consecutive windows drops, creating a detectable "representation mismatch."

Conceptual overview of representation mismatch between history and future windows.

Architecture and Representation Learning

The core of the system is a Temporal Convolutional Network (TCN) encoder based on the WaveNet architecture. The authors chose TCNs over traditional Recurrent Neural Networks (RNNs) because they handle long-range dependencies more effectively and offer superior training stability for contrastive tasks. This encoder maps raw time series windows into a compact embedding space.

Architecture of the TCN-based encoder and prediction head.

Contrastive Strategy and Loss

The model is trained using a self-supervised objective with the following sampling strategy:

  • Positive Pairs: Immediately adjacent temporal windows. The model maximizes the similarity between their embeddings.
  • Negative Pairs: Windows sampled from distant parts of the time series, separated by a minimum temporal distance to avoid confusing the model with windows from the same stable state.

The training utilizes the InfoNCE (Noise Contrastive Estimation) loss function, which forces the encoder to capture the shared information that characterizes stable system states.

Experimental Evaluation

The model was evaluated on three diverse real-world benchmarks:

  1. Yahoo! Benchmark: Web service traffic data featuring trends and seasonality.
  2. HASC (Human Activity Sharing Center): Accelerometer data capturing transitions between physical activities (e.g., walking to standing).
  3. USC-HAD (USC Human Activity Dataset): High-frequency (100Hz) accelerometer data covering 12 distinct activities.

Detection Mechanism

Once trained, detection is performed by sliding the encoder across the time series and calculating the cosine similarity between consecutive window embeddings. A change point is flagged whenever this similarity falls significantly below a moving average.

Results and Key Insights

$TS-CP^2$ demonstrated a significant performance leap over both traditional and deep learning baselines:

  • Superior Accuracy: The model outperformed five state-of-the-art methods, including KL-CPD and RuLSIF.
  • Quantitative Gains: On average, $TS-CP^2$ improved the F1-score by 79.4% over handcrafted statistical methods and by 17.0% over existing deep learning approaches.
  • Domain Agnosticism: Unlike competitors that specialize in specific types of changes, $TS-CP^2$ performed consistently well across both statistical shifts (Yahoo) and physical transitions (HASC/USC-HAD).
  • Efficiency: The detection phase is computationally light, relying on simple cosine similarity checks, making it suitable for potential online or low-resource deployment.

Conclusion and Future Work

While $TS-CP^2$ sets a new benchmark for unsupervised CPD, challenges remain in high-frequency environments where change points occur in rapid succession, potentially contaminating the "positive pairs" during training. Future research directions include exploring data augmentation (e.g., jittering) to improve representation robustness and implementing "hard negative mining" to further refine the model's discriminative power between similar but distinct system states.

Summary updated

BibTeX
@inproceedings{deldari2020time,
  author = {Shohreh Deldari and Daniel V. Smith and Hao Xue and Flora D. Salim},
  title = {{Time-series Change Point Detection with Self-Supervised Contrastive Predictive Coding}},
  booktitle = {The Web Conference},
  year = {2020},
  doi = {10.1145/3442381.3449903},
}
Figure