# Feature Optimization for Gait Phase Estimation with a Genetic Algorithm and Bayesian Optimization
## 5 Discussion  
In this study, the best feature set and its LTW were determined for each subject with BGA and BO. Some TD features were excluded from the best feature set, suggesting that some features were less useful than others. For example, the optimizer selects only six features among the 12 candidate features for subjects 1 and 3 for walking. For running, only four features were selected for subject 3. These small-sized feature sets show higher accuracy than other feature sets, which shows that optimization can also reduce the number of features. A smaller number of features reduces the computation time required for feature extraction. Table 8 lists the computation time for feature extraction. The computation cost for \(\sigma_{\theta}\) is considerably larger than that for the other features. Thus, a feature set that does not contain \(\sigma_{\theta}\) would be much faster than other feature sets with \(\sigma_{\theta}\). Although the computational speed was not considered for optimization in this study, it could be included in future optimization studies. The best feature sets and optimal LTW values varied considerably across subjects, as shown in Tables 6 and 7. This finding implies that personal variations in features and LTWs are considerable; thus, personalized optimization is necessary for gait estimation. Furthermore, the best feature sets for walking and running are different, which indicates that the effects of features on the estimation are also affected by gait speed. Because the gait patterns of walking and running motions may differ considerably, the gait phase needs to be estimated using different TD features. This study proposes a mathematical procedure to extract the TD features and LTWs. Previously, most studies selected a TD feature set without a systematic approach. For example, [PERSON] et al. [22] used a single TD feature set for each subject. [PERSON] et al. [23] \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \multirow{2}{*}{**Running**} & \multicolumn{6}{c}{**Subject ID**} \\ \cline{2-6}  & **1** & **2** & **3** & **4** & **5** \\ \hline \(\theta_{\text{min}}\) & & 574 ms & & 636 ms & 383 ms \\ \(\theta_{\text{max}}\) & 184 ms & & & & 363 ms \\ \(\mu_{\theta}\) & 782 ms & & & & 363 ms \\ \(\sigma_{\theta}\) & & 312 ms & 727 ms & 157 ms & 799 ms \\ \(\theta(t_{i})\) & & 336 ms & 135 ms & 678 ms & 633 ms \\ \(\theta\big{(}t_{f}\big{)}\) & - & - & - & - & \\ \(\hat{\theta}_{\text{min}}\) & 314 ms & 365 ms & & & \\ \(\theta_{\text{max}}\) & & & & 109 ms & \\ \(\mu_{\hat{\theta}}\) & 458 ms & 318 ms & & 225 ms & 408 ms \\ \(\sigma_{\hat{\theta}}\) & 208 ms & & & & 432 ms \\ \(\hat{\theta}(t_{i})\) & 186 ms & 688 ms & 501 ms & 370 ms & \\ \(\hat{\theta}\Big{(}t_{f}\Big{)}\) & - & & & & - \\ Error after & & & & & \\ optimization & 1.798\% & 1.527\% & 1.962\% & 1.122\% & 1.009\% \\ (Error of feature set 2) & (2.225\%) & (2.108\%) & (2.560\%) & (1.593\%) & (1.497\%) \\ \hline \hline \end{tabular} A gray shadow represents a feature that is not selected in the best feature set. A hyphen indicates that this feature is selected, but no LTW value is required to calculate the corresponding feature value.  
\end{table} 
Table 7: Optimized feature set, LTW, and error for running. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline \(\theta(t_{i})\) & \(\theta\Big{(}t_{f}\Big{)}\) & \(\theta_{\text{min}}\) & \(\theta_{\text{max}}\) & \(\mu_{\theta}\) & \(\sigma_{\theta}\) \\ \hline Ratio & 1 & 1 & 22.15 & 21.88 & 28.24 & 34.14 \\ \hline \hline \end{tabular} This calculation was conducted using a workstation with a single graphics processing unit (CPU: Intel Xeon CPU E5-2620 v4, 2.10 GHz, and 16 cores; GPU: NVIDIA GeForce RTX 2080 Ti).  
\end{table} 
Table 8: Comparison of the computation time required for feature extraction with an LTW of 300 ms. The ratio represents the computation time normalized by the computation time required to extract \(\theta(t_{i})\). changed the feature sets manually and compared the results.