# Hand Trajectory Recognition by Radar with a Finite-State Machine and a Bi-LSTM
## 4 Results
### Complex Trajectory Gesture Recognition Results
#### 4.2.2 Recognition Results  
To evaluate the recognition performance of the neural network after training, the test dataset is input into the neural network for recognition. Accuracy and F1-score are selected as evaluation criteria to assess the performance of the neural network where the accuracy is the ratio of the correctly identified sample size \(N_{correct}\) to the total sample size \(N_{total}\), defined as  
\[\text{Accuracy}=\frac{N_{correct}}{N_{total}} \tag{16}\]  
F1-score is an evaluation metric that considers both accuracy and recall. For a single category \(k\), the F1\({}_{k}\) is defined as  
\[\text{F1}_{k}=\frac{2\cdot\text{Precision}_{k}\cdot\text{Recall}_{k}}{\text{ Precision}_{k}+\text{Recall}_{k}} \tag{17}\]  
where \(\text{Precision}_{k}\) represents the accuracy of classification, defined as  
\[\text{Precision}_{k}=\frac{TP_{k}}{TP_{k}+FP_{k}} \tag{18}\]  
Recall\({}_{k}\) represents the recall rate of classification, defined as  
\[\text{Recall}_{k}=\frac{TP_{k}}{TP_{k}+FN_{k}} \tag{19}\]  
where \(TP_{k}\) indicates that the predicted category \(k\) is correct, \(FP_{k}\) represents predicting other categories as category \(k\), and \(FN_{k}\) represents predicting category \(k\) as other categories. By calculating and averaging the F1\({}_{k}\) of each category, the F1-score of all categories is obtained, defined as  
\[\text{F1}=\frac{1}{K}\sum_{k=0}^{K-1}\text{F1}_{k} \tag{20}\]  
The test set is input into two types of trained neural networks, and the corresponding recognition accuracy and F1-score are calculated. The results are presented in Table 6. The experimental results show that the average recognition accuracy of the proposed neural network model on the test set is 99.47%, representing a 3.19% increase compared to the accuracy of the three-channel CNN, which stands at 96.28%. Furthermore, the F1  
Figure 19: The training accuracy and loss function curves of two types of networks. (**a**) The validation accuracy of two networks. (**b**) The validation loss of two networks. score of the proposed neural network model is 0.996, surpassing the 0.968 F1-score of the three-channel CNN, indicating superior recognition performance. To better observe the classification and recognition performance of two neural networks on the test set, confusion matrices depicting the classification and recognition results of four gestures are presented in Figure 20. The confusion matrix of the three-channel CNN is shown in Figure 20a, while that of the bidirectional LSTM fusion neural network is displayed in Figure 20b. The test set data and training set data of the above experimental results are both from the same dataset. To verify the generalization and robustness of the proposed neural network, a total of 406 sets of gesture data were collected from two new subjects, with an average of about 100 sets collected for each gesture. Since the data from the two new subjects were not included in the training process of the neural network and were sourced from different datasets, they were utilized to evaluate the performance of the proposed model when encountering data not included in the training dataset. The confusion matrix for gesture recognition of the new participants is shown in Figure 21. It can be seen that the proposed neural network has an average recognition accuracy of 98.77% for four types of gestures. And its recognition ability is comparable to the recognition results of the training set, which still has good recognition results. It demonstrates that the proposed bidirectional LSTM fusion neural network has good generalization performance on different datasets.