Graph-Aware Contrasting for Multivariate Time-Series Classification

Yucheng Wang, Yuecong Xu, Jianfei Yang, Min Wu, Xiaoli Li, Lihua Xie, Zhenghua Chen

TL;DR

TS-GAC introduces a novel self-supervised framework for multivariate time-series (MTS) classification that prioritizes spatial consistency alongside temporal patterns. By treating sensors as nodes in a dynamic graph and employing specialized graph augmentations and multi-level contrastive losses, it achieves state-of-the-art performance across diverse real-world datasets.

What Problem Does This Paper Address?

Multivariate Time-Series (MTS) data, common in healthcare and industrial IoT, consists of signals from multiple sensors (e.g., accelerometers on different limbs). While contrastive learning has become a go-to for self-supervised representation learning, most existing methods focus almost exclusively on temporal consistency—ensuring the model recognizes the same pattern even if it's jittered or cropped in time.

The authors argue that this overlooks spatial consistency: the stability of individual sensors and the critical correlations between them. For instance, a foot sensor is physically more correlated with a knee sensor than a hand sensor. If a single sensor experiences a disturbance (like a drop in sensitivity), a model focusing only on global temporal patterns might misclassify an action entirely, such as mistaking "running" for "walking" because the signal amplitude dropped (see Figure 1).

Disturbances in sensor signals can lead to misclassification if spatial relationships aren't preserved.

Methods

The proposed method, TS-GAC (Graph-Aware Contrasting), builds a bridge between time-series analysis and graph representation learning. The architecture follows a two-stage pipeline:

  1. Graph Augmentation: To create "weak" and "strong" views for contrastive learning, the authors use:
  2. Node Augmentations: Applying Discrete Wavelet Transforms (DWT) to perturb signals in the frequency domain, followed by temporal permutations.
  3. Edge Augmentations: They construct a graph where sensors are nodes and edges represent correlations. Crucially, they propose a "top-s" strategy: they retain the strongest correlations (preserving the topological backbone) while replacing weaker ones with random noise to force the model to be robust to relationship fluctuations.
  4. Graph Contrasting: The framework uses three distinct contrastive losses to train the encoder (a 1D-CNN + GNN pipeline):
  5. Node-level Contrasting (NC): Ensures individual sensor features are robust across different augmented views.
  6. Graph-level Contrasting (GC): Pulls global representations of the same sample closer while pushing different samples in a batch apart.
  7. Multi-Window Temporal Contrasting (MWTC): Segments the series into windows and uses an autoregressive model to predict future windows in one view from past windows in another, ensuring temporal dependency robustness.
Figure 2: Overall structure of TS-GAC. (1) Graph augmentations to augment MTS data effectively, generating weak and strong views. The graph augmentations involve node and edge augmentations, where node augmentations include both frequency and temporal augmentations to fully augment sensors. Node frequency augmentations are first applied, followed by segmenting augmented samples into multiple windows by considering the dynamic local patterns in MTS data. Node temporal augmenta- tions are utilized within each window, followed by 1D-CNN to process these windows. Subsequently, graphs are constructed and augmented through edge augmentations, and then processed by GNN. (2) Graph contrasting includes NC and GC to achieve spatial consistency. NC ensures robust sensors by pulling closer corresponding sensors in different views and pushing father different sensors in those views within each sample. GC ensures robust global features by pulling closer corresponding samples in different views and pushing father different samples in those views within each batch. MWTC further achieves temporal consistency for each sensor by summarizing past windows to contrast with future windows in another view.

Datasets

The authors evaluated TS-GAC on ten public MTS datasets, covering a wide range of applications:

  • Human Activity Recognition (HAR): Smartphone-based activity data.
  • ISRUC: Sleep stage classification from EEG/EOG/EMG signals.
  • UEA Archive: Eight large-scale datasets including FingerMovements, SpokenArabicDigits, FaceDetection, and MotorImagery.

Key Insights and Ideas

  • The Importance of "Top-s" Edges: A naive approach to graph augmentation (randomly dropping edges) can destroy the underlying structure of MTS data. By specifically protecting the strongest sensor correlations, TS-GAC maintains the "physical" logic of the system while still providing enough perturbation for effective contrastive learning.
  • Spatial Consistency is the Missing Link: The "aha moment" is that MTS data isn't just a collection of independent time series; it's a dynamic graph. By forcing the model to align sensor-level features across views (Node-level Contrasting), the model learns to ignore sensor-specific noise that would otherwise baffle a purely temporal model.
  • Visualizing Robustness: The t-SNE visualizations (Figure 4) show that TS-GAC produces much tighter, more distinct clusters for different sensors compared to previous SOTA methods like TS2Vec or TAGCN.
Figure 4: Visualization for sensor features.

Key Results

TS-GAC achieved state-of-the-art performance on 8 out of 10 datasets.

  • On the HAR dataset, it improved accuracy by 1.44% over the best baseline.
  • On the ISRUC sleep dataset, it saw a significant jump of 3.13% in accuracy.
  • Ablation studies confirmed that removing either the graph augmentations or the specific spatial contrastive losses (NC/GC) led to a noticeable drop in performance, proving that the "graph-aware" components are doing the heavy lifting.

Limitations and Future Work

While the paper demonstrates strong results, a few areas remain for exploration:

  • Hyperparameter Sensitivity: The model relies on several weighting factors ($\lambda_{MWTC}, \lambda_{NC}, \lambda_{GC}$) and the "top-s" edge parameter. While the authors provide a sensitivity analysis, finding the optimal balance for a new dataset might require significant tuning.
  • Computational Complexity: Incorporating GNNs and multi-window autoregressive models adds computational overhead compared to simpler 1D-CNN architectures.
  • Dynamic Graphs: The current approach constructs graphs based on feature similarity. Future work could explore incorporating prior physical knowledge (e.g., actual body sensor placement) to further refine the graph structure.

Summary updated

BibTeX
@inproceedings{wang2024graph,
  author = {Yucheng Wang and Yuecong Xu and Jianfei Yang and Min Wu and Xiaoli Li and Lihua Xie and Zhenghua Chen},
  title = {{Graph-Aware Contrasting for Multivariate Time-Series Classification}},
  booktitle = {AAAI Conference on Artificial Intelligence},
  year = {2024},
  doi = {10.1609/aaai.v38i14.29501},
}
Figure