Electrocardiogram data quality evaluation method, device, equipment and medium

By using one-dimensional convolutional neural network and Transformer decoder for sparse information integration and context-aware processing in the ECG data quality evaluation model, the noise interference problem in the ECG signal quality evaluation is solved, and the accuracy and reliability of the evaluation are improved. .

CN119257612APending Publication Date: 2025-01-07THE FIRST AFFILIATED HOSPITAL OF ZHENGZHOU UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411461555.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-01-07

Smart Images

  • Figure CN119257612A_ABST
    Figure CN119257612A_ABST
Patent Text Reader

Abstract

The invention discloses an electrocardio data quality assessment method, device and equipment and a medium, and relates to the technical field of medical signal processing, and the method comprises the steps: obtaining to-be-assessed electrocardio sequence data; inputting the to-be-assessed electrocardiogram sequence data into a target electrocardiogram data quality assessment model so as to integrate the electrocardiogram signal information of each single time point in the to-be-assessed electrocardiogram sequence data through the target electrocardiogram data quality assessment model to obtain target dense semantic information used for reflecting the heart rhythm and the amplitude change trend; and performing context sensing processing on the target dense semantic information through the target electrocardiogram data quality evaluation model to obtain a corresponding target output sequence, and obtaining a quality evaluation result of the to-be-evaluated electrocardiogram sequence data according to a prediction probability distribution result of the target output sequence. The sparse information of the to-be-evaluated electrocardiogram sequence data is integrated into the dense semantic information through the model, so that the electrocardiogram signal data can be evaluated more efficiently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of medical signal processing technology, and in particular to an electrocardiogram data quality assessment method, device, equipment and medium. Background Art

[0002] Electrocardiogram (ECG) signals play a vital role in many fields. The application system places strict requirements on the precise determination of the reference points (or feature points) of the ECG signals, because this is the basis for ensuring that the morphological characteristics (including amplitude, duration, polarity and shape) of local waveforms (such as P wave, QRS complex wave, T wave and U wave) and interval characteristics (including PR segment, QT segment, ST segment, RR interval) can be accurately and reliably measured. In order to improve the accuracy and reliability of measurement, most ECG analysis systems require the input of relatively noise-free ECG signals. However, in practical applications, ECG signals are often interfered by various noises, such as baseline drift (often caused by electrode contact noise and electrode motion artifacts), power line interference, electromyography noise, and instrument noise. The presence of these noises seriously interferes with the morphological analysis of ECG signals, making it extremely difficult to accurately analyze the contaminated signals directly. Traditional ECG signal data evaluation methods can be divided into rule-based methods and machine learning-based methods. The rule-based method uses heuristic rules to evaluate ECG signal data. This method is easy to use and has low computational complexity, but has low accuracy. The machine learning-based method has higher accuracy than the rule-based method, but it requires manual extraction of specific waveform features based on expert knowledge, and then inputs the evaluation features into the subsequent classifier to complete the quality evaluation of ECG signal data, which is relatively complex.

[0003] In summary, how to achieve effective automatic evaluation of ECG signals and reduce false alarms caused by unacceptable noise levels, thereby ensuring the effectiveness and reliability of the ECG analysis system is a technical problem to be solved in this field. Summary of the invention

[0004] In view of this, the purpose of the present invention is to provide a method, device, equipment and medium for evaluating the quality of electrocardiogram data, which can effectively and automatically evaluate the electrocardiogram signal, reduce the false alarm caused by unacceptable noise level, and thus ensure the effectiveness and reliability of the electrocardiogram analysis system. The specific scheme is as follows:

[0005] In a first aspect, the present application discloses a method for evaluating the quality of electrocardiogram data, comprising:

[0006] Obtaining ECG sequence data to be evaluated;

[0007] Inputting the ECG sequence data to be evaluated into a target ECG data quality evaluation model, so as to integrate the ECG signal information of each single time point in the ECG sequence data to be evaluated through the target ECG data quality evaluation model, so as to obtain target dense semantic information for reflecting the trend of cardiac rhythm and amplitude changes;

[0008] The target dense semantic information is context-aware processed by the target ECG data quality assessment model to obtain a corresponding target output sequence, and a quality assessment result of the ECG sequence data to be assessed is obtained according to a predicted probability distribution result of the target output sequence.

[0009] Optionally, before inputting the to-be-evaluated ECG sequence data into the target ECG data quality evaluation model, the method further includes:

[0010] Acquire a training set of ECG data with corresponding quality assessment true labels, wherein the quality assessment true labels include excellent quality assessment labels, good quality assessment labels, qualified quality assessment labels, poor quality assessment labels, and unacceptable quality assessment labels;

[0011] The ECG data training set is used to perform ECG data quality assessment training on the initial ECG data quality assessment model to obtain a target ECG data quality assessment model for outputting a corresponding quality assessment result.

[0012] Optionally, before performing ECG data quality assessment training on the initial ECG data quality assessment model using the ECG data training set, the method further includes:

[0013] An initial ECG data quality assessment model is constructed, which includes a one-dimensional convolutional neural network encoder, a Transformer decoder, and a multi-classification head connected in sequence; wherein the multi-classification head is constructed based on a multi-layer perceptron.

[0014] Optionally, the Transformer decoder includes a multi-head attention mechanism layer, a residual connection layer and a feedforward layer.

[0015] Optionally, the using the ECG data training set to perform ECG data quality assessment training on the initial ECG data quality assessment model includes:

[0016] Inputting the ECG data training set into the initial ECG data quality assessment model, so as to perform signal value inference of each time step on the ECG sequence training data according to the time series information through the one-dimensional convolutional neural network encoder of the initial ECG data quality assessment model, so as to obtain the ECG signal training information at a single time point as sparse training information;

[0017] The sparse training information is integrated and processed by the one-dimensional convolutional neural network encoder to obtain dense semantic training information for reflecting the trend of cardiac rhythm and amplitude changes;

[0018] Inputting the dense semantic training information into the Transformer decoder so as to transform the dense semantic training information into different latent spaces through the multi-head attention mechanism layer of the Transformer decoder to obtain attention scores calculated based on query information, key information and value information of different heads respectively;

[0019] The target attention score after concatenating the attention scores is multiplied by the corresponding weight matrix through the residual connection layer and the feedforward layer to obtain a corresponding output training sequence;

[0020] Inputting the output training sequence into the multi-classification head, so as to respectively calculate the corresponding predicted probability distribution of the output training sequence under different quality assessment true labels through the multi-classification head;

[0021] The model parameters of the initial ECG data quality assessment model are reversely updated according to the degree of deviation between the quality assessment prediction label corresponding to the maximum probability value in each of the predicted probability distributions and the quality assessment true label of the ECG sequence training data to obtain an updated target ECG data quality assessment model.

[0022] Optionally, the reverse updating of the model parameters of the initial ECG data quality assessment model according to the degree of deviation between the quality assessment prediction label corresponding to the maximum probability value in each of the predicted probability distributions and the quality assessment true label of the ECG sequence training data to obtain an updated target ECG data quality assessment model includes:

[0023] Construct a target loss function that minimizes the probability distribution between the output quality assessment prediction label and the quality assessment true label as the optimization goal;

[0024] Calculate the loss value between each quality assessment prediction label and the corresponding quality assessment true label using the target loss function;

[0025] If the reverse update of the model parameters of the initial ECG data quality assessment model is started according to the loss value, the current gradient information is used to reversely perform the gradient descent parameter updating step along the multi-classification head, the Transformer decoder, and the one-dimensional convolutional neural network encoder to optimize the model parameters of the initial ECG data quality assessment model to obtain an updated target ECG data quality assessment model.

[0026] Optionally, after using the target loss function to respectively calculate the loss value between each quality assessment prediction label and the corresponding quality assessment true label, the method further includes:

[0027] If the current loss value meets the preset loss value condition, the reverse update operation is stopped, and the current model parameters are used as the model parameters of the target ECG data quality assessment model.

[0028] In a second aspect, the present application discloses an electrocardiogram data quality assessment device, comprising:

[0029] A data acquisition module, used for acquiring ECG sequence data to be evaluated;

[0030] A first evaluation module is used to input the ECG sequence data to be evaluated into a target ECG data quality evaluation model, so as to integrate the ECG signal information of each single time point in the ECG sequence data to be evaluated through the target ECG data quality evaluation model, so as to obtain target dense semantic information for reflecting the trend of cardiac rhythm and amplitude changes;

[0031] The second evaluation module is used to perform context-aware processing on the target dense semantic information through the target ECG data quality evaluation model to obtain a corresponding target output sequence, and obtain a quality evaluation result of the ECG sequence data to be evaluated based on the predicted probability distribution result of the target output sequence.

[0032] In a third aspect, the present application discloses an electronic device, comprising:

[0033] Memory, used to store computer programs;

[0034] The processor is used to execute the computer program to implement the steps of the aforementioned disclosed method for evaluating the quality of electrocardiogram data.

[0035] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the steps of the aforementioned disclosed ECG data quality assessment method are implemented.

[0036] It can be seen that the present application discloses a method for evaluating the quality of ECG data, including: obtaining ECG sequence data to be evaluated; inputting the ECG sequence data to be evaluated into a target ECG data quality evaluation model, so as to integrate the ECG signal information of each single time point in the ECG sequence data to be evaluated through the target ECG data quality evaluation model, so as to obtain target dense semantic information for reflecting the heart rhythm and amplitude change trend; context-aware processing is performed on the target dense semantic information through the target ECG data quality evaluation model to obtain the corresponding target output sequence, and the quality evaluation result of the ECG sequence data to be evaluated is obtained according to the predicted probability distribution result of the target output sequence. It can be seen that the sparse information of the ECG sequence data to be evaluated is integrated into dense semantic information through the model, so that the ECG signal data can be evaluated more efficiently, and there is no need to manually extract important features such as the central dirty rhythm and amplitude change trend of the data due to insufficient information at a single time point. The present invention can comprehensively consider the characteristics of multiple time points through the sparse information integration method, and more comprehensively reflect the state of the heart, thereby improving the accuracy of the ECG data quality evaluation. And by performing context-aware processing on the dense semantic information of the target, the context and overall context of the ECG signal can be fully considered. This helps to discover potential abnormal patterns and trends, further improving the accuracy of the assessment. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0038] Figure 1 A flow chart of a method for evaluating the quality of electrocardiogram data disclosed in this application;

[0039] Figure 2 A flow chart of a target ECG data quality assessment model training method disclosed in this application;

[0040] Figure 3 A flowchart of a specific ECG data quality assessment method disclosed in this application;

[0041] Figure 4 This is a schematic diagram of the structure of an electrocardiogram data quality assessment device disclosed in this application;

[0042] Figure 5 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0043] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.

[0044] ECG signals play a vital role in many fields. The application system places strict requirements on the precise determination of ECG signal reference points (or feature points), because this is the basis for ensuring that the morphological characteristics (including amplitude, duration, polarity and shape) of local waveforms (such as P wave, QRS complex wave, T wave and U wave) and interval characteristics (including PR segment, QT segment, ST segment, RR interval) can be accurately and reliably measured. In order to improve the accuracy and reliability of measurement, most ECG analysis systems require the input of relatively noise-free ECG signals. However, in practical applications, ECG signals are often interfered by various noises, such as baseline drift (often caused by electrode contact noise and electrode motion artifacts), power line interference, electromyography noise, and instrument noise. The presence of these noises seriously interferes with the morphological analysis of ECG signals, making it extremely difficult to accurately analyze the contaminated signals directly. Traditional ECG signal data evaluation methods can be divided into rule-based methods and machine learning-based methods. Rule-based methods use heuristic rules to evaluate ECG signal data. This method has the advantages of being simple and easy to use and having low computational complexity, but the accuracy is low. The accuracy of the machine learning-based method is higher than that of the rule-based method, but it requires manual extraction of specific waveform features based on expert knowledge, and then inputting the evaluation features into the subsequent classifier to complete the quality evaluation of the ECG signal data, which is relatively complicated.

[0045] To this end, the present invention provides an ECG data quality assessment scheme, which can achieve effective automatic assessment of ECG signals and reduce false alarms caused by unacceptable noise levels, thereby ensuring the effectiveness and reliability of the ECG analysis system.

[0046] Reference Figure 1 As shown, an embodiment of the present invention discloses a method for evaluating the quality of electrocardiogram data, comprising:

[0047] Step S11: Acquire the ECG sequence data to be evaluated.

[0048] In this embodiment, the ECG sequence data to be evaluated is obtained, wherein the ECG sequence data to be evaluated is ECG data in image format, and the data in image format is suitable for feature extraction using models such as convolutional neural networks in deep learning. These models have powerful capabilities in image processing and can automatically learn complex features in ECG images, providing a more accurate basis for ECG data quality assessment and disease diagnosis. Therefore, the ECG sequence data to be evaluated in image format is conducive to the quality assessment of the subsequent target ECG data quality assessment model.

[0049] Step S12: inputting the ECG sequence data to be evaluated into the target ECG data quality assessment model, so as to integrate the ECG signal information of each single time point in the ECG sequence data to be evaluated through the target ECG data quality assessment model, so as to obtain target dense semantic information for reflecting the trend of heart rhythm and amplitude changes.

[0050] In this embodiment, the ECG sequence data to be evaluated is input into the target ECG data quality assessment model, and the target ECG data quality assessment model is used to extract the ECG signal information of a single time point from the ECG sequence data to be evaluated in image format. It should be noted that the ECG signal information at a single time point is difficult to provide sufficient semantic information, and the ECG signal, as a natural time series data, is a signal with time redundancy, that is, by interpolating the values ​​of adjacent points, the signal value of each time step can be easily inferred. Therefore, the sparse information (ECG signal information at a single time point) is further integrated into target dense semantic information through the CNN (Convolutional Neural Network)-based encoder of the target ECG data quality assessment model.

[0051] Among them, the CNN-based encoder can extract features from the input data through a one-dimensional convolution layer. It uses the convolution kernel to slide on the input sequence and perform weighted summation on the local area to extract different feature patterns. As the network layer deepens, more advanced and abstract features can be captured.

[0052] Step S13: performing context-aware processing on the target dense semantic information through the target ECG data quality assessment model to obtain a corresponding target output sequence, and obtaining a quality assessment result of the ECG sequence data to be assessed based on a predicted probability distribution result of the target output sequence.

[0053] In this embodiment, the target dense semantic information is further processed by the Transformer decoder of the target ECG data quality assessment model for context awareness. Specifically, the self-attention mechanism is used for information interaction and transmission. This mechanism allows the model to pay attention to information at different positions when processing sequence data, and has the advantages of high efficiency, context awareness, and pre-training fine-tuning. The Transformer decoder is used to convert the target dense semantic information into a representation containing context information to obtain the corresponding target output sequence.

[0054] In this embodiment, the probability distribution of the target output sequence is calculated through the multi-classification head of the target ECG data quality assessment model, wherein the probability distribution categories are divided into five categories: excellent, good, qualified, poor, and unacceptable. Through the probability distribution calculation of the five categories, the probability values ​​of the target output sequence in the five categories are calculated respectively, and then the category label corresponding to the maximum probability value is output as the quality assessment result.

[0055] It can be seen that the present application discloses a method for evaluating the quality of ECG data, including: obtaining ECG sequence data to be evaluated; inputting the ECG sequence data to be evaluated into a target ECG data quality evaluation model, so as to integrate the ECG signal information of each single time point in the ECG sequence data to be evaluated through the target ECG data quality evaluation model, so as to obtain target dense semantic information for reflecting the heart rhythm and amplitude change trend; context-aware processing is performed on the target dense semantic information through the target ECG data quality evaluation model to obtain the corresponding target output sequence, and the quality evaluation result of the ECG sequence data to be evaluated is obtained according to the predicted probability distribution result of the target output sequence. It can be seen that the sparse information of the ECG sequence data to be evaluated is integrated into dense semantic information through the model, so that the ECG signal data can be evaluated more efficiently, and there is no need to manually extract important features such as the central dirty rhythm and amplitude change trend of the data due to insufficient information at a single time point. The present invention can comprehensively consider the characteristics of multiple time points through the sparse information integration method, and more comprehensively reflect the state of the heart, thereby improving the accuracy of the ECG data quality evaluation. And by performing context-aware processing on the dense semantic information of the target, the context and overall context of the ECG signal can be fully considered. This helps to discover potential abnormal patterns and trends, further improving the accuracy of the assessment.

[0056] Reference Figure 2 As shown, an embodiment of the present invention discloses a target ECG data quality assessment model training method, comprising:

[0057] Step S21: Acquire a training set of ECG data carrying corresponding quality assessment true labels, wherein the quality assessment true labels include excellent quality assessment labels, good quality assessment labels, qualified quality assessment labels, poor quality assessment labels, and unacceptable quality assessment labels.

[0058] In this embodiment, in order to train an ECG data set that can recognize detailed ECG quality levels (excellent, good, qualified, poor, unacceptable) and is suitable for different ECG data application scenarios, an ECG data training set is constructed using historical ECG sequence training data that carries the above-mentioned different levels of quality assessment true labels.

[0059] Step S22: construct an initial ECG data quality assessment model comprising a one-dimensional convolutional neural network encoder, a Transformer decoder, and a multi-classification head connected in sequence; wherein the multi-classification head is constructed based on a multi-layer perceptron.

[0060] In this embodiment, an initial ECG data quality assessment model is pre-constructed, wherein the initial model includes a one-dimensional convolutional neural network encoder, a Transformer decoder, and a multi-classification head connected in sequence, and the Transformer decoder includes a multi-head attention mechanism layer, a residual connection layer, and a feedforward layer.

[0061] Step S23: using the ECG data training set to perform ECG data quality assessment training on the initial ECG data quality assessment model to obtain a target ECG data quality assessment model for outputting a corresponding quality assessment result.

[0062] In this embodiment, the ECG data training set is input into the initial ECG data quality assessment model so that the signal value of each time step of the ECG sequence training data is inferred according to the time series information through the one-dimensional convolutional neural network encoder of the initial ECG data quality assessment model, so as to obtain the ECG signal training information at a single time point as sparse training information. It is understandable that the relatively isolated information representation of the ECG signal at each time point that lacks deep correlation and comprehensive significance is considered to be sparse training information. For example, observing the ECG signal data point at a certain moment alone may only reflect the weak electrical signal characteristics of that moment, and it is difficult to directly draw a clear judgment about the overall state of the heart.

[0063] In this embodiment, the sparse training information is integrated and processed by the one-dimensional convolutional neural network encoder to obtain dense semantic training information for reflecting the trend of heart rhythm and amplitude changes. It can be understood that after being processed by the one-dimensional convolutional neural network encoder (1D-CNN), the originally relatively sparse ECG signal information is integrated. The dense semantic information at this time is the information obtained after deep feature extraction and integration of the ECG signal. It contains richer feature patterns and more advanced semantic understanding. For example, after being processed by the encoder, the ECG signal features at multiple time points may be integrated, which can reflect more comprehensive information such as the rhythm and amplitude change trend of the heart, and provide more valuable input for subsequent classification and evaluation. This information is more compact and rich in connotation, and can be better processed by the Transformer decoder to generate an output sequence containing contextual information, thereby providing a more accurate basis for the final ECG signal evaluation. Among them, the one-dimensional convolutional neural network encoder integrates sparse training information to obtain dense information as follows:

[0064] ;

[0065] in, Indicated in Layer The output value of each position represents the state of the dense semantic information at the corresponding position after being processed by this layer; It is a nonlinear activation function, such as ReLU (Rectified Linear Unit), Sigmoid (logistic function), etc. Its function is to perform nonlinear transformation on the input and increase the expressive power of the model. Indicates that in the l-1th layer The output value of the position is the output of the corresponding position of the previous layer, which serves as one of the inputs of the current layer; Represents the weight from position to position in the layer. This weight is used to adjust the contribution of the input at different positions in the previous layer to the output at the current position. Indicated in Layer The bias term at each position is calculated together with the weight to adjust the output to better fit the data; Represents the index or position of the input, specifically traversing a specific collection.

[0066] In this embodiment, the dense semantic training information is input into the Transformer decoder so that the dense semantic training information is converted into different latent spaces through the multi-head attention mechanism layer of the Transformer decoder to obtain the attention scores calculated based on the query information, key information and value information of different heads. It can be understood that the input sequence (dense semantic training information) is converted into different latent spaces through different heads to obtain the query, key and value, where the query, key and value acquisition process is as follows:

[0067] ;

[0068] in, represents the query vector corresponding to the h-th head, which is obtained by layer normalization of the input Z ( ) and the weight matrix The multiplication is used to interact with the key vector in the attention mechanism to determine the location of attention; represents the key vector corresponding to the h-th head, which is also obtained by normalizing the input Z layer by layer and summing it with the weight matrix Multiply them together to calculate the attention score with the query vector; Represents the value vector corresponding to the h-th head, which is also the weight matrix after layer normalization of the input Z Multiply them together and perform weighted summation according to the attention scores in the attention mechanism to get the final output. Indicates that the layer normalization operation is performed on the input Z, which helps to stabilize the training process and accelerate model convergence.

[0069] Furthermore, the query vector, key vector, and value vector output by each head are calculated using the softmax function to obtain the final attention score of each head:

[0070] ;

[0071] in, represents the mask matrix, which is used to control the range of attention. represents the attention function, which is used to calculate the attention output based on the query, key and value, Represents the square root of the key vector dimension.

[0072] In this embodiment, the target attention score after splicing each of the attention scores is multiplied by the corresponding weight matrix through the residual connection layer and the feedforward layer to obtain the corresponding output training sequence. It can be understood that the attention scores of each head are spliced ​​to obtain the target attention score. In order to ensure that the important features of the information are not lost during the transmission process and to avoid the problem of gradient disappearance, the residual connection is introduced. Specifically, the spliced ​​result will be residually connected with the dense semantic information of the original input, so that the model can better retain and transmit information. The result after the residual connection is multiplied by the weight matrix. Here again emphasize the role of the residual connection, which enables the information to retain part of the features of the original information when it is transformed by the weight matrix, thereby enhancing the stability and expression ability of the model. After the nonlinear transformation and integration of the feedforward layer, in this process, the residual connection also contributes to the smooth transmission and deep processing of information, so that the output sequence containing contextual information more accurately reflects the essential characteristics of the ECG signal. The final output sequence is obtained under the joint action of the residual connection and the feedforward layer, which not only contains the important features of the original information, but also undergoes deep context-aware processing. Therefore, the representation of the output training sequence is obtained as follows:

[0073] ;

[0074] Where O represents the output training sequence, Indicates that the output of each header arrive Perform concatenation, i.e. connect them along a specific dimension. It is obtained by concatenating and further processing the outputs of each head; Represents the weight matrix, which is used to perform linear transformation on the concatenated result to obtain the final output sequence.

[0075] In this embodiment, the output training sequence is input to the multi-classification head so that the multi-classification head can respectively calculate the corresponding predicted probability distribution of the output training sequence under different quality assessment true labels. It can be understood that since the ECG signal data is divided into five levels: excellent, good, qualified, poor, and unacceptable, the context representation from the decoder is input to the multi-classification head composed of a multi-layer perceptron, and the softmax function is applied to calculate the probability distribution of the five categories as follows:

[0076] ;

[0077] Among them, P represents the probability distribution vector of five categories, and its elements correspond to the probability values ​​of the ECG signal data belonging to each level. and They are the weight matrices of different layers in the multi-layer perceptron, which are used to perform linear transformation on the input, and the softmax function, which is used to convert the input into a probability distribution so that the sum of the probabilities of each category is 1. and It is the bias term of different layers in the multi-layer perceptron, which is used to adjust the input.

[0078] In this embodiment, the model parameters of the initial ECG data quality assessment model are reversely updated according to the degree of deviation between the quality assessment prediction label corresponding to the maximum probability value in each of the predicted probability distributions and the quality assessment true label of the ECG sequence training data to obtain an updated target ECG data quality assessment model. Specifically, a target loss function is constructed with the minimum probability distribution between the output quality assessment prediction label and the quality assessment true label as the optimization target; the loss value between each quality assessment prediction label and the corresponding quality assessment true label is calculated using the target loss function; if the reverse update of the model parameters of the initial ECG data quality assessment model is selected according to the loss value, the gradient descent parameter update step is reversely performed along the multi-classification head, the Transformer decoder, and the one-dimensional convolutional neural network encoder using the current gradient information to optimize the model parameters of the initial ECG data quality assessment model to obtain an updated target ECG data quality assessment model. It should be noted that if the current loss value meets the preset loss value condition, the reverse update operation is stopped, and the current model parameters are used as the model parameters of the target ECG data quality assessment model. It can be understood that the target loss function can measure the degree of difference between the probability distribution predicted by the model and the true label. In this ECG signal classification scenario, the true ECG signal category is clear, such as belonging to one of the five categories such as excellent and good. Through the target loss function, the degree of deviation between the probability distribution predicted by the model and the actual category can be quantitatively evaluated. If the probability distribution predicted by the model differs greatly from the true category, the loss will be large; conversely, if the prediction is accurate, the loss will be small. Therefore, during the model training process, the value of the target loss function is used to guide the adjustment of the model parameters. By minimizing the target loss, the model can continuously adjust its own parameters so that the predicted probability distribution is closer to the true category distribution. For example, in the back propagation algorithm, the gradient of the cross entropy loss function is used to update parameters such as weights and biases in the multilayer perceptron, so that the model gradually improves the prediction accuracy of the ECG signal category. Therefore, the optimized target loss function is the cross entropy loss formula, and the target loss function is expressed as follows:

[0079] ;

[0080] in, Represents the true label of the sample, which is a one-hot encoded vector used to indicate the category to which the sample belongs. It is an element in the probability distribution of the i-th sample predicted by the model belonging to each category. N represents the total number of samples, that is, the number of ECG signal data samples involved in calculating the loss.

[0081] Reference Figure 3 As shown in the figure, after the training of the target ECG data quality assessment model is completed, a 12-lead ECG signal is obtained and the ECG signal is input into the target ECG quality assessment model. Next, the ECG signal data, that is, the ECG signal, is converted from sparse information to dense semantic information through a 1D CNN encoder. It should be noted that during the conversion process, the ECG signal data is divided into several small image blocks. These image blocks are then processed by a 1D CNN encoder to extract a potential, abstract feature representation, that is, dense semantic information. The dense semantic information is then passed through a Transformer decoder to generate an output sequence containing context information. Finally, the output sequence is passed through a multi-classification head composed of an MLP to obtain the probability distribution of five evaluation categories. The category with the highest probability is used as the final evaluation result, that is, the quality assessment result.

[0082] It can be seen that by setting the true labels of quality assessment such as excellent, good, qualified, poor and unacceptable, ECG data can be classified and evaluated more carefully. This allows the model to more accurately identify ECG data of different quality levels and provide more valuable information for doctors and researchers. The one-dimensional convolutional neural network encoder can effectively capture the time series information of ECG sequence data, infer the signal value of each time step, and obtain the ECG signal training information at a single time point. The multi-head attention mechanism layer of the Transformer decoder can transform dense semantic training information into different latent spaces to better capture the contextual information and complex features of ECG data. The multi-classification head is built based on the multi-layer perceptron, which can accurately calculate the predicted probability distribution of the output training sequence under different quality assessment labels, thereby achieving accurate evaluation of the quality of ECG data.

[0083] Reference Figure 4 As shown, the present invention also discloses a device for evaluating the quality of electrocardiogram data, comprising:

[0084] A data acquisition module 11 is used to acquire the ECG sequence data to be evaluated;

[0085] The first evaluation module 12 is used to input the ECG sequence data to be evaluated into a target ECG data quality evaluation model, so as to integrate the ECG signal information of each single time point in the ECG sequence data to be evaluated through the target ECG data quality evaluation model, so as to obtain target dense semantic information for reflecting the trend of cardiac rhythm and amplitude change;

[0086] The second evaluation module 13 is used to perform context-aware processing on the target dense semantic information through the target ECG data quality evaluation model to obtain a corresponding target output sequence, and obtain a quality evaluation result of the ECG sequence data to be evaluated according to the predicted probability distribution result of the target output sequence.

[0087] It can be seen that the present application discloses obtaining the ECG sequence data to be evaluated; inputting the ECG sequence data to be evaluated into the target ECG data quality assessment model, so that the ECG signal information of each single time point in the ECG sequence data to be evaluated is integrated by the target ECG data quality assessment model to obtain the target dense semantic information used to reflect the heart rhythm and amplitude change trend; the target ECG data quality assessment model performs context-aware processing on the target dense semantic information to obtain the corresponding target output sequence, and obtains the quality assessment result of the ECG sequence data to be evaluated according to the predicted probability distribution result of the target output sequence. It can be seen that the sparse information of the ECG sequence data to be evaluated is integrated into dense semantic information by the model, so that the ECG signal data can be evaluated more efficiently, without the need to manually extract important features such as the central dirty rhythm and amplitude change trend of the data due to insufficient information at a single time point. The present invention can comprehensively consider the characteristics of multiple time points through the sparse information integration method, and more comprehensively reflect the state of the heart, thereby improving the accuracy of the ECG data quality assessment. And by performing context-aware processing on the target dense semantic information, the before-after relationship and the overall context of the ECG signal can be fully considered. This helps to detect potentially unusual patterns and trends, further improving the accuracy of the assessment.

[0088] Furthermore, the present application also discloses an electronic device. Figure 5 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0089] Figure 5The present invention provides a schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the ECG data quality assessment method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0090] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0091] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0092] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0093] Among them, the operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, so as to realize the operation and processing of the massive data 223 in the memory 22 by the processor 21, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the ECG data quality assessment method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks. In addition to data received by the electronic device and transmitted from an external device, the data 223 can also include data collected by its own input and output interface 25, etc.

[0094] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed method for evaluating the quality of electrocardiogram data is implemented. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the aforementioned embodiments, and no further description will be given here.

[0095] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0096] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented with electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application. The steps of the method or algorithm described in conjunction with the embodiments disclosed herein can be implemented directly with hardware, a software module executed by a processor, or a combination of the two. The software module can be placed in a random access memory RAM (Random Access Memory), memory, read-only memory ROM (Read Only Memory), electrically programmable EPROM (Electrically Programmable Read Only Memory), electrically erasable programmable EEPROM (ElectricErasable Programmable Read Only Memory), register, hard disk, removable disk, CD-ROM (CompactDisc-Read Only Memory), or any other form of storage medium known in the technical field.

[0097] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0098] The scheme provided by the present invention is introduced in detail above. Specific examples are used in this article to illustrate the principle and implementation mode of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. At the same time, for those skilled in the art, according to the idea of ​​the present invention, there will be changes in the specific implementation mode and application scope. In summary, the content of this specification should not be understood as limiting the present invention.

Claims

1. A method for evaluating the quality of electrocardiogram data, characterized in that: include: Obtaining ECG sequence data to be evaluated; Inputting the ECG sequence data to be evaluated into a target ECG data quality evaluation model, so as to integrate the ECG signal information of each single time point in the ECG sequence data to be evaluated through the target ECG data quality evaluation model, so as to obtain target dense semantic information for reflecting the trend of cardiac rhythm and amplitude changes; The target dense semantic information is context-aware processed by the target ECG data quality assessment model to obtain a corresponding target output sequence, and a quality assessment result of the ECG sequence data to be assessed is obtained according to a predicted probability distribution result of the target output sequence.

2. The ECG data quality assessment method according to claim 1, characterized in that: Before inputting the to-be-evaluated ECG sequence data into the target ECG data quality evaluation model, the method further includes: Acquire a training set of ECG data with corresponding quality assessment true labels, wherein the quality assessment true labels include excellent quality assessment labels, good quality assessment labels, qualified quality assessment labels, poor quality assessment labels, and unacceptable quality assessment labels; The ECG data training set is used to perform ECG data quality assessment training on the initial ECG data quality assessment model to obtain a target ECG data quality assessment model for outputting a corresponding quality assessment result.

3. The ECG data quality assessment method according to claim 2, characterized in that: Before performing ECG data quality assessment training on the initial ECG data quality assessment model using the ECG data training set, the method further includes: An initial ECG data quality assessment model is constructed, which includes a one-dimensional convolutional neural network encoder, a Transformer decoder, and a multi-classification head connected in sequence; wherein the multi-classification head is constructed based on a multi-layer perceptron.

4. The ECG data quality assessment method according to claim 3, characterized in that: The Transformer decoder includes a multi-head attention mechanism layer, a residual connection layer and a feedforward layer.

5. The method for evaluating the quality of electrocardiogram data according to claim 4, characterized in that: The using the ECG data training set to perform ECG data quality assessment training on the initial ECG data quality assessment model comprises: Inputting the ECG data training set into the initial ECG data quality assessment model, so as to perform signal value inference of each time step on the ECG sequence training data according to the time series information through the one-dimensional convolutional neural network encoder of the initial ECG data quality assessment model, so as to obtain the ECG signal training information at a single time point as sparse training information; The sparse training information is integrated and processed by the one-dimensional convolutional neural network encoder to obtain dense semantic training information for reflecting the trend of cardiac rhythm and amplitude changes; Inputting the dense semantic training information into the Transformer decoder so as to transform the dense semantic training information into different latent spaces through the multi-head attention mechanism layer of the Transformer decoder to obtain attention scores calculated based on query information, key information and value information of different heads respectively; The target attention score after concatenating the attention scores is multiplied by the corresponding weight matrix through the residual connection layer and the feedforward layer to obtain a corresponding output training sequence; Inputting the output training sequence into the multi-classification head, so as to respectively calculate the corresponding predicted probability distribution of the output training sequence under different quality assessment true labels through the multi-classification head; The model parameters of the initial ECG data quality assessment model are reversely updated according to the degree of deviation between the quality assessment prediction label corresponding to the maximum probability value in each of the predicted probability distributions and the quality assessment true label of the ECG sequence training data to obtain an updated target ECG data quality assessment model.

6. The ECG data quality assessment method according to claim 5, characterized in that: The method of reversely updating the model parameters of the initial ECG data quality assessment model according to the degree of deviation between the quality assessment prediction label corresponding to the maximum probability value in each of the predicted probability distributions and the quality assessment true label of the ECG sequence training data to obtain an updated target ECG data quality assessment model includes: Construct a target loss function that minimizes the probability distribution between the output quality assessment prediction label and the quality assessment true label as the optimization goal; Calculate the loss value between each quality assessment prediction label and the corresponding quality assessment true label using the target loss function; If the reverse update of the model parameters of the initial ECG data quality assessment model is started according to the loss value, the current gradient information is used to reversely perform the gradient descent parameter updating step along the multi-classification head, the Transformer decoder, and the one-dimensional convolutional neural network encoder to optimize the model parameters of the initial ECG data quality assessment model to obtain an updated target ECG data quality assessment model.

7. The method for evaluating the quality of electrocardiogram data according to claim 6, characterized in that: After respectively calculating the loss value between each quality assessment prediction label and the corresponding quality assessment true label using the target loss function, the method further includes: If the current loss value meets the preset loss value condition, the reverse update operation is stopped, and the current model parameters are used as the model parameters of the target ECG data quality assessment model.

8. An electrocardiogram data quality assessment device, characterized in that: include: A data acquisition module, used for acquiring ECG sequence data to be evaluated; A first evaluation module is used to input the ECG sequence data to be evaluated into a target ECG data quality evaluation model, so as to integrate the ECG signal information of each single time point in the ECG sequence data to be evaluated through the target ECG data quality evaluation model, so as to obtain target dense semantic information for reflecting the trend of cardiac rhythm and amplitude changes; The second evaluation module is used to perform context-aware processing on the target dense semantic information through the target ECG data quality evaluation model to obtain a corresponding target output sequence, and obtain a quality evaluation result of the ECG sequence data to be evaluated based on the predicted probability distribution result of the target output sequence.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the steps of the method for evaluating ECG data quality as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: Used to store computer programs; wherein, when the computer program is executed by a processor, the steps of the electrocardiogram data quality assessment method according to any one of claims 1 to 7 are implemented.