Self-Supervised Human Activity Recognition With Localized Time-Frequency Contrastive Representation Learning

Setareh Rahimi Taghanaki, Michael J. Rainbow, Ali Etemad · DOI

TL;DR

This paper introduces a dual-stream self-supervised learning framework for Human Activity Recognition (HAR) that learns robust features from both raw time-series signals and time-frequency scalograms. By using contrastive learning to exploit unlabeled accelerometer data, the model achieves state-of-the-art performance and demonstrates exceptional ability to generalize across different datasets and devices.

What Problem Does This Paper Address?

Human Activity Recognition (HAR) using wearable sensors like accelerometers is vital for health monitoring, rehabilitation, and sports. However, training deep learning models for HAR typically requires massive amounts of labeled data.

Labeling sensor data is a major bottleneck: unlike images or audio, raw accelerometer signals are nearly impossible for human experts to interpret visually, making annotation expensive and time-consuming. Furthermore, models trained on one dataset often fail when applied to another due to differences in hardware, sampling rates, and user demographics. This paper tackles the "label scarcity" and "cross-dataset generalization" problems using Self-Supervised Learning (SSL).

Methods

The authors propose a dual-stream architecture that processes data in two distinct domains:

  1. The Scalogram Learner: The 1D accelerometer signal is transformed into a 2D "scalogram" using a Continuous Wavelet Transform (CWT) with Morlet wavelets. Unlike a standard Fourier Transform, CWT preserves temporal localization, showing when specific frequencies occur. A 2D CNN then learns features from these scalograms using image-based augmentations (cropping, flipping, color distortion).
  2. The Signal Learner: This stream operates directly on the 1D raw time-series data. It uses a 1D CNN and a suite of temporal augmentations specifically designed for sensor data, such as noise injection, scaling, time-warping, and channel-shuffling.

The Contrastive Framework: The model is pre-trained using SimCLR, a contrastive learning framework. The goal is to teach the network to recognize that two different "augmented views" of the same signal should have similar representations in latent space, while views from different signals should be pushed apart.

After pre-training on unlabeled data, the encoders are frozen, and a small classification head is added and fine-tuned with a limited amount of labeled data. Finally, the outputs of both streams are combined using late fusion (score-level) to make the final prediction.

Datasets

The study evaluates the model on four prominent HAR datasets:

  • MotionSense: 6 daily activities recorded via iPhone 6s.
  • HAPT: 12 activities (including postural transitions like sit-to-stand) recorded via Samsung Galaxy S2.
  • HHAR (Heterogeneous HAR): 6 activities recorded across 8 different smartphone models and 4 smartwatches to test device-independence.
  • MobiAct: A large dataset (66 participants, 11 activities + falls) used specifically for cross-dataset transfer learning experiments.

Key Insights and Ideas

  • The Power of Two Domains: The "aha moment" is that time-domain features (capturing raw motion patterns) and frequency-domain features (capturing periodicities) are complementary. The ablation study showed that the fused model consistently outperformed either individual stream.
  • Wavelets > Fourier: By using Morlet wavelets instead of Short-Time Fourier Transforms (STFT), the model gains better resolution for non-stationary signals—essentially, it's better at catching the exact moment an activity changes.
  • Superior Generalization: The model proved highly effective at transfer learning. When pre-trained on MobiAct and fine-tuned on MotionSense, it outperformed models trained from scratch on the target data, proving that SSL captures universal "human motion" features that transcend specific hardware.
  • Negative Pairs Matter: The authors compared SimCLR (which uses negative pairs) with SimSiam (which doesn't). In the context of sensor data, they found that explicitly pushing different samples apart (negative pairs) led to significantly better representation learning.

Key Results

  • State-of-the-Art (SOTA): The proposed method set new benchmarks across all three evaluation datasets, achieving F1-scores of 0.943 on MotionSense, 0.915 on HAPT, and 0.850 on HHAR.
  • Cross-Dataset Success: In transfer learning tests (pre-trained on MobiAct), the model achieved an F1-score of 0.926 on MotionSense, significantly outperforming previous SSL methods like multi-task learning and masked reconstruction.
  • Robustness: The high performance on the HHAR dataset demonstrates that the model is robust to the "noise" introduced by different device manufacturers and sensor placements.

Limitations and Future Work

  • Class Imbalance: The authors noted that in datasets like HAPT, basic activities (walking, sitting) far outnumber transition activities (stand-to-sit), which can skew results. Future work could integrate imbalanced learning techniques into the SSL pipeline.
  • Architecture Exploration: While CNNs were used here, the authors suggest exploring Recurrent Neural Networks (RNNs) or Transformers for the signal encoder to better capture long-term temporal dependencies.
  • Augmentation Optimization: The study highlights that the choice of augmentation is critical. Future research could focus on "automated augmentation" to find the most meaningful transformations for specific activity types.

Summary updated

BibTeX
@article{taghanaki2023self,
  author = {Setareh Rahimi Taghanaki and Michael J. Rainbow and Ali Etemad},
  title = {{Self-Supervised Human Activity Recognition With Localized Time-Frequency Contrastive Representation Learning}},
  journal = {IEEE Trans. Hum. Mach. Syst.},
  year = {2023},
  doi = {10.1109/thms.2023.3303438},
}
Figure