Scientific Papers

Detection of sedentary time and bouts using consumer-grade wrist-worn devices: a hidden semi-Markov model | BMC Medical Research Methodology


Participants

This study includes participants from two distinct sources: 44 intervention group participants from the OPTIMISE trial [28] and 10 participants from the ALLO-Active trial [29], all of whom wore Fitbit and activPAL monitors (the referent device) concurrently. The OPTIMISE trial focused on reducing sedentary behavior in adults with type 2 diabetes who work in desk-based environments, through provision of a Fitbit, a height-adjustable sit-stand desktop workstation, and behavioral health coaching [28]. Contexts like this, whereby participants are performing activities such as typing that would traditionally be sedentary behaviors, in an upright position (as light activity), are known to pose particular challenges for classifying sedentary time via wrist-worn devices [30]. The ALLO-Active trial involved a very low-active context, where participants spent significant time hospitalised, as the participants were adults with hematologic malignancies who received allogeneic stem cell transplantation. Here the intervention-group participants received a multifaceted activity program designed to increase purposeful aerobic and resistance exercise and reduce sedentary time through replacement with light exercise [29]. The ALLO-Active intervention targeted less extensive behaviour changes by comparison with OPTIMISE.

Human ethics approval for OPTIMISE were obtained from Alfred Health Human Ethics Committee (Melbourne, Australia), The University of Queensland Institutional Human Research Ethics Committee (Brisbane, Australia), and the University of the Sunshine Coast Human Research Ethics Committee (Sunshine Coast, Australia). The OPTIMISE Your Health trial has been registered with the Australian New Zealand Clinical Trials Registry (ANZCTRN12618001159246; date of registration: 07/03/2018). Ethics approval for the ALLO-Active trial was provided by the Alfred Hospital Human Research Ethics Committee, and the trial was registered with the Australian New Zealand Clinical Trials Registry (registration number: ACTRN12619000741189). All participants provided written informed consent.

Data collection

Both studies used similar protocols for collecting activPAL (PAL technologies, Glasgow, Scotland) data: activPAL4; 24-hour wear protocol; concurrent sleep and wear diary; and devices were attached to the thigh, two-thirds of the way up, along the midline. Devices were set to record data at the standard 30 Hz and were initialised and downloaded with the proprietary software, default settings, default (VANE) algorithm, and exported as events files. OPTIMISE participants wore the activPAL at 0, 3 and 6 months, for 10 days. ALLO-Active trial participants wore the thigh-mounted activPAL at 0, ≈ 1, and ≈ 4 months, for 7 days. ActivPAL measurements from all timepoints were used for validation purposes in this study as long as Fitbit was concurrently worn. OPTIMISE intervention participants received a Fitbit Inspire HR device (Fitbit Inc., San Francisco, CA, USA) while all ALLO-Active trial participants (intervention and usual care) were provided with either a Fitbit Ionic or a Fitbit Versa 2 device (Fitbit, Inc., San Francisco, CA, USA). Both studies encouraged participants to wear the Fitbit continuously throughout the trial period.

Data processing

Data from both studies were processed identically, limiting the data to when both devices were worn, and the participant was awake (see Details below).

The activPAL events files (VANE) provide a precise record of the start time and duration of each event -each bout of sitting / lying (sedentary) or standing, and each stride (two steps) along with the estimated MET-duration of the event. The default method [31] assigns MET-values of 1.25 to sitting and 1.4 for standing, and estimates METs for stepping as a linear function of cadence (steps/min). The activPAL has strong validity relative to direct observation for classifying sedentary time and transitioning between sedentary and non-sedentary states [32]. This device provides the ground truth for this study. Using SAS 9.4 (SAS Institute, Inc., Cary, NC, USA), based on usual practices in the field [33], time in bed (for sleeping purposes) and non-wear were removed (estimated from a combination of self-report and device movement), and data limited to valid days (≥ 10 h wear while awake with evidence of movement: ≥500 steps/day and < 95% of the day in any one activity) [28]. Automated estimation [34] coupled with visual checking of the automated classification against acceleration using actigrams was used to infer missing values for time in bed. Data were also summarized as amounts of each activity per 1-minute (to permit 1:1 matching of these mixed activity minutes with the Fitbit’s single-activity 1-minute epoch data).

Fitbit data was downloaded using the Fitabase software (Fitabase Small Steps Labs, LLC, San Diego, CA). The Fitbit-generated step counts, heart rate and physical activity intensity were extracted at 1-minute resolution (the smallest resolution available for steps and intensity). Non-wear time (i.e., minutes where the associated heart rate was zero or absent) was excluded along with data between midnight and 5AM, where the person may be wearing the Fitbit and awake but their physical activity patterns may not be representative of the rest of the days. No minimum daily wearing rates criteria was applied to the Fitbit data and no further inspection of the heart rate quality signals was performed.

For validation purpose, the Fitbit data was matched to the activPAL minute-level data and only minutes during which both devices were worn were retained. The activPAL event files were also mapped to the periods during which the participant was wearing the Fitbit and only events where Fitbit was worn 100% of the time were retained. Timestamp matching was performed using in-house R codes that utilize lubridate R package [35]. Since activPAL timestamp does not take into account daylight saving shift while Fitbit’s does, we manually shifted back the activPAL timestamp by one hour during time periods where daylight saving was observed. Sedentary behavior metrics were calculated based on these matched data.

Measures of sedentary time

Because of the differences in the data resolution (1-minute epoch for Fitbit data and continuous time up to the nearest 0.1s for activPAL), the classification of sedentary time is slightly different for the two data types.

For methods that use Fitbit data (Fitbit algorithm, STEPHEN and STEPCODE), the classification took place at each minute. In the case of Fitbit’s proprietary algorithm, Fitabase, a cloud-based Fitbit data management system, was used to extract the predicted physical activity intensity output and its lowest predicted intensity state was designated as sedentary. For STEPHEN and STEPCODE, we obtained the predicted physical activity state for each minute (see Model Development below). For activPAL, the classification rule is simpler whereby all of the time intervals associated with ‘sitting’ events are classified as sedentary.

Proportion of time spent being sedentary

For the Fitbit algorithm, STEPHEN and STEPCODE, this was calculated for each participant as the total number of sedentary minutes divided by the total number of minutes when the participant was awake and wearing both devices. For activPAL, this was calculated for each participant as the total time for sedentary (‘sitting’) events divided by the total time for all events.

Usual bout duration of sedentary bouts

Sedentary bouts were identified as recorded to the nearest 0.1s duration from the activPAL events files, and as consecutive sedentary minutes for the Fitbit data.

Usual bout duration, defined as the bout duration above and below which half of all sedentary time is accrued [36], was calculated for each participant using the methods described in [36] using all of their sedentary bouts across the entire study duration.

Fig. 1
figure 1

Schematic illustration of the Step and Heart Rate Autoencoder (STEPHEN) Hidden semi-Markov Model. The observed data are step counts and heart rate and individuals can move between the four hidden states representing sedentary behavior, LPA & Standing, MPA and VPA. The time spent in a particular hidden state before moving to another state (sojourn time) is assumed to follow Gamma distribution whose parameters are estimated empirically from the data

Statistical methods and analyses

Model development

We used Fitbit data from 11 OPTIMISE participants to develop 2 models: [1] Hidden semi-Markov Model using step counts and heart rate data (STEPHEN), and [2] Hidden semi-Markov Model using step counts data only (STEPCODE). While the focus of this paper is on validating STEPHEN, STEPCODE was developed to demonstrate that the improved performance of STEPHEN over proprietary algorithm is due to the combination of using heart data in addition to the Hidden semi-Markov model rather than merely due to the Hidden semi-Markov model alone. In both STEPHEN and STEPCODE models, we assume there are K = 4 unobserved physical activity states that manifest as the observed step counts and heart rate data. Without losing generality, we can think of these states as representing sedentary behavior, standing and LPA, MPA and VPA (see Fig. 1). The decision to lump standing with LPA should not affect the validity of the current models for characterising sedentary behaviour because both standings and LPA will be classified as non-sedentary anyway.

Under each state, we assume that the step count and heart rate data are distributed as Negative Binomial (NB) random variables with state-specific parameters. An individual is allowed to move between states, e.g., from the sedentary state to light physical activity with the amount of time (minutes) spent consecutively under a particular state (sojourn) following a Gamma distribution. Compared to the Exponential sojourn distribution for the standard Hidden Markov model, the Gamma sojourn distribution capture persistent sojourn (bouts) under a particular state after the initial transition [37]. This property enables the models to capture prolonged standing and LPA with stable heart rate after the initial heart increase when transitioning from sedentary behavior. The models were estimated separately for each participant, resulting in 11 × 2 = 22 estimated models (11 STEPHEN models and 11 STEPCODE models). We used the mhsmm R package [38] to estimate the model parameters and coded a user-written function to calculate the conditionally independent, bivariate Negative Binomial probability. A more detailed mathematical description of the three models is provided in the Supplementary Methods.

For both STEPHEN and STEPCODE to allow for potential differences in baseline resting heart rate between the individual in the development and validation cohorts, we adjusted the mean heart rate parameters under each state by subtracting a bias term defined as the difference in average heart rate with zero step counts between the individual whose physical activity states we tried to predict and the individual whose data was used to develop the model. We then obtained the predicted physical activity state under each of eleven models (using the Viterbi algorithm). At this stage, the predicted state for each minute is an integer ranging from 1 to 4 and unlabeled. We then labelled these predicted states using the following rules: the predicted states associated with Hidden semi-Markov states with the lowest mean step count and heart rate parameters were labelled as ‘Sedentary’, the remaining predicted states associated with increasing step counts and heart rate parameters were correspondingly labelled as standing/LPA, MPA and VPA. These labelled predicted states were then ensembled at each timepoint using the ‘majority vote’ rule to produce the final, labelled predicted physical activity state.

Model validation

An extensive internal validation was performed together with two external validations. Instance-level agreement statistics were not calculated due to the different device resolutions (1 min epoch versus continuous to nearest 0.1s). In lieu of a typical confusion matrix, the amount of time the activPAL recorded as spent sitting, standing and stepping were summarized separately for the minutes that the Fitbit and test methods predicted to be sedentary or non-sedentary. The sedentary time measures (proportion of time spent sedentary and usual bout duration) were compared against the activPAL (the ground truth) via two indicators. The main indicator used was absolute percentage errors (APE), which was summarized per individual and reported as median (MDAPE) with interquartile range (IQR). Mean bias (SD) were visualized via Bland-Altman plots [39] and equivalence between each method and activPAL (Δequivalence = ± 0.05 for proportion and ± 5 min for usual sedentary bout length) was tested using one sample t-test for equivalence hypothesis testing in R package TOSTER [40] and proportional bias in the Bland-Altman plots were tested using simple linear regression.

Internal validation

The internal validation was conducted within the 11 OPTIMISE participants used to develop the model.

External validation 1

The first external validation was performed in 33 OPTIMISE participants who were not used for model development, to indicate how well the models are likely to perform in participants with similar demographic characteristics to the participants used to develop the models. The MDAPE for each method was compared via Wilcoxon signed ranks test to determine whether the proposed methods outperformed the proprietary Fitbit method. To investigate whether gender, body mass index (BMI), age and job classification were associated with accuracy, we conducted multiple linear regression with APE as dependent variables.

External validation 2

To assess the performance of the models when used to predict sedentary time in participants wearing different brands of Fitbit and with very different physical activity patterns, we tested the models in 10 participants (5 participants wearing Fitbit Ionic and 5 participants wearing Fitbit Versa 2) from the ALLO-Active Trial [29].

All statistical analyses were performed using R 4.2.2.



Source link