Pathological Gait Abnormality Detection and Segmentation by Processing the Hip Joints Motion Data to Support Mobile Gait Rehabilitation

An accurate detection of the gait sub-phases is fundamental in clinical gait analysis to interpret kinetic and kinematic data. In general, detecting the gait events that mark the transition from one gait sub-phase to another as well as the sequence of sub-phases is essential to evaluate gait abnormalities. However, finding a reliable segmentation for pathological gait has been a challenging task. This manuscript entails a generic approach for the gait segmentation into sub-phases in the CORBYS 1 system. A number of distinctive features are extracted from the Hip joints motion data which are able to partition and segment the gait cycles in an efficient way. The degree of deviation (i.e. anomaly) in each sub-phase is then calculated with respect to an optimal gait reference which is used for robot-assisted gait rehabilitation. The proposed gait segmentation method is applicable to gait with many types of pathology since training on the pathology specific templates is not required. Performance of the proposed algorithm is evaluated by statistical analysis of results which produced 100% gait segmentation accuracy for healthy subjects and over 99% for pathological subjects.


Introduction
Gait analysis has by far received the most study as compared to other human body movement [1] because of its readily observable features. Gait comprises a periodic phenomenon in both legs in such a way that the entire body moves from one place to another [2]. A single gait cycle consists of one stride length which is further divided into stance and swing phases. In the stance phase, one leg bears the weight of the body whereas the swing phase causes the leg's forward motion to propel the body. The swing and stance phases are classified by a cut-off point such that the interval between the toe-off point and heel-strike for a foot represents the swing phase while the stance occurs between the heel-strike and toe-off. Swing and stancephases are further divided into seven sub-phases that include, Initial Contact (IC), Load Response (LR), Mid Stance (MSt), Terminal Stance (TSt), Pre-Swing (PSw), Initial Swing (ISw), Mid-Swing (MSw), and Terminal Swing (TSw) [2,3]. Since a measurement of the gait with foot switches, gyroscopes, and accelerometers can only detect events that are caused by repetitive patterns in the movement and in measured signals, the phases detected from sensors differ from those based on functional tasks. Literature contains a variety of gait segmentation models consisting of a different number of sub-phases varying from two to seven depending upon different clinical aims [4].
An accurate detection of the gait sub-phases is fundamental in clinical gait analysis to interpret kinetic and kinematic data [2]. Correct segmentation of the gait sub-phases can be considered as research initiatives for several scientific studies that include daily life activities Abnormality Detection, assessment of gait anomaly level in patients after interventions or rehabilitation treatments, the synergistic control of robotic devices for the recovery of lower limb mobility, athlete coaching, and distinguishing between normal and pathological gait [4]. Human locomotors system functionality can be affected by various causes leading to atypical gait generation. As an example, a gait cycle usually starts with the forefoot contact instead of a heel strike for patients with an equinus foot. Similarly, a foot-drop may be seen during the swing phase [5] in the case of different neurological and degenerative diseases such as muscular dystrophy, multiple sclerosis, stroke, and Parkinson's disease. Analysis of the gait biomechanics to a sub-phase level is very useful for a patient's degree of performance, gait rehabilitation, walking pattern recognition, and other related research [1]. A typical example would include pathological gait which can be diagnosed and evaluated after rehabilitation using different gait features such as stride width, walking speed, cadence, and walking symmetry [6]. Similarly, the gait sub-phase information has been used by various application devices such as functional electronic stimulation [7][8][9][10][11], wearable Despite the vast application areas of gait segmentation, it has been a challenging task more specifically for pathological gait [5]. In general, detecting the gait events that mark the transition from one gait sub-phase to another as well as the sequence of gait sub-phases is essential to evaluate gait abnormalities [21]. Literature consists of a number of approaches to classify the gait sub-phases in a normal walking gait. For instance, support vector machines, artificial neural networks [22], hidden Markov models [23][24][25][26], fuzzy models [27,28], and simple heuristic threshold methods [9,20] have been employed for gait sub-phase segmentation. These methods use variety of wearable sensors that include accelerometers [29], gyroscopes and force sensing resistors [9], inclinometers [30], and other force-contact sensors [31] for the gait data acquisition. Although, the aforementioned gait segmentation methods have been performed efficient sub-phase level gait segmentation; these are limited to healthy subjects (i.e. normal gait) only.
On the other hand, pathological gait segmentation has been a challenging task [5] because of its varying features for different patients and corresponding gait anomalies. The literature contains a variety of approaches to segmenting the abnormal gait into subphases [5,[32][33][34][35][36]. For instance, Jasiewicz et al. [32] proposed an algorithm for gait event (initial contact and end contact) detection in healthy and spinal-cord injured subjects. A number of methods were implemented using foot linear acceleration, foot sagittal angular velocity, and shank sagittal angular velocity data and their performances were compared with the most commonly used foot switch based gait data. Effective event detection was achieved for normal footfall patterns which are reduced significantly in pathological gaits specifically those involving the use of walking aids. Similarly, a pathological gait cycle segmentation presented in Agostini et al. [5].
performs the task of partitioning input signal into multiple gait cycles followed by the determination of atypical gait cycle in a foot switch signal. The anti-causal anti-bounce filter was used to eliminate the spurious spikes from the input signal. The processed signal is auto-segmented into four sub-phases that include heel contact, flat foot contact, heel-off, and swing. The duration of each gait cycle is measured by integrating the number of samples in its sub-phases which is then used for atypical gait cycle recognition. This method was tested on healthy as well as pathological gait cycles acquired from patients with Parkinson's disease and Hemiplegic children. Despite the efficient performance, these methods are able to segment the gait cycle up to a limited (two to three) number of sub-phases. These methods are also applicable to a specific type of pathology.
This manuscript introduces a novel approach used in the CORBYS system to perform multiple tasks that include: (i) partition of the joints' angular data into separate gait cycles (ii) identification of the pathological gait cycle based on the acquired signal during walking (iii) and finally segmentation of the pathological and healthy gait into sub-phases. In the case of pathological gait, the degree of deviation (i.e. anomaly level) in each sub-phase is measured to be used for medical treatment (i.e. gait rehabilitation). The segmentation and Abnormality Detection of pathological gait cycles becomes difficult because of associated dynamics for different patients and corresponding gait anomalies. In this scene, the proposed method introduces a generic gait segmentation applicable to both; healthy and pathological subjects having different types of anomalies, since the segmentation process is carried out without the definition of gait sub-phases templates. Time domain features are extracted from the acquired hip-joint angular data for sagittal movement and utilized to divide the automated gait segmentation into seven subphases. The degree of anomaly is then estimated at sub-phase level with respect to an optimal reference to find out the pathology type and exact location in the gait cycle.

Materials and Methods
Data acquisition and pre-processing The gait data for healthy and disabled patients has been recorded by the CORBYS clinical partners URIRS 2 . Data was recorded using the VICON motion capture system which logs the motion of infra-red sensitive markers strategically placed on the patients. Synchronised sensor readings are transmitted wirelessly formatted as standardised Robot Operating System (ROS) data from the human sensory system controller. Markers measure the motion within particular axes of the gait motion. This clinical data comprises the motion data relayed to the feed-forward trajectory controller for calculation of joint moments for the human body model. The coordinate system for this gait data is described in Figure 1 which depicts gait measured along three planes of motion. The sagittal plane describes motion around x-axis, the transversal plane describes motion around y-axis, and the frontal plane describes motion around the z-axis. The acquired dataset consists of measurements for each joint in both legs recorded in selected planes. Hip data is recorded in all three axes, knee data is recorded in only x-axis, and ankle data is recorded in the x-axis and z-axes.
The initial motion data for two patients are five to eight seconds of duration and contain six to eight gait cycles. The duration of a gait cycle is limited by the size of the recording area of the motion capture system. The URIRS does not record patients on the treadmill and therefore we have to append several gait cycles in order to obtain longer datasets of disabled gait. However, a large dataset for healthy subjects was recorded by walking on a treadmill. In addition, simulated data is generated using the optimal gait ranges [1] for joint muscular motion. Details of the appended motion data for one healthy subject, two patients, and a simulated dataset are presented in Table 1.  Gait model employed in the proposed study is a classic gait model by Perry [2] which divides each cycle into seven sub-phases that include: Initial Contact (IC) to Load Response (LR), Mid Stance (MSt), Terminal Stance (TSt), Pre Swing (PSw), Initial Swing (ISw), Mid Swing (MSw), and Terminal Swing (TSw). Figure 2 demonstrates a complete gait cycle acquired for healthy subject in Table 1, transitions between its sub-phases, and corresponding left hip, knee, and ankle joint movements in sagittal dimension.

Gait analysis and anomaly detection
Hip flexion and extension are one of the most important muscular activities in the walking phenomenon that occur with the pelvic girdle forward and backward rotation in the hip flexion and extension respectively [37-39]. It can be observed in Figure  2 that the Hip joint motion, specifically in sagittal dimension is a necessary condition for the body to move forward. In other words, without the Hip sagittal motion, a subject cannot progress (i.e. step forward or backward) along a horizontal axis regardless of gait medical conditions. This implies that maximum and minimum values for Hip joint sagittal dimension angular motion indicate the flexion and extension extremes of the corresponding leg respectively in a gait cycle. Hence, the proposed method exclusively processes the Hip joint muscular activities to partition and segment the gait cycle. A number of time-domain features are extracted from the acquired Hip-joint motion data (sagittal dimension only) to segment the entire gait into sub-phases. These features include global maxima, global minima, zero cross index, and offset value along with the expert knowledge from the literature [1,40,41] for joint motion ranges. Figure 3 shows sequential processing of the proposed method to partition, sub-phase level segmentation, and Abnormality Detection (healthy/pathological) of a gait cycle which is further used to measure the degree of deviation in the effected sub-phase. A visual demonstration of the described algorithm is presented in Figure 4. The interval between two successive negative going Zero-Crossing Rate (ZCR) produces a complete gait cycle. Following the ZCRwhich represents the start of the TSt as the initial point, 1 st positive data sample after ZCR gives the index of positive-going zero-cross (ZCR + ) that represents the end of PSw sub-phase. The index of minimum data sample (G min ) between ZCR and ZCR + is then calculated that gives the end of the TSt. In the next step, the index of the LR segment is calculated using the opposite leg angular data. As the data is synchronised, the index in the left Hip data corresponding to the minimum data sample in the right Hip will produce the finishing point of the LR sub-phase. To assure the synchronization in terms of being within the same gait cycle, the IC_LR index is calculated between the indexes of ZCR + and the end of the gait cycle as shown in Figure 4 above. The index of the data sample with a maximum value (G max ) between ZCR + and IC_LR is then calculated which indicates the starting index of TSw. Finally, data samples between IC_LR and the end of the gait cycle (2 nd ZCR -) indicates the MSt which is the longest sub-phase in a gait cycle. An important aspect of the proposed method is the ability to segment the gait with many types of pathology since training on the pathology specific templates is not required. To increase the reliability of the proposed algorithm, a number of important checks are carried out specifically for pathological gaits.
For example, the data synchronisation check is performed prior to sub-phase Abnormality Detection as described earlier.
Likewise, an offset value is used to ensure that the corresponding leg always crosses the pelvis point (origin) in the sagittal dimension that pursues the Hip flexion and extension phenomenon. The importance of the offset check can be analysed in Figure 4 which indicates that the gait segmentation uses zero crossings. In the case of a healthy subject, the gait always performs positive and negative angular activities which may not be the case for a pathological gait. In order to rectify this, we use an offset value to shift the entire gait by the required amount according to optimal gait ranges [1,40,41]. After the sub-phases measurements, the offset value is reused with a reverse sign to revert the signal into its original form. The degree of deviation in each sub-phase is then measured using the optimal gait ranges as a reference. The Euclidean distance between the subphases of the test subject and optimal reference gives the anomaly in a particular sub-phase that is further used for gait rehabilitation and the decision controller in the CORBYS system [42,43].
Where R and T are the optimal and test gait cycles respectively, and k is the current index of n number of samples/element in the current sub-phase i, and ∆ is the degree of deviation (i.e. anomaly) in current sub-phase of a particular gait cycle, and δ is the varying tolerance threshold. A gait cycle is identified as 'pathological/ abnormal' if the calculated deviation ∆ i (R,T) in any of the corresponding sub-phases exceeds zero.

Experimental setup and evaluation methodology
Experiments were conducted on the dataset presented in Table  1 using the proposed algorithm described earlier. The acquired data was forwarded to sequential setup presented in Figure 2 to achieve the desired goal of sub-phases Abnormality Detection. MATLAB ® by Math works was used for data processing, analysis, and simulation purposes. The validation process aims to demonstrate that the algorithm is as good as the human expert. The algorithm was validated on a total of 3920 gait cycles; 2900 from healthy and 1020 from pathological subjects) using the manual and Copyright ©Wasiq Khan automated methods presented in Agostini et al. [5]. For each signal, we compared the gait cycle Abnormality Detection obtained from the proposed algorithm and "manual" segmentation. The manual segmentation was performed with the following steps: (1) Extract the Hip joints X-axis motion data from the acquired ROS bags (2) Store in Excel sheets and mark each gait with a segmentation line (3) Label the dataset with a corresponding gait cycle number and sub-phases. Algorithm output can be classified in the binary form of correct and incorrect segmentation of a sub-phase. When a new sub-phase is incorrectly classified by an algorithm, a cross is added on a sheet of paper near the corresponding sub-phase name (4) Counting the crosses assigned to each sub-phase segment, we calculated the mismatched sub-phases between the procedures (i.e. algorithm and manual segmentation) if present. Performance of the algorithm was defined as the number of sub-phases matching the manual segmentation divided by the total number of sub-phases. Likewise, the performance of the healthy subject and self-generated dataset is evaluated by varying the tolerance window in terms of sub-phase start and end position estimates. The proposed gait segmentation algorithm is applied to the sample dataset and results were obtained as reported in Table 2. For each examined subject, we indicated the subject's health condition, accuracy for complete cycle partition in the gait data through manual and automatic procedures, the Abnormality Detection accuracy for a gait to be recognised as normal or pathological, and accuracy of sub-phase level segmentation for healthy and patient gait data corresponding to the varying temporal tolerance window.

Results and Discussion
Time period of the oscillations in the gait data also varies depending on how fast the patient is walking. Additionally, from left to right leg, qualitatively the dynamics become more erratic. This is likely due to the increased degrees of freedom and variability of movement and the successive dependency of the left hip dynamics on those of the right hip; specifically, for the LR sub-phase. Taken together, these factors make the learning of a patient's gait challenging [5]. The extreme indexes for sub-phases in ground truth and algorithm output may lag by a number of samples. The varying tolerance window indicates granularity in the system performance for sub-phases segmentation as shown in Table 2. This phenomenon can be analysed in Table 2 results where the accuracy is affected only during the TSw and LR sub-phases. Statistics indicated that the system performance degraded 003% when the tolerance level is decreased from 6% to 3% of the gait cycle. However, the proposed algorithm classified, partitioned, and segmented 100% of the cycles in healthy subjects and over 99% in pathological subjects which demonstrate that the muscular activities of Hip joints can be used for sub-phase level segmentation for both healthy and pathological gaits. These results indicate the superiority of our algorithm in terms of the segmentation accuracy and granularity level of seven sub-phases as compared to the existing signal processing [32,34,35] and machine learning [22,23,25,26] based approaches that are limited to segment the gait cycle into up to three subphases. Despite of the accuracy (100% and 98% for healthy and pathological subjects respectively) achieved by Agostini et al. [5] in terms of gait segmentation and Abnormality Detection into normal and pathological, it was limited to three sub-phases only which decreases the granularity level of gait rehabilitation.
Angular ranges for the joint muscles in a healthy gait vary with respect to subject physical properties and other dynamics [1,40]. For instance, in left Hip sagittal motion, it varies from 30 to 35 in flexion and -2 to -10 in the extension phase. This gives an indication to set the anomaly threshold for each sub-phase to classify a gait cycle as normal or pathological. For instance, the gait Abnormality Detection results shown in Table 2 are achieved using a threshold value of ±5 degree which means that a gait is identified as pathological if any of its sub-phases deviate more than 5 degrees (flexion or extension). However, the threshold value may vary with respect to application, patient condition, and rehabilitation process. The efficient sub-phase level segmentation is very useful for detecting the exact spatial and temporal position of defected gait as shown in Table 3. It can be observed that the mean deviations of the patient sub-phase from the optimal gait are larger than in a healthy gait. For instance, the MSw for patient 1 is deviated 8.07 degrees in the sagittal dimension which indicates the required degree of rehabilitation in the left Hip joint sagittal dimension in that particular sub-phase. Also, diminutive deviations within the anomaly threshold for healthy subjects as expected; validate the proposed method for healthy gait segmentation. An accurate segmentation of gait sub-phases is useful for several scientific studies such as the assessment of the gait anomaly level in patients after interventions or rehabilitation treatments and distinguishing between a normal and pathological gait [2,4]. Figure 5 demonstrates a test case outcome for healthy and pathological gait segmentation into seven sub-phases. The degree of deviation in each sub-phase can be easily observed and calculated which indicates the anomaly type and location in a pathological gait cycle. For instance, the TSt and PSw phases of both patients are an approximately deviated mean value of 10 degrees with respect to the optimal reference which indicates that the rehabilitation is needed for these two sub-phases only.

Conclusion
This research was focused on the gait segmentation into seven sub-phase using Hip joint angular motion independent of a pathology type. The proposed method was able to partition the continuous stream of Hip joint sagittal dimensional motion data into individual gait cycles and classify the gait as normal or pathological based on the measured degree of anomaly in each sub-phase. The Sub-phase level gait segmentation enabled the determination of the deviation in a patient's gait from the optimal reference gait pattern.