# Elderly Fall Detection in Complex Environment Based on Improved YOLOv5s and LSTM
## 4 Fall Detection with WiFi Signal Based on LSTM Model
### Fall Detection
#### 4.5.2 Improved LSTM Model
Improved LSTM model  
The LSTM network can capture long-term dependencies in sequence data, allowing the model to better adapt to the temporal dynamics in data, while CNNs are a very effective deep learning method, good at extracting local features in image data, and have achieved remarkable results in image recognition, classification, and detection. However, CNNs have some limitations when dealing with long-term dependencies and time series data. To effectively extract the local features of CSI data and capture their long-term dependence, this paper combines the convolution feature of a CNN model with LSTM neural network architecture to process the CSI human posture data and provide more accurate fall estimation. The fusion structure is shown in Figure 9, and the fused model's related parameters are shown in Table 2.  
The CSI data in each packet were converted into an image and fed to the CNN for feature extraction of the different postures. The LSTM model was \begin{table}
\begin{tabular}{c c c} \hline \hline
**Network Layer** & **Output** & **Learnable Parameter** \\ \hline Input & \(90\times 1\times 1\) & — \\ Fold & \(90\times 1\times 1\) & — \\ Conv2D & \(61\times 1\times 3\) & Weights \(30\times 1\times 1\times 3\) \\  & & Bias \(1\times 1\times 3\) \\ BN & \(61\times 1\times 3\) & Offset \(1\times 1\times 3\) \\ ReLU & \(61\times 1\times 3\) & Scale \(1\times 1\times 3\) \\ MaxPool & \(61\times 1\times 3\) & — \\ Unfold & \(61\times 1\times 3\) & — \\ Flatten & \(183\) & — \\ LSTM & \(100\) & Input Weights \(400\times 183\) \\  & & Recurrent Weights \(400\times 100\) \\  & & Bias \(400\times 1\) \\ Dropout & \(100\) & — \\ FC & \(1\) & Weights \(1\times 100\) \\ \hline \hline \end{tabular}
\end{table} 
Table 2: The improved LSTM model network. Figure 9: Improved LSTM model. features. Hence, the goal of deep learning changed to the analysis of the amplitudes of 90 CSI signals (data received by three receiving antennae from one transmitting antenna) in the dataset, and the result changed to the analysis of human posture with corresponding signals. In this way, the algorithm's computational pressure can be reduced, more computing power can be used by the required part, the model's training efficiency can be improved, the LSTM model's forgetful characteristics can be invoked to a greater extent, and the influence of the former point on the latter point can be reduced. In this study, the combination of LSTM function and convolution function is used to train short- and long-term memory. The input of the LSTM layer is as follows:  
\[I_{t}=\delta\Big{(}K_{f}x_{t}+K_{f}h_{t-1}+b_{t}\Big{)} \tag{18}\]  
where \(\delta\) indicates that the ReLU function is stimulated; \(K_{f}x_{t}\) and \(K_{f}h_{t-1}\) are the data of current time and previous time, respectively, which are fed to the forget gate through the Sigmoid function; and \(b_{t}\) is the bias. Finally, the output of the improved LSTM model is obtained by interconnecting with the data label through the full connection layer.