Estimation of Gait Parameters in Huntington’s Disease Using Wearable Sensors in the Clinic and Free-living Conditions

In Huntington’s disease (HD), wearable inertial sensors could capture subtle changes in motor function. However, disease-specific validation of methods is necessary. This study presents an algorithm for walking bout and gait event detection in HD using a leg-worn accelerometer, validated only in the clinic and deployed in free-living conditions. Seventeen HD participants wore shank- and thigh-worn tri-axial accelerometers, and a wrist-worn device during two-minute walk tests in the clinic, with video reference data for validation. Thirteen participants wore one of the thigh-worn tri-axial accelerometers (AP: ActivPAL4) and the wrist-worn device for 7 days under free-living conditions, with proprietary AP data used as reference. Gait events were detected from shank and thigh acceleration using the Teager-Kaiser energy operator combined with unsupervised clustering. Estimated step count (SC) and temporal gait parameters were compared with reference data. In the clinic, low mean absolute percentage errors were observed for stride (shank/thigh: 0.6/0.9%) and stance (shank/thigh: 3.3/7.1%) times, and SC (shank/thigh: 3.1%). Similar errors were observed for proprietary AP SC (3.2%), with higher errors observed for the wrist-worn device (10.9%). At home, excellent agreement was observed between the proposed algorithm and AP software for SC and time spent walking (ICC $_{{2},{1}}\gt 0.975$ ). The wrist-worn device overestimated SC by 34.2%. The presented algorithm additionally allowed stride and stance time estimation, whose variability correlated significantly with clinical motor scores. The results demonstrate a new method for accurate estimation of HD gait parameters in the clinic and free-living conditions, using a single accelerometer worn on either the thigh or shank.


I. INTRODUCTION
H UNTINGTON'S disease (HD) is an autosomal dominant neurodegenerative disease, characterized by progressive decline across cognitive, behavioral and motor functions [1].Gait impairment progressively worsens throughout the course of HD, and is thus an important marker of disease progression and endpoint in intervention studies [2].
The Unified Huntington's Disease Rating Scale (UHDRS) total motor score (TMS) is the current gold standard for assessing motor function in HD [3].However, it is a composite score not specifically developed to evaluate gait.Moreover, UHDRS-TMS is affected by inter-rater and intra-rater variability [4], and may have limited sensitivity for detecting subtle changes in motor symptoms over time [5].Objective measures of HD gait in the clinic have been reported using video motion systems [6] or computerized walkway systems [7], [8].In recent years, the use of wearable sensors to assess motor impairment in neurological disorders has increased, offering the potential for real-world monitoring of patients to assess disease progression and the efficacy of therapeutic interventions [9], [10].
Wearable sensors have been applied in HD to assess sleep [11], chorea [12], postural control [13], disease severity [14], and to classify pathological gait patterns [15].While consumer devices typically provide measures of step count (SC), spatiotemporal gait analysis in neuromuscular diseases [9] requires precise detection of initial (IC) and final (FC) contact events, which can be derived from inertial data using appropriate gait event detection (GED) algorithms.Increased variability in spatiotemporal parameters is consistently reported in HD, with increased variability of temporal gait parameters associated with higher UHDRS-TMS values [7], [16], [17], [18].Most previous algorithms for detecting gait events in HD have been based on acceleration recorded by trunk-or wrist-worn devices [16], [18], [19], [20], [21], [22], with few deployed under free-living conditions [16], [20], [22], and some lacking disease-specific validation [16], [17], [18], [20].Although GED algorithms based on leg acceleration have been found to perform better than those based on trunk or wrist acceleration in other pathologies, such as Parkinson's disease, spinal cord injury, or stroke, and healthy subjects [23], [24], no previous studies have compared the accuracy of GED algorithms for sensors at different locations in HD.
Here we present a new GED algorithm for use with either shank or thigh acceleration in individuals with HD.The algorithm was adapted from a method based on the Teager-Kaiser energy (TKE) operator previously validated for use on the shank in healthy individuals in the clinic [25].Unsupervised clustering techniques were incorporated to adapt the algorithm for both shank and thigh acceleration, and for pathological gait patterns.The proposed algorithm, together with the gait parameters provided by the proprietary software of the wrist-and thigh-worn sensors, were first validated against video reference data in individuals with HD in the clinic.Once validated in the clinic, the proposed GED algorithm was then applied during free-living conditions, and estimates of SC and time spent walking were compared with those provided by proprietary software of the wrist-and thigh-worn sensors, the latter used as reference data.We hypothesized that the proposed GED algorithm would provide accurate estimates of SC and temporal gait parameters in patients with HD in the clinic, using either shank-or thigh-worn sensors.We also hypothesized that the proposed algorithm would provide estimates of daily SC and time spent walking similar to those provided by proprietary AP software in HD patients, using a single leg-worn accelerometer under freeliving conditions.

A. Ethics Statement
Participants were recruited and data was collected at Cardiff University.Full ethical approval was obtained from an NHS research ethics committee (Wales REC 3, United Kingdom, 19/WA/0329, 13 Jan 2020), with the University College Dublin approved to analyze the data.A second local ethical approval for data analysis only was obtained as required by the local ethics committee at University College Dublin (HREC-LS, University College Dublin, Ireland, LS-LR-22-178-Garcia-Lowery, 05 Sep 2022).All participants provided written informed consent.

B. Study Participants
Participants were identified from registered Enroll-HD participants from the Cardiff HD clinic.Enroll-HD is a global research platform that acts as worldwide observational study for HD families, monitoring the onset of the disease and its progression with annual assessments.Inclusion criteria were adults with a diagnosis of HD confirmed by genetic screening, a diagnostic confidence level >2, who were self-ambulatory and participants in Enroll-HD.Exclusion criteria included the following components: diagnosis of juvenile onset HD, history of co-morbid neurological conditions, acute orthopedic conditions, severe medical conditions, acute or unstable psychiatric condition, inability to tolerate long-term wear of physical activity monitors, and inability or unwillingness to provide written informed consent.Individuals meeting the criteria were invited to participate in the study coinciding with their annual Enroll-HD clinical assessments.
Seventeen individuals with HD (5 female) participated in the gait assessment in the clinic.Ten of these participants (2 female), together with three additional participants (1 female) participated in the free-living study.Anthropometric and clinical data for study participants are summarized in Table I.

C. Protocol and Data Acquisition
The study involved two components: a gait assessment in the clinic and 7-day physical activity at home monitoring during free-living conditions.
In the clinic, all participants performed two two-minute walk tests (2MWTs) wearing five tri-axial accelerometers: a Fitbit Charge 4 (FB, Fitbit, San Francisco, CA, USA, 3.58 × 2.27 × 1.25 cm, 24 g) on their non-dominant wrist, two ActiGraph GT9X Link (ActiGraph Corporation, Pensacola, Florida, USA, 3.5 × 3.5 × 1 cm, 14 g, 100 Hz, +/−16 g) on the left and right shanks, and two ActivPAL4 (AP, PAL Technologies, Glasgow, UK, 2.35 × 4.3 × 0.5 cm, 9.5 g, 40 Hz, +/−4 g) on the left and right thighs.Leg-worn devices were placed 10 cm below the infrapatellar region on the anterior tibial midline, and 10 cm above the suprapatellar region on the anterior surface of the vastus intermedius muscle (Fig. 1a).First, participants performed a 2MWT with instructions to walk continuously and cover as much distance as possible in two minutes, slowing down or stopping to rest if needed.They walked in an anticlockwise direction on a circuit consisting of 10 m lengths and 1 m turning transitions on both ends marked with two cones (Fig. 1b).After two minutes, participants stopped walking and sat quietly for another two minutes.A second 2MWT was then performed to increase the number of steps for the analysis while avoiding fatigue.Video data were recorded to provide reference data.Video recordings were obtained from inside the Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.circuit path, following and recording participants with a side view during the entire 2MWTs, with the focus on participants' feet.

TABLE I DEMOGRAPHICS AND CLINICAL SCORES FOR STUDY PARTICIPANTS
For the free-living study, participants wore a FB on their non-dominant wrist to minimize the impact of arm movements typically conducted with the dominant arm during everyday activities, and an AP on their right thigh, following manufacturer's recommendations, for seven days during their normal home routine, starting the same day as in-clinic assessments.Both devices were waterproof and only removed at the end of the seven days, therefore requiring minimal interaction and charging.Participants downloaded the FB mobile app to their personal phone, were assigned an account linked to their study identifier, and used their phone to sync their FB data after each night.Participants were able to see their daily SC in their FB device and through the FB app.
The following clinical scores were directly obtained (via a specific data request) for each participant from the Enroll-HD study data, within a time frame of 23 days (median value, interquartile range 9-49) from the in-clinic and free-living assessments: length of CAG trinucleotide repeat expansion (CAG repeats), UHDRS-TMS, total functional capacity (TFC), and UHDRS gait score.Additionally, the following clinical scores were calculated for each participant from the obtained clinical scores: composite UHDRS score (c-UHDRS) [26], disease burden score [27], total maxima dystonia, and total maxima chorea [28].

D. Physical Activity Data Extraction
Raw shank and thigh acceleration data were downloaded for each participant after the 2MWTs in the clinic and at the end of the free-living study, to be used by the proposed GED algorithm.
SC provided by FB software was recorded in the clinic at the beginning and the end of each 2MWT and a total SC value (SC FB−wrist ) was calculated for each participant for the two 2MWTs together.For the free-living study, a bespoke platform (AthenaCX, AthenaCV.com,In the Wild Research Ltd., Dublin, Ireland) was used to integrate FB data for all participants.FB step and heart rate data (60-s epochs) were extracted from this platform as JSON files.FB heart rate data was used to distinguish FB wear periods (with available heart rate data) from non-wear periods (with heart rate data unavailable).Daily SC FB−wrist was obtained for each participant by summing step events detected only during FB wear periods.
For comparison with the proposed GED algorithm, SC and walking bout (WB) data were extracted from the AP software (ActivPAL PALbatch v8.11.1.63software) after the 2MWTs and after the free-living study.These data were used to calculate a total SC value (SC AP−thigh ) for each participant for the two 2MWTs and for the left and right thighs together.For the free-living study, periods of consecutive step events were considered as WBs.WBs of less than 4 s were removed and WBs separated by 2 s or less were combined.Daily time spent walking (W t−AP−thigh ) was calculated as the sum of the duration of all WBs on each day.Daily SC AP−thigh values were calculated as the sum of steps during all WBs of each day and only for FB wear periods, and the resulting single leg values were doubled.
Video recordings of the two 2MWTs performed in the clinic were visually inspected frame by frame for manual annotation of IC and FC event times, using a graphical user interface developed in MATLAB and the Video Viewer app of the Image Processing Toolbox.This procedure was performed for each foot.The resulting IC and FC events were used to estimate SC, as the number of IC events, and the following temporal gait parameters: stride time (STR), as time between consecutive IC events, stance time (STA), as time between consecutive IC and FC events, and swing time (SWI), as time between consecutive FC and IC events.Temporal gait parameters were estimated for the first three straight sections of each 2MWT, totaling 60 m.With IC and FC events annotated during turning transitions excluded, this yielded over 30 gait cycles per participant [29].Estimates of SC were summed, and mean and coefficient of variation of temporal gait parameters were calculated for the two 2MWTs and both legs together to obtain the final gait parameters for each participant (SC Video , STR Mean−video , STA Mean−video , SWI Mean−video , STR CV−video , STA CV−video and SWI CV−video ).

E. Automatic Detection of WBs From Thigh Raw Acceleration
An automatic algorithm was developed to detect WBs from thigh acceleration recorded during the free-living study, using a method similar to a previous study which used wrist acceleration in HD patients [22].The norm of the raw acceleration signal was computed and the resulting signal was band-pass filtered 0.5-15 Hz using a 4th-order Butterworth filter (Fig. 2a).Mean and standard deviation of the absolute value of the filtered acceleration signal were calculated over a 6-s moving window with 5-s overlap (Fig. 2b).Windows with means and standard deviations above a predefined activity threshold of 0.1 g [22] were further analyzed to confirm the presence of gait using normalized autocorrelation.A window was determined to contain periods of gait if the highest absolute value of the normalized autocorrelation with a minimum time lag of 0.5 s and a maximum time lag of 3 s was greater than 0.2 (Fig. 2d).WBs were then identified as consecutive 1-s periods that were included in windows containing gait (Fig. 2c).WBs shorter than 4 s [30] were removed and those separated by 2 s or less were combined.Daily time spent walking (W t−thigh−acc ) was calculated as the sum of all WB durations on each day.

F. GED Algorithm for Thigh and Shank Raw Acceleration
The proposed GED algorithm is based on a previous algorithm developed to detect potential gait events from shank acceleration in healthy individuals [25].The algorithm has been extended here to be applied to both thigh and shank raw acceleration signals in HD participants.The proposed algorithm includes the following steps: 1) Filtering: The z-Axis Acceleration, Which Corresponds to the Acceleration Recorded in the Antero-Posterior Direction of Either Shanks or Thighs When Participants Were Standing Upright, Was High-Pass Filtered at 0.5 Hz Using a 4th-Order Butterworth Filter, to Obtain a z (Fig. 2e) (i) a z with FC (blue dots) and IC (red dots) events detected after peak characterization, classification, and post-processing.
2) TKE Estimation: TKE Was Estimated From a z as in (1) (Fig. 2f) where n represents the sample number.2i) The proposed GED algorithm was applied to raw acceleration from the thighs and shanks during each 2MWT in the clinic and from the thigh for each WB detected during the free-living study.The resulting IC and FC events were used to calculate SC and temporal gait parameters, as explained above for the video data, thus obtaining overall gait parameters for each participant (SC Thigh−acc , SC Shank−acc , STR Mean−thigh , STR Mean−shank , STA Mean−thigh , STA Mean−shank , SWI Mean−thigh , SWI Mean−shank , STR CV−thigh , STR CV−shank , STA CV−thigh , STA CV−shank , SWI CV−thigh and SWI CV−shank ).
For the free-living study, daily SC Thigh−acc values were calculated as the sum of SC estimates during all WBs of each day and only for FB wear periods, and the resulting single leg values were doubled.Mean and coefficient of variation of temporal gait parameters were also calculated for all WBs during the seven days.To avoid abnormally high or low values of STR CV , STA CV , and SWI CV due to inaccuracies in GED, values with a difference of more than 25% from the corresponding median value were rejected.

G. Statistical Analysis
In the clinic, video data were used as reference for validation of the proposed GED algorithm as well as the gait parameters provided by proprietary AP and FB software.Scatter and Bland-Altman plots, Pearson's correlation coefficient (r), intra-class correlation coefficient (ICC 2,1 ), and mean absolute percentage error (MAPE), were used to assess the level of association and agreement for SC between video data, the proposed GED algorithm, and AP and FB software, and for temporal gait parameters between video data and the proposed GED algorithm.ICC 2,1 values less than 0.5, between 0.5 and 0.75, between 0.75 and 0.9, and greater than 0.9 were considered as poor, moderate, good, and excellent agreement, respectively [32].In the free-living study, proprietary AP data were used as reference for assessing the performance of the proposed GED algorithm and the gait parameters provided by proprietary FB software.Scatter and Bland-Altman plots, and r and ICC 2,1 coefficients, were used to assess the level of association and agreement for SC between AP software, the proposed GED algorithm, and FB software, and for W t between AP software and the proposed GED algorithm.
Comparisons of temporal gait parameters between UHDRS gait score levels were made using Kruskal-Wallis tests, followed by multiple pairwise comparisons.Bonferroni's method was used to obtain adjusted p-values.Correlations between temporal gait parameters and UHDRS-TMS were analyzed, using Benjamini & Hochberg method to adjust for multiple correlation tests.In this case, Bonferroni's method was deemed too conservative due the large number of correlation tests, whereas the false discovery rate method provided a good balance between discovery of statistically significant correlations and limitation of false positive occurrences.

B. Estimation of Gait Parameters at Home
Detected WBs and cumulative SC obtained from a representative HD participant during free-living conditions are presented in Fig. 5a and 5b.
W t and SC estimated from the thigh-worn AP sensor using the proposed algorithm and AP software were first compared in the 13 HD participants during free-living conditions (Fig. 6a-6d).Similar to our findings in the clinic, there was a very strong correlation and excellent agreement for SC estimated using the proposed GED algorithm and AP software (r = 0.989, ICC 2,1 = 0.976).Excellent agreement was also observed between the two algorithms for W t (r = 0.991, ICC 2,1 = 0.981).
The wrist-worn FB device overestimated daily SC during free-living conditions by 1897 steps (median value, interquartile range 723-4155) or 34.2% (11.9-86.0%),when compared to SC obtained from the thigh-worn AP sensor (Fig. 6e-6h).Despite this overestimation, a very strong correlation for SC was maintained between FB and both AP software (r = 0.901) and the proposed GED algorithm (r = 0.904).

C. Temporal Gait Parameters and Clinical Scores
Variability of swing time (SWI CV ), obtained from video data and shank acceleration in the clinic, was moderately correlated with UHDRS-TMS (r = 0.69, p = 0.018 and r = 0.62, p = 0.044 respectively).In free-living conditions, strong correlations were observed between UHDRS-TMS and variability of both stride (STR CV ) (r = 0.83, p = 0.01) and stance (STA CV ) (r = 0.76, p = 0.018) times estimated from the thigh acceleration.No significant correlations were observed between UHDRS-TMS and mean value of temporal gait parameters.
When estimated from video data in the clinic, STR Mean , STA Mean , STR CV , STA CV and SWI CV were significantly higher in HD participants with a UHDRS gait score of 2 than in those with a UHDRS gait score of 0 (Fig. 7a, 7b).Shank and thigh estimates of STR Mean also differed significantly between these two groups.However, there was no significant effect of UHDRS gait score on other temporal gait parameters estimated from shank or thigh acceleration.No significant differences in temporal gait parameters across UHDRS gait scores were observed during free-living conditions.

IV. DISCUSSION
The accuracy of physical activity metrics provided by wearable devices varies with device type and placement site, protocol, or population [33].Disease-specific validation of GED algorithms is required to provide confidence in gait parameters derived using wearable sensors for remote monitoring in neurodegenerative diseases.Towards this goal, a new algorithm to detect gait events from either shank or thigh acceleration in individuals with HD, validated in the clinic and applied under free-living conditions, has been presented.

A. Gait Event Detection Algorithm
The proposed GED algorithm is adapted from a method previously developed for acceleration recorded from the Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.shanks [25].The approach offers the advantage that it can be implemented with relative computational efficiency.The use of a single acceleration component and the sensitivity of the TKE operator to identify potential gait events minimize signal pre-processing, offering potential for real-time gait analysis.However, the original algorithm was validated only in healthy individuals under supervised conditions, and was dependent on a specific signal profile.The GED algorithm proposed here has been extended to accommodate the higher gait variability in HD, especially under free-living conditions.The main features of the proposed algorithm are the following:   Several different algorithms for GED using wearable sensors have been proposed [23], [24].Despite differences in sensor sampling rate, range, and location, targeted populations, and evaluation criteria, some general conclusions can be drawn.Most previous algorithms for GED in HD have used trunk-or wrist-worn inertial sensors [16], [18], [19], [20], [21], [22].While these are convenient and unobtrusive, lower limb-based algorithms generally perform better than lower trunk-or wrist-based algorithms.Regarding the computational approach, rule-based algorithms have been the most widely used due to their simplicity and lower computational complexity.These methods use either heuristically defined thresholds or peak detection techniques on the acceleration or angular velocity signal to detect gait events [23].However, rule-based algorithms can be less accurate when applied to highly variable gait patterns, such as in pathological gait or real-world data.Accordingly, gait algorithms should be evaluated in specific clinical populations, and not only in the clinic but also under free-living conditions [23].Few previous studies have been conducted in HD under free-living conditions [16], [20], [22], with the majority of gait analysis algorithms applied Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
in the clinic, and some lacking disease-specific validation [16], [17], [18], [20].A machine learning approach, based on a support vector machine classifier, has been used for gait analysis in HD, but validated only in the clinic [15].Support vector machine classifiers, however, require labelled data for model training.Unsupervised algorithms, such as the k-means clustering used in this study, are capable of classifying data without prior knowledge.Although unsupervised approaches for GED have been proposed previously [34], [35], [36], they have not been used in HD.The proposed GED algorithm takes advantage of rule-based techniques and unsupervised clustering techniques to detect and classify gait events independent of any underlying signal pattern, accommodating the higher variability in HD.

B. Accuracy of Step Counts
The proposed algorithm accurately estimated SC from shank and thigh acceleration when validated against video annotations (Fig. 3).However, the wrist-worn FB underestimated SC, with a relative error of 10.9 ± 12.4% and moderate agreement (ICC 2,1 = 0.656) with video data.Visual inspection of video recordings revealed reduced arm swing in two participants during the 2MWTs in the clinic, causing an underestimation of SC using the FB device in those participants (Fig. 3g, 3h).Similar results for SC derived from wrist-worn wearable devices in laboratory conditions have been reported in other neurological diseases [37], [38], [39].Previous studies in Parkinson's disease have reported SC errors of 4.7-11% for an ActiGraph GT3X+ [37], or a relative error of 4.8% and poor agreement (ICC 2,1 = 0.47) for SC obtained from a Fitbit Charge 2 [38].In multiple sclerosis, an ICC 2,1 of 0.69 was reported for SC obtained from the Fitbit Flex [39].In healthy participants, similar accuracies have been reported for wrist-worn FB devices in the clinic, with SC errors of −4.8 ± 12.2% [40] and -21.2 (-13.0,-29.4)% [41].
In free-living conditions, there was also an excellent agreement for W t and SC estimated using the proposed GED algorithm and provided by the AP software (Fig. 6a-6d).Wrist-worn FB, however, overestimated daily SC while maintaining strong correlations with SC estimated from the thigh data.These results are in accordance with previous studies which evaluated gait algorithms under free-living conditions in other clinical populations [39], [42], [43].Compared with a thigh-worn AP device in healthy participants, FB devices overestimated SC by 30% during a week of normal activities [42] and by 3.7% during one working day of free-living conditions [43].In patients with multiple sclerosis, a Fitbit Flex device detected more steps than an ActiGraph device during 7-day home monitoring, but good agreement was reported between the two devices [39].The overestimation of SC by wrist-worn devices under free-living conditions found in this and previous studies is likely due to more complex, less rhythmic, arm movements which occur during everyday life, together with involuntary movements in HD, resulting in false step event detection.It should also be noted that participants could track their daily SC during the free-living study, which may have influenced their activity levels, and free-living SC estimates may therefore not be fully representative of patients with HD in daily life.

C. Accuracy of Temporal Gait Parameters
The proposed GED algorithm estimated STR Mean with high accuracy from both shank and thigh acceleration, whereas STA Mean and SWI Mean tended to be systematically underestimated and overestimated, respectively, compared to video data, with shank acceleration yielding lower MAPE values (3.3 ± 2.3% and 6.0 ± 3.7% respectively) than thigh acceleration (7.1 ± 3.4% and 13.6 ± 7.1% respectively) (Fig. 4e-4l).These results are in line with a previous analysis of the performance of 17 algorithms to detect gait events, showing that STA was consistently underestimated, increasingly as the sensor position moved proximally from the foot to the trunk [24].Stance duration errors between 6-14% and swing duration errors between 10-32% were reported in another study comparing different temporal gait analysis methods in different pathological populations, including HD [21].

D. Temporal Gait Parameters and Clinical Scores
Variability of temporal gait parameters tended to increase with motor function impairment in HD, as suggested by moderate-to-strong positive correlations observed between UHDRS-TMS and STR CV , STA CV, and SWI CV estimated using video annotations and shank acceleration in the clinic, and using thigh acceleration during free-living conditions.Consistent with this, estimates of STR CV , STA CV , and SWI CV increased with UHDRS gait score (Fig. 7b).These results reflect the difficulty in maintaining consistent gait with increasing motor impairment in HD [7], [16], [17], [18].Step time variability has been reported to increase in the presymptomatic stage of HD and to continue increasing in the symptomatic stages [7], being higher in those with UHDRS-TMS≥50 than in those with UHDRS-TMS<50 [16].Similar to the results of this study, moderate-to-strong positive correlations between UHDRS-TMS and variability in step (r = 0.55), stride (r = 0.676), stance (r = 0.690), and swing (r = 0.595) times in HD have been previously reported [17], [18].Lack of significant correlations between UHDRS-TMS and mean temporal gait parameters is consistent with previous studies [8], [18], [44], [45].However, the increasing trend of STR Mean estimates with increasing UHDRS gait score indicates that mean temporal gait parameters reflect gait alterations in HD, as previously described [8], [17], [20].

E. Limitations of the Study
Biases obtained for shank (55 ms) and thigh (81 ms) estimates of STA Mean and SWI Mean were of 1-3 video frames (at 30 frames/s), which could be assumed as a reasonable error for the manual annotation of IC and FC events.However, the biases observed for STA Mean and SWI Mean estimates, which depend on FC event detection, but not for STR Mean estimates, which only depends on IC events, suggest systematic early detection of FC events by the proposed algorithm with respect to video annotations.The smoother movement occurring during FC events makes them more Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
difficult to detect by GED algorithms.Previous studies have reported better performance of GED algorithms for detecting IC than FC events [46], [47], [48], [49], with FC events being consistently early predicted as compared to reference data [47], [49], [50].Machine learning techniques could be used for the automatic detection of FC events, instead of rule-based and peak finding methods, which are more sensitive to signal amplitude.Moreover, FC times annotated from video recordings may not directly correspond to FC points detected using shank or thigh acceleration due to the distance between the sensor location and the toe.This is consistent with the observed greater bias in the thigh estimates than in the shank estimates, indicating that the leg starts to move before the foot leaves the ground.It should be noted that sensors were synchronized using a universal timestamp, and the estimated temporal gait parameters were calculated for each single sensor and were therefore insensitive to synchronization issues.
Despite the limited sample size, the proposed GED algorithm has been validated in the clinic and deployed during free-living conditions, with high agreement against reference data in both settings, thus offering potential for analysis of real-world gait data.Due to differences in gait during in-clinic assessments and free-living conditions, further validation of GED algorithms in HD patients in uncontrolled, real-world settings is required and remains a challenge.Application of the proposed algorithm in a larger HD cohort and in healthy controls would improve our understanding of gait impairments associated with motor dysfunction in HD, and would allow for more accurate estimation of systematic bias between actual FC events and FC events detected from shank-worn or thigh-worn sensors, which seems to be the main source of error for STA Mean and SWI Mean estimation.In light of the results in this study, a single shank-worn sensor would be recommended for accurate and practical assessment of gait in HD patients.Experiences and preferences of HD patients regarding the adoption of wearable activity trackers were previously explored [51], with positive opinions on wearable activity trackers reported, such as the devices being easy to use and compatible with lifestyle.Although the wrist was reported as the preferred location, HD patients also showed interest in devices that could be worn comfortably and discreetly under clothes, with need and potential benefit being more important than appearance in device adoption.

V. CONCLUSION
This study presents a new algorithm to estimate SC and temporal gait parameters using a single leg-worn accelerometer in individuals with HD, validated in the clinic and applied under free-living conditions.The algorithm provided accurate estimates of SC, STR and STA in the clinic, along with estimation of WBs and daily W t in free-living conditions.Excellent agreement was observed between SC and W t estimated using the proposed algorithm and proprietary software under free-living conditions, with SC overestimated using a wrist-worn sensor.The results support the use of a single leg-worn accelerometer together with the proposed GED algorithm for objective free-living gait analysis in HD.

Fig. 2 .
Fig. 2. (a) Filtered norm of the acceleration (|a|) recorded on the right thigh of a HD participant during 2 hours of free-living conditions.(b) Moving mean ( ā) (purple) and moving standard deviation (σ a ) (green) of |a|.Red line indicates the gait activity threshold of 0.1 g.(c) Walking bouts obtained using the proposed algorithm (WB Acc ).(d) Normalized autocorrelation (ρ aa ) of |a| during a 6-s time window containing gait.Red line indicates the gait activity threshold of 0.2.Blue dashed line is the estimated stride time (ST R) of 1.125 s.(e) Filtered acceleration recorded in the antero-posterior direction (a z ) of the right thigh of a HD participant during a 15-s time period of gait activity under free-living conditions.(f) Teager-Kaiser energy (TKE) signal estimated from a z .(g and h) Smoothed TKE signals calculated from the TKE signal in (f).White dots indicate peaks detected as candidate FC or IC events.(i)a z with FC (blue dots) and IC (red dots) events detected after peak characterization, classification, and post-processing.

Fig. 3 .
Fig. 3. Scatter (left) and Bland-Altman (right) plots for step count obtained in HD participants during two 2MWTs from video annotations (SC Video ) against those obtained from (a, b) shanks (SC Shank-acc ) and(c, d) thighs (SC Thigh-acc ) using the proposed GED algorithm, and from (e, f) thighs (SC AP-thigh ) and (g, h) wrists (SC FB-wrist ) using ActivPAL and Fitbit software, respectively.Solid and dashed lines in the left panels represent linear regressions and lines of equality, respectively.Solid and dashed lines in the right panels represent mean and mean ± 1.96 times the standard deviation of step count differences, respectively.Pearson's correlation coefficients (r) and intra-class correlation coefficients (ICC 2,1 ) are shown in the left and right panels, respectively.

Fig. 4 .
Fig. 4. Scatter and Bland-Altman plots for (a-d) stride (STR), (e-h) stance (STA), and (i-l) swing (SWI) time mean values obtained in HD participants during two 2MWTs from video annotations (STR Mean-video , STA Mean-video , and SWI Mean-video ) against those obtained from shanks (STR Mean-shank , STA Mean-shank , and SWI Mean-shank ) and thighs (STR Mean-thigh , STA Mean-thigh and SWI Mean-thigh ) using the proposed GED algorithm.Solid and dashed lines in the scatter plots represent linear regressions and lines of equality, respectively.Solid and dashed lines in the Bland-Altman plots represent mean and mean ± 1.96 times the standard deviation of differences, respectively.Pearson's correlation coefficients (r) and intra-class correlation coefficients (ICC 2,1 ) are shown in the scatter and Bland-Altman plots, respectively.

Fig. 5 .
Fig. 5. (a) Walking bouts obtained from the thigh acceleration of a HD patient during 7 days of free-living conditions using the proposed algorithm (WB Acc ) and ActivPAL software (WB AP ).Mean value of daily time spent walking (W t ), walking bout duration (WB dur ), and steps per day are shown in the shaded box.(b) Walking bouts obtained during 24 hours of free-living conditions (day 5) and the corresponding cumulative step count obtained using the proposed GED algorithm (SC Acc ) and ActivPAL software (SC AP ).

1 )
Stride Time Estimation: Stride Time Was Estimated for Each WB and Participant From the Raw Acceleration Signal, Without a Priori Assumptions About Subject Cadence.The Original Algorithm Assumed an Average Stride Time of 1.1 s for Healthy Individuals, and Estimated Stride Time as the Time Lag of the First Positive Peak in the Autocovariance of the Smoothed TKE Signal, Within a Maximum Time Lag of 1.65 s.However, HD Participants Usually Have a Lower Cadence.Stride Time Was Estimated More Robustly in This Study Based on the Two Highest Peaks of the Normalized Autocorrelation of Raw Acceleration, Calculated in 6-s Moving Windows With a Maximum Time Lag of 3 s.In This Way, Estimated Stride Time for a Certain WB Was Based on the Median of Multiple Stride Time Estimates 2) Peak Finding and Classification: Amplitude and Temporal Constraints for Gait Event Detection Were Relaxed in Comparison With the Original Algorithm, Making Peak Detection More Flexible.The Amplitude Threshold Was Lowered From 0.5 (only for TKE') to 0.4 (for TKE' and TKE") Times the Mean Value of the Corresponding TKE Signal.The Lower Threshold Was Used as Acceleration Peaks Are Usually Shorter Than, and Not as Evident As, Those in Healthy Subjects, Due to the Smoother Movements of HD Participants During IC and FC Events.Furthermore, the Original

Fig. 6 .
Fig.6.Scatter (left) and Bland-Altman (right) plots for (a, b) W t and (c-h) SC obtained in HD participants during free-living from thighs using the proposed GED algorithm (W t-thigh-acc and SC Thigh-acc ) and AP software (W t-AP-thigh and SC AP-thigh ), and from wrists using FB software (SC FB-wrist ).Participants are color-coded and each point represents a day.Solid and dashed lines in the scatter plots represent linear regressions and lines of equality, respectively.Solid and dashed lines in the Bland-Altman plots represent mean and mean ± 1.96 times the standard deviation of differences, respectively.Pearson's correlation coefficients (r) and intra-class correlation coefficients (ICC 2,1 ) are shown in the left and right panels, respectively.

Fig. 7 .
Fig. 7. Swarm scatter plots for (a) mean and (b) coefficient of variation of stride (STR Mean and STR CV ), stance (STA Mean and STA CV ) and swing (SWI Mean and SWI CV ) times obtained in HD participants during two 2MWTs from video annotations and both shank and thigh acceleration, using the proposed GED algorithm, against UHDRS gait score.Solid lines represent significant differences.Dotted lines represent linear regressions.Adjusted p-values were obtained using Bonferroni's method.* : p < 0.05, * * : p < 0.01.
Stride Time Was Estimated for Each WB and Participant.Normalized Autocorrelation of a z Was Calculated Over a 6-s Moving Window With 3-s Step.The Two Highest Peaks With a Minimum Time Lag of 0.5 s and a Maximum Time Lag of 3 s Were Identified for Each Window.If the Time Lag of One Peak Was Approximately Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.Twice (±10%) the Time Lag of the Other Peak, Stride Time Was Estimated as the Time Lag of the First Peak Above 0.75 s (Fig. 2d).If Not, the Time Lag of the Highest Peak Was Considered as the Estimated Stride Time.The Histogram of Estimated Stride Times Over All Windows Was Then Calculated and the Highest Bin Identified.The Median of the Stride Time Estimates in the Identified Bin Was Taken as the Stride Time Estimation (ST R) 5) Peak Finding: Peaks Higher Than 0.4 Times the Mean Value of TKE' and Separated by a Minimum of 0.6ST R s Were Identified (Fig. 2g).TKE' Values Within a Region of ±0.3ST R About Each Detected Peak Were Set at Zero, Obtaining TKE" (Fig. 2h).Peaks Higher Than 0.4 Times the Mean Value of TKE" and Separated by a Minimum of 0.4ST R s Were Then Detected 6) Peak Characterization: All Peaks Detected in Step 5 Were Characterized by Six Features, Including Time Since Previous Peak (p 1 ), Time to the Next Peak (p 2 ), the Ratio of the Two Previous Parameters (p 3 ), and the Following Features of a z Within a Region of ±0.25 s About the Peak: Range (maximum Minus minimum) (p 4 ), Number of Zero-Crossings (p 5 ), and Number of Peaks Higher Than 0.5 (p 6 ).Parameters p 3 -p 6 Were Normalized to the Maximum Values Across All Peaks and Were Used as Peak Coordinates for Unsupervised Peak Clustering 7) Centroid Initialization: Only Peaks With p 1 and p 2 Lower Than or Equal to 1.25ST R Were Used to Initialize the Cluster Centroids.After Calculating Histograms of Parameters p 3 -p 6 Using 0.1-Width Bins, Otsu's Method [31] Was Applied to Each Histogram to Distinguish Two Classes, Minimizing Intra-Class Variance.The Parameter That Provided the Minimum Intra-Class Variance Was Used to Divide Peaks Into Two Clusters, and Centroid Starting Locations Were Calculated as the Mean of the Peaks in Each Cluster 8) Peak Classification: Using the Centroid Starting Locations, All Peaks Were Classified Using the Squared Euclidean Distance.Peaks Included in the Cluster With the Lowest p 3 Median Value Were Labelled FC Events, and the Remaining Peaks Were Labelled IC Events 9) Peak Post-Processing: An Iterative Process Was Then Initiated to Remove Peaks Which Were Too Distant (p 1 and p 2 ≥ 0.65ST R) or Too Close (p 1 and p 2 < 0.35ST R), and Relabel Peaks When Two Consecutive Peaks Had the Same Label.Finally, the Series of IC and FC Events Was Forced to Start With an FC Event and End With an IC Event, and Events With the Same Label as Its Preceding Event Were Removed (Fig.