# Gait Phase Identification and Damping Control for Knee Orthosis Using Time Series Forest Classifier
## 5 Conclusions  
This study focuses on developing a machine-learning-based gait phase identification methodology for flexion damping marked with simulated knee moment. The methodology utilizes IMU data collected from two Adafruit BNO085 sensors placed on the thigh and shin. Foot switches are used for data acquisition and labeling, facilitating the capture of activation patterns aligned with a normal gait. OpenSim, an open-source musculoskeletal simulation software, is utilized for simulation using existing experimental gait motion-capture data and reaction force data. Inverse kinematic and inverse dynamic simulations are applied to derive important metrics such as knee joint angle and knee moment, which are then normalized and scaled. The synchronization of IMU and foot switch data through meticulous data capture methodology enables the creation of comprehensive labeled subphase datasets. By integrating simulation results with these datasets, activation data for knee flexion dampening are obtained. Multiple supervised machine learning algorithms are trained and evaluated, with the time series forest classifier displaying the most robust performance. The work classifies the gait phases into seven different classes, as defined in Table 3. In future work, the number of classes can be expanded by incorporating a pressure sensor instead of a binary switch for phase segregation. Additionally, utilizing signal analysis techniques such as thresholding and min-max cutoff can further segment the classes into smaller portions. The current method employs a fixed activation level for each class, derived from simulation. This necessitates the use of a smoothing function to transform the output activation values from step signals to transient curves. However, this smoothing process reduces the resolution of the activation signal. To address this issue, the same simulation results can be applied with an increased number of classes, allowing for more precise validation of the activation magnitude through moment output. Furthermore, it should be noted that the overall accuracy of the time series forest is 86%, which may be insufficient for applications requiring more accurate predictions, such as gait abnormality detection. Additional training for abnormal gaits might be \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Algorithm** & **Accuracy** & **Precision Weighted Avg** & **Recall Weighted Avg** & **F1-Score** \\ \hline TSFC & 0.86 & 0.86 & 0.86 & 0.86 \\ ROCKET & 0.71 & 0.66 & 0.71 & 0.68 \\ K-NTSC & 0.79 & 0.75 & 0.79 & 0.76 \\ LSTM–FCN & 0.78 & 0.79 & 0.78 & 0.78 \\ \hline \hline \end{tabular}
\end{table} 
Table 14: Performance metrics for classifiers. necessary. Notably, the gait phase associated with class 5 is of particular interest, as it appears to be a bottleneck in the existing hardware setup. The computation time is predominantly consumed by the motion engine of the IMUs performing sensor fusion, resulting in an imbalanced dataset and poor predictability. It is worth highlighting that the activation of the median right knee moment does not vary significantly between classes 5 and 6, ranging from 0.580 to 0.599. Subsequent research should focus on enhancing data collection resolution by increasing the number of IMUs and exploring alternative methods for marking gait subphases. Furthermore, a wider array of machine learning models should be investigated. Practical implementation considerations include the deployment of an edge computer with a well-designed controller system to facilitate real-world applications. In rehabilitation contexts, utilizing the variable braking capability of the MR brake can optimize the rehabilitative process by gradually augmenting the brake profile based on each patient's recovery progress. Conceptualization, Y.S. ; methodology, Y.S. and R.B. ; software, R.B. ; validation, Y.S. and R.B. ; formal analysis, Y.S. and R.B. ; investigation, R.B. ; data curation, R.B. ; writing--original draft preparation, R.B. ; writing--review and editing, Y.S. ; supervision, Y.S.