Timestamp-Supervised Wearable-Based Activity Segmentation and Recognition With Contrastive Learning and Order-Preserving Optimal Transport

Songpengcheng Xia, Lei Chu, Ling Pei, Jiarui Yang, Wenxian Yu, Robert C. Qiu

TL;DR

This paper introduces a novel weakly supervised framework for wearable-based human activity recognition (HAR) that requires only a single timestamp label per activity segment. By integrating contrastive learning with order-preserving optimal transport, the model generates high-quality pseudo-labels for unlabeled data, achieving performance that rivals fully supervised methods while drastically reducing the manual annotation burden.

What Problem Does This Paper Address?

Human Activity Recognition (HAR) using wearable sensors is vital for healthcare and smart home applications. Traditionally, researchers have relied on two approaches:

  1. Sliding Windows: Segmenting data into fixed chunks. This often fails because a single window might contain multiple activities (the "multi-class window" problem).
  2. Fully Supervised Segmentation: Labeling every single data point in a sequence. While accurate, this is incredibly labor-intensive and expensive.

Unsupervised methods exist but generally yield poor results. The authors aim to bridge this gap by using timestamp supervision—where an annotator only needs to mark one sample within each activity segment. The challenge is how to train a robust model that can accurately segment and recognize activities across the entire sequence using such sparse information.

Methods

The proposed framework consists of three main technical modules designed to maximize the utility of sparse labels:

  • Multi-Stage Temporal Convolutional Network (MS-TCN): The model uses an MS-TCN backbone to capture long-range dependencies in sensory data, treating the task as a dense, sample-level prediction problem rather than a window-based one.
  • Sample-to-Prototype Contrast with CAMs: To bridge the gap between sequence classification and sample segmentation, the authors use Class Activation Maps (CAMs). These maps identify which parts of a sequence most influence a classification decision. The model uses these high-confidence areas to estimate "prototypes" (representative feature vectors) for each activity. A contrastive loss then pulls similar samples toward their respective prototypes in the embedding space.
  • Order-Preserving Optimal Transport (OPOT): To fill in the labels for the vast amount of unlabeled data between timestamps, the authors leverage Optimal Transport theory. By adding a temporal ordering constraint, the model calculates the probability of each unlabeled sample belonging to a specific activity prototype while respecting the natural sequence of events. This generates "pseudo-labels" used for further training.
Overview of the proposed framework, showing the flow from feature extraction to pseudo-label generation via optimal transport.

Datasets

The model was evaluated on four diverse, public HAR datasets:

  • Hospital Dataset: Continuous activities of elderly patients (e.g., lying, sitting, walking).
  • Opportunity Dataset: 17 sporadic gestures plus a "Null" class recorded at 30 Hz.
  • PAMAP2 Dataset: 12 diverse physical activities recorded at 100 Hz.
  • Skoda Dataset: 10 manipulative gestures from a car manufacturing scenario.

Key Insights and Ideas

  • CAMs for Time-Series: While Class Activation Maps are a staple in computer vision for object localization, this paper demonstrates they are equally effective at identifying discriminative segments in 1D sensory data, helping the model "see" where an activity is likely happening even without dense labels.
  • Temporal Constraints in Optimal Transport: Standard optimal transport doesn't care about time. By modeling the transport matrix with a Gaussian distribution centered on the diagonal (as seen in Figure 3), the authors force the model to respect the chronological order of activities, which is a powerful prior for human behavior.
  • Hybrid Pseudo-Labeling: The authors found that a simple "winner-takes-all" approach to pseudo-labels caused oscillations. They instead proposed a hybrid strategy using "hard" labels near known timestamps and "soft" (probabilistic) labels in ambiguous transition zones.
The pseudo-label generation process using order-preserving optimal transport.

Key Results

The proposed method significantly outperformed existing state-of-the-art (SOTA) weakly supervised methods and remained competitive with fully supervised models:

  • Performance Gains: Compared to other timestamp-supervised methods (like TAS-ABE), the proposed model improved the class-average F-score by 5.28% to 9.72% across the four datasets.
  • Near-Full Supervision Accuracy: On the Skoda dataset, the model achieved a 91.45% F-score with only timestamp labels, coming remarkably close to the 95.06% achieved with full sample-level supervision.
  • Efficiency: Computational analysis showed the model is more efficient than competitors, taking less training time per epoch because it avoids complex boundary estimation during the early stages of training.

Limitations and Future Work

The authors acknowledge that while the gap is narrowing, a performance difference still exists between timestamp-supervised and fully supervised settings, particularly in complex transition boundaries.

Future work will focus on:

  • Exploring even "weaker" forms of supervision to further reduce labeling effort.
  • Testing the model in more diverse, real-world "in-the-wild" scenarios where activity sequences are less structured.
  • Improving the accuracy of activity transition recognition, which remains a challenging area for all HAR models.

Summary updated

BibTeX
@article{xia2024timestamp,
  author = {Songpengcheng Xia and Lei Chu and Ling Pei and Jiarui Yang and Wenxian Yu and Robert C. Qiu},
  title = {{Timestamp-Supervised Wearable-Based Activity Segmentation and Recognition With Contrastive Learning and Order-Preserving Optimal Transport}},
  journal = {IEEE Trans. Mobile Computing},
  year = {2024},
  doi = {10.1109/tmc.2024.3381171},
}
Figure