# Walking Gait Phase Detection Based on Acceleration Signals Using LSTM-DNN Algorithm
## 3 Materials and Methods
### Data Preprocessing  
Because each dataset has multiple characteristics and includes the acceleration in the X-, Y-, and Z-directions, a large number of features would result in large complexity of the DNN model. PCA uses dimensionality reduction and transforms multiple indices into a few comprehensive indices (principal components). The principal components contain most of the information of the original variables and the information in the principal components is not correlated. This method reduces many complex factors into several principal components, which simplifies the problem. In this study, PCA was used to compress the data and generate a synthetic variable Comp. Comp is expressed by Equation (1), where \(a_{x}\), \(a_{y}\), and \(a_{z}\) represent the acceleration in the X-, Y-, and Z-directions respectively, and z1, z2, and z3 represent the coefficients of the acceleration in three directions, respectively. The distribution of z1, z2, and z3 corresponding to different body parts at asynchronous speed is shown in Table 1. In the walking experiment, the acceleration and composite acceleration data curves of the three directions collected are shown in Figure 2.  
\begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Pace** & **Collection Location** & **z\_1** & **z\_2** & **z\_3** \\ \hline \multirow{3}{*}{0.78 m/s} & Calf & 0.658 & 0.659 & 0.365 \\  & Thigh & \(-\)0.556 & 0.569 & 0.365 \\  & Foot & 0.645 & 0.499 & 0.579 \\ \hline \multirow{3}{*}{1.0 m/s} & Calf & 0.636 & 0.645 & 0.423 \\  & Thigh & \(-\)0.479 & 0.597 & 0.643 \\  & Foot & 0.667 & 0.545 & 0.508 \\ \hline \multirow{3}{*}{1.25 m/s} & Calf & 0.639 & 0.631 & 0.440 \\  & Thigh & \(-\)0.565 & 0.533 & 0.630 \\ \cline{1-1}  & Foot & 0.703 & 0.566 & 0.431 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Acceleration data for different parts at different speeds using a principal components analysis (PCA) synthesized parameter table.  
Figure 1: Human lower limb movement and gait information acquisition system.  
During normal walking, the acceleration signals in the three directions of the foot, thigh, and calf exhibit periodicity. The sway phase accounts for approximately 40% of the total gait phase, and the stance phase accounts for approximately 62% of the total gait phase [35]. We can approximate that the stance phase is the biggest phase in the walking cycle. Determined according to the division of gait phase by [PERSON] et al. [27], the phase division in this paper is shown in Figure 3. Feature extraction is used to extract meaningful information or noise from acceleration graphs. After processing, the corresponding gait phase is obtained by using a classification algorithm.  
Figure 2: Acceleration data collected under the three body parts: foot (**a**), calf (**b**), and thigh (**c**). a_x represents the acceleration in the _x_-axis direction, a_y represents the acceleration in the _y_-axis direction, a_z represents the acceleration in the _z_-axis direction, a_com represents the combined acceleration.  
On a related note, feature extraction is an effective and important method in extracting meaningful information from acceleration signals. The extracted features used in this study include the standard deviation (SD), mean absolute value (MAV), maximum (MAX), minimum (MIN), and median (MED). These features were selected because some of them were used in the study by [PERSON] et al. on acceleration signals [PERSON] et al. (2017).  
[PERSON] et al. (2019) proposed the use of single and multiple feature sets to achieve high accuracy. Therefore, to assess multi-feature performance and improve recognition accuracy, SD, MAX, MIN, MED, and MAV were combined to create the input feature vector. Because PCA was performed for dimensionality reduction, the number of input eigenvectors for the neural network is relatively low.  
\[Comp=z\_1*a_{x}+z\_2*a_{y}+z\_3*a_{z} \tag{1}\]