## 3 Experiments and Results
### Motion Pattern Recognition Based on LSTM Neural Network
#### 3.2.1 Sliding Window Length of 1024 ms Using All Time and Frequency-Domain Features  
In order to compare the classification effect of the LSTM classifier with the optimal multilayer perceptrons, all the time-domain and frequency-domain feature parameters were used as inputs to the LSTM model. With a sliding window length of 1024 ms and a sliding window interval of 50 ms, a feature parameter dataset for training was established. Seventy percent of the dataset was used for training, and 30% was used for testing. In the 70% of the dataset used for training, 90% of the data-set was used for training, and 10% of the data-set was used for verification. The number of hidden layer nodes was 128, and the activation function of the input layer was the tanh function.  
The results are shown in Figure 10. When the sliding window length is 1024 ms and all the time and frequency-domain features are used, the correct rate of recognition on the verification set is 96.57%, which is slightly higher than 95.93% using the multilayer perceptrons. During the model training process, the accuracy rate of motion pattern recognition is over 90% when the number of iterations of the LSTM classifier is 200. The training process as a whole is steadily increasing, and only a few are poorly identified. The comparison between the highest classification accuracy of the LSTM classifier and the true motion model is shown in Figure 10b. The confusion matrix corresponding to the data in Figure 10b is in Table A4 in Appendix A. The 400 samples are basically classified correctly. The classification errors are mainly concentrated in stepping in place, walking upstairs, and walking downstairs, which are incorrectly identified as walking flat. There is also a misrecognition between walking upstairs and walking downstairs.  
\begin{table}
\begin{tabular}{c c c c} \hline \hline
**Window Length (ms)** & **Number of Hidden Nodes** & **Recognition Accuracy Rate (\%)** & **Prediction Time (ms)** \\ \hline
256 & 35 & 49.38 & 9 \\ \hline
512 & 26 & 65.98 & 6.3 \\ \hline
1024 & 40 & 95.93 & 6.4 \\ \hline
2048 & 28 & 88.65 & 6.4 \\ \hline \hline \end{tabular}
\end{table}
Table 3: Recognition accuracy using different sliding window lengths.  
The results are shown in Figure 10. When the sliding window length was 1024 ms and all the time and frequency-domain features were used, the accuracy of recognition on the verification set was 96.57%, which was slightly higher than 95.93% using the multilayer perceptrons. During the model training process, the accuracy of motion pattern recognition was over 90% when the number of iterations of the LSTM classifier was 200. The training process as a whole was found to increase the accuracy steadily, and only a few poor identifications were found. The comparison between the highest classification accuracy of the LSTM classifier and the true motion model is shown in Figure 9b. The confusion matrix corresponding to the data in Figure 10b is in Table 4 in Appendix A. The 400 samples were basically classified correctly. The classification errors were mainly concentrated in stepping in place, walking upstairs, and walking downstairs, which were incorrectly identified as walking flat. There was also a misrecognition between walking upstairs and walking downstairs.