1. Introduction
The popularity of wearable devices to monitor physical activity (PA) has increased widely during the last decades. Plenty of wearable devices, from step counters to sleep monitors, are now available to provide a broad spectrum of physiological measurements and feedbacks (e.g., step count [
1], level of activity [
2], upper limb activity count [
3], distance traveled [
4], heart rate history [
5]). These devices have been widely adopted for everyday monitoring of PA, such as personal training (by providing to the user a real-time feedback of their performance [
6]), but are yet to be implemented in clinical physical therapy. From a clinical perspective, healthcare services could benefit from wearable monitoring devices. Indeed, there is a vast diversity of available miniature sensors (inertial measurement units, electromyography, heart rate sensors, dermatological sensors [sweating], etc.) and physical outcomes that can be extracted from such sensors. Combined with the possibility to automatically save data on a secure cloud service (as with most commercial wearable sensors), it would be possible to give direct feedback to patients or to give better insight to clinicians about their patients’ everyday activity evolution, allowing them to provide feedback and enabling more personalized interventions. For example, stroke survivors and their rehabilitation professionals could benefit from a more comprehensive and quantitative assessment of the real use of the affected arm after returning home by receiving daily feedback [
7]. Children with cerebral palsy would also benefit from a closer monitoring and feedback on their capacities before beginning school to maximize functional gains [
3]. Injured workers could benefit from a more realistic and quantitative assessment [
8] of environmental risk factors, which would help them return to work more quickly and safely. Wearable sensors have the potential to improve clinical rehabilitation monitoring and efficiency by allowing an objective, non-invasive and inexpensive way to evaluate physical functions [
9].
However, wearable sensors are not commonly used in clinical practice as of now. The challenge does not simply reside in the development of sensors and data processing algorithms, but also in the transformation from raw sensor data to a feedback that is clinically meaningful to end-users. Such a transformation crucially requires interdisciplinary collaboration. Furthermore, a major issue of available commercial wearable devices is that the underlying algorithms are often protected either by intellectual property or trade secrets [
10]. This leads to two problems: (1) the algorithms are not openly available which impairs data reproducibility and long-terms follow-ups if the technology becomes discontinued; and (2) the algorithms might be based on data from young and healthy subjects, thus reducing the variability of movement patterns and restricting their readiness to be used in pathological population (e.g., children living with cerebral palsy or older stroke survivors). Reduction in movement speed (e.g., multiple sclerosis) [
11], impossibility to maintain or perform a calibration position (e.g., spasticity secondary to an upper motoneuron injury) [
12], tremors (e.g., Parkinson disease) [
13] or muscle spasms (e.g., spinal cord injury) [
14] are common problems that are encountered and that must be considered when using portable devices for rehabilitation or medical purposes requiring algorithm optimization. This uncertainty about the sustainability of commercial devices over time and the lack of flexibility to adapt the algorithms to different clinical populations are major concerns for researchers and clinicians.
A popular outcome that has been used in many rehabilitation studies [
15,
16,
17,
18] is the activity intensity count to provide an insight of the physical condition/participation of their patient to the clinician. This variable is extracted from accelerometers and consists of a scaled quantity of activity performed during a certain amount of time. However, as is generally the case, algorithms from commercial activity intensity count wearable devices are not publicly available (or open source) since they are protected by trade secret. The development of an open-source activity intensity count algorithm is necessary to ensure the sustainability of data processing and to enable researchers to optimize the algorithm to given clinical populations. To this end, BrØnd & al. [
10] have developed an open-source algorithm statistically comparable to commercial activity intensity count solutions (e.g., ActiGraph GT9X, ActiLife). Interestingly, the algorithm can be used with other accelerometer sensors or inertial measurement units (IMU) (which comprise accelerometers), as they are based on raw data acceleration (in the case where the commercial technology would be discontinued), assuming that the accelerometers’ specifications are similar (raw data between accelerometers is typically similar but the accelerometer range must also be similar).
However, the proposed algorithm in BrØnd & al. [
14] has two main issues for clinical applications. First, from its design, the algorithm obligatorily requires one to downsample the acceleration signal sampling rate to 30 Hz, which can be too low for applications such as running (where a sampling rate of at least 250 Hz is recommended [
19]). Indeed, high movement speeds require a higher sampling rate to ensure high data quality acquisitions and reduce the risk of missing data [
20]. Sports medicine in general (e.g., swimming, throwing a ball) and working environments (e.g., industrial factory work) with high biomechanical requirements are other examples of applications requiring high sampling rates [
21]. Secondly, the band-pass filter parameters of the proposed algorithm in BrØnd & al. [
10] cannot be modified because of the numerical optimization process used to find the parameters (the filter parameters are complicated and they cannot be changed to accommodate another band-pass frequency, for instance). Thus, the filter cannot be modified to adapt to various pathological conditions and this could lead to underestimated or overestimated activity quantification depending on the clinical population assessed. For instance, adapting the filter parameters (band-pass cut-off frequency, notch filter) could help reduce the impact of tremors on the quantification of activity intensity count data (e.g., tremors in Parkinson’s patients do not count as activity count), or involuntary movements (e.g., spasms within children living with cerebral palsy) or very slow movements.
The objectives of the current study are to design and validate two activity quantification algorithms and an activity intensity classifier: (1) a fixed bandwidth algorithm, which replicates commercial activity intensity counts as closely as possible, allowing acceleration signal processing regardless of sampling rates; (2) a modifiable bandwidth algorithm that allows us to easily adapt the filter parameters, regardless of sampling rates; and (3) an activity intensity classification algorithm that allows the modification of cut-off values according to the studied population, thereby reducing potential saturation effects.
The paper is structured as follows: the descriptions of the two activity quantification algorithms are first presented, followed by the description of the activity intensity classification algorithm. Thereafter, the protocols used to validate the proposed algorithms are compared to commercial solutions. Then, the results are presented, followed by a discussion and conclusion.
2. Materials and Methods
In this section, the proposed activity quantification algorithms (fixed and modifiable bandwidths) and the activity intensity classification scale are presented, along with the protocol used to validate them against commercial solutions.
2.1. Activity Quantification Algorithm
Two algorithms are proposed: a fixed bandwidth algorithm and a modifiable bandwidth algorithm (which offers more flexibility).
Both algorithms have the same basic structure, which is first detailed here (see eight steps below) and summarized in
Figure 1.
(1) The 3D linear acceleration signals (ax, ay and az) are first sampled at a fixed frequency (e.g., 30 Hz or 100 Hz).
(2) Each of the three signals is filtered with a passband filter (specific to each algorithm and described below).
(3) A saturation (maximum threshold) limit of 20.874 m/s
2 (2.13 g with g = 9.81 m/s
2) [
10] is applied to each signal.
(4) A deadband (minimum threshold) of 0.6664 m/s
2 (i.e., 0.068 g) [
10] is applied to each signal.
(5) A scaling is then applied to convert the acceleration signal into a metric referred to as activity counts. The scaling is 1 count = 0.001664 g = 0.0163072 m/s
2 [
22]. This scaling could be omitted but is applied to match with the “count” definition from ActiGraph which was defined as such for historical reasons [
23].
(6) The counts are then multiplied by a factor (0.93 for the fixed bandwidth filter and 0.96 for the modifiable bandwidth filter), as in BrØnd & al. [
10], to better match the commercial activity counts results. These values (0.93 and 0.96) were optimized with the least squares method to best match ActiLife results.
(7) Each of the three resulting signals from steps 1 to 5 are converted into 1-s epochs. This consists of the sum of the counts acquired over 1 s divided by the sampling frequency to obtain the mean activity count/sec, defined as , and , where is the epoch number.
(8) For each epoch, the total tri-axial vector magnitude (VM3) count is obtained with a Euclidian norm:
2.1.1. Fixed Bandwidth Algorithm
The fixed bandwidth algorithm exactly follows the general sequence presented in the previous section. The focus in this subsection is on the bandpass filter applied at step 2 of the algorithm. In BØnd & al. [
10], the commercial bandpass filter characteristics were identified by generating discrete sinewave signals and successively sending them to the software. A discrete bandpass transfer function (at 30 Hz) of order 20 was optimized to represent the commercial activity counts filter. However, being defined only at 30 Hz precludes the algorithm use at other sampling frequencies, which is vital for other applications (e.g., running, requiring sampling rates of 100 Hz to 500 Hz). Furthermore, it was found that the high order of the filter also prevented the conversion of the discrete transfer function to other sampling frequencies due to numerical instability. In the framework of this paper, a continuous 8th-order bandpass transfer function has thus been used to mimic the commercial activity count bandpass frequency response. Using MATLAB, a genetic optimization algorithm was used, starting from random continuous filter parameters, and discretized to a 30 Hz discrete bandpass filter at each optimization step to match the filter from BØnd & al. [
10]. As the optimization result is the continuous filter parameter, it is then possible to discretize the filter to any sampling frequency (e.g., 100 Hz).
Figure 2A compares the proposed filter to that of BØnd & al. [
10].
2.1.2. Modifiable Bandwidth Algorithm
This section proposes a modifiable bandpass filter version of the fixed bandwidth algorithm. The advantage of the fixed bandwidth algorithm presented in the previous section is that the resulting activity intensity counts are closer to commercial activity count solutions than to the modifiable bandwidth algorithm. This might be an advantage because commercial activity count solutions have been validated in the literature, and the results can be compared to those of previous studies that used commercial solutions. Indeed, the commercial solutions’ passband filters were designed for healthy subjects and might not be optimal for other clinical populations. However, because the fixed passband 8th-order filter was obtained through an optimization process to best represent the commercial solution, changing its bandwidth is not an obvious procedure. A simpler 4th-order passband Butterworth filter is thus proposed. It was designed using MATLAB with the “butter” function and then discretized to the required sampling frequency (e.g., 30 Hz or 100 Hz). The default filter parameters (i.e., high and low cutoff frequencies) were obtained to be as close as possible to the BrØnd & al. [
10] filter using a least square optimization approach and are 0.305 Hz and 1.615 Hz, respectively.
Figure 2B presents the proposed modifiable filter compared to BrØnd & al. [
10]. With this filter, the bandwidth can now be easily modified (by changing the high and low cutoff frequencies) to adapt to the needs of different activities/clinical populations. One should note that other algorithm parameters (deadband and threshold) can be adapted as well, as for the fixed bandwidth algorithm. However, in exchange for such modularity, the modifiable bandwidth leads to larger deviations from commercial activity counts as more approximations are required.
2.2. Activity Intensity Classification
Based on the activity intensity counts, two activity intensity classification algorithms are proposed. The goal of these algorithms is to determine the proportion of time spent in different categories of activity intensity during an activity such as “light, moderate, vigorous, very vigorous”. The number of categories and the threshold for each class (referred to as cutpoints) can vary depending on the activity. Therefore, in order to compare the proposed algorithm to commercial activity intensity count solutions, the Freedson Adult VM3 scale [
24] was used. It is divided into four activity intensities (light, moderate, vigorous and very vigorous) corresponding to the different ranges of activity counts per minute that are shown in
Table 1. The number of categories and cutpoint levels can easily be changed to any other value as needed.
Two versions of the activity intensity classification algorithms are proposed: one referred to as the discrete classification method and the other one as the continuous classification method.
2.2.1. Discrete Classification Method
The discrete classification method consists of summing counts (which, based on the quantification algorithm are in 1-s epochs) into 1-min-epochs. A 3-min test therefore has three epochs: the sum of the activity level counts from 0 to 60 s, from 60 to 120 s and from 120 to 180 s. Then, each epoch is associated with an activity intensity category based on the threshold values presented in
Table 1 (e.g., light). Finally, the algorithm outputs the number of 1-min epochs for each category along with the representation percentage in each activity intensity class. This discrete classification method is the one used in commercial solutions such as ActiLife.
2.2.2. Continuous Classification Method
One potential problem with the discrete classification method is that the results may greatly vary depending on how the activity levels fall within the 1-min epochs.
Figure 3 presents a fictive example demonstrating this limitation.
Figure 3A shows an activity level curve that lasts three minutes.
Figure 3B displays the resulting 1-min epoch categories, assuming that the activity started at the same time as data acquisition.
Figure 3C shows the resulting 1-min epoch categories assuming that the activity started 30 s after the onset of data acquisition. As seen when comparing
Figure 3B,C, the end result is quite different (the percentage in each class is different).
In order to alleviate this drawback, a new continuous classification algorithm is proposed, based on a sliding window approach. Rather than using back-to-back one minute-epochs, continuous one minute-epochs are used: at each second, a one minute-epoch is created by taking the 30 preceding and 30 following seconds. This means that for a 3-min test, 180 overlapping one minute-epochs are used and categorized. The aim of this algorithm is to be more precise in the cutpoint evaluation by alleviating the drawback of the discrete classification method where the one minute-epoch level results depend on when the movement starts with respect to data acquisition onset. Finally, the algorithm outputs the number of epochs for each category together with the representation percentage in each activity intensity class.
2.3. Experimental Procedure
Data were gathered from four different projects involving accelerometry measures. These projects were: (1) Activity of daily living (24-h data collection); (2) Bilateral manipulation in daily living tasks; (3) Manual wheelchair propulsion; and (4) Real-world working environment—Nordic expedition project on the Amundsen Research Ice breaker. In this section, the participants involved in each experiment and the experimental setup of each project are described.
2.3.1. Participants and Experimental Setup
Four participants (25 ± 0.82 years old, two men, four right-handed) wore two watches (one on each wrist, sampling rate = 100 Hz, ±8G, ActiGraph GT9X-BT, ActiGraph, LLC) for 24 h. Activities included but were not limited to running, walking, driving a car, dressing or working at a computer (see Annex 1,
Table 1 for more details). Participants were instructed to fill in a custom-designed activity logbook reporting the activities they performed each hour, and to remove the device only for activities requiring water immersion (e.g., swimming, taking a shower). See
Appendix A Table A1 for a synthesis of the activities reported. Recruitment criteria were (1) being aged 18 years or older, and (2) having no musculoskeletal, neurological disorders or pain. Every participant gave written informed consent prior to participation and the project was approved by the local ethics committee (CIUSSS-CN; project #2018-609).
Ten participants (27.9 ± 7 years old, three men, nine right-handed) wore two watches (on each wrist [dominant and non-dominant hand], sampling rate = 100 Hz, ±8G, Actigraph GT9X-BT, ActiGraph, LLC) during eight specific activities of daily living. Activities: (1) washing a table, (2) making coffee, (3) setting the table, (4) serving a glass of water, (5) cutting therapeutic putty, (6) folding towels, (7) putting toothpaste on a toothbrush, (8) walking, performed in a standardized kitchen of a rehabilitation center. Tasks were selected to require the use of both upper limbs. Each task took between 1.5 and 2 min, for a total of approximately 15 min. Recruitment criteria were (1) being 18 years or older, (2) having no musculoskeletal, neurological disorder or pain that could interfere with the task. Participants were recruited using the research center and Laval University’s mailing lists. Each participant gave written informed consent prior to participation. The project was approved by the local ethics committee (CIUSSS-CN; project #2018-609).
Seven manual wheelchair users (45.8 ± 17.2 years old, six women and one man wore a watch (sampling rate = 30 Hz, ±8G, Actigraph, GT3X-BT, ActiGraph, LLC) on their dominant wrist during two days at two different data collection times: before (T1) and after (T2) following a wheelchair training program. Participants had different diagnoses (multiple sclerosis [n = 1], spina bifida [n = 2], spinal cord injury [n = 1], cerebral palsy [n = 1], Friedreich ataxia [n = 1] and post-poliomyelitis syndrome [n = 1]) and they used their manual wheelchair for more than 5 h per day. All participants gave their informed written consent prior to participation and the project was approved by the local ethics committee (CIUSSS-CN; project #2016-493). Subject 2-T2 was excluded due to technical problems with data collection.
Two healthy workers (37 and 40 years old, two women, both right-handed) were recruited from a Nordic expedition project aboard an icebreaker (NGCC Amundsen, Canadian Coast Guard) (total data collection of six weeks). They were instructed to wear two watches (24/7) (sampling rate = 30 Hz, ±8G, Actigraph GT3X-BT, ActiGraph, LLC), one on the middle of the thigh and one fixed in a customized pair of shorts at thigh and L1-L5 levels (trunk and leg). They also filled a task logbook at the end of each workday. Recruitment criteria were (1) being 18 years or older, (2) being assigned to a >=6-week work shift on the icebreaker, (3) having no musculoskeletal, neurological disorders or pain that would limit their work capacity. Each participant gave written informed consent prior to the experiment and the project was approved by the local ethics committee (CIUSSS-CN; project #2017-539).
2.3.2. Statistical Analysis
Activity Quantification Algorithm
Descriptive analyses (sum, mean and standard deviation [SD]) were used to describe the recording sessions (e.g., time and activity count) and participants (e.g., age). Pearson correlation coefficients were calculated between the data processed by ActiLife 6 (ActiGraph, LLC) and by both (fixed and modifiable) bandwidth algorithms. A Bland–Altman plot for each subject, time of measure (when applicable) and algorithm was used to investigate the validity under free living (outcomes: mean difference, number of data outside of 1.96SD, upper and lower limits of agreement). The level of significance for all analyses was set at p < 0.05. A linear regression was used to evaluate any association between error size of the difference between the proposed algorithm compared to the commercial solution and intensity of activity.
Activity Intensity Classification
Descriptive analyses (mean and SD) were used to describe the proportion of time spent at each activity level. Agreement between the classification of the five intensity categories was assessed using a correlation coefficient analysis (considering as very low [0.0 to 0.3], low [0.3 to 0.5], moderate [between 0.5 and 0.7], high [between 0.7 and 0.9] or very high correlation [>0.9] [
25]). All statistical analyses and data processing were performed with a customized MATLAB program (R2018b, 64bit). A Spearman correlation coefficient was calculated for both algorithms comparing the commercially available one to the discrete and the continuous methods separately (significance level =
p < 0.05). A NparLD analysis was performed to compare the commercial algorithm to the discrete and continuous methods (2 factors; algorithm tested and level of physical activity). NparLD is a robust method that does not require a normal distribution and homoscedasticity while allowing us to assess datasets with repeated measures [
26]. Post-hoc analyzes compared commercial to discrete methods and commercial to continuous methods for each level of PA. Statistical significance was set at
p < 0.05 for the main and interaction effects and at
p < 0.00625 for the post-hoc analyses (Bonferroni correction).
4. Discussion
This study presents two different versions of an open-source algorithm (
https://github.com/ingreadaptulaval/activitycounts) to compute activity counts (i.e., fixed and modifiable bandwidth algorithms) and two different versions of an activity classification algorithm (i.e., discrete and continuous) and compares them to a popular, commercially available, closed-source activity count algorithm (Actilife
TM). The fixed and modifiable bandwidth algorithms have been shown to be valid when compared to commercial algorithms (all r > 0.96,
p < 0.0001) for quantifying activity during different tasks (e.g., activities of daily living, wheelchair propulsion), for a variety of recording durations (i.e., several minutes to several days), in non-disabled participants and manual wheelchair users. The fixed algorithm results are closer to those of the commercial solution than those of the modifiable algorithm (average relative difference of 1.4% and 2.5%, respectively). However, the modifiable algorithm still shows an excellent performance and presents the advantage of being adaptable to pathological populations (e.g., modifying the filter characteristics to minimize the effects of tremors or spasms). In addition, the number of data points out of the limits of agreement was higher for shorter recording durations (project 2: 5%) compared to longer ones (projects 1 and 4: 3.9%; project 3: 2%). This could be explained by the smaller amount of data for project 2, especially when an epoch of 60 s is selected, giving more weight to each error (i.e., one data point outside for 60 s in project 2 represents 10% of the total dataset, while it only represents 0.01% in project 1). The algorithm proposed in the pioneering work of BrØnd & al. [
14] showed a similar behavior: these authors reported an average relative difference of 2.2% ± 1.7% and a Cohen’s kappa of 0.945 (meaning an almost perfect level of agreement as stated by [
27], but using a more complex algorithm that allowed less adaptability capacity than both algorithms presented in the current study. Indeed, our proposed fixed bandwidth algorithm is simpler (8th- vs. 20th-order filter) than that of BrØnd & al. [
10], thereby allowing adaptability to various data sampling rates, and the modifiable bandwidth version allows us to modify the frequency bandwidth to best match the movement profile of clinical populations, environments and tasks.
Adding to these results, the two proposed activity classification methods also showed excellent performance. Indeed, the discrete algorithm reproduced the commercial activity classifier results in an accurate manner, while the continuous method differed from the commercial solution but still reported high concurrent validity (r > 0.89, p < 0.05). In fact, the continuous method should be considered more precise to classify levels of physical activity as it operated sample-by-sample (e.g., 100 computations at each second for a sampling rate of 100 Hz) as opposed to the discrete method, which calculates values second-by-second. As they are both valid methods to classify levels of activity, we suggest that the discrete method should be used when comparing results with other studies using commercial solutions, and the continuous method should be used otherwise.
4.1. Clinical Implications
Wearable sensors, including accelerometers, are already used with various clinical populations to measure PA in the rehabilitation setting [
28]. However, as is generally the case, commercial activity count algorithms are not publicly available (or open-source) as they are protected by trade secret. The development of an open-source activity intensity count algorithm is important to ensure sustainability of data processing as commercially available devices change over time, and to enable researchers to adapt the algorithm to the clinical population under study. Rehabilitation programs and clinical research will benefit from the proposed open-source algorithms as they are more adaptable to the real-world context and therefore become more precise than commercially available solutions when used to assess physical activity in the presence of movement disorders (e.g., spasticity, tremors, slowness of movement).
The proposed algorithms have been validated with different tasks and on different data collection duration time scales, from minutes to weeks. The modifiable bandwidth algorithm can be used with people living with incapacities. For example, in persons with Parkinson’s disease, the band-pass frequency can be adjusted to remove tremors from the signals. For persons having slowness of movements (e.g., stroke survivors), the threshold can be reduced, and on the contrary, in persons living with spasms or hyperkinesia (e.g., cerebral palsy), the threshold can be increased. The continuous method to classify levels of PA is also an interesting tool for clinicians and rehabilitation researchers as it helps to identify the level of PA performed over a given amount of time more precisely. Indeed, people living with disabilities often have to deal with a greater amount of fatigue, which means small periods of time with high levels of intensity. This could lead the commercial algorithm to underestimate their overall physical activity level.
4.2. Limitations
First, the proposed algorithms have been tested mainly on healthy subjects; only one population living with a disability (i.e., manual wheelchair users) was evaluated. It will be interesting to test the validity of the different methods proposed on other populations such as stroke survivors and people living with Parkinson’s disease or cerebral palsy, to see the effects of spasticity, tremors or slowness of movements on PA level assessment. Second, it would have been interesting to evaluate the validity of the four proposed algorithms with different brands of accelerometers as in [
14] (i.e., they used two different brands: ActiGraph and Axivity). Indeed, in this paper, the proposed algorithm activity counts using the Actigraph raw data were compared to the Actigraph Actilife software activity count. This decision was to make sure that the difference between activity counts came from the algorithm design and not from the fact that two or more sensors would not be exactly located at the same location on the arm or that they could move relative to another. As mentioned in [
14], the algorithm can be used with other accelerometer sensors or inertial measurement units (IMU) (which comprise accelerometers), as they are based on raw data acceleration, which is typically very similar between devices. Two main accelerometer characteristics that could lead to differences between raw sensor data are the sensor’s precision (minimum increment between two values, for instance, 0.001 g) and the accelerometer range (for instance, ±8 g). The precision should not be a major issue since the deadband and the bandpass filter in the algorithm will tend to minimize this difference. The range (ex. ±8 g for Actigraph GT9x used in this study) is more problematic. Indeed, if the range is different between sensors (ex. ±2 g vs. ±8 g), the activity count results could differ since one sensor would saturate. The effect of this should be limited since an accelerometer sensor range is typically minimal at ±2 g and the proposed algorithm saturates the signal either way at 2.13 g. In order to minimize discrepancies with the proposed algorithm, one should aim to set the range to ±8 g. Third, as accelerometers detect linear accelerations, they may detect false levels of activity by considering as valid any “false positive” activity counts such as acceleration when driving a car or going up in an elevator. This should be further investigated. Fourth, as accelerometer signals are highly dependent on the limb on which the accelerometer is placed, clinicians will have to carefully choose the placement of their sensors depending on the type of physical activity mostly performed by their patients (e.g., putting sensors on the leg if the patient mostly does cycling). Otherwise, activities might not be considered in the level of physical activity, which could underestimate the extent of physical activity in some patients. Finally, the open-source algorithms made available with this study (
https://github.com/ingreadaptulaval/activitycounts) are adapted for research purposes (available in MATLAB format with a user interface that requires a certain level of knowledge in computer science), but are not yet adapted for use in clinical practice. Indeed, as clinicians must perform their assessment in a limited amount of time, they may need an easier-to-use interface, which would require further development.