Detection and Classification of Stroke Gaits by Deep Neural Networks Employing Inertial Measurement Units

This paper develops Deep Neural Network (DNN) models that can recognize stroke gaits. Stroke patients usually suffer from partial disability and develop abnormal gaits that can vary widely and need targeted treatments. Evaluation of gait patterns is crucial for clinical experts to make decisions about the medication and rehabilitation strategies for the stroke patients. However, the evaluation is often subjective, and different clinicians might have different diagnoses of stroke gait patterns. In addition, some patients may present with mixed neurological gaits. Therefore, we apply artificial intelligence techniques to detect stroke gaits and to classify abnormal gait patterns. First, we collect clinical gait data from eight stroke patients and seven healthy subjects. We then apply these data to develop DNN models that can detect stroke gaits. Finally, we classify four common gait abnormalities seen in stroke patients. The developed models achieve an average accuracy of 99.35% in detecting the stroke gaits and an average accuracy of 97.31% in classifying the gait abnormality. Based on the results, the developed DNN models could help therapists or physicians to diagnose different abnormal gaits and to apply suitable rehabilitation strategies for stroke patients.


Introduction
Stroke is a common medical emergency with a high mortality rate, ranking second among the leading causes of death in the last 15 years [1]. However, the patients who are fortunate enough to survive stroke events usually suffer from partial disability and inconvenience in their daily lives. Therefore, post-stroke patients usually require long-term healthcare and rehabilitation. At present, stroke costs are about 34 billion US dollars per year in the USA [2]. On average, each stroke patient spends about 60,000 US dollars per year, with 30% of those costs expended on rehabilitation and medical care [3]. The purpose of rehabilitation is to help these patients recover their ability for independent living, particularly walking on their own.
Hemiplegia is one of the most common impairments after stroke and contributes significantly to walking impairments [4]. The hemiplegic gait patterns include decreased knee flexion and ankle dorsiflexion during swing [5]. Approximately two thirds of stroke survivors with initial paralysis of the leg can eventually walk with or without assistance [6]. However, many individuals still exhibit considerable gait impairments and cannot achieve the walking dexterity that enable them to perform all their daily activities. Stroke survivors normally develop abnormal gaits, such as longer swing phases and decreased stance phases on the paretic side. Because different and diverse gait problems are encountered in stroke survivors, it is important to determine each individual's gait abnormalities during the golden time window of rehabilitation to develop appropriate training strategies and improve patients' functional outcomes.
Unfortunately, most of the gait training programs have been based mainly on clinical assessments, which may be influenced by subjective decisions and therapists' experiences. For this reason, many researchers have attempted to identify the walking pattern in objective manners. For example, Zhao et al. [7] proposed the rule-based algorithms to identify several gait events. Wang et al. [8] developed algorithms to detect three gait events in real time. Knutsson and Richards [9] used electromyogram signals to identify three types of abnormal muscle activation patterns in post-stroke patients. Wong et al. [10] applied load sensors to analyze the foot contact pattern when evaluating walking ability in patients with hemiplegic stroke. Some studies have also applied machine learning techniques to develop gait classification models. For instance, Wahid et al. [11] measured spatialtemporal gait signals for feature extraction and proposed a classification model to diagnose Parkinson disease (PD); their model achieved an accuracy of 92.6% after normalizing gait data using a multiple regression approach. Daliri [12], who analyzed gait signals derived from ground reaction forces, applied support vector machines to diagnose subjects with PD and achieved an accuracy of 91.2%. Similarly, Dolatabadi et al. [13] applied two machine learning methods and discriminated normal and pathological gait patterns with an accuracy of more than 90%. Li [14] used the dynamic time warping algorithm, sample entropy method, and empirical mode decomposition-based stability index to analyze the symmetry, regularity, and stability of post-stroke hemiparetic gaits. They then applied the k-nearest-neighbor classifier to distinguish stroke gaits and achieved an area-under-thecurve value of 0.94. However, no research has yet been conducted on the classification of stroke gait patterns. Therefore, the aim of this paper is to develop models that can recognize stroke gaits.
The gait abnormalities in post-stroke patients vary, and each needs specific rehabilitation strategies. For example, the following are four common gait abnormalities seen in post-stroke patients: (1) The drop-foot gait [15][16][17]: Patients develop a drop foot gait because their weakness or paralysis limits their ability to raise the front part of the foot, so that their toes are dragged when walking. This abnormal gait can slow walking speed and increased risk of falls. (2) The circumduction gait [18][19][20][21][22][23]: This gait is also known as the neurological or hemiplegia gait. The knee and hip movements are insufficient to allow the foot to clear the ground, so the patients adopt an abnormal walking pattern by taking the leg away from the body and swinging the leg forward in a semicircular fashion when walking. (3) The hip hiking gait [18,24,25]: This gait is defined as a frontal plane elevation of the ipsilateral side of the pelvis to achieve foot clearance. Both hip hiking and circumduction are secondary gait deviations used to achieve ground clearance during the paretic swing phase. (4) The back knee gait [26][27][28][29]: This gait is also known as genu recurvatum, which is defined as full extension or hyperextension of the knee in the stance phase [27]. Genu recurvatum can lead to functional mobility limitations and early degenerative changes of knee joint due to progressive knee hyperextension [28].
The abnormal gaits in post-stroke patients not only increase energy consumption but they also reduce walking efficiency, causing difficulties in ambulation and increasing the risk of falling. The abnormal gaits can also place extra pressure on the joints, cause damage to joints or ligaments, and even affect the patient's mental state and quality of life. Hence, evaluation and identification of gait abnormalities are important for developing appropriate training strategies for rehabilitation. In current clinical practice, gait pattern diagnosis mainly relies on the experience of clinicians or physical therapists to make judgments, and there is no objective diagnostic standard. Different clinicians or therapists might have different diagnoses of stroke gait patterns. In addition, some patients may present with mixed neurological gaits, for example, hemiplegic gait combined with foot inversion gait due to increased muscle tone or some patients may combine with drop foot because of receiving over-dose botulinum toxin treatment for legs spasticity. Therefore, many researchers have attempted to identify gait events [7,8] and gait abnormalities [9,10]. Machine learning techniques are also applied to improve the identification performance [11][12][13][14]. However, no research has yet been conducted on the classification of stroke gaits. Hence, in this paper we apply deep learning technologies to detect and classify stroke gaits as an aid to diagnosis and for application of appropriate rehabilitation methods for stroke patients. In this study, the stroke gait patterns were diagnosed by two physical therapists who were more than 15 years qualified, with at least 10 years of daily experience working with patients with stroke. Then we apply the clinical data to develop Deep Neural Network (DNN) models to assist physical therapists or physicians for more optimizing the diagnosis of different stroke gaits, especially for those with mixed neurological gait problems.
The paper is arranged as follows: Section 2 introduces the experiments for the collection of gait data. We applied inertial measurement units (IMUs) to acquire the gait information. Section 3 develops a deep-learning model for recognizing stroke gaits. Section 4 describes the model training processes and validation. We also test the developed models by applying a public dataset. Based on the results, we discuss the performance, limitation, and future development of the developed model in Section 5. Finally, we draw conclusions in Section 6.

Collection and Processing
This section describes the experiments conducted to collect gait data. We invited stroke patients and healthy subjects to conduct walking tests. Their gaits were measured and applied to develop a DNN model that can identify and classify the stroke gaits.
First, we recruited eight post-stroke patients; their data are illustrated in Table 1. The following criteria were applied when selecting the test subjects: (1) the Brunnstrom Stage (BS) [30] on the lower extremity was stage 3-5; (2) the Functional Ambulation Category (FAC) [31] was stage 3-5; (3) the Mini-Mental State Examination (MMSE) [32] score was higher than 24; (4) subjects could walk ten meters indoors with or without aid devices, and (5) subjects could stand up on their own using a handrail and aids. Second, we also recruited seven healthy subjects as the normal reference group; their data are illustrated in Table 2. All test subjects signed informed consent forms approved by the Human Subject Research Ethics Committee of Institutional Review Board (IRB) [33], as shown in Appendix A.  Wearable sensor technologies have been frequently applied to gait analyses. For example, Diaz et al. [34] surveyed the applications of wearable sensor technologies in analyzing the gait, balance, and range of motion research. Nguyen et al. [35] applied an IMU-based system to develop deep convolutional neural network models for distinguish subjects with foot structural abnormalities. In this paper, we applied the APDM OPAL system [36] to acquire the gait information. The OPAL system contains wearable IMUs with a sampling rate of 128 Hz and a resolution of 17.5 bits. Each IMU has a size of about 44 mm × 40 mm × 14 mm and weighs less than 25 gm. Two IMUs were attached to the subjects' shanks, as shown in Figure 1. Each IMU consists of a 3-axis accelerometer, a 3-axis gyroscope, and a 3-axis magnetometer. The maximum measurement ranges of the accelerometer, the gyroscope, and the magnetometer are ±200 g, ±200 deg/s, and ±8 Gauss, respectively. This IMU device can detect a subject's kinematic data with a highest sampling rate of 128 Hz. In the experiment, all subjects were required to complete walking tests at their most comfortable pace.  Wearable sensor technologies have been frequently applied to gait analyses. For exam ple, Diaz et al. [34] surveyed the applications of wearable sensor technologies in analyzin the gait, balance, and range of motion research. Nguyen et al. [35] applied an IMU-base system to develop deep convolutional neural network models for distinguish subjects wit foot structural abnormalities. In this paper, we applied the APDM OPAL system [36] to ac quire the gait information. The OPAL system contains wearable IMUs with a samplin rate of 128 Hz and a resolution of 17.5 bits. Each IMU has a size of abou 44mm 40mm 14mm × × and weighs less than 25 gm. Two IMUs were attached to the sub jects' shanks, as shown in Figure 1. Each IMU consists of a 3-axis accelerometer, a 3-ax gyroscope, and a 3-axis magnetometer. The maximum measurement ranges of the acce erometer, the gyroscope, and the magnetometer are 200 g ± , 200 deg/s ± , and 8 Gauss ± respectively. This IMU device can detect a subject's kinematic data with a highest sam pling rate of 128 Hz. In the experiment, all subjects were required to complete walkin tests at their most comfortable pace. We applied the angular velocity of the shank on the sagittal plane [37], which is th mediolateral axis (y-axis) in Figure 1, to develop the DNN model. For example, the angu lar velocities y ω of patient P8 are shown in Figure 2a,b, where L and R represents the le leg and the right leg, respectively. Each gait cycle contains the following three importan gait events [38]: (1) Mid-swing: when the angular velocity achieves its maximum in the ga cycle; (2) Heel strike: when the heel touches the ground, where the angular velocity has th first negative trough after the mid-swing; (3) Toe off: when the toes leave the ground. Be cause these gait events can be evaluated by the angular velocities [37], we can mark the mid swing points of each gait and divided the measured data into individual gait cycles, a shown in Figure 2c,d. Note that we split the gait cycles by the mid-swing in that labellin the mid-swing is much easier and more direct than labelling the heel-strike [8]. The mode development will be similar if the gait cycles are partitioned by the heel-strike or the toe off. We then normalized the gait data by dividing it into one hundred points for each ga We applied the angular velocity of the shank on the sagittal plane [37], which is the mediolateral axis (y-axis) in Figure 1, to develop the DNN model. For example, the angular velocities ω y of patient P8 are shown in Figure 2a,b, where L and R represents the left leg and the right leg, respectively. Each gait cycle contains the following three important gait events [38]: (1) Mid-swing: when the angular velocity achieves its maximum in the gait cycle; (2) Heel strike: when the heel touches the ground, where the angular velocity has the first negative trough after the mid-swing; (3) Toe off: when the toes leave the ground. Because these gait events can be evaluated by the angular velocities [37], we can mark the mid-swing points of each gait and divided the measured data into individual gait cycles, as shown in Figure 2c,d. Note that we split the gait cycles by the mid-swing in that labelling the mid-swing is much easier and more direct than labelling the heel-strike [8]. The model development will be similar if the gait cycles are partitioned by the heel-strike or the toe-off. We then normalized the gait data by dividing it into one hundred points for cycle; this was done because each subject had a different walking speed and the data length for each gait cycle was not the same. By contrast, we illustrate the angular velocities y ω of the healthy subject H7 in Figure 3, where the healthy subject's gaits tend to be smoother than the stroke patient's gaits shown in Figure 2. We further compare the gait cycles of other stroke patients and healthy subjects, as shown in Appendix B, and find that the stroke subjects' gaits have significantly more trembles and vibration, especially on the paretic side. Hence, it is not difficult to distinguish the stroke gaits from the healthy gaits [10,13,14]. Nevertheless, the classification of abnormal stroke gaits is challenging because each patient might develop various combination of gait abnormalities which simultaneously affect the gait patterns. Therefore, we propose a DNN model structure for detecting and classifying the stroke gaits. We labelled the gait data from the stroke patients and the healthy subjects as the stroke gait (SG) and the normal gait (NG), respectively. The stroke gaits were further classified as the stroke gait with a drop foot (SGwDF), the stroke gait with circumduction (SGwC), the stroke gait with hip hiking (SGwHH), and the stroke gait with back knee (SGwBK), according to the therapists' diagnoses. Because the patients might or might not have had these abnormal gaits, we set four labels to build a multi-label classification model, as shown in Table 3. For example, patient P5 had all four gait abnormalities on the right leg, while patient P6 had both the drop foot gait and the back knee gait on the left leg. Conversely, Patient P7 had only the hip hiking gait on the left leg. We applied the gait data from Table 3 to establish a gait dataset with 4037 gaits, including 2037 stroke gaits By contrast, we illustrate the angular velocities ω y of the healthy subject H7 in Figure 3, where the healthy subject's gaits tend to be smoother than the stroke patient's gaits shown in Figure 2. We further compare the gait cycles of other stroke patients and healthy subjects, as shown in Appendix B, and find that the stroke subjects' gaits have significantly more trembles and vibration, especially on the paretic side. Hence, it is not difficult to distinguish the stroke gaits from the healthy gaits [10,13,14]. Nevertheless, the classification of abnormal stroke gaits is challenging because each patient might develop various combination of gait abnormalities which simultaneously affect the gait patterns. Therefore, we propose a DNN model structure for detecting and classifying the stroke gaits.
We labelled the gait data from the stroke patients and the healthy subjects as the stroke gait (SG) and the normal gait (NG), respectively. The stroke gaits were further classified as the stroke gait with a drop foot (SGwDF), the stroke gait with circumduction (SGwC), the stroke gait with hip hiking (SGwHH), and the stroke gait with back knee (SGwBK), according to the therapists' diagnoses. Because the patients might or might not have had these abnormal gaits, we set four labels to build a multi-label classification model, as shown in Table 3. For example, patient P5 had all four gait abnormalities on the right leg, while patient P6 had both the drop foot gait and the back knee gait on the left leg. Conversely, Patient P7 had only the hip hiking gait on the left leg. We applied the gait data from Table 3 to establish a gait dataset with 4037 gaits, including 2037 stroke gaits and 2000 normal gaits, as illustrated in Appendix C.

Deep Neural Network Model
This section develops a DNN model to recognize stroke gaits. We applied the measured gait data to develop a DNN model that can identify and classify the stroke gaits.
We applied the normalized gait data to build a multi-output gait recognition model. The model architecture is shown in Figure 4 and includes the detection part and the classification part. The detection part first judges whether the input gait is a normal gait or a stroke gait. It contains the input layer, six hidden layers, and the detection output. Each fully connected layer has 100 neurons. The numbers of hidden layers and neurons were chosen by iterative tests. Because the DNN model is highly nonlinear, using more layers and neurons might result in similar accuracy but greatly increase the computing loads. For example, the computing time was increased by about 75% when using ten layers. The detection output has two neurons to label the gait as NG or SG, marked as [1,0]

Deep Neural Network Model
This section develops a DNN model to recognize stroke gaits. We applied the measured gait data to develop a DNN model that can identify and classify the stroke gaits.
We applied the normalized gait data to build a multi-output gait recognition model. The model architecture is shown in Figure 4 and includes the detection part and the classification part. The detection part first judges whether the input gait is a normal gait or a stroke gait. It contains the input layer, six hidden layers, and the detection output. Each fully connected layer has 100 neurons. The numbers of hidden layers and neurons were chosen by iterative tests. Because the DNN model is highly nonlinear, using more layers and neurons might result in similar accuracy but greatly increase the computing loads. For example, the computing time was increased by about 75% when using ten layers. The detection output has two neurons to label the gait as NG or SG, marked as [1,0]   We applied the following functions to develop the DNN model: (1) The Activation Function: The neural network applied nonlinear activation functions in neurons. We selected the rectified linear unit (ReLU) [39], as shown in Figure 5a, as the activation function for the hidden layers: where z is the neuron input and ReLU(z) is the neuron output. This function can effectively overcome the vanishing gradient problem when updating the model parameters by back propagation [40]. The neural network would not continue training when the learning gradient is small. Moreover, the computing load is reduced because the function judges whether the input is greater than 0. That is, the ReLU We applied the following functions to develop the DNN model: (1) The Activation Function: The neural network applied nonlinear activation functions in neurons. We selected the rectified linear unit (ReLU) [39], as shown in Figure 5a, as the activation function for the hidden layers: where z is the neuron input and ReLU(z) is the neuron output. This function can effectively overcome the vanishing gradient problem when updating the model parameters by back propagation [40]. The neural network would not continue training when the learning gradient is small. Moreover, the computing load is reduced because the function judges whether the input is greater than 0. That is, the ReLU function is a complete transfer for positive gradients with a derivative of 1. If the input z < 0, then ReLU(z) = 0 and this neuron is directly deleted, thereby achieving a reduction in neurons and allowing rapid convergence.
( ) where z is the neuron input and (z) σ is the neuron output. The sigmoid function converts a scalar number to [0, 1], as shown in Figure 5b. If (z) σ is greater than a threshold of 0.5, it is considered to belong to the labelled category. The sigmoid function is the optimized fitting function of the binary classification problem, where its output corresponds to the loss function mentioned in the next section. Because the probability of each label is independent, the sigmoid function is usually used as the activation function of the output layer for multi-label classification. (2) The Loss Function: The loss function is applied to evaluate how well the algorithms interpret the given data. This function evaluates the loss of the model and updates the weights to reduce the loss on the next evaluation. We applied the following crossentropy [42] as the loss function: where i y is the distribution of the true output and î y is the distribution of the predicted output. Cross entropy can measure and quantify the similarity between i y and î y . In addition, it can help to avoid learning rate decreases in the gradient descent [43] by simultaneously applying the cross-entropy as the loss function and the sigmoid function as the activation function to the output layer. (3) The Optimizer: We selected Adam [44] as the optimizer of the DNN model. Adam is an adaptive learning rate optimization algorithm designed specifically for training DNNs, because it combines the advantages of Adagrad [45] and RMSprop [46] by calculating the gradients and updating the weights [43].

Model Training and Validation
This section introduces the model training process and model validation. We applied the k-fold cross-validation test [47] to evaluate the performance of the model. In this paper, we set k = 4 by dividing all classes of gait data into four parts (Fold 1, Fold 2, Fold 3, Conversely, we selected the following sigmoid function [41] as the activation function of the output layers: where z is the neuron input and σ(z) is the neuron output. The sigmoid function converts a scalar number to [0, 1], as shown in Figure 5b. If σ(z) is greater than a threshold of 0.5, it is considered to belong to the labelled category. The sigmoid function is the optimized fitting function of the binary classification problem, where its output corresponds to the loss function mentioned in the next section. Because the probability of each label is independent, the sigmoid function is usually used as the activation function of the output layer for multi-label classification. (2) The Loss Function: The loss function is applied to evaluate how well the algorithms interpret the given data. This function evaluates the loss of the model and updates the weights to reduce the loss on the next evaluation. We applied the following cross-entropy [42] as the loss function: where y i is the distribution of the true output andŷ i is the distribution of the predicted output. Cross entropy can measure and quantify the similarity between y i andŷ i . In addition, it can help to avoid learning rate decreases in the gradient descent [43] by simultaneously applying the cross-entropy as the loss function and the sigmoid function as the activation function to the output layer. (3) The Optimizer: We selected Adam [44] as the optimizer of the DNN model. Adam is an adaptive learning rate optimization algorithm designed specifically for training DNNs, because it combines the advantages of Adagrad [45] and RMSprop [46] by calculating the gradients and updating the weights [43].

Model Training and Validation
This section introduces the model training process and model validation. We applied the k-fold cross-validation test [47] to evaluate the performance of the model. In this paper, we set k = 4 by dividing all classes of gait data into four parts (Fold 1, Fold 2, Fold 3, and Fold 4), and we then arranged them randomly for training and validating. Each training took three of the four folds as a training dataset and used the remaining fold as validation. Figure 6 shows the training and validating flow chart, where the 4-fold cross-validation was repeated four times.
paper, we set k = 4 by dividing all classes of gait data into four parts (Fold 1, Fold 2, Fold 3, and Fold 4), and we then arranged them randomly for training and validating. Each training took three of the four folds as a training dataset and used the remaining fold as validation. Figure 6 shows the training and validating flow chart, where the 4-fold crossvalidation was repeated four times. In the training process, 500 samples were selected for each model training (batch size = 500) to update the weights. The training data passed through the layers of the model with present parameters and the ReLU function. Then, the obtained evaluation output was compared with the ground truth label by clinical experts to calculate the corresponding model loss by the loss function and to update model parameters by back propagation. This training process was repeated sixty times (Epochs = 60), where the model parameters were optimized and the model loss was minimized by repeated training. The phenomena of overfitting and excessive time in the training process were avoided by adding Dropout [48], with a dropout rate of 0.2, to each fully connected layer in the classification part of the model. This gave each neuron a probability of 20% of being deleted. Finally, the remaining fold was inputted to the trained models to verify the correction of these models in the validation process.
The correction of a model is frequently quantitatively indicated by the confusion matrix, as illustrated in Table 4. Based on Table 4, the following indicators are frequently applied to evaluate the quality of model training [49]: where Accuracy is the most intuitive indicator, although it might be invalid in some cases [49]. In this paper, we apply Accuracy and F1-score to demonstrate the quality of the developed DNN model. In the training process, 500 samples were selected for each model training (batch size = 500) to update the weights. The training data passed through the layers of the model with present parameters and the ReLU function. Then, the obtained evaluation output was compared with the ground truth label by clinical experts to calculate the corresponding model loss by the loss function and to update model parameters by back propagation. This training process was repeated sixty times (Epochs = 60), where the model parameters were optimized and the model loss was minimized by repeated training. The phenomena of overfitting and excessive time in the training process were avoided by adding Dropout [48], with a dropout rate of 0.2, to each fully connected layer in the classification part of the model. This gave each neuron a probability of 20% of being deleted. Finally, the remaining fold was inputted to the trained models to verify the correction of these models in the validation process.
The correction of a model is frequently quantitatively indicated by the confusion matrix, as illustrated in Table 4. Based on Table 4, the following indicators are frequently applied to evaluate the quality of model training [49]: where Accuracy is the most intuitive indicator, although it might be invalid in some cases [49]. In this paper, we apply Accuracy and F1-score to demonstrate the quality of the developed DNN model. The confusion matrix of the detection layer is shown in Table 5, where model i applied all gait data except Fold i for training and used the gait data of Fold i for validation. The results show that the model can successfully identify the stroke gaits with only few errors on the FP and FN terms. The confusion matrix of the classification layer is shown in Table 6, where P and N represent positive and negative, respectively. We independently list the output neurons and observe that some errors occur in classifying the four gait abnormalities: drop foot, circumduction, hip hiking, and back knee gaits. The overall test results are shown in Table 7. The detection layer achieves an average accuracy of 99.35% and an average F1-score of 0.9935 in detecting the stroke gaits, while the classification layer achieves an average accuracy of 97.31% and an average F1-score of 0.9662 in classifying the abnormal stroke gaits.   Gait is a symmetrical and rhythmic periodic motion that can be disrupted by stroke. Abnormal stroke gaits can decrease the efficiency of walking; therefore, the identification of gait abnormalities and the development of appropriate training strategies for rehabilitation are very important. From Table 7, the developed DNN models are deemed effective in detecting and classifying stroke gaits. However, the classification model is not as good as the detection model. One possible reason is that the number of stroke gaits in the dataset is insufficient; hence, the number of samples for SGwDF, SGwC, SGwHH, and SGwBK is not representative. That is, the accuracy of the classification can be further improved by adding additional abnormal gaits. In the future, we can collect more abnormal gait data to further improve the efficiency of the model.
We also applied the public dataset Physical Activity Monitoring Data Set (PAMAP2) [50], available in the UCI machine learning repository [51], to evaluate the developed model. This dataset consists of nine healthy subjects (one female and eight males) who wore IMU devices and conducted 12 different activity tests, including standing, sitting, and walking. We applied the angular velocity of the shank in the walking activities as the input data to the four DNN models. Because there is no public dataset for stroke gaits, we invited two stroke patients to conduct experiments and measured their gaits to test the developed models. The data of these two stroke subjects are illustrated in Appendix D and their gait data is illustrated in Appendix C. The testing results are shown in Table 8, where the average accuracy is 99.34% and the average F1-score is 0.9939. That is, the developed DNN model is effective in detecting gaits from data in public domains.

Discussion
This study develops DNN models to recognize four common stroke gaits, including those with a drop foot, circumduction gait, those with hip hiking, and the stroke gait with back knee. Stroke patients usually suffer from partial disability and develop abnormal gaits that can vary significantly and need targeted rehabilitation strategies. Therefore, evaluation of gait patterns is crucial for clinical experts to make decisions on the medication and rehabilitation methods for the stroke patients. In current clinical practice, gait pattern diagnosis mainly relies on the experience of clinicians or physical therapists to make judgments, and there is no objective diagnostic standard. Different clinicians or therapists might have different diagnosis of stroke gait patterns. In addition, some patients may present with mixed neurological gaits. Therefore, many researchers have attempted to develop objective means for identifying gait events and gait abnormalities [7][8][9][10]. Some studies applied machine learning techniques to improve the identification performance [11][12][13][14]. However, no research has yet been conducted on the classification of stroke gaits. Hence, in this paper, we applied deep learning technologies to detect and classify stroke gaits as an aid to diagnosis and for application of appropriate rehabilitation methods for stroke patients.
In this study, we collected clinical gait data from eight stroke patients and seven healthy subjects. Their gait patterns were diagnosed by two physical therapists who were more than 15 years qualified, with at least 10 years of daily experience working with patients with stroke. Then, we apply the clinical data to develop DNN models to detect stroke gaits and to classify four common gait abnormalities seen in stroke patients.
The developed models were shown to achieve high accuracies in detecting the stroke gaits and classifying the gait abnormality. Therefore, our DNN model could assist physical therapists or physicians for more optimizing the diagnosis of different stroke gaits and making decisions about the medication and rehabilitation strategies for the stroke patients. The limitation of this study is the number of enrolled patients is relatively small. A future large-scale study enrolling more patients with stroke is needed to validate the effectiveness of our established DNN structure.

Conclusions
This paper has developed DNN models that can detect stroke gaits and classify gait abnormalities. First, we collected clinical gait data from eight stroke patients and seven healthy subjects. The stroke gaits were further analyzed to indicate four common abnormal gaits in the stroke patients: the drop foot gait, the circumduction gait, the hip hiking gait, and the back knee gait. We applied IMUs to collect gait information from the stroke patients and healthy subjects. The obtained gait data were then analyzed to establish an expert dataset and to develop DNN models for recognizing the stroke gaits. The results showed that the developed DNN models achieved an average accuracy of 99.35% for detecting the stroke gaits and an average accuracy of 97.31% for classifying the gait abnormality. We also applied the PAMAP2 public dataset to the DNN models and achieved an average accuracy of 99.92% and an average F1-score of 0.9996. The effectiveness of the DNN structure could be further verified by recruiting more subjects. In the future, the proposed DNN model could help therapists to identify abnormal gaits and to apply suitable rehabilitation methods. The model can be further expanded in the future to identify more types of abnormal gaits, such as the Trendelenburg gait and the scissor gait, associated with other neurologic or musculoskeletal disorders.