## 3 Model and Algorithm Design
### CNN-LSTM Model
Feature Selection: In physiological signals, not all features contribute equally to the model's predictive power. Feature selection algorithms, such as Recursive Feature Elimination (RFE) or tree-based methods, are employed to identify the most relevant features that directly correlate with the target variable. The formula for feature selection can be expressed as follows:  
\[\text{Im}(f)=\sum_{i=1}^{n}\left|\omega_{i}\right| \tag{4}\]  
where \(\omega_{i}\) is the weight of feature \(f\) in the model. By selecting important features, the model can be simplified, reducing the risk of overfitting while simultaneously improving computational efficiency [24]. Time Window Division: To capture the dynamic changes in physiological signals, time-series data are typically divided into multiple fixed-length windows. This ensures that each window represents a segment of the signal with similar characteristics. The feature vector for each time window is represented as follows:  
\[X_{\omega}=\left[x_{t},x_{t+1},\ldots,x_{t+L-1}\right] \tag{5}\]  
This partitioning method effectively extracts local features from the time series and provides structured data input for subsequent CNN and LSTM processing [18]. **Step 2**: Feature Extraction (CNN Part). Feature extraction is a critical process in the learning process, wherein CNNs are used to extract effective and discriminative features from the preprocessed physiological signals. Convolutional Layer: The convolution operation extracts local features using a convolution kernel, mathematically expressed as follows:  
\[(f*g)(i,j)=\sum_{m}\sum_{n}f(m,n)g(i-m,j-n) \tag{6}\]  
where \(f\) is the input feature map, and \(g\) is the convolution kernel. This operation captures local patterns in the signals, such as heart rate waveforms and variations in breathing frequency, thereby providing crucial evidence for subsequent analysis [25]. In practical applications, selecting an appropriate kernel size and stride is essential, as they directly affect the precision of feature extraction and computational efficiency. This local connectivity feature enables the model to effectively capture the spatiotemporal characteristics of physiological signals. Activation Function: To introduce non-linearity into the model and allow it to learn more complex patterns, the ReLU (Rectified Linear Unit) activation function is applied. This function is mathematically expressed as follows:  
\[f(x)=\max(0,x) \tag{7}\]  
ReLU can effectively accelerate model training in most cases and reduce the vanishing gradient problem, thus speeding up the model's convergence. When processing physiological signals, the non-linear characteristics of ReLU help the model capture complex signal patterns, especially in the face of dynamic changes in physiological states [27]. Pooling Layer: The pooling layer is used to reduce the dimensionality of the feature map and retain only the most significant features. A common operation is max pooling, which selects the maximum value from a given region in the feature map. The max pooling operation is expressed as follows:  
\[y_{i,j}=\max_{m,n}\Bigl{(}x_{s_{i}+m,s_{j}+n}\Bigr{)} \tag{8}\]  
This process not only reduces the size of the feature map but also enhances the computational efficiency of the model, thereby improving its generalization capability [28]. Through pooling operations, the model can retain the most significant feature information while reducing the computational load and enhancing robustness. In the feature extraction process of the CNN, in addition to the basic operations of convolution and pooling layers, batch normalization can also be employed to accelerate training and improve stability. **Step 3**: Feature Serialization. After the convolution and pooling layers, the output of the CNN consists of a multi-dimensional feature map. To input these features into the LSTM network, the multi-dimensional output must be flattened into a one-dimensional vector.