Electrocardiogram signal quality evaluation method based on autoencoder
By using an autoencoder to encode and decode ECG signals and perform quality assessment, the problem of accurate identification of ECG signals in complex noisy environments is solved, and adaptive continuous quality evaluation and efficient signal quality assessment are achieved.
Patent Information
- Application Number
- CN202310313430.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-28
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2043-03-28
AI Technical Summary
Existing methods for assessing ECG signal quality struggle to accurately identify ECG signals and noise in complex, noisy environments, and traditional deep learning methods are unable to build stable and universal quality assessment models for different scenarios.
An autoencoder is used to perform multi-layer filtering preprocessing on the electrocardiogram signal, which is then segmented into fixed-length segments and signal points are selected. The general laws of the signal are learned through the autoencoder model, and the unreliability and quality score of the signal are calculated. Encoding and decoding are performed using convolutional neural networks and transposed convolutions, and a loss function based on the log-likelihood function is constructed to evaluate the signal quality.
It enables adaptive continuous quality assessment of ECG signals in complex noisy environments, improves assessment accuracy and robustness, avoids the limitations of binary or multi-class classification in traditional methods, and provides rich quality feedback information.
Smart Images

Figure CN116350233B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of signal quality evaluation, and more particularly to an electrocardiosignal quality evaluation method based on a self-encoder. BACKGROUND
[0002] With the wide application of wearable and handheld products embedded with sensors, quality evaluation is an indispensable important link in the process of sensor signal data processing. For wearable and handheld ECG acquisition devices / products, it is possible to record long-term dynamic electrocardiosignal, which makes up for the deficiency that traditional electrocardiogram can only be collected in a short period and in a resting state. However, due to the fact that the collection environment cannot meet the medical requirements, complex noise is inevitable. In addition, electrocardiosignal is a complex and weak signal, which is easily affected by various noises. For example, in the handheld or wrist-wearing scenario, electrocardiosignal is easily affected by electromyography and motion noise, resulting in a decrease in the detection accuracy of subsequent functions based on electrocardiosignal.
[0003] At present, many electrocardiosignal quality evaluation algorithms are based on electrocardiosignal features to complete the calculation and judgment. However, when the human body undergoes physiological changes, the electrocardiosignal features will also change. The signal quality evaluation based on features is easy to filter the electrocardiosignal data under the disease as noise or an alien class, and thus causes the loss of signals with important diagnostic value. It is difficult to obtain accurate evaluation and estimation. In addition, some environmental noise (such as baseline drift) that is not easy to avoid but within an acceptable range will also cause significant variation of electrocardiosignal features. As can be seen, it is difficult to deal with these problems by relying only on the extraction of electrocardiosignal features.
[0004] In addition, in the field of electrocardiosignal quality evaluation, many methods make this technology into a binary classification or multi-classification task. Essentially, this algorithm learns the distribution of electrocardiosignals of different qualities, which is subject to the scale of training data and the label set, and cannot explore the general rules of electrocardiosignal and noise signal. The multi-classification of electrocardiosignal quality by using a deep learning method depends on the label of electrocardiosignal quality annotation, and the annotation standard of the label is not only different for different people, but also different in different scenes. Some detection scenes require clear and accurate P wave, ST wave, QRS wave cluster and other waves (clusters), and some scenes only require clear and accurate R-peak. Therefore, it is difficult to create a stable and highly universal electrocardiosignal quality evaluation model.
[0005] Therefore, how to perform adaptive and continuous quality evaluation on signals and improve the accuracy is a problem that those skilled in the art need to solve. SUMMARY
[0006] Therefore, the application provides an electrocardiosignal quality evaluation method based on a self-encoder, which can adaptively and continuously evaluate the quality of signals and has high evaluation accuracy.
[0007] To achieve the above-mentioned purpose, the application adopts the following technical solutions:
[0008] An electrocardiosignal quality evaluation method based on a self-encoder comprises the following steps:
[0009] An original electrocardiosignal is acquired and subjected to multilayer filtering pretreatment.
[0010] The pretreated signal is segmented into multiple fixed-length segments, and the signal points of each signal segment are screened to obtain a batch of primary screened electrocardiosignals.
[0011] The primary screened electrocardiosignals are used to train a self-encoder model constructed in advance, so that the self-encoder model learns the general rules of electrocardiosignals.
[0012] An original signal to be evaluated is input into the trained self-encoder model to reconstruct the signal, and the unreliability of the signal is calculated.
[0013] The quality score of the original signal to be evaluated is calculated based on the reconstructed signal and the unreliability.
[0014] Further, the pretreatment of the original electrocardiosignal at least comprises removing baseline drift, power signal filtering and high-frequency signal noise reduction.
[0015] Further, the screening of the signal segment is based on judging the proportion of signal points with amplitudes exceeding a threshold value in each signal segment, and if the proportion of signal points exceeds a preset proportion, the signal points under the proportion are filtered out.
[0016] Further, in the process of screening the signal points, the signal points with amplitudes exceeding the average value of the overall signal amplitude plus 2*std in each signal segment are marked as excessively large signal points, and if the proportion of the excessively large signal points in the overall signal segment exceeds 0.5, the excessively large signal points under the proportion are marked as filtered signal points and are filtered out; wherein std represents the standard deviation of the signal segment.
[0017] Further, before screening the signal points in each signal segment, the segmented signal segments are subjected to data standardization processing.
[0018] Further, the self-encoder model is composed of an encoder and a decoder; the encoder adopts a convolutional neural network to extract features from the original one-dimensional electrocardiosignal and performs multilayer convolution expansion, so as to abstract the original electrocardiosignal into a low-dimensional dense vector electrocardiosignal feature; the decoder adopts transposed convolution to reconstruct the low-dimensional dense vector electrocardiosignal feature and calculate the unreliability of the reconstructed signal.
[0019] Further, the loss function AE-LLH of the autoencoder model is constructed by using the log-likelihood function, and the expression is as follows:
[0020]
[0021] wherein, represents the log-likelihood function; x represents the original electrocardiogram signal; mu represents the reconstructed signal; sigma represents the untrustworthiness; L represents the total number of signal segments in the batch, and l represents the lth signal segment.
[0022] Further, the evaluation formula of the quality score of the original signal to be evaluated is as follows:
[0023]
[0024] wherein, Score represents the quality score of the signal to be evaluated, and lambda represents a penalty coefficient, represents the untrustworthiness bias term.
[0025] Further, it further comprises: segmenting the original signal to be evaluated into signal segments of the same signal length as in the training stage, and reconstructing and calculating the untrustworthiness of each signal segment based on the trained autoencoder model.
[0026] Further, it further comprises: sorting the quality scores of each signal segment of the original signal to be evaluated, and taking the signal segments ranked in the top n or the quality scores satisfying the score threshold as high-quality signals.
[0027] According to the above technical solution, compared with the prior art, the present disclosure provides an electrocardiogram signal quality evaluation method based on an autoencoder. The electrocardiogram signal is encoded and decoded by the autoencoder, and the general rule of the electrocardiogram signal is learned. Since the noise signal cannot be reconstructed due to the lack of regularity, the proportion of the signal noise is determined by the reconstruction error between the output signal and the input signal. Not only can the noise-embedded electrocardiogram signal without analysis value be effectively identified, but also more detailed quality feedback information can be provided. The whole process can be completed without other instruments and manual annotation, and is feasible, accurate and efficient. At the same time, the present disclosure can realize adaptive continuous quality evaluation of the electrocardiogram signal segment, and avoid the two or three classification of the traditional deep learning.
[0028] The increased receptive field and untrustworthiness (i.e. signal segment standard deviation) are introduced into the network design, the data distribution is more extensive, the model performance is improved, and the robustness is enhanced.
[0029] Based on the learning objective of the aforementioned network loss function, this invention designs the network's learning objective to be the result of ECG signal quality quantification, meaning the model's output value is positively correlated with signal quality. Simultaneously, an uncertainty bias is introduced to further reduce quality score deviation and improve confidence. Attached Figure Description
[0030] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0031] Figure 1 A flowchart of the electrocardiogram signal quality assessment method based on an autoencoder provided by the present invention;
[0032] Figure 2 This is a schematic diagram of the encoding and decoding process of the autoencoder model provided by the present invention. Detailed Implementation
[0033] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0034] like Figure 1 As shown in the figure, this invention discloses a method for assessing the quality of electrocardiogram signals based on a self-encoder, comprising the following steps:
[0035] Step 1: Acquire the raw electrocardiogram signal and perform multi-layer filtering preprocessing;
[0036] Step 2: Divide the preprocessed signal into multiple fixed-length segments, and filter the signal points of each signal segment to obtain a batch of initial screening ECG signals;
[0037] Step 3: Use the initial screening ECG signals to train the pre-constructed autoencoder model, so that the autoencoder model learns the general rules of ECG signals;
[0038] Step 4: Input the original signal to be evaluated into the trained autoencoder model to reconstruct the signal and calculate the unreliability of the signal;
[0039] Step 5: Calculate the quality score of the original signal to be evaluated based on the reconstructed signal and the aforementioned unreliability.
[0040] The above steps are further described below.
[0041] In step 1, after obtaining the original electrocardio signal, the signal is subjected to baseline drift removal, power frequency signal filtering, high frequency signal noise reduction and the like.
[0042] In step 2, the electrocardio signal obtained in step 1 is segmented and screened, and a continuous acquisition electrocardio signal is segmented into multiple fixed length (such as 5s) signal segments and subjected to data standardization processing. The screening of the signal segment is based on the judgment of the proportion of signal points with amplitude exceeding the threshold value in each signal segment. If the proportion of signal points exceeds the preset proportion, the signal points under the proportion are filtered out.
[0043] Specifically, in the process of screening the signal points, the signal points with amplitude exceeding the average value of the overall signal amplitude plus 2*std in each signal segment are marked as excessive signal points, and if the proportion of the excessive signal points in the overall signal segment exceeds 0.5, the excessive signal points under the proportion are marked as filtered signal and are filtered out; wherein std represents the standard deviation of the signal segment. The signal points with amplitude exceeding the average value of the overall signal amplitude plus 2*std and the proportion exceeding 0.5 are mostly seriously contaminated by noise and drift in the production environment, and have no analysis value.
[0044] In step 3, the processed electrocardio signal segment is input into the autoencoder model, and the model is trained. The autoencoder model is an unsupervised deep learning model, which encodes and decodes the electrocardio signal segment through a deep neural network. An autoencoder is composed of an encoder and a decoder. The encoder is responsible for abstracting the input one-dimensional electrocardio signal into a multi-dimensional feature, and the decoder is responsible for restoring the feature vector into the original electrocardio signal.
[0045] Specifically, as shown in Figure 2 The encoder uses a convolutional neural network to extract features from the original one-dimensional electrocardio signal and performs multi-layer convolution expansion. The expansion rate parameter can be set to be greater than 2 times, the range of the convolution kernel is expanded, the original electrocardio signal is abstracted into a low-dimensional dense vector electrocardio feature, that is, the output (mostly 1*n-dimensional dense vector) of the flatten layer of the convolution network. Compared with the traditional convolution kernel, the dilated convolution kernel can expand the range of the receptive field and promote the fusion of long-time span features in the time series.
[0046] The decoder uses transposed convolution to reconstruct the low-dimensional dense vector electrocardio feature and calculate the unreliability of the reconstructed signal. Compared with forward convolution, the transposed convolution adopted in the embodiment of the application can output the input features as a larger scale tensor.
[0047] The untrustworthiness is essentially the standard deviation of the signal segment, which measures the fluctuation of the whole signal (deviation from the mean). By introducing this parameter in network design, the model can learn the morphological knowledge of the signal waveform. The larger the signal set in the sample, the more diverse the untrustworthiness, and the more confident the distribution, so that the model also has the ability to cope with a wide range of signal morphological distribution. For example, if a signal segment has a large untrustworthiness (large standard deviation), it means that the signal deviates from the standard segment waveform in shape.
[0048] The transposed convolution of the reconstructed electrocardio signal and the untrustworthiness only makes a difference on the last layer, while the parameters are shared in other layers to ensure the difference and correlation of the two.
[0049] In one specific embodiment, the loss function AE-LLH of the autoencoder model is constructed by using the log-likelihood function, and the expression is as follows:
[0050]
[0051] wherein, represents the maximum log-likelihood function of the reconstructed signal and the original signal residual after Gaussian mapping; x represents the original electrocardio signal; μ represents the reconstructed signal; σ represents the untrustworthiness; L represents the total number of signal segments in the batch, and l represents the lth signal segment.
[0052] The training target of the model is to maximize the log-likelihood function to ensure that the reconstructed signal is close to the original signal. Between the convolution layers, normalization layers and activation layers are also processed to avoid gradient explosion and gradient disappearance.
[0053] In step 4, after the network training is completed, an autoencoder model that has learned the general rules of electrocardio signals can be obtained. The original signal to be evaluated is segmented into signal segments with the same signal length as in the training stage, and input into the autoencoder model to reconstruct and calculate the untrustworthiness of each signal segment to be evaluated.
[0054] In step 5, according to the untrustworthiness and the reconstructed signal of the signal segment to be evaluated calculated by the autoencoder model, the log-likelihood function is calculated, and a penalty term is added to the value of the untrustworthiness. The final designed quality score (Score) is the mean of the log-likelihood function minus the penalty coefficient multiplied by the mean of the untrustworthiness. The evaluation formula of the quality score is:
[0055]
[0056] wherein, Score represents the quality score of the signal to be evaluated, which can measure and reflect the signal quality, λ represents the penalty coefficient, represents the untrustworthiness bias term.
[0057] In the design of the Score loss function, the untrustworthiness bias is introduced, which can be used as a regular penalty term to constrain the deviation caused by the signal waveform form. The greater the value of this term is, the more biased the signal form is, and the quality of the signal is adjusted, so as to further reduce the quality score deviation and improve the confidence.
[0058] In other embodiments, further comprising:
[0059] Step six, sort the quality scores of each signal segment of the to-be-evaluated original signal, and select the signal segments with the top n or quality scores meeting the score threshold as high-quality signals. The proportion of the selected signal segments and the score threshold are determined by the general quality of the collected electrocardio signals and the discrimination requirements of the electrocardio signals.
[0060] The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the difference from other embodiments. The same or similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be referred to the method part.
[0061] The above description of the disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to the embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. An electrocardiogram quality assessment method based on an autoencoder, characterized in that, The method comprises the following steps: Obtain the original electrocardio signal, and perform multi-layer filtering preprocessing; Divide the preprocessed signal into a plurality of fixed-length segments, and screen the signal points of each signal segment to obtain a batch of preliminary screening electrocardio signals; the screening of the signal segment is based on the proportion of signal points with an amplitude exceeding a threshold value in each signal segment; if the proportion of signal points exceeds a preset proportion, the signal points under the proportion are filtered out; Train a pre-constructed autoencoder model using the preliminary screening electrocardio signals, so that the autoencoder model learns the general rules of electrocardio signals; Input the original signal to be evaluated into the trained autoencoder model for signal reconstruction, and calculate the untrustworthiness of the signal; Calculate the quality score of the original signal to be evaluated based on the reconstructed signal and the untrustworthiness; the evaluation formula of the quality score of the original signal to be evaluated is: where Score represents the quality score of the original signal to be evaluated, λ represents a penalty coefficient, represents an untrustworthiness bias term; represents a log-likelihood function; x represents the original signal to be evaluated; μ represents the reconstructed signal; σ represents the untrustworthiness; L represents the length of the original signal to be evaluated, and l represents the lth element.
2. The electrocardiogram quality assessment method based on autoencoder according to claim 1, characterized in that, The preprocessing of the original electrocardio signal at least includes removing baseline drift, power frequency signal filtering and high frequency signal noise reduction.
3. The electrocardiogram quality assessment method based on autoencoder according to claim 1, characterized in that, In the process of screening the signal points, the signal points with an amplitude exceeding the average value of the overall signal amplitude plus 2*std in each signal segment are marked as excessive signal points; if the proportion of the excessive signal points in the overall signal segment exceeds 0.5, the excessive signal points under the proportion are marked as filtered signal points and are filtered out; wherein std represents the standard deviation of the signal segment.
4. The electrocardiogram quality assessment method based on autoencoder according to claim 1, characterized in that, Before screening the signal points in each signal segment, the method further comprises performing data standardization processing on each segmented signal segment.
5. The electrocardiogram quality assessment method based on autoencoder according to claim 1, characterized in that, The autoencoder model is composed of an encoder and a decoder; the encoder uses a convolutional neural network to extract features from the original one-dimensional electrocardio signal and performs multi-layer convolution expansion, so as to abstract the original electrocardio signal into a low-dimensional dense vector electrocardio feature; the decoder uses transposed convolution to reconstruct the low-dimensional dense vector electrocardio feature, and calculates the untrustworthiness of the reconstructed signal.
6. The electrocardiogram quality assessment method based on autoencoder according to claim 1, characterized in that, The loss function AE-LLH of the autoencoder model is constructed by using a logarithmic likelihood function, and the expression is as follows:
7. The electrocardiogram quality assessment method based on autoencoder according to claim 1, characterized in that, The method further comprises the following steps: Divide the original signal to be evaluated into signal segments with the same signal length as the training stage, and reconstruct and calculate the untrustworthiness of each signal segment based on the trained autoencoder model.
8. The electrocardiogram quality assessment method based on autoencoder according to claim 7, characterized in that, The method further comprises the following steps: Sort the quality scores of each signal segment of the original signal to be evaluated, and select the signal segments with the top n quality scores or the quality scores meeting the score threshold as high-quality signals.