Physiological signal segment analysis method based on time-frequency information fusion and attention
By constructing a Transformer-based time-frequency information fusion attention model, the problems of low feature engineering efficiency and insufficient context information capture in existing technologies are solved, efficient sleep apnea event classification of physiological signal fragments is achieved, and detection accuracy and automation capabilities are improved.
Patent Information
- Application Number
- CN202310556580.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-17
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2043-05-17
AI Technical Summary
Existing machine learning and deep learning models have problems in the classification of obstructive sleep apnea events, such as low feature engineering efficiency, inability to achieve automated classification, inability to capture contextual information, and detection accuracy affected by noise interference and feature differences.
A Transformer-based time-frequency information fusion attention model is adopted to construct a physiological signal segment analysis method through preprocessing, feature extraction, time-frequency information fusion and classification modules, including deep residual shrinkage network, multi-scale convolutional attention, adaptive pruned time-frequency information fusion attention and classifier, to improve the classification accuracy of physiological signal segments.
The accuracy of sleep apnea event classification in physiological signal segments is improved, the amount of computation is reduced, the robustness and detection accuracy of the model are enhanced, and automatic classification can be achieved on large data sets.
Smart Images

Figure CN116548979B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of medical physiological signal processing, and relates to a physiological signal segment analysis method based on time-frequency information fusion attention. Background Art
[0002] Obstructive sleep apnea (OSA) event classification aims to extract features from medical physiological signals to complete event classification. Currently, electrocardiogram (ECG) signals are primarily used to identify apnea events. These methods are categorized into machine learning-based and deep learning-based sleep apnea classification methods, depending on the technology employed.
[0003] Traditional machine learning classification methods primarily rely on feature engineering to manually select a suitable feature set as input to the machine learning classifier to classify sleep apnea events. However, manual feature selection reduces efficiency and is not suitable for large datasets, making this method incapable of automated sleep apnea classification.
[0004] With the continuous development of deep learning in recent years, it has been applied in various fields and demonstrated its advantages over traditional machine learning models without requiring domain knowledge. Convolutional neural networks (CNNs) are a popular deep learning model. Due to their excellent feature extraction and classification capabilities in tasks such as visual image recognition, speech recognition, and text recognition, CNNs are now also being applied to biosignal classification. Some have proposed inputting preprocessed ECG signals into the LeNet-5 model to extract features and perform OSA classification. However, CNN models are limited by their receptive field size and cannot achieve long-range modeling and contextual information extraction, leading to bottlenecks in sleep apnea classification. To capture contextual information in ECG data and achieve long-range modeling, some have proposed dividing long ECG signals into segments of fixed length of 1 minute. Subsequently, a CNN combined with a recurrent neural network (RNN) model is proposed to achieve long-range modeling, capture contextual information, and perform OSA classification. However, RNN models cannot be parallelized and suffer from vanishing and exploding gradients when the sequence length is too long. Furthermore, noise introduced by environmental interference during information acquisition and the lack of clear distinction between ECG data features are significant issues that affect OSA detection accuracy. Summary of the Invention
[0005] The purpose of the present invention is to provide a physiological signal segment analysis method based on time-frequency information fusion attention. The method uses physiological signal segment analysis based on Transformer time-frequency information fusion to improve the accuracy of analyzing whether sleep apnea events occur in physiological signal segments.
[0006] The technical solution adopted by the present invention is a physiological signal segment analysis method based on time-frequency information fusion attention, which specifically includes the following steps:
[0007] Step 1: Input the original ECG signal from the public dataset, perform preprocessing on the corresponding signal, and then divide it into a training set and a test set;
[0008] Step 2: Construct a physiological signal segment analysis model based on Transformer time-frequency information fusion;
[0009] Step 3: Use the training set processed in step 1 to train the model constructed in step 2;
[0010] In step 4, the test set ECG signal preprocessed in step 1 is fed into the model trained in step 3, and the classification detection result is finally output.
[0011] The present invention is also characterized in that:
[0012] The process of preprocessing the ECG signal in step 1 is as follows:
[0013] Segmentation, filtering, R peak detection, RR interval and R peak amplitude extraction, linear interpolation and channel splicing are performed in sequence to obtain the time series z.
[0014] In step 2, the physiological signal segment analysis model based on Transformer time-frequency information fusion includes a feature extraction module, a time-frequency information fusion module, and a classification module;
[0015] The feature extraction module includes deep residual shrinkage network DRSNs, multi-scale convolutional attention MSCA and multi-layer convolution + ReLU module CRL;
[0016] The time-frequency information fusion module includes a Transformer architecture consisting of a scalable positional encoder, an adaptive pruned time-frequency information fusion attention module (APTFFA), and a multi-scale MLP.
[0017] The classification module includes average pooling, fully connected layers and Softmax activation function.
[0018] In step 2, in the classification module, the following formula (1) is used to obtain the predicted value y of the sleep apnea event physiological signal classification:
[0019]
[0020] During the training process of step 3, the cross entropy loss function is used, that is, the following formula (2) to constrain the model constructed in step 2:
[0021]
[0022] Where N is the number of samples, y i represents the label of sample i, p i It represents the probability that sample i is predicted to be positive.
[0023] The beneficial effects of the present invention are that the present invention constructs a feature extraction module, a time-frequency information fusion module and a classification module; the signal denoising method commonly used in ECG is used in preprocessing; the feature extraction module is composed of a deep residual shrinkage network (DRSNs), a multi-scale convolutional attention (MSCA) and a multi-layer convolution + ReLU module (CRL). First, a deep residual shrinkage network is used to filter out noise in the features; then, multi-scale convolutional attention (MSCA) is used to extract rich semantic information from multiple perspectives to enhance the model's temporal feature extraction capability; finally, stacking multiple layers of convolution + ReLU modules (CRL) reduces the sequence length and reduces the amount of calculation; the time-frequency information fusion module (Time-Frequency Information Fusion) first dynamically adds position information by using scalable position encoding (SPE) to ensure the order of the time series. Then, a Transformer architecture composed of an adaptive pruned time-frequency information fusion attention module (APTFFA) and a multi-scale MLP (MSM) is used to complete the fusion of time domain information and frequency domain information, as well as the integration of channel information. Finally, the classifier composed of average pooling (Avgpool), a fully connected layer and a Softmax activation function completes the classification of obstructive sleep apnea events for the physiological signal segment. The present invention can improve the accuracy of physiological signal segment classification. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] Figure 1 It is a schematic diagram of the preprocessing process of the physiological signal segment analysis method based on time-frequency information fusion attention of the present invention;
[0025] Figure 2 It is a schematic diagram of the overall structure of the physiological signal segment analysis model based on Transformer time-frequency information fusion constructed in the physiological signal segment analysis method based on time-frequency information fusion attention of the present invention;
[0026] Figure 3 Schematic diagram of the structure of multi-scale convolutional attention constructed in the physiological signal segment analysis method based on time-frequency information fusion attention of the present invention;
[0027] Figure 4 It is a structural diagram of the adaptive pruning time-frequency information fusion attention module constructed in the physiological signal segment analysis method based on time-frequency information fusion attention of the present invention. DETAILED DESCRIPTION
[0028] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments.
[0029] The present invention is a physiological signal segment analysis method based on time-frequency information fusion attention. The present invention uses a time-frequency information fusion model composed of multi-scale convolutional attention and adaptive pruned time-frequency information fusion attention modules to perform physiological signal analysis to improve the accuracy of analyzing whether sleep apnea events occur in physiological signal segments.
[0030] Example 1
[0031] The physiological signal segment analysis method based on time-frequency information fusion attention includes the following steps:
[0032] Step 1: Input the original ECG signals from the public dataset and divide them into a training set and a test set after appropriate preprocessing operations. Use the training set for training and the test set for testing.
[0033] Step 2: Construct a physiological signal segment analysis model based on Transformer time-frequency information fusion (such as Figure 2 As shown in FIG, the time series z obtained in step 1 is sequentially passed through a feature extraction module (Feature extraction), a time-frequency information fusion module (Time-Frequency Information Fusion) and a classification module (Classifier).
[0034] In step 3, the model is trained using the data set processed in step 1. The cross-entropy loss function is used to constrain the results of the training network, and then the parameters are updated in reverse. The training is repeated 100 times, where 1 time refers to training the preprocessed signal segment once, and finally a trained network model is obtained.
[0035] In step 4, the test set ECG signal preprocessed in step 1 is fed into the model trained in step 3, and the classification detection result is finally output.
[0036] Example 2
[0037] Based on Example 1, each step is implemented as follows:
[0038] The specific process of step 1 is as follows:
[0039] Step 1.1, signal preprocessing. ECG signals are segmented, filtered, R-peaks detected, RR interval (RRI) and R-peak amplitude (RA) extracted, linear interpolated, and channel stitching are performed. The overall process is as follows: Figure 1 The details of the processing method are as follows:
[0040] Fragmentation: Based on the annotations provided by the dataset, each individual signal is divided into 1-minute subsegments. For example, in the Apnea-ECG dataset, the sampling rate is 100 Hz, so each signal segment has 100 × 60 = 6000 sampling points and a corresponding label. Furthermore, considering that OSA classification relies on continuous time information, this method concatenates the 2 minutes before and after the current segment to form a 5-minute subsegment, while retaining the current 1-minute label.
[0041] Filtering: The input raw ECG signal frequency band is preprocessed by applying a second-order Butterworth Band Pass Filter (BPPF) with a high-pass frequency of 5 Hz and a low-pass frequency of 35 Hz to suppress high-frequency and low-frequency noise and preserve the original signal.
[0042] R-peak detection and extraction of the RR interval (RRI) and R-peak amplitude (RA): The Hamilton algorithm is used to detect the position of the R-peak and obtain the RR interval (RRI) and R-peak amplitude (RA). A median filter is then used to remove any noise present in the RR interval.
[0043] Linear interpolation: Since the RR interval and R peak amplitude have different data dimensions after extraction, in order to maintain the consistency of the dimensions, RRI and RA are interpolated to a sequence of length 900. At this time, the RRI sequence is defined as The RA sequence is defined as Among them, 1 represents the number of channels and 900 represents the length of the sequence after interpolation.
[0044] Channel concatenation (Concat): In order to make full use of the extracted RR interval and R peak amplitude, they are concatenated on the channel to obtain a time series Then input the network model.
[0045] In step 1.2, the signals preprocessed in step 1.1 are divided into a test set and a validation set. In order to verify its applicability and robustness to the task of physiological signal segment analysis, proportional division is performed based on independent individuals.
[0046] The specific process of step 2 is as follows: Step 2.1, design a feature extraction module to achieve adaptive noise reduction and extract temporal features. First, adaptive noise reduction is performed by using deep residual shrinkage networks (DRSNs); then, multi-scale convolutional attention (MSCA) (such as Figure 3As shown in the figure, rich semantic information is extracted from multiple perspectives to enhance the model's temporal feature extraction capability; finally, stacking multiple layers of convolution + ReLU modules (CRL) reduces the sequence length and reduces the amount of computation.
[0047] Step 2.1.1, the deep residual contraction network is an improvement on the deep residual network. It mainly filters out noise in the features by designing a soft threshold as a contraction layer in the residual module. The soft threshold formula is:
[0048]
[0049] In formula (1), τ is a soft threshold and is a positive number, z k is the input feature data, f(z k ) is the output feature. Through soft thresholding, the input feature data is shrunk to 0 as much as possible to achieve the effect of noise reduction. At this time, the denoised feature is defined as z nr .
[0050] To achieve soft thresholding of feature sequences, the DRSN module designs a contraction layer based on a residual network. This contraction layer first performs global average pooling (GAP) and takes the absolute value of the feature sequence. The threshold is then automatically learned through a neural network consisting of a fully connected layer, batch normalization, ReLU, and sigmoid activation function.
[0051] Step 2.1.2, next we will denoise the feature z nr Input to multi-scale convolutional attention (such as Figure 3 As shown in Figure 2, the model extracts rich semantic information from multiple perspectives to enhance the model's temporal feature extraction capability. The model first captures RRI and RA sequence features from different perspectives through a parallelized multi-scale feature extractor consisting of four convolutions + ReLU and a pooling. Figure 3 Here, CRL represents the combination of one-dimensional convolution and ReLU activation function, MaxPool1D represents the maximum pooling on one-dimensional data, K represents the convolution kernel size, S represents the stride length, IC represents the number of input channels, and OC represents the number of output channels. Subsequently, the extracted multi-scale features are concatenated and SENet is used to perform adaptive weight calculation on the channel dimension for features at different scales. The degree of attention is allocated according to the weight size, so that the model has the ability to adaptively select features. Finally, a convolutional neural network with a convolution kernel of 7 and a stride length of 2 is used to reduce the sequence length and reduce the amount of model calculation. At this point, the enhanced time series feature is defined as z MSCA .
[0052] Step 2.1.3, finally, feature Z MSCAThe four-layer CRL is used to reduce the sequence length and computational complexity, and the feature F is obtained.
[0053] Step 2.2, design the time-frequency information fusion module (such as Figure 2 Time-Frequency Information Fusion (TFIF) achieves the fusion of time and frequency domain information. This module first uses Scalable Position Encoding (SPE) to dynamically add position information to ensure the order of the time series. It then uses a Transformer architecture consisting of an Adaptive Pruned Time-Frequency Fusion Attention Module (APTFFA) and a Multi-Scale MLP (MSM) to complete the fusion of time and frequency domain information, as well as the integration of channel information.
[0054] In step 2.2.1, the temporal features F obtained by the feature extraction module are input into the SPE module to obtain the dynamic position information of the features to ensure the order of the time series. The expandable position encoding formula is as follows:
[0055] ψ=DWConv(F)×F (2)
[0056] In formula (2), ψ represents the feature after dynamic position encoding, DWConv is the depthwise convolution, and F is the time series feature after feature extraction. In addition, LayerNorm is used to normalize the features to ensure the stability of data feature distribution and accelerate model convergence.
[0057] In step 2.2.2, in order to make full use of the time domain and frequency domain information to remove the redundant tokens in each domain, an adaptive pruning time-frequency information fusion attention module is designed (such as Figure 4 This module consists of a time-frequency information fusion attention module (TFFA) and an adaptive pruning module (APM). The TFFA, composed of time-domain self-attention and frequency-domain self-attention, calculates feature information for each domain and uses a gating mechanism to achieve interaction between time and frequency domain information. The adaptive pruning module is responsible for removing redundant information to improve model detection performance.
[0058] like Figure 4 As shown in (a), the temporal self-attention first extracts the temporal information of the input feature ψ through a cascade convolution module (Cascade Conv) with expansion factors of (1, 2, 4), and generates and As shown in formulas (3) to (5). t and K tPerform dot product operation to obtain attention score, and normalize and probabilize the attention score through Softmax activation function. To prevent the Softmax gradient from being too small to update the parameters, Q t and K t The dot product is scaled by the scaling factor The calculation process is shown in formula (6). Finally, the weight of each Token in V is assigned according to the attention score matrix. The time domain attention result is defined as
[0059]
[0060]
[0061] V=ψ×W v (5)
[0062]
[0063] In formulas (3) to (6), Represent different linear matrices. t is the time domain query feature, K t is the time domain query feature, K f is the frequency domain query feature, V is the content feature, n is the number of tokens, d t and d k This is the Token dimension. is the scaling factor.
[0064] like Figure 4 As shown in (a), the frequency domain self-attention first uses the Welch method to obtain the power spectral density (PSD) of the input feature sequence ψ as the input frequency domain information. Then, the frequency domain features are extracted by 1D convolution to generate Secondly, Q f With K f Perform dot product to obtain attention score, and activate it through Softmax function and The attention scores are normalized and probabilized. Finally, the shared V is weighted from the perspective of the frequency domain. The frequency domain self-attention result is defined as The formula is as follows:
[0065] W f =Welch(ψ) (7)
[0066]
[0067]
[0068] In formulas (7) to (9), Q fis the frequency domain query feature, d f and d t is the dimension of Token, They represent different linear matrices respectively.
[0069] Finally, in order to complete the fusion of time domain and frequency domain information, the time domain information is controlled by the gating mechanism. and frequency domain information The proportion of , thus achieving a balanced state of information fusion. At this time, the balanced attention feature is defined as attn. The calculation formula is as follows:
[0070]
[0071] In formula (10), λ is the proportion of hyperparameter control domain information.
[0072] Since the model will have some invalid information in each domain that interferes with the detection performance of the model during the time-frequency information fusion process, this is called redundant token. These redundant tokens are the tokens whose sum of the rows of the attention score matrix is 0 after the dot product operation of Q and K. Although the sum of the tokens is 0, the existence of Softmax will still affect the self-attention operation, causing unnecessary calculations to the model and reducing the model performance. For this reason, this paper designs an adaptive pruning module (such as Figure 4 (a) shows that the pruning threshold is obtained by passing Q through convolution and Sigmoid. The CSENet module composed of GAP, CRL and CS is responsible for calculating the importance score of each token and assigning a weight to Q by multiplication. Finally, the number of pruning is determined by comparing the generated pruning threshold with the token score, and redundant tokens below the pruning threshold are removed by sorting according to the token score. In the subsequent calculations, in order to ensure the sequence structure, the redundant tokens are replaced by the mean of V. At this time, the token selected for subsequent attention is defined as Q select Where V is the content feature. The calculation formula is as follows:
[0073] Thresold=CS(Q) (11)
[0074] Q score =CS(CRL(GAP)) (12)
[0075] Q CA =Q×Q score (13)
[0076] number=sum((Q score -Thresold)>0) (14)
[0077] index=Topk(Q score ,number) (15)
[0078] Q select =Q CA [index] (16)
[0079] In formulas (11) to (16), Q is the query feature, CS is composed of convolution and Sigmoid activation function, GAP is global average pooling, and CRL is composed of convolution and ReLU activation function. The purpose of using convolution instead of fully connected layer is to reduce the amount of calculation. Thresold represents the pruning threshold, number represents the number of tokens to be saved, and index represents the number of selected Q. score The first number of Token sequences after sorting, Q CA represents Q after weighted assignment, Q select Represents the token that chooses to participate in the self-attention calculation.
[0080] In order to make full use of the time-frequency fusion global information extracted by the APTFFA module, a multi-scale MLP (such as Figure 4 (b) to integrate channel information. The entire module first extracts local information from attn through 1×1 convolution to obtain (i=0,1,2,3). Then Divide into four equal parts, Direct mapping is performed without any operations. The remaining features are extracted through deep convolution (DWConv), and then information interaction is performed using dot products. Finally, the four parts are spliced together and channel information is integrated through 1×1 convolution and SENet. The feature information at this time is defined as MSM. The formula is as follows:
[0081]
[0082]
[0083] In formula (17) and formula (18), σ is the Sigmoid activation function, f 1×1 Represents a convolution operation with a convolution kernel of 1, SE represents SENet, (i=0, 1, 2, 3) represents each divided feature subset, and M represents the features extracted by deep convolution of different feature subsets.
[0084] The calculation formula of the time-frequency information fusion module obtained through the above description is as follows:
[0085] ψ'=APTFFA(Norm(ψ))+ψ (19)
[0086] ψ”=MSM(Norm(ψ'))+ψ' (20)
[0087] In formula (19) and formula (20), APTFFA is the self-pruning time-frequency fusion attention module, Norm is LayerNorm, ψ' is the feature after completing the time-frequency information fusion, and ψ" is the feature after completing the channel information extraction and dimensionality transformation after the time-frequency information fusion.
[0088] Step 2.3, finally, the classification module is used to classify sleep apnea events based on the time-frequency information fusion module feature ψ" output in step 2.2. The classification module consists of average pooling (Avgpool), fully connected layer (FC) and softmax activation function. The predicted value of physiological signal segment classification is obtained through the above modules. The formula is as follows:
[0089]
[0090] In step 3, the cross entropy loss function (see formula (22)) is used to constrain the results of the training network. The process is shown in formula (23), where N is the number of samples, y i represents the label of sample i, p i It represents the probability that sample i is predicted to be a positive class, and y is the incoming label, which is the index value of a certain category.
[0091]
[0092]
[0093] Example 3
[0094] To obtain optimal results and ensure model reproducibility, the hyperparameter settings are shown in Table 1. Among them, the hyperparameter settings include ECG channel (ECG Channel) is 1, the length of each segment (Per-segement Length) is 60s, the learning rate (Learning Rate) is 1e-3, the decay rate (wd) is 1e-4, the number of Transformer layers (L) is 1, the number of APTFFA heads is 4, λ is set to 0.3, Epoch is the number of iterations (here set to 100), the batch size (Batchsize) is 64, and the optimizer (Optimizer) is Adam.
[0095] Table 1
[0096] Hyperparameters Value ECGChannel 1 Per-segmentLength 60s LearningRate(lr) 1e-3 wd 1e-4 L 1 APTFFAHeads 4 λ 0.3 Epoch 100 BatchSize 64 Optimizer Adam
[0097] The comparative experimental results on the Apnea-ECG dataset are shown in Table 2 below. It is not difficult to find that compared with other methods based on machine learning and deep learning, the present invention can achieve better results without complex feature engineering and complex processing methods on the original signal. It can better balance various evaluation indicators (including accuracy Acc, sensitivity Sen, specificity Spec and F1 score) and obtain higher accuracy and specificity.
[0098] Table 2
[0099]
[0100]
Claims
1. A physiological signal segment analysis method based on time-frequency information fusion and attention, characterized by: The specific steps include: Step 1: input the original ECG signal in the public dataset, perform preprocessing on the original ECG signal and divide it into a training set and a test set; The process of preprocessing the original ECG signal in step 1 is: segmentation, filtering, R peak detection and RR interval and R peak amplitude extraction, linear interpolation and channel splicing to obtain a time series z; Step 2: constructing a physiological signal segment analysis model based on Transformer time-frequency information fusion; in step 2, the physiological signal segment analysis model based on Transformer time-frequency information fusion includes a feature extraction module, a time-frequency information fusion module, and a classification module; The feature extraction module includes a deep residual shrinkage network, a multi-scale convolutional attention module and a multi-layer convolution + ReLU module; The time-frequency information fusion module includes a Transformer architecture consisting of an extensible position encoding module, an adaptive pruned time-frequency information fusion attention module, and a multi-scale MLP; The classification module includes average pooling, fully connected layers and Softmax activation function; Step 2.1: Design the feature extraction module to achieve adaptive noise reduction and extract time series features, specifically: Step 2.1.1, the deep residual contraction network is an improvement of the deep residual network. By designing a soft threshold as a contraction layer in the residual module, the noise in the feature is filtered out. The soft threshold formula is: (1) In formula (1), is a soft threshold and is a positive number, To input feature data, To output features, the denoised features are defined as ; Step 2.1.2, the denoised features The input is sent to the multi-scale convolution attention module, and the RRI and RA sequence features are captured from different perspectives through a parallel multi-scale feature extractor composed of four convolutions + ReLU and a pooling. The extracted multi-scale features are spliced and the SENet is used to calculate the adaptive weights of the features at different scales in the channel dimension. The degree of attention is allocated according to the weight size, and the convolutional neural network is used to reduce the sequence length and reduce the model calculation amount. The enhanced time series features are defined as ; Step 2.1.3, the features By reducing the sequence length and computational complexity through the four-layer convolution + ReLU module, feature F is obtained; Step 2.2: Design the time-frequency information fusion module, specifically: Step 2.2.1: Input the feature F obtained by the feature extraction module into the scalable position coding module to obtain the feature dynamic position information to ensure the order of the time series. The scalable position coding formula is as follows: (2) Where, Represents the features after dynamic position encoding, DWConv is depth convolution; Step 2.2.2, design the adaptive pruning time-frequency information fusion attention module, which consists of the time-frequency fusion attention module and the adaptive pruning module; The time domain information of the features is extracted through the cascade convolution modules with expansion factors of (1, 2, 4) and generated 、 、 and , n is the number of tokens, and is the Token dimension, as shown in formulas (3) to (5); and Perform dot product operation to obtain the first attention score, and normalize and probabilize the first attention score through the Softmax activation function. The calculation process is shown in formula (6); According to the first attention score matrix, each token in the content feature is weighted, and the temporal attention result is defined as : (3) (4) (5) (6) In formulas (3)~(6), Represent different linear matrices, is the time domain query feature, is the time domain queried feature, is the queried feature in the frequency domain, For content features, is the scaling factor; The input feature sequence The power spectral density is obtained as the frequency domain information of the input through the Welch method; the frequency domain features are extracted through 1D convolution to generate ;Will and Perform dot product to obtain the second attention score, and pass it through the Softmax activation function and Normalize and probabilize the second attention score; assign weights to the shared content features from the perspective of the frequency domain. The frequency domain attention result is defined as , the formula is as follows: (7) (8) (9) In formulas (7)~(9), is the frequency domain query feature, and is the dimension of Token, 、 Represent different linear matrices respectively; Controlled by a gating mechanism and The proportion is used to achieve a balanced state of information fusion. At this time, the balanced attention feature is defined as attn, and the calculation formula is as follows: (10) In formula (10), is the proportion of hyperparameter control domain information; Pass attn Convolution extracts local information , then on the channel Divide into four equal parts, Direct mapping is performed without any operation, and the remaining features are extracted through deep convolution, and then information interaction is performed using dot product; finally, the four parts are spliced together, and channel information integration is completed through 1×1 convolution and SENet. At this time, the feature information is defined as , the formula is as follows: (11) (12) In formula (11) and formula (12), is the Sigmoid activation function, Represents a convolution operation with a convolution kernel of 1, SE represents SENet, Represents each feature subset divided, and M represents the features extracted by deep convolution of different feature subsets; The calculation formula of the time-frequency information fusion module obtained through the above description is as follows: (13) (14) In formula (13) and formula (14), is the self-pruning time-frequency information fusion attention module, Norm is normalization, To complete the features after time-frequency information fusion, It is the feature to complete channel information extraction and dimension transformation after time-frequency information fusion; Step 2.3: The classification module integrates the features of the module based on the time-frequency information output from step 2.
2. To classify sleep apnea events, the following formula (15) is used to obtain the predicted value y ̂ of the sleep apnea event physiological signal classification: (15) In step 3, the model constructed in step 2 is trained using the training set processed in step 1. During the training process in step 3, the model constructed in step 2 is constrained using the cross entropy loss function, i.e., the following formula (16): (16) Where N is the number of samples, represents the label of sample i, Indicates the probability that sample i is predicted to be positive; In step 4, the test set ECG signal preprocessed in step 1 is fed into the model trained in step 3, and the classification detection result is finally output.
Citation Information
Patent Citations
Staging regulation and control method based on physiological state evaluation
CN112353401A
Adaptive pruning model compression algorithm based on grouping attention mechanism
CN114118402A
Automatic sleep staging method based on time sequence multi-scale mixed attention model
CN114129138A