A deep compressed sensing method for ECG signals
By using continuous convolutional layer and multi-scale feature extraction module in the depth compression perception of ECG signals, the problem of insufficient performance at low sampling rates is solved, efficient compression and recovery of ECG signals is achieved, and sampling performance and signal noise are significantly improved. Compare.
Patent Information
- Application Number
- CN202210858765.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-21
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2042-07-21
AI Technical Summary
The existing electrocardiogram depth compression sensing methods have insufficient performance at low sampling rates, making it difficult to effectively improve sampling performance.
Using a deep compression perception method including a measurement module, an initial reconstruction module and a final reconstruction module, signal compression and reconstruction are performed through continuous convolutional layers, combining LeakyReLU activation function, improved Inception block and LSTM layer to perform multi-scale feature extraction and signal recovery. .
It significantly improves the performance of deep compression perception of ECG signals at low sampling rates, achieves lower reconstruction errors and higher signal-to-noise ratios, ensuring accurate signal recovery and diagnostic quality.
Smart Images

Figure CN115399780B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of deep compressed sensing, and in particular to a method for deep compressed sensing of electrocardiogram signals. Background Art
[0002] Real-time monitoring of ECG signals is a technical means of medical diagnosis, used to detect various arrhythmias. However, the monitoring of ECG signals is usually long-term and multi-lead, with a large amount of data. Data transmission and data storage require a large storage space, and the energy consumption required for transmission is also large. The use of deep compressed sensing technology can use the deep learning framework to downsample the ECG signal according to the required sampling rate to obtain the measurement value, reduce data redundancy, and then transmit the data. After receiving the compressed signal at the signal receiving end, the deep learning framework is used to recover the signal and use it for arrhythmia detection. This not only reduces energy consumption, but also ensures the accuracy of data used for clinical diagnosis.
[0003] The deep compressed sensing framework is similar to the deep learning framework for classification tasks. The parameters of the network are learned through back propagation. The difference is that the labels of the deep learning framework are not category labels, but original signals. In the existing deep compressed sensing methods of ECG signals, there is a problem of insufficient sampling performance, especially the performance at low sampling rates needs to be further improved. Summary of the invention
[0004] In order to solve the problems raised in the above background technology, the purpose of the present invention is to provide a method for deep compression sensing of electrocardiogram signals.
[0005] To achieve the above object, the technical solution adopted by the present invention is:
[0006] A deep compression sensing method for electrocardiogram signals comprises the following steps:
[0007] S1, establishing a training model, which includes a measurement module, an initial reconstruction module and a final reconstruction module, obtaining an initial ECG signal, and preprocessing the initial ECG signal;
[0008] S2, inputting the ECG signal preprocessed in step S1 into a measurement module, and compressing the signal using a continuous convolution layer in the measurement module to obtain a measurement value;
[0009] S3, inputting the measured value obtained in step S2 into the initial reconstruction module for processing to obtain a preliminarily restored ECG signal;
[0010] S4, inputting the ECG signal initially restored in step S3 into the final reconstruction module for processing to obtain a final reconstructed ECG signal.
[0011] In some embodiments, in step S1, the step of preprocessing the initial ECG signal specifically includes:
[0012] The initial ECG signal is normalized according to the following formula:
[0013]
[0014] In the formula, x represents the initial ECG signal, which includes 256 sampling points, min(x) and max(x) represent the maximum and minimum values of the initial signal respectively. Represents the normalized ECG signal.
[0015] In some embodiments, in step S2, the signal obtained in step S1 is processed using a continuous convolutional layer. The compression process specifically includes the following steps:
[0016] S21, first passes through the first convolution layer, whose convolution kernel size is 1×4, step size is 4, input channel is 1, and output channel is After the first convolutional layer, the dimension is The feature map of
[0017] S22, then passes through the second convolution layer, whose convolution kernel size is 1×4, the step size is 4, and the input channel is The output channel is After the second convolutional layer, the dimension is The feature map of
[0018] S23, finally passes through the third convolution layer, whose convolution kernel size is 1×4, the step size is 4, and the input channel is The output channel is After the third convolutional layer, the dimension is The characteristic diagram is obtained by , and the output signal is the measured value y.
[0019] In some embodiments, in step S2, the preset sampling rate is 0.05, 0.1, 0.2, 0.3, 0.4, 0.5 or 0.6.
[0020] In some embodiments, step S3 specifically includes the following steps:
[0021] S31, firstly reconstruct the measured value y obtained in step S2, through a convolution kernel of 1×1, a step size of 1, and an input channel of The convolutional layer with 64 output channels obtains a feature map with a dimension of 1×4×64, which is then processed through a LeakyReLU activation function layer;
[0022] S32, then, the signal is reshaped to obtain a feature map with a dimension of 1×256×1, that is, the initially restored ECG signal x is obtained. initial .
[0023] In some embodiments, step S4 specifically includes the following steps:
[0024] S41, the signal x obtained in step S3 initial First, it passes through a convolution layer with a convolution kernel of 1×11, a stride of 1, zero padding, an input channel of 1, and an output channel of 16, and then is processed by the LeakyReLU activation function to obtain a feature map with a dimension of 1×256×16;
[0025] S42, inputting the feature map obtained in step S41 into the improved Inception block for processing to obtain a feature map with a dimension of 1×125×64;
[0026] S43, input the feature map obtained in step S42 into a convolution layer with a convolution kernel of 1×11, a step size of 1, zero padding, 64 input channels, and 1 output channel, and then process it through a LeakyReLU activation function to obtain a feature map with a dimension of 1×256×1;
[0027] S44, input the feature map obtained in step S43 into the LSTM layer, and then pass it through the Tanh activation function to obtain a feature map with an output dimension of 1×250×1;
[0028] S45, inputting the feature map obtained in step S44 into a linear layer to linearly map it to a feature map with a dimension of 256;
[0029] S46, reshape the feature map obtained in step S45, and transform the dimension of the feature map into 1×256×1, so as to obtain the final reconstructed ECG signal x final .
[0030] In some embodiments, in step S42, the improved Inception block includes four parallel convolution lines, each line corresponds to a convolution layer with convolution kernels 1×7, 1×9, 1×11, and 1×13, a step size of 1, zero padding, 16 input channels, and 16 output channels, and each convolution line adopts a residual structure;
[0031] Each convolution line is represented by the following formula:
[0032]
[0033] Where n = 1, 2, 3, 4, and represents the input and output of the nth convolution line, and represents the first and second convolutions in the nth line, and σ represents the LeakyReLU activation function;
[0034] After obtaining the output of four convolution lines, the feature maps are concatenated to obtain a feature map with a dimension of 1×125×64.
[0035] In some embodiments, in step S1, when establishing a training model, training parameters are set, the network is trained using a loss function, and iterative training is performed to obtain parameters of the training model.
[0036] Compared with existing algorithms, the deep compressed sensing method for ECG signals provided by the present invention can greatly improve the performance of deep compressed sensing of ECG signals at low sampling rates. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 A flow chart of the deep compression sensing method for ECG signals provided by the present invention;
[0038] Figure 2a and Figure 2b A performance comparison diagram of the method provided by the present invention and the method in the prior art
[0039] Figure 3 The figure is a comparison diagram between the signal reconstructed by the method provided by the present invention and the original signal. DETAILED DESCRIPTION
[0040] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the following further describes how the present invention is implemented in conjunction with the accompanying drawings and specific implementation methods.
[0041] Reference Figure 1 As shown, the present invention provides a method for deep compression sensing of electrocardiogram signals, comprising the following steps:
[0042] S1, establishing a training model, which includes a measurement module, an initial reconstruction module and a final reconstruction module, obtaining an initial ECG signal, and preprocessing the initial ECG signal;
[0043] S2, inputting the ECG signal preprocessed in step S1 into a measurement module, and compressing the signal using a continuous convolution layer in the measurement module to obtain a measurement value;
[0044] S3, inputting the measured value obtained in step S2 into the initial reconstruction module for processing to obtain a preliminarily restored ECG signal;
[0045] S4, inputting the ECG signal initially restored in step S3 into the final reconstruction module for processing to obtain a final reconstructed ECG signal.
[0046] In step S1, when establishing a training model, set the training parameters, use the loss function to train the network, and perform iterative training to obtain the parameters of the training model. In a specific embodiment, 16,000 ECG signals with a length of 256 sampling points can be uniformly selected from the ECG signal data set as the training set. During training, the Adam optimizer can be used, the initial learning rate is 0.0005, the first and second momentum decays are 0.9 and 0.999, the batch size is 32, and the mean square error between the training output and the average value is used as the loss function of the model. The network is trained using back propagation and gradient descent methods, and a total of 200 rounds of training are performed.
[0047] Preferably, in step S1, the step of preprocessing the initial ECG signal specifically includes:
[0048] The initial ECG signal is normalized according to the following formula:
[0049]
[0050] In the formula, x represents the initial ECG signal, which includes 256 sampling points, min(x) and max(x) represent the maximum and minimum values of the initial signal respectively. Represents the normalized ECG signal.
[0051] The present invention performs normalization processing on the signal so that the network can converge stably. Since the training model parameters are trained by back propagation and gradient descent, according to back propagation, if the value of the input layer is too large, then the gradient of back propagation will be very large, and when the learning rate is determined, the optimal point may not be found. In the present invention, the input data is normalized, and the range of the data value is limited to between 0 and 1, so the learning rate can be easily determined to avoid the situation where the gradient is too large.
[0052] Preferably, in step S2, the signal obtained in step S1 is subjected to continuous convolutional layers. The compression process specifically includes the following steps:
[0053] S21, first passes through the first convolution layer, whose convolution kernel size is 1×4, step size is 4, input channel is 1, and output channel is After the first convolutional layer, the dimension is The feature map of
[0054] S22, then passes through the second convolution layer, whose convolution kernel size is 1×4, the step size is 4, and the input channel is The output channel is After the second convolutional layer, the dimension is The feature map of
[0055] S23, finally passes through the third convolution layer, whose convolution kernel size is 1×4, the step size is 4, and the input channel is The output channel is After the third convolutional layer, the dimension is The characteristic diagram is obtained by , and the output signal is the measured value y.
[0056] Preferably, in step S2, the preset sampling rate is 0.05, 0.1, 0.2, 0.3, 0.4, 0.5 or 0.6.
[0057] In traditional compressed sensing, the original signal is multiplied by the sampling matrix to obtain the measured value. However, the present invention adopts a different solution, using continuous convolution to simulate the sampling process. The dimension of the feature map output by the compression in the present invention is The total number of sampling points is The number of sampling points is consistent with that in traditional compressed sensing. In step S2, according to the given sampling rate, the required number of channels is calculated and rounded, and a convolution operation is performed to perform sampling adaptively.
[0058] Preferably, step S3 specifically includes the following steps:
[0059] S31, firstly reconstruct the measured value y obtained in step S2, through a convolution kernel of 1×1, a step size of 1, and an input channel of The convolutional layer with 64 output channels obtains a feature map with a dimension of 1×4×64, which is then processed through a LeakyReLU activation function layer;
[0060] S32, then, the signal is reshaped to obtain a feature map with a dimension of 1×256×1, that is, the initially restored ECG signal x is obtained. initial .
[0061] Since the dimensions of the resulting measurements are However, the final output should have the same dimension as the original data, so the signal dimension needs to be changed to 1×256×1 through convolution and dimension reshaping operations. Therefore, the initial reconstruction module is used for processing in step S3.
[0062] Preferably, step S4 specifically includes the following steps:
[0063] S41, the signal x obtained in step S3 initial First, it passes through a convolution layer with a convolution kernel of 1×11, a stride of 1, zero padding, an input channel of 1, and an output channel of 16, and then is processed by the LeakyReLU activation function to obtain a feature map with a dimension of 1×256×16;
[0064] S42, inputting the feature map obtained in step S41 into the improved Inception block for processing to obtain a feature map with a dimension of 1×125×64;
[0065] S43, input the feature map obtained in step S42 into a convolution layer with a convolution kernel of 1×11, a step size of 1, zero padding, 64 input channels, and 1 output channel, and then process it through a LeakyReLU activation function to obtain a feature map with a dimension of 1×256×1;
[0066] S44, input the feature map obtained in step S43 into the LSTM layer, and then pass it through the Tanh activation function to obtain a feature map with an output dimension of 1×250×1;
[0067] S45, inputting the feature map obtained in step S44 into a linear layer to linearly map it to a feature map with a dimension of 256;
[0068] S46, reshape the feature map obtained in step S45, and transform the dimension of the feature map into 1×256×1, so as to obtain the final reconstructed ECG signal x final .
[0069] Preferably, in step S42, the improved Inception block includes four parallel convolution lines, each line corresponds to a convolution layer with convolution kernels 1×7, 1×9, 1×11, and 1×13, a step size of 1, zero padding, 16 input channels, and 16 output channels, and each convolution line adopts a residual structure;
[0070] Each convolution line is represented by the following formula:
[0071]
[0072] Where n = 1, 2, 3, 4, and represents the input and output of the nth convolution line, and represents the first and second convolutions in the nth line, and σ represents the LeakyReLU activation function;
[0073] After obtaining the output of four convolution lines, the feature maps are concatenated to obtain a feature map with a dimension of 1×125×64.
[0074] In step S4, the LeakyReLU activation function is used instead of the ReLU activation function. This is because when the input is a negative value, the output of the ReLU activation function is 0, which may result in the parameters not being updated. In order to avoid this phenomenon, the LeakyReLU activation function is used in the present invention.
[0075] In addition, in step S4, convolution operations all select convolution kernels larger than 1×7, because a larger convolution kernel means a larger receptive field, and better global features can be obtained through convolution. An improved Inception module is used, and four convolution lines with different convolution kernel sizes are designed to run in parallel to extract features under different receptive fields, which promotes cross-channel information interaction and integration, and adds residual connections to avoid network degradation without increasing the computational complexity of the network, thereby improving reconstruction performance. The LSTM layer can effectively avoid the occurrence of gradient vanishing and gradient explosion, and can more effectively process long sequence time series signals. Compared with RNN, it can overcome the long-term dependency problem.
[0076] Finally, the effect of the present invention is verified by combining the test results in a specific embodiment.
[0077] PRD (percentage root mean square error) and SNR (signal-to-noise ratio) are used to evaluate the model. PRD is the percentage of error between the reconstructed signal and the original signal. The smaller the PRD, the better the model performance. SNR is a measure of the degree of similarity between the reconstructed signal and the original signal. The larger the SNR, the better the model performance. PRD above 9% indicates poor reconstruction performance, 2%-9% indicates good reconstruction performance, and below 2% indicates very good reconstruction performance.
[0078] In order to verify the effect of the present invention, 16,000 ECG signals with a length of 256 sampling points were uniformly selected from the records 103, 105, 106, 108, 112, 113, 114, 116, 121, 122, 210, 212, 213, 214, 215, 217, 219, 220, 221, and 222 of the MIT-BIH arrhythmia database as a training set, and 4,000 signals of the same length were uniformly selected from the records 100, 101, 107, 109, and 117 as a test set. And compared with various existing compressed sensing methods, the existing methods are: block sparse Bayesian algorithm (BSBL-BO), orthogonal matching pursuit algorithm (OMP), subspace pursuit algorithm (SP), CSNet model algorithm (CSNet), and convolutional autoencoder algorithm (CAE). The method provided by the present invention is represented by (proposed). The comparison results are shown in Table 1:
[0079] Table 1 Average PRD and SNR of different methods at different sampling rates of MIT-BIH arrhythmia database
[0080]
[0081]
[0082] According to Table 1, Figure 2a and Figure 2b , Figure 2a It is a PRD trend chart, with the horizontal axis being the sampling rate SR and the vertical axis being the PRD; Figure 2b It is an SNR trend graph, with the horizontal axis being the sampling rate SR and the vertical axis being the SNR. It can be seen that the method provided by the present invention obtains the lowest PRD and the highest SNR at all experimental sampling rates, and the reconstruction performance is the best. The PRD trend graph corresponding to the method provided by the present invention is the flattest, lower than all other comparison methods, and the SNR is also higher than other methods. When the sampling rate of the method provided by the present invention is 0.4, the PRD is 1.32%, which is less than 2%, achieving "very good" reconstruction performance.
[0083] Figure 3 The reconstructed visual effect diagram of the method provided by the present invention is shown. The two curves in the figure are the original signal and the reconstructed signal respectively. It can be seen that since the method obtains the lowest PRD and the highest SNR, the matching degree of its peaks is very high and the reconstruction performance is the best.
[0084] The above experimental results show that compared with other comparison methods, the reconstruction error of this method is the smallest, and the peak of the reconstructed signal is closest to the original signal, showing the best reconstruction performance.
[0085] In summary, the deep compressed sensing method of ECG signal provided by the present invention first preprocesses the signal to make the signal easy to train, and then compresses and samples the signal to obtain the measurement value through continuous sequence convolution, and reshapes the measurement value through convolution and dimension to become the initial reconstructed signal of the same dimension as the original signal, and finally extracts the signal features at multiple scales and reconstructs it through the improved Inception block and LSTM in the final reconstruction module. The experimental results show that compared with the selected traditional compressed sensing method and deep compressed sensing method, the reconstruction effect of the method provided by the present invention is the best, with the highest SNR and the lowest PRD, and can maintain a relatively good sampling performance at a low sampling rate.
[0086] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A deep compression sensing method for electrocardiogram signals, characterized in that: The steps include: S1, establishing a training model, which includes a measurement module, an initial reconstruction module and a final reconstruction module, obtaining an initial ECG signal, and preprocessing the initial ECG signal; S2, inputting the ECG signal preprocessed in step S1 into a measurement module, and compressing the signal using a continuous convolution layer in the measurement module to obtain a measurement value; S3, inputting the measured value obtained in step S2 into the initial reconstruction module for processing to obtain a preliminarily restored ECG signal; S4, inputting the ECG signal initially restored in step S3 into the final reconstruction module for processing to obtain a final reconstructed ECG signal; In step S2, the signal obtained in step S1 is processed using a continuous convolutional layer. The compression process specifically includes the following steps: S21, first passes through the first convolution layer, whose convolution kernel size is 1×4, stride is 4, input channel is 1, and output channel is After the first convolutional layer, the dimension is The feature map of S22, then passes through the second convolution layer, whose convolution kernel size is 1×4, the step size is 4, and the input channel is The output channel is After the second convolutional layer, the dimension is The feature map of S23, finally passes through the third convolution layer, whose convolution kernel size is 1×4, the step size is 4, and the input channel is The output channel is After the third convolutional layer, the dimension is The characteristic diagram of , and the output signal is the measured value y; Step S3 specifically includes the following steps: S31, firstly reconstruct the measured value y obtained in step S2, through a convolution kernel of 1×1, a step size of 1, and an input channel of The convolutional layer with 64 output channels obtains a feature map with a dimension of 1×4×64, which is then processed through a LeakyReLU activation function layer; S32, then, the signal is reshaped to obtain a feature map with a dimension of 1×256×1, that is, the initially restored ECG signal x is obtained. initial ; Step S4 specifically includes the following steps: S41, the signal x obtained in step S3 initial First, it passes through a convolution layer with a convolution kernel of 1×11, a stride of 1, zero padding, an input channel of 1, and an output channel of 16, and then is processed by the LeakyReLU activation function to obtain a feature map with a dimension of 1×256×16; S42, inputting the feature map obtained in step S41 into the improved Inception block for processing to obtain a feature map with a dimension of 1×125×64; S43, input the feature map obtained in step S42 into a convolution layer with a convolution kernel of 1×11, a step size of 1, zero padding, 64 input channels, and 1 output channel, and then process it through a LeakyReLU activation function to obtain a feature map with a dimension of 1×256×1; S44, input the feature map obtained in step S43 into the LSTM layer, and then pass it through the Tanh activation function to obtain a feature map with an output dimension of 1×250×1; S45, inputting the feature map obtained in step S44 into a linear layer to linearly map it to a feature map with a dimension of 256; S46, reshape the feature map obtained in step S45, and transform the dimension of the feature map into 1×256×1, so as to obtain the final reconstructed ECG signal x final ; In step S42, the improved Inception block includes four parallel convolution lines, each line corresponds to a convolution layer with convolution kernels 1×7, 1×9, 1×11, and 1×13, a step size of 1, zero padding, 16 input channels, and 16 output channels, and each convolution line adopts a residual structure; Each convolution line is represented by the following formula: Where n = 1, 2, 3, 4, and represents the input and output in the nth convolution line, and represents the first and second convolutions in the nth line, and σ represents the LeakyReLU activation function; After obtaining the outputs of the four convolutional lines, the feature maps are concatenated to obtain a feature map with a dimension of 1×125×64.
2. The method for deep compression sensing of electrocardiogram signals according to claim 1, characterized in that: In step S1, the step of preprocessing the initial ECG signal specifically includes: The initial ECG signal is normalized according to the following formula: In the formula, x represents the initial ECG signal, which includes 256 sampling points, min(x) and max(x) represent the maximum and minimum values of the initial signal respectively. Represents the normalized ECG signal.
3. The method for deep compression sensing of electrocardiogram signals according to claim 2, characterized in that: In step S2, the preset sampling rate is 0.05, 0.1, 0.2, 0.3, 0.4, 0.5 or 0.
6.
4. The method for deep compression sensing of electrocardiogram signals according to claim 1, characterized in that: In step S1, when establishing a training model, training parameters are set, the network is trained using a loss function, and iterative training is performed to obtain parameters of the training model.
