Improved BiLSTM-FCN model applied to ballistocardiogram signal classification method
Through the improved BiLSTM-FCN model combined with BCG and ECG signals, the problems of noise interference and complex characteristics in the heart impact signal are solved, and the accuracy of heart rate estimation and classification is improved, providing a more comprehensive physiological state assessment.
Patent Information
- Application Number
- CN202510268365.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-08-01
AI Technical Summary
The prior art is difficult to effectively deal with noise interference in the heart impact signal, and the signal characteristics are complex, resulting in insufficient accuracy in heart rate estimation and classification.
The improved BiLSTM-FCN model is adopted, combined with the synchronous acquisition and preprocessing of BCG signals and ECG signals, and the feature extraction is performed through feature extraction and fusion, using the convolution layer, BiLSTM layer and attention layer to generate a comprehensive feature vector, and the timing feature weight is adjusted through the self-attention mechanism, and the prediction label and heart rate prediction value of the heart impact signal are finally output.
It improves the accuracy and stability of cardiac impact signal classification, enhances the ability to portray cardiac activity characteristics, improves the sensitivity of abnormal heart rhythm detection, and provides a more comprehensive physiological state assessment.
Smart Images

Figure CN120392075A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of biological signal processing, and particularly to an improved BiLSTM-FCN model for ballistocardiogram (BCG) signal classification method. Background Art
[0002] The ballistocardiogram (BCG) signal is a non-invasive physiological signal that can reflect the mechanical activity process of the heart. In recent years, due to its convenient acquisition method and application potential in health monitoring, cardiovascular disease detection, etc., the BCG signal has received extensive attention. However, compared with the electrocardiogram (ECG) signal, the BCG signal has greater noise interference and more complex signal characteristics. Therefore, how to effectively process the BCG signal and improve its accuracy in heart rate estimation and BCG classification has become an important research issue. Summary of the Invention
[0003] In view of the above-mentioned disadvantages and deficiencies of the prior art, the present invention provides an improved BiLSTM-FCN model for ballistocardiogram (BCG) signal classification method.
[0004] To achieve the above object, the main technical solutions adopted by the present invention include:
[0005] An embodiment of the present invention provides an improved BiLSTM-FCN model for ballistocardiogram (BCG) signal classification method, including:
[0006] S1. Obtain synchronously collected BCG signals and ECG signals, and preprocess the BCG signals and ECG signals respectively to obtain preprocessed BCG signals and preprocessed ECG signals; the BCG signal is a ballistocardiogram signal; the ECG signal is an electrocardiogram signal;
[0007] S2. Respectively perform feature extraction on the preprocessed BCG signals and preprocessed ECG signals to obtain BCG signal feature vectors and ECG signal feature vectors, and generate a comprehensive feature vector based on the BCG signal feature vectors and ECG signal feature vectors;
[0008] S3. Input the comprehensive feature vector into the trained improved BiLSTM-FCN model to obtain a prediction result; the prediction result includes the predicted label corresponding to the BCG signal and the predicted value of the heart rate;
[0009] The improved BiLSTM-FCN model includes, in sequence: an input layer for receiving a comprehensive feature vector; an embedding layer for mapping the comprehensive feature vector to a high-dimensional space through linear transformation to obtain high-dimensional features; a convolution layer for performing a convolution operation on the high-dimensional features using multiple one-dimensional convolution kernels to extract local features; a pooling layer for performing a pooling operation on the local features to obtain low-dimensional features; a BiLSTM layer for extracting time series features from low-dimensional features using a bidirectional long short-term memory network to obtain a time series feature vector; an attention layer for dynamically adjusting the weights of each time step in the time series feature vector through a self-attention mechanism to obtain a global feature vector; a fully connected layer for fusing the time series feature vector and the global feature vector to obtain a final fused feature vector; and an output layer for outputting a predicted label and a predicted value of the heart rate based on the final fused feature vector.
[0010] Preferably, the S1 specifically includes:
[0011] S11, calibrating and aligning the synchronously collected BCG signal and ECG signal using an optimal time alignment delay, wherein the optimal time alignment delay is calculated using formula (1);
[0012] The formula (1) is:
[0013]
[0014] S BCG (i) is the amplitude of the BCG signal at the i-th time point;
[0015] S ECG (i+ΔT) is the amplitude of the ECG signal at the time point i plus the time delay of signal alignment;
[0016] ||S BCG (i)|| is S BCG (i) the normalized amplitude;
[0017] ||S ECG (i+ΔT)|| is S ECG Normalized amplitude of (i+ΔT);
[0018] ΔT is the time delay of signal alignment;
[0019] ΔT * is the optimal time alignment delay;
[0020] S12, filtering and denoising the BCG signal and the ECG signal, wherein the filtering operation adopts a nonlinear dynamic adaptive filter, and the transfer function of the nonlinear dynamic adaptive filter is formula (2);
[0021] The formula (2) is:
[0022]
[0023] f is the signal frequency; β is the first adjustment parameter; γ is the second adjustment parameter.
[0024] Preferably, the S2 specifically includes:
[0025] Based on the BCG signal feature vector and the ECG signal feature vector, the comprehensive feature vector is generated using formula (3);
[0026] The formula (3) is:
[0027] in,
[0028]
[0029] δ is the third adjustment parameter; ∈ is a very small positive number; tanh( ) is the hyperbolic tangent function; V fusion is the comprehensive feature vector; V BCG is the BCG signal feature vector; V ECG is the ECG signal feature vector; ||V BCG || indicates V BCG Norm of a vector; ||V ECG || indicates V ECG Norm of the vector.
[0030] Preferably,
[0031] The comprehensive feature vector X satisfies X∈R T×d ; R represents the set of real numbers;
[0032] T represents the number of time steps; d represents the feature dimension of each time step;
[0033] The embedding layer is used to map the comprehensive feature vector to a high-dimensional space using formula (4) to obtain high-dimensional features;
[0034] The formula (4) is: E = X·W e +b e ;
[0035] V fusion =α·V BCG +(1-α)·V ECG ;
[0036] E is a high-dimensional feature; W e is the weight matrix of the embedding layer; b e is the bias term of the embedding layer;
[0037] in
[0038] Preferably, the BiLSTM layer is used to extract the temporal features in the low-dimensional features by a bidirectional long short-term memory network to obtain a temporal feature vector, specifically including:
[0039] The BiLSTM layer extracts temporal features through forward and backward long short-term memory units and outputs a temporal feature vector H t ; where H t ∈R T×2h ;
[0040]
[0041] Among them, is the output hidden state of the forward long short-term memory unit;
[0042]
[0043] h represents the hidden state dimension of each short-term memory unit.
[0044] Preferably,
[0045] The attention layer is used to dynamically adjust the weights of each time step in the temporal feature vector through a self-attention mechanism to obtain a global feature vector, specifically including:
[0046] The attention layer calculates the weight of each time step through a self-attention mechanism, and dynamically adjusts the weights of each time step according to the temporal feature H t to finally obtain a global feature vector A;
[0047] Among them, the weight of the time step is calculated by formula (5);
[0048] The formula (5) is:
[0049]
[0050] α t represents the weight of time step t;
[0051] W a is a learnable weight matrix;
[0052] H i represents the temporal feature of the i-th time step in the temporal feature vector;
[0053] T is the total number of time steps of the temporal feature;
[0054]
[0055] Preferably,
[0056] The fully connected layer is used to fuse the temporal feature vector and the global feature vector to obtain the final fused feature vector, specifically including:
[0057] The fully connected layer fuses the temporal feature vector and the global feature vector using formula (6) to obtain the final fused feature vector;
[0058] The formula (6) is:
[0059] F = c1·H t + c2·A;
[0060] F is the final fused feature vector; c1 is the first fusion coefficient; c2 is the second fusion coefficient; and, c1 + c2 = 1.
[0061] Preferably,
[0062] The output layer is used to output the predicted label using the softmax activation function according to the final fused feature vector;
[0063] The output layer is also used to output the predicted value of the heart rate using the linear activation function according to the final fused feature vector.
[0064] Preferably, among them, the improved BiLSTM-FCN model is pre-trained using the training data set to obtain the trained improved BiLSTM-FCN model;
[0065] The training data set includes: multiple samples; each sample includes: the comprehensive feature vector for training and the corresponding true label and true heart rate value.
[0066] Preferably, during the process of training the improved BiLSTM-FCN model using the training data set, formula (7) is used as the loss function;
[0067] The formula (7) is:
[0068] L total = r1·L1 + r2·L2 + ω·L3;
[0069] r1 is the first weighting coefficient;
[0070] r2 is the second weighting coefficient;
[0071] ω is the weight coefficient;
[0072] L3 is the regularization loss for preventing overfitting;
[0073] Among them,
[0074]
[0075] yi is the true label in the $i$-th sample of the training dataset;
[0076] is the probability of the predicted label output by the improved BiLSTM-FCN model when the $i$-th sample in the training dataset is input into the improved BiLSTM-FCN model;
[0077] $\varepsilon$ is the first factor for adjusting the weight of the classification task;
[0078] $M$ is the total number of samples in the training dataset;
[0079] where
[0080]
[0081] is the predicted value of the heart rate output by the improved BiLSTM-FCN model when the $i$-th sample in the training dataset is input into the improved BiLSTM-FCN model;
[0082] $r$ i is the true heart rate value in the $i$-th sample of the training dataset;
[0083] $\sigma$ is the second factor for adjusting the overall weight of the regression task.
[0084] The beneficial effects of the present invention are:
[0085] An improved BiLSTM-FCN model for ballistocardiogram signal classification method of the present invention, due to the synchronous acquisition and preprocessing of BCG signals and ECG signals, compared with the prior art, it can reduce the noise interference that may exist in a single signal, improve the reliability of the data, and achieve the effect of enhancing the signal stability.
[0086] Since the present invention uses feature extraction methods to respectively obtain the BCG signal feature vector and the ECG signal feature vector, and generates a comprehensive feature vector based on the two, compared with the prior art, it can make full use of the complementarity of different physiological signals, improve the feature expression ability, and achieve the effect of enhancing the robustness of the classification model.
[0087] Since the present invention uses an improved BiLSTM-FCN model and combines convolutional layers, BiLSTM layers and attention layers for feature extraction, compared with the prior art, it can fully combine the local feature extraction ability of the convolutional neural network (CNN), the temporal feature capture ability of BiLSTM, and the dynamic weight adjustment ability of the self-attention mechanism, and achieve the effect of effectively improving the classification accuracy of ballistocardiogram signals.
[0088] Since the attention layer is introduced after the BiLSTM layer in the present invention, compared with the prior art, it can adaptively adjust the importance of different time steps in the temporal features, reduce the interference of irrelevant features, and achieve the effect of optimizing the utilization rate of temporal information.
[0089] Since the output layer of the present invention can simultaneously output the prediction label of the ballistocardiogram signal and the heart rate prediction value based on the final fused feature vector, compared with the prior art, it can provide a more comprehensive physiological state assessment and achieve the effect of improving the diagnostic assistance ability. BRIEF DESCRIPTION OF THE DRAWINGS
[0090] Figure 1 It is a flowchart of a method for classifying ballistocardiogram signals using an improved BiLSTM-FCN model of the present invention;
[0091] Figure 2 It is a schematic structural diagram of the improved BiLSTM-FCN model machine in the embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0092] In order to better explain the present invention for easy understanding, the present invention will be described in detail below with reference to the accompanying drawings through specific embodiments.
[0093] In order to better understand the above technical solutions, the exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided so that the present invention can be understood more clearly and thoroughly, and the scope of the present invention can be fully conveyed to those skilled in the art.
[0094] Embodiment 1
[0095] Refer to Figure 1 , this embodiment provides a method for classifying ballistocardiogram signals using an improved BiLSTM-FCN model, including:
[0096] S1. Obtain the synchronously collected BCG signal and ECG signal, and preprocess the BCG signal and ECG signal respectively to obtain the preprocessed BCG signal and the preprocessed ECG signal; the BCG signal is the ballistocardiogram signal; the ECG signal is the electrocardiogram signal;
[0097] S2. Extract features from the preprocessed BCG signal and the preprocessed ECG signal respectively to obtain the BCG signal feature vector and the ECG signal feature vector, and generate a comprehensive feature vector based on the BCG signal feature vector and the ECG signal feature vector;
[0098] S3. Input the comprehensive feature vector into the trained improved BiLSTM-FCN model to obtain a prediction result. The prediction result includes the predicted label corresponding to the BCG signal and the predicted value of the heart rate.
[0099] See Figure 2 , the improved BiLSTM-FCN model sequentially includes: an input layer for receiving the comprehensive feature vector; an embedding layer for mapping the comprehensive feature vector to a high-dimensional space through a linear transformation to obtain high-dimensional features; a convolutional layer for performing a convolutional operation on the high-dimensional features using multiple one-dimensional convolutional kernels to extract local features; a pooling layer for performing a pooling operation on the local features to obtain low-dimensional features; a BiLSTM layer for using a bidirectional long short-term memory network to extract temporal features in the low-dimensional features to obtain a temporal feature vector; an attention layer for dynamically adjusting the weights of each time step in the temporal feature vector through a self-attention mechanism to obtain a global feature vector; a fully connected layer for fusing the temporal feature vector and the global feature vector to obtain a final fused feature vector; and an output layer for outputting the predicted label and the predicted value of the heart rate according to the final fused feature vector.
[0100] For example, the collected BCG signal (ballistocardiogram signal) and ECG signal (electrocardiogram signal) may be affected by noise interference (such as respiratory movement, electromyogram signal, etc.). The preprocessing step filters, denoises, and normalizes the signals. For example, a band-pass filter is used to remove baseline drift to improve the signal quality.
[0101] For example, high-frequency noise may exist in the original BCG signal and is removed by low-pass filtering. The ECG signal may contain power frequency interference (50Hz / 60Hz) and is removed by a notch filter. After normalization, the signal amplitude range is adjusted to [-1, 1] for subsequent processing.
[0102] Features are extracted from the preprocessed BCG signal and ECG signal respectively. For example, BCG signal features: pulse waveform features (peak value, trough value, rhythm, etc.); ECG signal features: R-R interval, QRS complex morphology, etc.
[0103] For example, the features obtained from a certain detection: BCG feature vector: [0.8, 1.2, 0.9, 0.7]; ECG feature vector: [0.6, 1.1, 1.0, 0.8]; after combination, a comprehensive feature vector is generated: [0.8, 1.2, 0.9, 0.7, 0.6, 1.1, 1.0, 0.8];
[0104] The improved BiLSTM-FCN model includes:
[0105] Input layer: Receive the comprehensive feature vector.
[0106] Embedding layer: Maps the comprehensive feature vector to a high-dimensional space, enabling the model to better capture the non-linear relationships between features.
[0107] Convolutional layer (CNN): Uses 1D convolution operations to extract local features. For example, it is detected that certain rhythm changes in the BCG signal may be synchronized with the QRS complex of the ECG.
[0108] Pooling layer: Reduces the dimension of local features and reduces redundant information.
[0109] BiLSTM layer: Extracts temporal features. For example, the heart rate rhythm in the previous few seconds may affect the current heart rate state.
[0110] Attention layer: Adaptively adjusts the importance of different time steps. For example, when an abnormal heart rhythm is detected, the model may assign a higher weight to a specific time step. For example, if there is a large sudden fluctuation in the signal at the 5th second, the attention mechanism will give a higher weight.
[0111] Fully connected layer: Fuses all features to form the final discriminant information.
[0112] Output layer: Predicts the classification label (normal / abnormal) of the ballistocardiogram signal and the heart rate value (e.g., 72 bpm).
[0113] For example: Predicted label: Arrhythmia (AFib, atrial fibrillation) Predicted heart rate: 75 bpm (true heart rate 76 bpm, error 1 bpm).
[0114] In this embodiment, due to the synchronous acquisition and preprocessing of the BCG signal and the ECG signal, compared with the existing single-signal detection method, it can reduce external interference, improve the accuracy of data, and achieve the effect of enhancing signal stability. Due to the feature extraction and fusion of the BCG signal and the ECG signal, compared with the existing method of classifying using only the ECG or BCG alone, it can more comprehensively depict the characteristics of cardiac activity and achieve the effect of improving the classification accuracy of the ballistocardiogram signal. Due to using the convolutional layer (CNN) to extract local features and combining with the BiLSTM layer to extract temporal features, compared with the traditional method of separately processing using only CNN or LSTM, it can better capture the short-term and long-term dependence relationships of the signal and achieve the effect of enhancing the model's understanding ability of the temporal features of the ballistocardiogram signal. Due to using the attention layer to dynamically adjust the weights of temporal features, compared with the temporal model with fixed weights, it can pay more attention to the abnormal changes at key time steps and achieve the effect of improving the sensitivity of detecting abnormal heart rhythms.
[0115] Specifically, the S1 specifically includes:
[0116] S11. Calibrate and align the synchronously acquired BCG signal and ECG signal through the optimal time alignment delay, where the optimal time alignment delay is calculated by formula (1);
[0117] The formula (1) is:
[0118]
[0119] S BCG (i) is the amplitude of the BCG signal at the i-th time point; S ECG (i + ΔT) is the amplitude of the ECG signal at the time point obtained by adding the signal alignment time delay to the i-th time point; ||S BCG (i)|| is the normalized amplitude of S BCG (i); || ECG (i + ΔT)|| is the normalized amplitude of S ECG (i + ΔT); ΔT is the signal alignment time delay; ΔT * is the optimal time alignment delay;
[0120] Since the physiological sources of the BCG and ECG signals are different, there may be a phase difference. This method can accurately estimate the optimal alignment delay and improve the signal matching accuracy. Through the optimal alignment, the rhythm of the BCG signal is aligned with the corresponding cardiac cycle of the ECG signal, making it easier to interpret the cardiac activity reflected in the BCG signal.
[0121] S12. Filter and denoise the BCG signal and ECG signal, where the filtering operation uses a non-linear dynamic adaptive filter, and the transfer function of the non-linear dynamic adaptive filter is formula (2);
[0122] The formula (2) is:
[0123]
[0124] f is the signal frequency; β is the first adjustment parameter; γ is the second adjustment parameter.
[0125] In this embodiment, a filter with a traditional fixed cut-off frequency may weaken the useful signal, while this method can dynamically adapt to the characteristics of signals with different frequencies and improve the signal fidelity. Since the BCG and ECG signals may be affected by high-frequency interference (such as electromyographic noise, external vibration, etc.), this method can effectively reduce the influence of high-frequency noise on the signals and improve the signal quality. Traditional filters may cause signal phase distortion, while this method can better retain the time-frequency characteristics of the original signal, which is beneficial to subsequent cardiac rhythm analysis.
[0126] Specifically, the S2 specifically includes:
[0127] Based on the BCG signal feature vector and the ECG signal feature vector, the comprehensive feature vector is generated using formula (3);
[0128] The formula (3) is:
[0129] V fusion =α·V BCG +(1-α)··V ECG ;
[0130] in,
[0131]
[0132] δ is the third adjustment parameter, which controls the sensitivity of the fusion; ∈ is a very small positive number to prevent the denominator from being zero; tanh() is the hyperbolic tangent function, and its value range is (-1, 1); V fusion is the comprehensive feature vector; V BCG is the BCG signal feature vector; V ECG is the ECG signal feature vector; ||V BCG || indicates V BCG Norm of a vector; ||V ECG || indicates V ECG Norm of the vector.
[0133] When the BCG signal is stronger than the ECG signal (i.e. || V BCG ||>||V ECG ||), α becomes larger, which means that the fusion result is more biased towards the BCG signal characteristics.
[0134] When the ECG signal is stronger than the BCG signal (i.e. || V BCG ||<||V ECG ||), α becomes smaller, which means that the fusion result is more biased towards the ECG signal characteristics.
[0135] When the eigenvectors of two signals are similar in size (i.e. ||V BCG ||≈||V ECG ||, then α≈0.5, that is, the contributions of the two are equal, achieving balanced fusion.
[0136] Since the hyperbolic tangent function tanh( ) has an S-shaped smooth change characteristic, it can ensure that the weight α changes smoothly, avoiding drastic changes in weight due to slight fluctuations in signal strength, making the fusion result more stable and robust.
[0137] In this embodiment, the comprehensive feature vector X satisfies X∈R T×d ; R represents a set of real numbers; T represents the number of time steps; d is the feature dimension of each time step;
[0138] An embedding layer for mapping the comprehensive feature vector to a high-dimensional space using formula (4) to obtain high-dimensional features;
[0139] The formula (4) is: E = X·W e +b e ;
[0140] E is the high-dimensional feature; W e is the weight matrix of the embedding layer; b e is the bias term of the embedding layer;
[0141] where
[0142] A BiLSTM layer for extracting temporal features in low-dimensional features using a bidirectional long short-term memory network to obtain a temporal feature vector, specifically including:
[0143] The BiLSTM layer extracts temporal features through forward and backward long short-term memory units and outputs a temporal feature vector H t ; where, H t ∈R T×2h ;
[0144]
[0145] where is the output hidden state of the forward long short-term memory unit; is the output hidden state of the backward long short-term memory unit; h represents the hidden state dimension of each short-term memory unit.
[0146] An attention layer for dynamically adjusting the weights of each time step in the temporal feature vector through a self-attention mechanism to obtain a global feature vector, specifically including:
[0147] The attention layer calculates the weight of each time step through a self-attention mechanism and dynamically adjusts the weights of each time step according to the temporal feature H t to finally obtain a global feature vector A;
[0148] where, the weight of the time step is calculated using formula (5);
[0149] The formula (5) is:
[0150]
[0151] α t represents the weight of time step t; W a is a learnable weight matrix; H i represents the temporal feature of the i-th time step in the temporal feature vector; T is the total number of time steps of the temporal feature;
[0152]
[0153] A fully connected layer, which is used to fuse the temporal feature vector and the global feature vector to obtain a final fused feature vector, specifically including:
[0154] The fully connected layer fuses the temporal feature vector and the global feature vector by using formula (6) to obtain a final fused feature vector;
[0155] The formula (6) is:
[0156] F = c1·H t + c2·A;
[0157] F is the final fused feature vector; c1 is the first fusion coefficient; c2 is the second fusion coefficient; and, c1 + c2 = 1.
[0158] In this embodiment, the output layer is used to output a predicted label by using the softmax activation function according to the final fused feature vector;
[0159] The output layer is further used to output a predicted value of the heart rate by using the linear activation function according to the final fused feature vector.
[0160] The output layer in this embodiment can not only classify the individual health status (such as "normal" or "abnormal"), but also provide accurate physiological parameters (such as heart rate value). This is very important for medical applications. Doctors can not only see the classification results of the health status, but also obtain specific numerical references to improve the accuracy of diagnosis. Softmax can normalize the output to form a probability distribution, ensuring that the sum of predictions for all classes is 1, which helps the stable training of the model. The heart rate is a continuous numerical value. Using the linear activation function enables the model to predict any reasonable heart rate range (such as 50 - 180 bpm) without being affected by the numerical truncation that may be caused by sigmoid or ReLU. Since the classification task and the regression task share the final fused feature vector, more generalizable features can be learned, improving the adaptability to different input data.
[0161] Among them, the improved BiLSTM-FCN model is pre-trained with a training data set to obtain a trained improved BiLSTM-FCN model;
[0162] The training data set includes: multiple samples; each sample includes: a comprehensive feature vector for training, the corresponding true label, and the true heart rate value.
[0163] Among them, in the process of training the improved BiLSTM-FCN model with the training data set, formula (7) is used as the loss function;
[0164] The formula (7) is as follows:
[0165] L total = r1·L2 + r2·L2 + ω·L3;
[0166] r1 is the first weighting coefficient; r2 is the second weighting coefficient; ω is the weight coefficient; L3 is the regularization loss for preventing overfitting. Since L3 is used to prevent overfitting, it is generally L2 regularization (weight decay) or L1 regularization (sparsification).
[0167] Among them,
[0168]
[0169] y i is the true label in the i-th sample of the training dataset; is the probability of the predicted label output by the improved BiLSTM-FCN model when the i-th sample in the training dataset is input into the improved BiLSTM-FCN model; ε is the first factor for adjusting the weight of the classification task; M is the total number of samples in the training dataset;
[0170] Among them,
[0171]
[0172] is the predicted value of the heart rate output by the improved BiLSTM-FCN model when the i-th sample in the training dataset is input into the improved BiLSTM-FCN model; r i is the true heart rate value in the i-th sample of the training dataset; σ is the second factor for adjusting the full weight of the regression task.
[0173] In this embodiment, the cross-entropy loss L1 combines class weight adjustment and is suitable for the problem of class imbalance, making BiLSTM-FCN perform better in the classification task. The combined loss function structure enables BiLSTM-FCN to not only perform classification but also optimize other objectives, such as feature learning or numerical prediction, improving the comprehensive ability of the model. By restricting the model complexity through L3 (regularization loss), the gap between the training error and the test error is reduced, making the model perform more stably on unseen data.
[0174] Embodiment 2
[0175] Referring to Figure 1 , this embodiment provides an improved BiLSTM-FCN model for the classification method of ballistocardiogram signals, including:
[0176] Step 1: Obtain the synchronously collected BCG signal and ECG signal, and preprocess the BCG signal and ECG signal respectively to obtain the preprocessed BCG signal and the preprocessed ECG signal; the BCG signal is the ballistocardiogram signal; the ECG signal is the electrocardiogram signal;
[0177] Step 2: Perform feature extraction on the preprocessed BCG signal and the preprocessed ECG signal respectively to obtain the BCG signal feature vector and the ECG signal feature vector, and generate a comprehensive feature vector based on the BCG signal feature vector and the ECG signal feature vector;
[0178] Step 3: Input the comprehensive feature vector into the trained improved BiLSTM-FCN model to obtain a prediction result; the prediction result includes the predicted label corresponding to the BCG signal and the predicted value of the heart rate;
[0179] The improved BiLSTM-FCN model successively includes: an input layer for receiving the comprehensive feature vector; an embedding layer for mapping the comprehensive feature vector to a high-dimensional space through a linear transformation to obtain high-dimensional features; a convolutional layer for performing a convolution operation on the high-dimensional features using multiple one-dimensional convolutional kernels to extract local features; a pooling layer for performing a pooling operation on the local features to obtain low-dimensional features; a BiLSTM layer for using a bidirectional long short-term memory network to extract the temporal features in the low-dimensional features to obtain a temporal feature vector; an attention layer for dynamically adjusting the weights of each time step in the temporal feature vector through a self-attention mechanism to obtain a global feature vector; a fully connected layer for fusing the temporal feature vector and the global feature vector to obtain a final fused feature vector; and an output layer for outputting the predicted label and the predicted value of the heart rate according to the final fused feature vector.
[0180] The BiLSTM-FCN model combines the advantages of the bidirectional long short-term memory network (BiLSTM) and the fully convolutional network (FCN), specifically including:
[0181] The BiLSTM layer can capture the long-term dependencies in time series data and is particularly suitable for processing the periodic and aperiodic features in the BCG signal; the FCN layer is used to extract local features and can automatically learn the multi-scale features in the BCG signal to further improve the classification effect.
[0182] In this embodiment, a multi-modal data fusion technology is adopted to improve the classification accuracy, specifically including: feature-level fusion: performing operations such as splicing, addition, or multiplication on the features of the BCG and ECG signals to form a comprehensive feature vector; model-level fusion: using deep learning models such as multi-modal Transformer or HEALNet to capture the correlations and complementarities between different modalities and improve the classification performance.
[0183] Example 3
[0184] This embodiment provides an improved BiLSTM-FCN model for classifying ballistocardiogram signals, which specifically includes the following steps:
[0185] 100: Obtain synchronously collected ballistocardiogram signals (BCG signals) and electrocardiogram signals (ECG signals), and preprocess them respectively to obtain preprocessed BCG signals and ECG signals.
[0186] 200: Extract features from the preprocessed BCG signals and ECG signals respectively to obtain BCG signal feature vectors and ECG signal feature vectors, and generate a comprehensive feature vector based on the two.
[0187] 300: Input the comprehensive feature vector into the trained improved BiLSTM-FCN model to obtain a prediction result. The prediction result includes the predicted label corresponding to the BCG signal and the predicted value of the heart rate.
[0188] The improved BiLSTM-FCN model successively includes the following levels:
[0189] Input layer: Used to receive the comprehensive feature vector;
[0190] Embedding layer: Map the comprehensive feature vector to a high-dimensional space through a linear transformation to obtain high-dimensional features;
[0191] Convolution layer: Use multiple one-dimensional convolutional kernels to perform convolutional operations on the high-dimensional features to extract local features;
[0192] Pooling layer: Perform pooling operations on the local features to obtain low-dimensional features;
[0193] BiLSTM layer: The bidirectional long short-term memory network (BiLSTM) extracts the temporal features in the low-dimensional features to obtain a temporal feature vector;
[0194] Attention layer: Dynamically adjust the weights of each time step in the temporal feature vector through a self-attention mechanism to obtain a global feature vector;
[0195] Fully connected layer: Fuse the temporal feature vector and the global feature vector to obtain a final fused feature vector;
[0196] Output layer: Output the predicted label and the heart rate prediction value according to the final fused feature vector.
[0197] In this embodiment, the improved BiLSTM-FCN model combines the advantages of BiLSTM and the fully convolutional network (FCN): The BiLSTM layer can capture long-term dependencies in time series data and is particularly suitable for processing periodic and aperiodic features in BCG signals; the FCN layer is used to extract local features and can automatically learn multi-scale features in BCG signals, thereby improving the classification effect.
[0198] This embodiment adopts multi-modal data fusion technology to improve classification accuracy, specifically including:
[0199] Feature-level fusion: Concatenate, add, or multiply the features of BCG and ECG signals to form a comprehensive feature vector;
[0200] During the training process of the improved BiLSTM-FCN model in this embodiment, in order to improve the generalization ability of the model, a variety of data augmentation techniques are adopted, including:
[0201] Random cropping: Randomly select a 5-second segment from the collected signal as a new training sample; flipping: Horizontally flip the collected signal along the time axis to generate a new training sample; adding noise: Add Gaussian white noise to the collected signal to simulate interference in the actual environment; time-domain augmentation: Perform random translation, scaling, etc. on the collected signal to generate new training samples; frequency-domain augmentation: Perform filtering, spectral perturbation, etc. on the collected signal to generate new training samples.
[0202] The experimental environment described in this embodiment includes the following hardware and software configurations:
[0203] Hardware: NVIDIA RTX 3090 GPU, Intel i9-10900K CPU, 64GB RAM;
[0204] Software: Python 3.8, TensorFlow 2.4, PyTorch 1.7, CUDA 11.3.
[0205] During the training process of the improved BiLSTM-FCN model in this embodiment, the following parameter settings are adopted:
[0206] Optimizer: Adam optimizer, initial learning rate 0.001, β1 = 0.9, β2 = 0.999;
[0207] Loss function: The cross-entropy loss function is used for classification tasks, and the mean squared error (MSE) loss function is used for regression tasks. In order to balance the weights of the two tasks, a hyperparameter λ is introduced into the total loss to control the ratio of the classification loss and the regression loss;
[0208] Batch size: 64;
[0209] Number of iterations (Epochs): 100 epochs;
[0210] Stop training when the loss on the validation set has not decreased for 10 consecutive epochs.
[0211] Specifically, to comprehensively evaluate the model performance, the following metrics can be used: Accuracy, Recall, F1-score, AUC-ROC curve, Mean Squared Error (MSE).
[0212] In this embodiment, an improved BiLSTM-FCN model is used to achieve efficient classification of ballistocardiogram signals, and multi-modal fusion and data augmentation strategies are adopted to effectively improve the classification accuracy and the generalization ability of the model.
[0213] In the description of the present invention, it should be understood that the terms "first" and "second" are only used for descriptive purposes and cannot be construed as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, the features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present invention, "a plurality" means two or more unless otherwise specifically defined.
[0214] In the present invention, unless otherwise clearly defined and limited, the terms "installed", "connected", "connected with", "fixed" and other terms should be understood in a broad sense. For example, it may be a fixed connection, a detachable connection, or integrated; it may be a mechanical connection or an electrical connection; it may be directly connected or indirectly connected through an intermediate medium; it may be the internal communication of two components or the interaction relationship between two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0215] In the present invention, unless otherwise clearly defined and limited, when the first feature is "on" or "under" the second feature, it may be that the first and second features are in direct contact, or the first and second features are indirectly in contact through an intermediate medium. Moreover, when the first feature is "above", "over" and "on top of" the second feature, it may be that the first feature is directly above or obliquely above the second feature, or merely indicates that the horizontal height of the first feature is higher than that of the second feature. When the first feature is "under", "below" and "beneath" the second feature, it may be that the first feature is directly below or obliquely below the second feature, or merely indicates that the horizontal height of the first feature is lower than that of the second feature.
[0216] In the description of this specification, the descriptions of terms such as "one embodiment", "some embodiments", "embodiment", "example", "specific example", or "some examples" mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, without contradiction, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0217] Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.
Claims
1. An improved BiLSTM-FCN model for cardiac impact signal classification method, characterized in that, Including: S1. Obtain the synchronously collected BCG signal and ECG signal, and preprocess the BCG signal and the ECG signal respectively to obtain the preprocessed BCG signal and the preprocessed ECG signal; the BCG signal is the ballistocardiogram signal; the ECG signal is the electrocardiogram signal; S2. Perform feature extraction on the preprocessed BCG signal and the preprocessed ECG signal respectively, obtain the BCG signal feature vector and the ECG signal feature vector, and generate a comprehensive feature vector based on the BCG signal feature vector and the ECG signal feature vector; S3. Input the comprehensive feature vector into the trained improved BiLSTM-FCN model to obtain a prediction result; the prediction result includes the predicted label corresponding to the BCG signal and the predicted value of the heart rate; The improved BiLSTM-FCN model sequentially includes: an input layer for receiving the comprehensive feature vector; an embedding layer for mapping the comprehensive feature vector to a high-dimensional space through a linear transformation to obtain high-dimensional features; a convolutional layer for performing a convolution operation on the high-dimensional features using multiple one-dimensional convolutional kernels to extract local features; a pooling layer for performing a pooling operation on the local features to obtain low-dimensional features; a BiLSTM layer for extracting the temporal features in the low-dimensional features through a bidirectional long short-term memory network to obtain a temporal feature vector; an attention layer for dynamically adjusting the weights of each time step in the temporal feature vector through a self-attention mechanism to obtain a global feature vector; a fully connected layer for fusing the temporal feature vector and the global feature vector to obtain a final fused feature vector; an output layer for outputting the predicted label and the predicted value of the heart rate according to the final fused feature vector.
2. An improved BiLSTM-FCN model for cardiac impact signal classification method according to claim 1, characterized in that, The specific content of S1 includes: S11. Calibrate and align the synchronously collected BCG signal and ECG signal through the optimal time alignment delay, and the optimal time alignment delay is calculated by formula (1); The formula (1) is: S BCG (i) is the amplitude of the BCG signal at the i-th time point; S ECG (i + ΔT) is the amplitude of the ECG signal at the time point obtained by adding the time delay for signal alignment to the i-th time point. ||S BCG (i) || is S BCG (i)'s normalized amplitude; ||S ECG (i + ΔT)|| is S ECG The normalized amplitude of (i + ΔT); ΔT is the time delay of signal alignment; ΔT * is the optimal time alignment delay; S12. Filter and denoise the BCG signal and the ECG signal, where the filtering operation uses a non-linear dynamic adaptive filter, and the transfer function of the non-linear dynamic adaptive filter is formula (2); The formula (2) is: f is the signal frequency; β is the first adjustment parameter; γ is the second adjustment parameter.
3. An improved BiLSTM-FCN model for cardiac impact signal classification method according to claim 1, characterized in that, The specific content of S2 includes: Generate a comprehensive feature vector based on the BCG signal feature vector and the ECG signal feature vector using formula (3); The formula (3) is: V fusion = α·V BCG + (1 - α)·V ECG ; Where, δ is the third adjustment parameter; ∈ is an extremely small positive number; tanh() is the hyperbolic tangent function; V fusion is the comprehensive feature vector; V BCG is the BCG signal feature vector; V ECG is the ECG signal feature vector; ||V BCG || represents the norm of the V BCG vector; ||V ECG || represents the norm of the V ECG vector.
4. According to the method for classifying ballistocardiogram signals using an improved BiLSTM-FCN model as described in claim 3, characterized in that The comprehensive feature vector X satisfies X ∈ R T×d ; R represents the set of real numbers; T represents the number of time steps; d is the feature dimension of each time step; The embedding layer is used to map the comprehensive feature vector to a high-dimensional space using formula (4) to obtain high-dimensional features; The formula (4) is: E = X·W e + b e ; E is the high-dimensional feature; W e is the weight matrix of the embedding layer; b e is the bias term of the embedding layer; wherein d 1 > d.
5. An improved BiLSTM-FCN model for cardiac impact signal classification method according to claim 4, characterized in that, The BiLSTM layer is used to extract the temporal features in the low-dimensional features through a bidirectional long short-term memory network to obtain a temporal feature vector, specifically including: The BiLSTM layer extracts temporal features through forward and backward long short-term memory units and outputs a temporal feature vector H t ; where H t ∈R T×2h ; Among them, is the output hidden state of the forward long short-term memory unit; is the output hidden state of the bidirectional long short-term memory unit; h represents the hidden state dimension of each short-term memory unit.
6. An improved BiLSTM-FCN model for classifying ballistocardiogram signals according to claim 5, wherein an attention layer is used to dynamically adjust the weights of each time step in the temporal feature vector through a self-attention mechanism to obtain a global feature vector, specifically including: The attention layer calculates the weights for each time step through the self-attention mechanism, and dynamically adjusts the weights of each time step according to the temporal feature H t to finally obtain the global feature vector A; wherein the weights of the time steps are calculated using formula (5); The formula (5) is: α t represents the weight at time step t; W a is a learnable weight matrix; H i represents the temporal feature of the i-th time step in the temporal feature vector; T is the total number of time steps of the temporal feature; 7. An improved BiLSTM-FCN model for classifying ballistocardiogram signals according to claim 6, wherein a fully connected layer is used to fuse the temporal feature vector and the global feature vector to obtain a final fused feature vector, specifically including: The fully connected layer uses formula (6) to fuse the temporal feature vector and the global feature vector to obtain a final fused feature vector; The formula (6) is: F = c1·H t + c2·A; F is the final fused feature vector; c1 is the first fusion coefficient; c2 is the second fusion coefficient; and, c1 + c2 = 1.
8. An improved BiLSTM-FCN model for classifying ballistocardiogram signals according to claim 1, wherein the output layer is used to output a predicted label using the softmax activation function according to the final fused feature vector; The output layer is also used to output a predicted value of the heart rate using the linear activation function according to the final fused feature vector.
9. An improved BiLSTM-FCN model for cardiac impact signal classification method according to claim 1, wherein wherein, the improved BiLSTM-FCN model is pre-trained using a training data set to obtain a trained improved BiLSTM-FCN model; The training data set includes: a plurality of samples; each sample includes: a comprehensive feature vector for training, a corresponding true label, and a true heart rate value.
10. An improved BiLSTM-FCN model for cardiac impact signal classification method according to claim 9, wherein wherein, during the process of training the improved BiLSTM-FCN model using the training data set, formula (7) is used as the loss function; The formula (7) is: L total = r1·L1 + r2·L2 + ω·L3; r1 is the first weighting coefficient; r2 is the second weighting coefficient; ω is the weight coefficient; L3 is the regularization loss for preventing overfitting; wherein y i is the true label in the i-th sample of the training dataset; The probability of the predicted label output by the improved BiLSTM-FCN model when the i-th sample in the training dataset is input into the improved BiLSTM-FCN model; ε is the first factor for adjusting the weight of the classification task; M is the total number of samples in the training data set; wherein The predicted value of the heart rate output by the improved BiLSTM-FCN model when the i-th sample in the training dataset is input into the improved BiLSTM-FCN model; r i is the true heart rate value in the i-th sample of the training dataset; σ is the second factor for adjusting the full weight of the regression task.