# Feature Optimization for Gait Phase Estimation with a Genetic Algorithm and Bayesian Optimization
## 6 Conclusions  
The gait phase estimation performance strongly depends on features. However, parameter determination for feature extraction is complicated. For gait estimation, TD feature set selection and LTW determination require different techniques. Previous studies determined the features by trial and error, which does not guarantee optimal features. To address this problem, this study proposes an optimizing procedure composed of a BGA and BO. This approach can effectively reduce the estimation error by simultaneously considering the feature set and LTWs. This study also revealed that the best feature set and optimal LTW vary across subjects and motion types (i.e., walking and running). The proposed approach can be modified depending on its application. For example, if the gait phase is required for assistive robots, computation speed is the most important factor. In this system, the upper bound of the LTW can be lowered during the optimization process. Then, the time required to calculate the values of the TD features can be decreased. The maximum number of TD features can also be defined in order to reduce computation time. Penalty values can be allocated to individual features. Some features require a very short computation time, whereas other features require significant computational resources. For instance, \(\theta(t_{i})\) and \(\theta\Big{(}t_{f}\Big{)}\) can be handled with very small computational resources. However, \(\mu_{\theta}\) and \(\sigma_{\theta}\) require a relatively lengthy computation time, as shown in Table 8. Thus, the cost function of the optimizer can be modified to consider computation time. For example, a high cost can be applied if \(\mu_{\theta}\) and \(\sigma_{\theta}\) are selected because their computation time is relatively long. This modification can provide different features that are optimized for computational speed. Feature optimization for various walking (or running) speeds is required for practical use. In this study, optimization was conducted for gait motions where the speed remained constant over time. As shown in the optimization results, the optimal feature set and LTW changes according to walking (or running) speed. Thus, if the gait phase needs to be estimated at various speeds, the optimizer should consider the estimation errors over the target speed range. Alternatively, adaptive feature selection could be used as a scheme to handle speed variations. Walking (or running) speed can be classified into discrete levels. Then, the optimal feature set and LTW at each level is predefined. Subsequently, the estimation algorithm is able to handle speed variations by updating the feature set and LTW according to the walking (or running) speed. The following are available online at [[https://www.mdpi.com/article/10.3390/app11198940/s1](https://www.mdpi.com/article/10.3390/app11198940/s1)]([https://www.mdpi.com/article/10.3390/app11198940/s1](https://www.mdpi.com/article/10.3390/app11198940/s1)), Table S1: Effects of optimization on the test error for walking, Table S2: Effects of optimization on the test error for running, Table S3: Estimation result with different MLP nodes for walking, Table S4: Estimation result with different MLP nodes for running, Figure S1: BO result for the LTW of \(\theta_{\text{min}}\), Reference [22]. Conceptualization, W.N. ; methodology, W.C. and W.Y. ; software, J.N. ; validation, W.C. and W.Y. ; formal analysis, W.C.; investigation, W.C.; resources, W.C.; data curation, W.Y. ; writing--original draft preparation, W.C. and W.Y. ; writing--review and editing, W.N. and G.L. ; visualization, W.Y. and W.C.; supervision, W.C.; project administration, W.C. and G.L. ; funding acquisition, G.L. and W.C. All authors have read and agreed to the published version of the manuscript. This work was supported by the Naetional Research Foundation of Korea (NRF) grant funded by the Korea government (MSIT) (No. 2021R1A4A3030268) and the Chung-Ang University Research Scholarship Grants in 2021. **Institutional Review Board Statement:** Not applicable.