Hierarchical Span-Based Conditional Random Fields for Labeling and Segmenting Events in Wearable Sensor Data Streams

Roy J. Adams, Nazir Saleheen, Edison Thomaz, Abhinav Parate, Santosh Kumar, Benjamin M. Marlin

Overview

This paper introduces a Hierarchical Span-Based Conditional Random Field (HNS) designed to jointly detect discrete events (like smoking puffs) and segment them into high-level activity sessions (like smoking a cigarette) from wearable sensor data. By incorporating domain-specific constraints—such as event counts and durations—directly into the model, the authors achieve state-of-the-art segmentation performance while maintaining efficient, exact inference.

The Challenge: Noisy Sessions in mHealth

In the realm of mobile health (mHealth), researchers rely on wearable sensors to track behaviors like smoking and eating. This tracking involves two distinct but related tasks:

  1. Event Detection: Identifying a single discrete action, such as a hand-to-mouth gesture or a specific respiration cycle.
  2. Session Segmentation: Grouping these individual events into a meaningful "session," like a 10-minute meal or a 5-minute smoking break.

The primary challenge is that real-world sessions are "noisy." A smoking session isn't just a continuous block of puffs; it is a heterogeneous mix of puffs and non-puffs (e.g., normal breathing) occurring over an arbitrary length of time. Previous approaches typically treated these as separate problems—detecting events first and then using ad-hoc rules to group them. This paper argues that by modeling the hierarchy jointly, the high-level structure of a session can be used to improve the detection of individual events, and vice-versa.

Proposed Method: The Hierarchical Span-Based CRF (HNS)

To address these challenges, the authors propose the Hierarchical Span-Based CRF (HNS). Unlike standard linear-chain CRFs that label every single time point independently, this model operates on spans (intervals of time).

Comparison of CRF architectures: (a) Linear-chain CRF, (b) Tree-structured CRF, and (c) the proposed Hierarchical Span-Based CRF (HNS).

The HNS utilizes a unique three-layer architecture:

  • Event Level: Labels individual sensor "periods" (e.g., respiration cycles) as positive or negative events.
  • Inter-Event Level: Models the gaps and durations between positive events within a broader session.
  • Session Level: Labels long-range spans as active sessions or background noise.

The model's "secret sauce" lies in its higher-order factors. It includes cardinality factors (which model how many puffs typically make up a cigarette) and duration factors (which model the typical time between puffs). Despite the complexity of hierarchical spans, the authors developed a dynamic programming algorithm that performs exact Maximum A Posteriori (MAP) inference in quadratic time ($O(n^2)$). The model is trained using the Structured Support Vector Machine (SSVM) framework, allowing it to optimize for specific loss functions like Hamming loss.

Datasets

The model was evaluated on one synthetic dataset and four real-world mHealth datasets:

  1. mPuff (MP): Respiration data from smokers using a chest band.
  2. puffMarker (PM): Respiration and actigraphy (wrist-worn) data from smokers.
  3. RisQ (RQS): Wrist-worn actigraphy data for smoking gesture detection.
  4. Thomaz et al. (T): Wrist-worn actigraphy data for eating gesture detection.

Key Insights

  • Joint Modeling Wins: The primary insight is that "top-down" knowledge of what a session looks like (e.g., "a meal usually lasts 20 minutes and has at least 10 bites") provides a powerful prior that helps clean up "bottom-up" event detections.
  • Heterogeneity is Key: Unlike Semi-Markov CRFs, which assume everything inside a span has the same label, the HNS allows for "heterogeneous" labels. It recognizes that a "smoking session" span inherently contains both "puff" and "not-a-puff" events.
  • Domain Knowledge as Constraints: By using cardinality factors, the model can effectively "count." If a detected session has an unrealistic number of events for that activity, the model can reject that segmentation in favor of a more statistically likely one.

Results and Performance

The HNS demonstrated strong performance across both primary tasks:

  • Task 1 (Event Detection): The HNS performed better than or equal to Logistic Regression (LR) and Tree-Structured CRFs (T-CRF) across most datasets. On the eating dataset (T), the improvement was statistically significant.
  • Task 2 (Activity Segmentation): This is where the model truly shined. The HNS outperformed the T-CRF baseline on three out of four real-world datasets, showing F1 score improvements ranging from 0.082 to 0.266.
Performance of HNS compared to LR and T-CRF under increasing sensor noise levels.
  • Synthetic Validation: In simulations with high sensor noise, the HNS maintained high performance while simpler models (LR and T-CRF) crashed. This proves that the hierarchical structure effectively compensates for poor signal quality by relying on higher-level session constraints.

Limitations and Future Work

While highly effective, the approach has a few limitations:

  • Computational Complexity: Although $O(n^2)$ is efficient for many tasks, the authors had to split very long data streams into smaller "data cases" to keep processing times manageable.
  • Feature Engineering: The current model relies on manually engineered features. Integrating feature learning (like Deep Learning) into the base level of the CRF could further boost performance.
  • Subject Variability: The model currently doesn't account for individual differences (e.g., varying eating speeds). Future work could involve per-subject model adaptation.
  • Real-time Constraints: The current study focused on offline analysis; moving this to real-time, on-device monitoring remains a goal for future research.

Summary updated

BibTeX
@inproceedings{adams2016hierarchical,
  author = {Roy J. Adams and Nazir Saleheen and Edison Thomaz and Abhinav Parate and Santosh Kumar and Benjamin M. Marlin},
  title = {{Hierarchical Span-Based Conditional Random Fields for Labeling and Segmenting Events in Wearable Sensor Data Streams}},
  booktitle = {International Conference on Machine Learning},
  year = {2016},
}
Figure