## 3 Proposed Methodology
### Recognition Model  
This section presents CNN-GRU-AttNet, an attention-based neural network designed for recognizing human activities using WiFi CSI data, as illustrated in Figure 4. The proposed CNN-GRU-AttNet comprises five layers: the input layer, two CNN layers, a GRU layer, an attention layer, a fully connected layer, and an output layer. Each of these layers will be described in detail below. Figure 3: Some CSI signal representations from StanWiFi dataset after pre-processing: (**a**) before denoising; (**b**) after denoising. CNNs extensively employ DL models with robust feature extraction capabilities. They can effectively and automatically extract features from input data, especially two-dimensional image data, and process them quickly. The convolutional layers in CNN are different from traditional neural network models since they are not fully connected. Instead, the inputs are linked to the following layers, and subregions in the input sets have the exact weights, resulting in spatially related outputs. In contrast, traditional neural network models have different weights for each input, increasing the input dimensionality and making the network more intricate. CNN addresses this issue by reducing the number of connections and weights through weight sharing and downsampling operations. This study utilized a CNN with two layers. The first layer contained 64 filters and a kernel size of 3, while the second layer had 64 filters and a kernel size of 5. The max-pooling layers had a uniform pool size of 2. To connect the CNN and GRU layers, a flattened layer was inserted. Table 3 displays the detailed parameters of the CNN used in this research. While CNNs have proven to be highly effective in feature extraction, their performance in tasks involving time-dependent inputs, such as the analysis of biometric signal data in this study, may be relatively limited. In scenarios where sequential data are processed, the network's prediction of future states is influenced by the previous state of the input. Therefore, the network needs to consider both the current and preceding inputs. To address this challenge, the RNN model is capable of analyzing each element of the temporal sequence and incorporating both the current and preceding inputs for the current input of the RNN. The output of an RNN at a specific time step \(t\) depends on the output of the RNN at the previous time step, \(t-1\). Theoretically, RNNs are capable of acquiring knowledge from time series data with arbitrary lengths. However, when dealing with extensive time series in real-world applications, RNNs encounter the problem of gradient disappearance, which impedes the learning of long-term dependencies. To tackle this issue, we integrated a GRU as the memory component within the RNN architecture. The organization of the GRU cell's internal structure is visualized in Figure 5. \begin{table}
\begin{tabular}{l c c c c} \hline
**Layer Name** & **Kernel Size** & **Kernel Number** & **Padding** & **Stride** \\ \hline Conv1D-1 & 5 & 64 & 2 & 4 \\ Maxpooling-1 & 2 & None & 0 & 1 \\ Conv1D-2 & 7 & 64 & 2 & 1 \\ Maxpooling-2 & 2 & None & 0 & 1 \\ \hline \end{tabular}
\end{table} 
Table 3: Parameters of each layer of the CNN network. Figure 4: The proposed CNN-GRU-AttNet architecture for CSI-based HAR in this work. GRU networks can be considered as a simplified form of LSTM networks within the class of RNNs, as illustrated in Figure 6. They offer enhanced computational efficiency while preserving the effectiveness of LSTM networks. The architectural representation of a GRU unit, as shown in Figure 6c, consists of an update gate and a reset gate that control the extent of modification for each hidden state. These gates serve as mechanisms to regulate the flow of relevant and irrelevant information between consecutive states in a computational model. Computation of the hidden state \(h_{t}\) at a specific time \(t\) incorporates the update gate output \(z_{t}\), the reset gate output \(r_{t}\), and the current input \(x_{t}\).