# Elderly Fall Detection in Complex Environment Based on Improved YOLOv5s and LSTM
## 6 Experimental Results and Analysis
### Performance of CSI Fall Detection Algorithm Based on Improved LSTM Model
#### 6.2.2 Comparison of Performance of Posture Estimation  
The results estimated with the original LSTM, CNN, and improved LSTM models and the true target posture data were compared using the training dataset, as shown in Figure 22. Here, we set the standing posture, lying posture, and process state to 1, 0, and 0.5, respectively. As we can see from Figure 22a,b, the results of the original LSTM model are more stable but the estimated error is bigger than that of the CNN model. On the contrary, the CNN model achieves a higher estimated accuracy as it can effectively capture local features in the CSI images, but the estimated results jump sharply, making it difficult to judge whether the target's posture has changed. The combination of these two models takes into account both temporal and spatial information, thus improving the accuracy and stability of the model, as shown in the results of the improved LSTM model in Figure 22c, where the target's posture changes and the differentiation in various postures can be clearly seen. This indicates that the estimated posture error and stability of the improved LSTM model are significantly improved compared to the original LSTM model and CNN model.  
Similarly, the target postures estimated with the original LSTM, the improved LSTM, and the CNN and NN models were compared to the true target posture data from the testing dataset, and the results are shown in Figure 23a-d. From the results, we can conclude that the improved LSTM model achieved a good fitting between the estimated value and the true values, and the model can accurately estimate and judge changes in the target body's posture through changes in the WiFi signal. As can be seen from Figure 23c, the CNN model is unstable in the direction of the estimated results and presents the problem of large errors in the judgment process of posture change. The NN model not only has the problems of unstable estimated results and inability to output effective estimated values but also shows an insufficient processing of outliers, as shown in Figure 23d.  
Figure 21: The training performance of the improved LSTM model.  
For greater clarity, we used a statistical index, named the coefficient of determination \(R^{2}\), to help us understand how well the models can explain variation in the data, thus evaluating the models' goodness of fit. The calculation formula for \(R^{2}\) is as follows:  
\[R^{2}=1-\frac{SSR}{SST} \tag{19}\]  
where \(SSR\) is the sum of squares residual, and \(SST\) is the sum of squares total. The value range of \(R^{2}\) is [0, 1]. If the result is 0, the model is poorly fitted; the closer the \(R^{2}\) value is to 1, the better the model fits the data, that is, the higher the posture estimation accuracy. As can be seen in Table 6, the \(R^{2}\) of the improved LSTM model increased significantly, compared to the original LSTM and other models. The \(R^{2}\) of the improved LSTM model reaches 0.7581, an increase of 15.61%, 29.36%, and 52.39% compared with the original LSTM, CNN, and NN models, respectively. Therefore, we believe that the improved LSTM model can accurately estimate changes in the target body's posture or fall states in the target through changes in the WiFi signal in complex environments.  
Figure 22: Posture prediction performance of the models on the training data set: (**a**) original LSTM model; (**b**) CNN model; (**c**) improved LSTM model.