Development of Stride Detection System for Helping Stroke Walking Training

Walking is a popular post-stroke rehabilitation exercise for patients. Stroke walking training is a sort of physical therapy that aims to help people who have had a stroke improve their walking ability. The walking training is usually conducted by assistance of the trainer so it is difficult to be conducted by patient alone every day. The progress walking training is difficult to be monitored while the patient training. The goal of this research is to classify stride length and include it into a mobile application which is later can be used to monitor the progress of walking training. The accelerometer sensor on a smartphone can be used to construct a stride detection system to aid in stroke walking training. This application was created for Android-powered smartphones. A binder must be used to secure the smartphone device to the patient's thigh. This application reads the accelerometer sensor included into the smartphone. In this study, a stride detection model is designed to increase the performance of stride length and circumduction detection. The accelerometer is read and saved by the application as the participant walks on the specific path. Five subjects were participated on the data collection which is walking on 3 different paths (20 cm, 30 cm, and 40 cm). After the signal has been pre-processed and its feature extracted, the data is used to create the stride detection model. The performance is good, as evidenced by accuracy, precision, recall, and f-measure values of 88.60%, 88.60%, 88.60%, and 88.60%, respectively. When utilized on a stride detection system, the decision tree algorithms function admirably. The model is then loaded into the Android walking app.


I. INTRODUCTION
The World Health Organization defines stroke as a clinical disorder characterized by quickly developing clinical symptoms of localized impairments in brain function that persist for more than 24 hours or end in death without any obvious cause other than vascular origin [1].Stroke is the leading cause of disability and death worldwide.Stroke is a clinical illness of sudden, localized neurological dysfunction caused by central nervous system vascular injury (infarction, hemorrhage) [2].Stroke is a condition that may be treated and avoided.This type of assault can result in the abrupt onset of neurological symptoms such as limb weakness or numbness, speech difficulties, sight loss, or balance issues.Service providers should consider the unique requirements of stroke survivors and their caregivers in order to help stroke patients recover and resume full lives.[3].
Walking is one of the most common post-stroke rehabilitation exercises for patients.Stroke walking training is a type of physical therapy aimed at helping individuals who have experienced a stroke patient to improve their walking abilities.Stroke can cause weakness, paralysis, or spasticity in the muscles used for walking, making it difficult for the person to walk normally.Stroke walking training involves exercises and techniques designed to address these issues and improve the person's balance, coordination, and strength.According to a study published in the Journal of NeuroEngineering and Rehabilitation, stroke walking training can significantly improve gait speed, stride length, and balance in individuals who have experienced a stroke [4].It is challenging for patients to practice walking alone every day because it is typically done with the trainer's help.It is challenging to keep track of a patient's development throughout walking training.
Step length can be used for gait analysis during training.Gait analysis can help determine and document therapeutic difficulties.Adults with stroke benefitted the most from treadmill training with body weight support and sensory stimulation, both of which increased step length [5].A step training program that is monitored can enhance a stroke patient's walking capacity [6].Gait training may facilitate the reacquisition of normal gait patterns and reduce the occurrence of atypical gait patterns [7].Variability of gait pattern indices reflects instability, influenced by impairments like poorer strength, balance, and processing speed.Poorer strength and processing speed are associated with greater stance time variability and step length variability.Variability indices should be sensitive indicators for gait abnormality [8].
There are various methods for calculating the step.Hurt et al. introduce a customized mobile phone application that measures the number of steps taken by your patient based on smartphone shaking.The step count is just measured; the step length is not.As a result, determining walking speed is challenging [9].Wall et al. provided methods for calculating step widths and lengths.To measure the step length in this study, a printed grid, and video capture are necessary.A videotape recording is used to measure the step length from the side.During the recording, the step width was measured from behind the individual [10].The researchers investigated the association between SF, SL, and velocity while jogging on a treadmill and on a surface [11].This research hints at potential gender differences in gait speed development across the lifespan [12].

FIGURE 1. An illustration of Step width
Normal gait can be defined as a series of rhythmic, systematic, and coordinated limb and body movements that result in the forward movement of the body's center of mass [13].One of the parameters is stride length and circumduction.The stride length is the distance traveled when you take one step.Start with your feet together and start walking.You can start with either foot, but let's say you start with the left foot and followed by lifting your left leg up and step forward.Now both feet are on the ground with the left foot in front of the right foot.The distance covered by your left foot (from the toe of your right foot to the toe of your left foot, or from the heel of your right foot to the heel of your left foot) is your stride width [14].An illustration of Step width is shown in FIGURE 1.
The definition of Circumduction is the circular movement found at the distal end of the extremities.This involves the angular movement of the ball and socket joints.When present involuntarily, it is often a sign of distal muscle weakness.
Problems with circumduction usually occur in the foot area.Circumduction of gait is a walking disorder in which a person leans their torso away from the leg that is affected by a neurological problem.This contrasts with a typical walking pattern in which a person bends their knees and brings their feet forward [15].An illustration of circumduction is shown in FIGURE 2.

FIGURE 2. An illustration of circumduction
These approaches are incapable of calculating step lengths or estimating step lengths in real-time.An inertial measuring unit (IMU) can be used to estimate step length in real-time.The IMU device can be attached to the subject's ankle or attached on wearable robots for exercise or therapy can be used to monitor gait characteristics like walking speed and stride length [16].The step of travel can be determined using pressure sensors and accelerometers implanted in the insole shoes.The data is then transferred to and analyzed on a smartphone to calculate the number of steps done and the distance traveled [17].To save money, a consumer IMU sensor such as the MPU6050 can be used to estimate the system's step length [18].The height variable could be included in the step-length calculating algorithm to lessen the inaccuracy of people of different heights.The step length is calculated using height, stride frequency, and sensor output change [19].
This study wants to classify the stride length and implement it into a mobile application.Some decision tree approaches can be utilized to tackle classification problems such as those used in this study.Breiman's [20].The decision tree algorithm has been employed in a variety of applications, including the classification of heart beat [21] and coronary artery diseases [22].A decision tree has been built to detect driver fatigue based on EEG data [23].Mishra has conducted a study to compare the performance of decision tree to other machine learning techniques on survival prediction for heart failure conditions [24].The decision tree method has been utilized in the medical industry to diagnose disorders such as stroke, merkel cell carcinoma, and diabetic patients [25]- [27].
There have been various studies on the classification and estimation of walking training.Hurt's [9] research simply counts steps.The study does not consider step length, which is critical for post-stroke walking training.The Stenum [10] research can measure step length, but it employs a video recording, which is inefficient.Truong's study demonstrated that the stride count and velocities can be measured using 8 pressure sensors [28].It has been evaluated for estimating stride length on a 16-meter distance, which is too lengthy for post-stroke walking training.
Various electronic innovations today have developed rapidly.Various sensors have been created.The accelerometer sensor can be used to identify speed and slope.This sensor is available in smartphones which are currently very commonly used by Indonesian people.There is a lot of application that has been developed as mobile application such as Oximeter monitoring [29].The use of accelerometer sensor in this smartphone is quite widely used.By utilizing the accelerometer sensor on a smartphone that is attached to a person's thigh, the person's step width can be predicted by recognizing the speed of change in value and slope read from the accelerometer sensor.In this study, an application can be developed that can display data from measurements of walking practice activities directly.The contributions of this study are: 1) Providing an application so by using this application, stroke sufferers can practice walking at any time accompanied only by their family members without needing to be accompanied by a therapist.2) Adding machine learning based on decision trees to improve stride length detection.
3) The data during the training process will also be recorded for the therapist to read.These data include the patient's stride length and step circumduction when practicing walking.With this device, the therapist does not always have to be at the patient's place to supervise the walking exercise process.The therapist just observes and evaluates the data.Based on this background, the author proposed an android mobile app for helping with the walking training of the stroke patient.

A. RESEARCH METHOD
The study was conducted by several steps as shown on the FIGURE 3.

B. SYSTEM DESIGN
Stroke Walking Applications (Swaps) is a walking training application for stroke patients.This application was developed for Android-based smartphone devices.The smartphone device must be attached to the patient's thigh using a binder (such as an armband that has been added with Velcro so that the reach of the armband is sufficient for the circumference of the thigh).This application reads the accelerometer sensor that has been embedded in the smartphone.This app will detect stride width and circumduction (lateral foot movement during the swing phase).The measurement results are displayed in the form of current stride and circumduction values and the average in the exercise.This Android application was designed to help the walking exercise process in stroke patients.The patient will pair the smartphone using an armband plus a strap.The patient will activate the application that has been made when starting the walking exercise.The smartphone application will read data from the accelerometer sensor that is already available on the smartphone.The sensor value from this sensor will change when the patient walks.This sensor value is then used to compute the stride length and circumduction of the patient.
These results will be displayed on the smartphone application and sent to a database for storage.The therapist will be able to access data on the results of running exercises through the website that has been provided.As feedback in walking practice, the smartphone application is also projected on a television or monitor screen using a screen mirroring device.Screen mirroring is intended for users to get feedback in real-time.The design of this system is shown in FIGURE 4.

C. STRIDE DETECTION MODEL
The stride detection model is developed in this study to improve the performance of stride length and circumduction detection.The stride detection model is started by collecting data from the accelerometer sensor.The stride detection model is then followed by several steps including filtering, feature extraction, and the decision algorithm.The working principle of the stride detection model in this system is shown in FIGURE 5.

FIGURE 5. Stride Detection Model
To obtain initial data as material for making detection model, five normal subjects (3 male and 2 female) were participated in this study.The normal subject is chosen because this study is a preliminary study to develop the decision model.The normal subject can adjust their stride length into 20 cm, 30 cm, and 40 cm, which is difficult to be conducted by stoke patient.The subject will be asked to walk on the walking path provided while using a smartphone device.Data from the accelerometer sensor on the smartphone will be read, stored, and further analyzed.Data from the accelerometer sensor will go through a filtering stage to remove unnecessary noise in this study by using second order Butterworth low pass filter.
The filtered signal is then extracted its features are needed.The time domain analysis is used in this study.These features include positive peak values of the x-axis accelerometer, positive peak values of the z-axis accelerometer, negative peak values of the x-axis accelerometer, and negative peak values of the z-axis accelerometer.The features that have been extracted are used as input decision models based on the decision tree.The resulting output is an estimate of walking exercise performance which includes stride width, and circular swing width (circumduction).

A. DEVELOPMENT OF STRIDE DETECTION MODEL
The Development of the stride detection model was conducted by acquiring the accelerometer signal.The accelerometer signal was read by the accelerometer value on the smartphone.The smartphone was attached to the subject tight while the subject is asked to walk on a specific path as shown in Figure 4.The accelerometer signal is then saved as a CSV file and then processed on the computer to develop and evaluated the Decision tree model.
The acquired accelerometer signal is then filtered to reduce its noise.The second-order low-pass Butterworth filter is used to reduce the noise of the accelerometer signal.The result of the filtering process is shown in the Figure 6.

FIGURE 6. Result of The Filtering Process on X-axis Signal
The FIGURE 6 shows the result of the filtering process on x-axis signal.The blue line is the original x-axis accelerometer signal, while the black line is the filtered accelerometer signal.The figure 6 indicate that the noise of the accelerometer signal can be suppressed by using the second order low pass Butterworth filter.It is indicated by the filtered signal show a smooth line with no ripple.The comparison of the filtered signal is shown on the FIGURE 7. The FIGURE 7 shows the filtered signal.The black line is x axis signal, while the blue and red line is the accelerometer signal on y and z axis, respectively.Based on the figure 7, the z-axis signal has the highest amplitude followed by the x-axis signal the x-axis and z-axis signal has a clear both positive an negative peak.Based on this condition, the x-axis and z-axis signal are possible to be used on the stride length detection system.The filtered accelerometer signal is the extracted it feature before it can be used to develop the stride detection model.The feature that is extracted in this study is the positive peak and negative peak of the accelerometer signal on x-axis and zaxis.The result of the feature extraction process is shown on the FIGURE 7.

FIGURE 8. Result of The Peak Detection Process
The FIGURE 8 shows the result of the feature extraction process.The black line is the filtered accelerometer signal, while the blue line is the detected positive peak of accelerometer signal.The FIGURE 7 indicate that the peak of the accelerometer signal can be detected.It is indicated by the blue line signal show peak of the signal.The peak can be used for the feature on decision tree development.
Base on the acquired accelerometer signal, it has been extracted the feature.The positive peak values of x-axis accelerometer, positive peak values of z-axis accelerometer, negative peak values of x-axis accelerometer, and negative peak values of z-axis accelerometer.The extracted feature can be shown on the FIGURE 9.
The FIGURE 9 shows the extracted feature.The FIGURE 9 (a) shows the scatter plot of positive peak X-axis vs positive peak Z-axis accelerometer.The FIGURE 9 (b) shows the scatter plot of negative peak X-axis vs positive peak Z-axis Accelerometer.The grey dot indicated the 40 cm stride length, while the blue and orange dot indicated the 30 cm and 20 cm stride length, respectively.Based on the figure 8, it can be concluded that the data horde to its class.Therefore, it possible to classify the class based on these features.There are some overlaps on the data, it raises a possibility to yield some error on the classification process.
The extracted feature is the used for classification process using decision tree.Due to the imbalance class, the Synthetic Minority Over-sampling Technique (SMOTE) [30] was applied to oversampled the non-majority class.To ensure that the model developed in this study not overfitting, the k-fold cross validation was applied in this study.The k in this study is 10.The result of the stride detection system is shown on the FIGURE 10.
The FIGURE 10 shows the result of the stride detection system.The blue line represents the target class, while the orange line represents the predicted class.Based on this figure, most of the line is overlapped.It is indicating that most of the predicted class is same as the target class.Only a few of the class is misclassified.Based on this result the stride detection system shows a good performance.
The accuracy is measured as one of stride detection model performance evaluation.The accuracy of each fold is shown on the TABLE 1.Based on the TABLE 1, the average accuracy of the stride detection model is 88.60%.The accuracy is varied between 80.00% to 100%.The fold 5 has the lowest accuracy while the fold 9 has the highest accuracy.Based on this result, the performance of the stride detection system is quite satisfying.
The overall performance is also measured.The accuracy, precision, recall, and F-measure are measured as performance evaluation for the stride detection system.The performance evaluation is compared between class.The overall performance is shown on the TABLE 2. Based on TABLE 2, the average accuracy of the stride detection model is 88.60%, while the average precision, recall, and F-measure are 88.60%, 88.60%, and 88.60%, respectively.The accuracy of class 20 cm, 30 cm, and 40 cm are 88.2%, 88.1%, and 89.4%, respectively.This result indicates that the accuracy of each class is not varied very much.
Based on TABLE 2, the weighted mean of precision for the stride detection system is 88.60%.Precision values for class 20 cm, 30 cm, and 40 cm are 85.2%, 89.2%, and 91.6%, respectively.The precision of the class label is still varied but there are not many differences.Based on TABLE 2, the weighted mean of recall in this investigation is 88.60%.The Recall values for class 20 cm, 30 cm, and 40 cm are 88.2%, 88.1%, and 89.4%, respectively.Based on the result, there is not much variance in the recall value of each class label.
Based TABLE 2, the weighted mean of the F-measure for the stride detection system is 88.60%.The F-measure values for class 20 cm, 30 cm, and 40 cm are 86.70%,88.60%, and 90.50%, respectively.The F-measure value of the class label is still varied but there are not many differences.Based on the result, there are some misclassified data, but the result shows a stable performance on the precision, recall, and F-measure.

Target Predicted
The performance evaluation show that the accuracy, precision, recall, and f-measure of the stride detection system show a good result.This result implies that the decision tree used on the stride detection system is working well.The decision tree can be used as a decision model for the stride detection system.The decision tree can be deployed as a decision model in the application development.

B. APPLICATION DEVELOPMENT
There are 4 main sections on the main screen of the app, namely: 1.

PREDICTED STRIDE LENGTH
In this section, users can see the results of the stride length prediction which includes: a) Current: is the current stride length prediction value in cm units b) Green progress bar: shows the relative stride length value.The fuller the progress bar, the wider the steps the user takes.This shows that the Step width is getting better c) Average: is the average value of the predicted stride length in cm units since this application was used.d) Blue progress bar: shows the relative average stride length value.The fuller the progress bar, the wider the steps the user takes.This shows that the step width is getting better

PREDICTED CIRCUMDUCTION
In this section, users can see the results of circumduction predictions which include: a) Current: is the predicted value of the current circumduction in units of cm.b) Green progress bar: shows the relative circumduction value.The fuller the progress bar, the greater the user's circumduction.This shows that circumduction is getting worse.c) Average: is the average value of the predicted stride length in cm units since this application was used.d) Blue progress bar: shows the relative circumduction value.The fuller the progress bar, the greater the user's circumduction.This shows that the step width is getting worse.

ACCELEROMETER SENSOR READING RESULTS
This section shows the results of accelerometer sensor readings.The sensor reading results have been filtered before being displayed on the graph so that the graph becomes smoother.A change in peak-to-peak value again indicates 1 full Step cycle.

SEE THE PERFORMANCE BUTTON
This section is used to move to the See Performance page.The See performance page is a summary record of each time the user conducts walking training using this smartphone application.This button can be pressed when the user has finished practicing walking.The parts of the Main Screen are shown in the following Figure 11.

FIGURE 11. The design of the user interface of the application
The application that has been developed shows good performance.It is indicated by the ability of each part to do its function.The predicted stride length can display the predicted stride length and its average during using this application.The predicted circumduction can display the predicted circumduction and its average during using this application.Based on this condition, it is possible to use the smartphone application for walking training of stroke patients.

C. DISCUSSION
The error rate score is categorized as a successful outcome based on the evaluation of the error rate as shown in a study of classification using decision tree [31].When compared to Truong's study, where the short and long distances had error rates of 4.8% and 3.1%, respectively [28], the finding is noticeably less accurate.Truong uses eight sensors for his investigations, but the suggested method uses just one.The technology that is being shown delivers a satisfying result with just a sensor.
Compared to the previous study that is using the Naïve Bayes model [32], the finding is a little bit less accurate.The accuracy of the Naïve Bayes model is 90.35%.Precision, recall, and F-measure for the Naïve Bayes model are each 0.906, 0.904, and 0.902, respectively.The Naive Bayes model has using MPU6050 sensor which has both an accelerometer and gyroscope sensor, while the study is using only the accelerometer sensor.The gyroscope is not used in this study because this sensor is not available for some smartphones.
Compared to the previous study that uses the Decision Tree model [33], the finding is noticeably less accurate.The accuracy of the Decision Tree model is 94.33%.The Decision Tree model has using MPU6050 sensor which has both an accelerometer and gyroscope sensor, while the study is using only the accelerometer sensor.The gyroscope is not used in this study because, for some smartphones, this sensor is not available.
Based on the discussion above, the performance of the decision mode is a little bit lower than in other studies.However, this result is still acceptable due to the proposed model using a simpler system.The proposed model uses only a single sensor compared to Truong [28] which uses 8 sensors.The sensor used in this study is an accelerometer sensor that is available on low-end smartphones compared to the previous study that is using MPU6050 which has both accelerometer and gyroscope [32], [33].
The proposed model does not include subject height in the decision model.The different subject height has different accelerometer reading on the same stride length.Including the subject height can improve detection accuracy [19].Adding the subject height as the feature of the decision model is expected to improve the performance of the system.
The proposed model is only using a single decision model.The ensemble model can be included to achieve better performance [34].Compared to a single model, an ensemble can perform better and make better predictions.An ensemble narrows the prediction and model performance distribution.

IV. CONCLUSION
The study proposed a stride detection system for helping stroke walking training which is implemented by using the accelerometer sensor on the smartphone.The accelerometer is read by the application and stored while the participant walking on a specific path.The data is used for developing the stride detection model after the signal is pre-processed dan extracted its feature.The performance shows a good result which is indicated by accuracy, precision, recall, and fmeasure of 88.60%, 88.60%, 88.60%, and 88.60%, respectively.The Decision tree method performs wonderfully when it comes to being used on stride detection systems.The model is then deployed on the Android walking application.However, the result still needs more improvement.Adding the subject height as the feature of the decision model and implementing an ensemble model is expected to improve the performance of the system.
a) Literature Study was conducted by collecting literature from books, journals, and other sources related to the problem under study.b) Problem Analysis was conducted by holding a discussion with experts regarding the problems raised in the research c) System Design was conducted by holding a discussion with experts regarding the test method used to test the system created.d) System Development was conducted by making the signal reader feature from the accelerometer sensor, making feature filtering and feature extraction, developing a decision model, and making application features to estimate walking exercise performance such as stride width, circular swing width, and stride speed.e) System Test was conducted by testing the accelerometer sensor reading, testing feature filtering, and feature extraction, testing app features to determine running training performance, testing the system for sending and receiving data from various sensors via the internet.f) Data Analysis was conducted by analyzing the results of accelerometer sensor signal readings, analyzing app features to determine stride width, circular swing width, and stride speed.

FIGURE 4 .
FIGURE 4. The design of this sytem

FIGURE 7 .
FIGURE 7. Comparison of the Filtered Signal

FIGURE 9 .FIGURE 10 .
FIGURE 9.The Scatter plot of the extracted feature, (a) positive peak x-axis vs positive peak z-axis accelerometer, (b) negative peak x-axis vs positive peak z-axis accelerometer