A method, device, and equipment for classifying heart beats of an electrocardiosignal, and a storage medium
Patent Information
- Application Number
- CN202311423905.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-27
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-10-27
AI Technical Summary
[0003]本申请提供的一种心电信号心搏分类方法、装置、设备及存储介质,用以解决现有当前的心搏分类方法中,心搏分类方法模板容易被污染,导致现有方法中的心搏分类方法准确性较低的技术问题
[0042]本申请可以实现如下有益效果:本申请先通过第一代数模板进行第一次分类,然后通过第二代数模板进行第二次分类,能够有效的避免同类信号被排挤出模板、以及有效的避免非同类信号污染模板,进而提升心搏分类的准确性;通过第一几何模板进行第三次分类、通过第二几何模板进行第四次分类,能够有效的避免因统一模板形态中含有不同的幅度信号导致的模板污染,进而有效的反映幅度一致性,进一步提升心搏分类的准确性。
Smart Images

Figure CN117297622B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the medical field, and in particular to a method, apparatus, device, and storage medium for classifying electrocardiogram signals and heartbeats. Background Technology
[0002] Monitoring equipment includes a series of parameters such as electrocardiogram (ECG), blood pressure, blood oxygen saturation, respiration, and depth of anesthesia. Among these parameters, ECG monitoring is crucial. ECG monitoring includes heart rate calculation and arrhythmia analysis. Heart rate calculation requires detecting the correct QRS complex in the ECG signal and averaging the detected RR interval (the positional difference between two consecutive QRS complexes) to obtain the heart rate value. In arrhythmia analysis, heartbeat classification (QRS complex classification) is particularly important. Common heartbeat classifications include normal heartbeats, ventricular heartbeats, and atrial heartbeats. Among these three classifications, ventricular heartbeat classification is of greater concern to clinicians. Only by correctly classifying heartbeats can a series of ventricular arrhythmias, such as ventricular tachycardia, ventricular rhythms, and ventricular bigeminy, be analyzed. Currently, there are many methods for classifying ventricular heartbeats. However, in current heartbeat classification methods, similar signals are easily excluded from the template, resulting in low accuracy. Different signals and different amplitude signals in the template morphology are easily contaminated by the template, leading to low accuracy in current heartbeat classification methods. Summary of the Invention
[0003] This application provides a method, apparatus, device, and storage medium for classifying electrocardiogram signals and heartbeats, which solves the technical problem that the heartbeat classification method template is easily contaminated in existing heartbeat classification methods, resulting in low accuracy of existing heartbeat classification methods.
[0004] Firstly, a method for classifying electrocardiogram (ECG) signals and heartbeats is provided, the method comprising:
[0005] QRS wave detection is performed on the target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave;
[0006] The waveform features of the current QRS wave are matched with the first algebraic template that stores the waveform features of the first QRS wave reference to obtain the first classification result.
[0007] Based on the first classification result, the waveform features of the current QRS wave are matched with the second algebraic template that stores the second QRS wave reference waveform features to obtain the second classification result;
[0008] Feature extraction is performed on the current QRS wave to determine its geometric features;
[0009] Based on the second classification result, the geometric features of the current QRS wave are matched with the first geometric template that stores the reference geometric features of the first QRS wave to obtain the third classification result;
[0010] Based on the third classification result, the geometric features of the current QRS wave are matched with the second geometric template that stores the second QRS wave reference geometric features to determine the classification type of the heartbeat corresponding to the target ECG signal.
[0011] In conjunction with the first aspect, in one possible implementation, before matching the waveform features of the current QRS wave with the first algebraic template storing the waveform features of the first QRS wave reference, the method further includes:
[0012] Determine whether the first algebraic template exists; if the first algebraic template exists, perform the step of matching the waveform features of the current QRS wave with the first algebraic template storing the reference waveform features of the first QRS wave; if the first algebraic template does not exist, output the current QRS wave as a category; then construct a third algebraic template based on the waveform features of the current QRS wave, and use the third algebraic template as the first algebraic template; finally, use the next QRS wave as the current QRS wave, and perform the step of determining whether the first algebraic template exists.
[0013] In conjunction with the first aspect, in one possible implementation, matching the waveform features of the current QRS wave with a first algebraic template storing the waveform features of a first QRS wave reference to obtain a first classification result includes:
[0014] If the waveform features of the current QRS wave match the first algebraic template, a first classification result is obtained; and the first algebraic template is updated according to the waveform features of the current QRS wave to obtain an updated first algebraic template, which is then used as the first algebraic template. If the waveform features of the current QRS wave do not match the first algebraic template, a fourth algebraic template is constructed according to the waveform features of the current QRS wave, and the fourth algebraic template is used as the first algebraic template. Then, the current R wave is output as the first classification result.
[0015] In conjunction with the first aspect, in one possible implementation, before matching the waveform features of the current QRS wave with a second algebraic template storing the second QRS wave reference waveform features based on the first classification result, the method further includes:
[0016] Determine whether a second algebraic template exists; if a second algebraic template exists, perform the step of matching the waveform features of the current QRS wave with the second algebraic template that stores the reference waveform features of the second QRS wave; if a second algebraic template does not exist, construct a fifth algebraic template based on the waveform features of the current QRS wave, and use the fifth algebraic template as the second algebraic template; then output the current QRS wave as the second classification result.
[0017] In conjunction with the first aspect, in one possible implementation, the QRS wave detection of the target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave includes:
[0018] Acquire the target electrocardiogram (ECG) signal; preprocess the target ECG signal to obtain a preprocessed target ECG signal; perform QRS wave detection on the preprocessed target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave.
[0019] In conjunction with the first aspect, in one possible implementation, the QRS wave detection of the target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave includes:
[0020] The Tompkins algorithm is used to detect QRS waves in the target ECG signal, resulting in multiple QRS waves and waveform characteristics of each QRS wave.
[0021] In conjunction with the first aspect, in one possible implementation, the geometric feature includes at least one of the following: left amplitude, right amplitude, left width, right width, amplitude, width, and area feature.
[0022] Secondly, a cardiac signal heartbeat classification device is provided, the device comprising:
[0023] The waveform feature acquisition module is used to detect QRS waves in the target electrocardiogram signal to obtain multiple QRS waves of the target electrocardiogram signal and the waveform features of each QRS wave.
[0024] The first classification module is used to match the waveform features of the current QRS wave with the first algebraic template that stores the reference waveform features of the first QRS wave to obtain the first classification result;
[0025] The second classification module is used to match the waveform features of the current QRS wave with a second algebraic template storing the second QRS wave reference waveform features based on the first classification result, so as to obtain the second classification result;
[0026] The geometric feature acquisition module is used to extract features from the current QRS wave and determine the geometric features of the current QRS wave.
[0027] The third classification module is used to match the geometric features of the current QRS wave with the first geometric template storing the reference geometric features of the first QRS wave based on the second classification result, so as to obtain the third classification result;
[0028] The fourth classification module is used to match the geometric features of the current QRS wave with a second geometric template that stores the reference geometric features of the second QRS wave, based on the third classification result, to determine the classification type of the heartbeat corresponding to the target ECG signal.
[0029] In conjunction with the second aspect, in one possible implementation, the device further includes a first determination module, configured to:
[0030] Determine whether the first algebraic template exists; if the first algebraic template exists, perform the step of matching the waveform features of the current QRS wave with the first algebraic template storing the reference waveform features of the first QRS wave; if the first algebraic template does not exist, output the current QRS wave as a category; then construct a third algebraic template based on the waveform features of the current QRS wave, and use the third algebraic template as the first algebraic template; finally, use the next QRS wave as the current QRS wave, and perform the step of determining whether the first algebraic template exists.
[0031] In conjunction with the second aspect, in one possible implementation, the first classification module is specifically used for:
[0032] If the waveform features of the current QRS wave match the first algebraic template, a first classification result is obtained; the first algebraic template is updated according to the waveform features of the current QRS wave to obtain an updated first algebraic template, and the updated first algebraic template is used as the first algebraic template; if the waveform features of the current QRS wave do not match the first algebraic template, a fourth algebraic template is constructed according to the waveform features of the current QRS wave, and the fourth algebraic template is used as the first algebraic template; then the current QRS wave is output as the first classification result.
[0033] In conjunction with the first aspect, in one possible implementation, the device further includes a second determining module, configured to:
[0034] Determine whether a second algebraic template exists; if a second algebraic template exists, perform the step of matching the waveform features of the current QRS wave with the second algebraic template that stores the reference waveform features of the second QRS wave; if a second algebraic template does not exist, construct a fifth algebraic template based on the waveform features of the current QRS wave, and use the fifth algebraic template as the second algebraic template; then output the current QRS wave as the second classification result.
[0035] In conjunction with the first aspect, in one possible implementation, the waveform feature acquisition module is specifically used for:
[0036] Acquire the target electrocardiogram (ECG) signal; preprocess the target ECG signal to obtain a preprocessed target ECG signal; perform QRS wave detection on the preprocessed target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave.
[0037] In conjunction with the first aspect, in one possible implementation, the waveform feature acquisition module is further configured to:
[0038] The Tompkins algorithm is used to detect QRS waves in the target ECG signal, resulting in multiple QRS waves and waveform characteristics of each QRS wave.
[0039] In conjunction with the first aspect, in one possible implementation, the geometric feature includes at least one of the following: left amplitude, right amplitude, left width, right width, amplitude, width, and area feature.
[0040] Thirdly, a computer device is provided, including a memory and one or more processors, the one or more processors being used to execute one or more computer programs stored in the memory, the one or more processors, when executing the one or more computer programs, causing the computer device to implement the electrocardiogram signal heartbeat classification method of the first aspect described above.
[0041] Fourthly, a computer-readable storage medium is provided, which stores a computer program, the computer program including program instructions, which, when executed by a processor, cause the processor to perform the electrocardiogram signal heartbeat classification method described in the first aspect.
[0042] This application can achieve the following beneficial effects: First, it performs a first classification using a first algebraic template, and then a second classification using a second algebraic template. This effectively avoids similar signals being squeezed out of the template and effectively avoids dissimilar signals contaminating the template, thereby improving the accuracy of heartbeat classification. Second, it performs a third classification using a first geometric template and a fourth classification using a second geometric template. This effectively avoids template contamination caused by different amplitude signals in a uniform template shape, thereby effectively reflecting amplitude consistency and further improving the accuracy of heartbeat classification. Attached Figure Description
[0043] Figure 1 A flowchart illustrating a method for classifying electrocardiogram signals and heartbeats, provided as an embodiment of this application;
[0044] Figure 2 A flowchart illustrating a method for classifying electrocardiogram signals and heartbeats, provided as an embodiment of this application;
[0045] Figure 3 This is a schematic diagram illustrating the selection of feature points for QRS wave geometric features, provided in an embodiment of this application.
[0046] Figure 4 This is a schematic diagram of the structure of an electrocardiogram signal heartbeat classification device provided in an embodiment of this application;
[0047] Figure 5 This is an internal structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0048] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.
[0049] The technical solution of this application is applicable to various scenarios of QRS wave classification. In current ECG signal heartbeat classification methods, when establishing templates, only signals with a correlation coefficient greater than a specified threshold are classified into the same template. If the specified threshold for the template coefficient is set too high, many similar signals will be excluded from the template; if the specified threshold is set too low, many dissimilar signals will contaminate the template. In addition, current ECG signal heartbeat classification methods are only effective for morphological consistency and cannot effectively reflect amplitude consistency, resulting in different amplitude signals in a uniform template morphology, which also contaminates the template. The technical solution proposed in this application first performs a first classification using a first algebraic template, and then performs a second classification using a second algebraic template. This effectively avoids the exclusion of similar signals from the template due to a template threshold that is too high, and effectively avoids the contamination of the template by dissimilar signals due to a template threshold that is too low. The third classification using a first geometric template and the fourth classification using a second geometric template effectively avoids template contamination caused by different amplitude signals in a uniform template morphology, thus effectively reflecting amplitude consistency.
[0050] In one embodiment, this application proposes a method for classifying electrocardiogram (ECG) heartbeats, such as... Figure 1 As shown, Figure 1 This is a flowchart illustrating a method for classifying electrocardiogram (ECG) signals and heartbeats, provided in an embodiment of this application. The method includes:
[0051] Step 101: Perform QRS wave detection on the target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave.
[0052] Among them, the electrocardiogram (ECG) signal refers to the ECG signal monitored by the monitoring equipment. The QRS waveform characteristics refer to the shape characteristics of the QRS wave itself.
[0053] Specifically, QRS wave detection is performed on the target ECG signal to extract multiple QRS waves from the target ECG signal, and waveform recognition is performed on each QRS wave to determine the waveform characteristics of each QRS wave.
[0054] In one embodiment, such as Figure 2 As shown, Figure 2 This is a flowchart illustrating a method for classifying heartbeats in electrocardiogram (ECG) signals according to an embodiment of this application. The step of detecting QRS waves in the target ECG signal to obtain multiple QRS waves and the waveform characteristics of each QRS wave includes:
[0055] Step 1011: Obtain the target electrocardiogram signal.
[0056] The target electrocardiogram (ECG) signal can be obtained using an ECG device with multiple leads.
[0057] Step 1012: Preprocess the target ECG signal to obtain the preprocessed target ECG signal.
[0058] The preprocessing of the target electrocardiogram signal can include high-pass filtering, low-pass filtering, and power frequency filtering.
[0059] Specifically, high-pass filtering can be 0.5Hz, low-pass filtering can be 40Hz, and power frequency filtering can be 60Hz or 50Hz. High-pass, low-pass, and power frequency filtering can effectively remove noise from the target ECG signal and improve the accuracy of QRS wave detection.
[0060] Step 1013: Perform QRS wave detection on the preprocessed target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave.
[0061] Specifically, the Tompkins algorithm can be used to detect QRS waves in the target ECG signal to obtain a set of QRS waves containing multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave.
[0062] The Tompkins algorithm refers to the Pan-Tompkins algorithm, which is an adaptive dual-threshold QRS wave detection algorithm first proposed by Pan and Tompkins et al., and can be used for real-time processing of QRS waves.
[0063] Specifically, after obtaining multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave, step 102 can be executed to classify each QRS wave in the target ECG signal.
[0064] Step 102: Determine if a first algebra template exists.
[0065] The algebraic template stores waveform reference features of QRS waves, which are waveform features of classified QRS waves.
[0066] Specifically, if it is determined that there is no first algebraic template, it means that the current classification is of the first QRS wave in the QRS wave set, that is, the first QRS wave classification is performed; at this time, step 103 is executed. If it is determined that there is a first algebraic template, it means that the current classification is of a non-first QRS wave in the QRS wave set, that is, the first QRS wave classification is performed; at this time, step 105 is executed.
[0067] Step 103 then outputs the current QRS wave as a classification.
[0068] If it is determined that no first-generation template exists, the current QRS wave is output as a classification. Specifically, after naming and storing the current QRS wave, the classification of the current QRS wave is output. For example, the classification of the current QRS wave is named A, and the classification result of the current QRS wave is output as class A, and then step 104 is executed.
[0069] Step 104: Construct a third algebraic template based on the waveform characteristics of the current QRS wave, and use the third algebraic template as the first algebraic template.
[0070] Specifically, after the current QRS wave is output as a classification, an algebraic template can be constructed based on the waveform characteristics of the current QRS wave to classify other QRS waves in the target electrocardiogram.
[0071] Specifically, the waveform characteristics of the current QRS wave are used to construct a third algebraic template, and the third algebraic template is used as the first algebraic template. Finally, the next QRS wave is used as the current QRS wave, and step 102 is executed to start classifying the next QRS wave.
[0072] Step 105: Match the waveform features of the current QRS wave with the first algebraic template that stores the reference waveform features of the first QRS wave.
[0073] Specifically, if a first-generation template is determined to exist, the current QRS wave is classified using the first-generation template as a reference.
[0074] Specifically, matching the waveform features of the current QRS wave with a first algebraic template storing the waveform features of a first QRS wave reference means determining the similarity between the waveform features of the current QRS wave and the first QRS wave reference features. If the similarity between the waveform features of the current QRS wave and the first QRS wave reference features is not greater than a first preset threshold, it indicates that the waveform features of the current QRS wave do not match the first algebraic template, and step 106 is executed. If the similarity between the waveform features of the current QRS wave and the first QRS wave reference features is greater than the first preset threshold, it indicates that the waveform features of the current QRS wave match the first algebraic template, and steps 107 and 108 are executed respectively.
[0075] In one implementation, if it is determined that there are multiple first algebraic templates, the multiple first algebraic templates are traversed, and the highest similarity among the multiple similarity results is compared with a first preset threshold. If it is greater than the first preset threshold, it means that the first algebraic template corresponding to the highest similarity matches the waveform characteristics of the current QRS wave.
[0076] Specifically, similarity is determined using the Pearson correlation coefficient, as shown in the formula below:
[0077] Suppose there exist two n-dimensional variables X(X0, X1, ..., Xn-1) and Y(Y0, Y1, ..., Yn-1), then the Pearson correlation coefficient r of X and Y is defined as:
[0078]
[0079] in,
[0080]
[0081]
[0082] Step 106: Construct a fourth algebraic template based on the waveform characteristics of the current QRS wave, and use the fourth algebraic template as the first algebraic template.
[0083] Specifically, if the waveform characteristics of the current QRS wave do not match the first algebraic template, a fourth algebraic template is constructed based on the waveform characteristics of the current QRS wave, and this fourth algebraic template is used as the first algebraic template for subsequent step 105. Then, the current QRS wave is output as the first classification result.
[0084] Step 107: Update the first algebraic template according to the waveform characteristics of the current QRS wave to obtain the updated first algebraic template, and finally use the updated first algebraic template as the first algebraic template.
[0085] Specifically, the method for updating the first algebraic template is as follows: the updated first algebraic template is obtained by averaging the QRS waveform signals, as described in the formula below:
[0086] Assuming that there are n R-waves of the same type in class v, each R-wave having a waveform length of u, then the waveform data of the i-th R-wave is described as R(i) = {ri0,ri1,…,ri(u-1)}. The updated first algebraic template formula is then:
[0087]
[0088] Step 108 yields the first classification result.
[0089] The first classification result is the initial classification result obtained by matching with the first algebraic template. After classification using the first algebraic template, step 109 can be executed.
[0090] Step 109: Determine whether the second algebraic template exists.
[0091] In this design, the second algebraic template is a split algebraic template, and the second QRS wave reference waveform feature is a subordinate feature of the first QRS wave reference waveform feature. That is, the second algebraic template is a subordinate template of the first algebraic template. For example, the first algebraic template can classify the QRS wave into class B, and the second algebraic template can classify the QRS wave into class b within class B.
[0092] Specifically, if it is determined that there is no second algebraic template, it means that this is the first time that the QRS wave has been classified for its lower-level features, and step 110 is executed; if it is determined that there is a second algebraic template, it means that the QRS wave has been classified for its lower-level features before, and step 111 is executed.
[0093] Step 110: Construct a fifth algebraic template based on the waveform characteristics of the current QRS wave, and use the fifth algebraic template as the second algebraic template.
[0094] Specifically, if it is determined that a first algebraic template does not exist, a fifth algebraic template is constructed based on the waveform characteristics of the current QRS wave, and this fifth algebraic template is used as the first algebraic template for subsequent step 111. Then, the current QRS wave is output as the second classification result.
[0095] Step 111: Match the waveform features of the current QRS wave with the second algebraic template that stores the reference waveform features of the second QRS wave.
[0096] Specifically, if a second algebraic template is determined to exist, the current QRS wave is classified using the second algebraic template as a reference.
[0097] Specifically, matching the waveform features of the current QRS wave with a second algebraic template storing the waveform features of a second QRS wave reference means determining the similarity between the waveform features of the current QRS wave and the second QRS wave reference features. If the similarity between the waveform features of the current QRS wave and the second QRS wave reference features is not greater than a second preset threshold, it means that the waveform features of the current QRS wave do not match the second algebraic template, and step 112 is executed. If the similarity between the waveform features of the current QRS wave and the second QRS wave reference features is greater than the second preset threshold, it means that the waveform features of the current QRS wave match the second algebraic template, and steps 113 and 114 are executed respectively.
[0098] In one implementation, if it is determined that there are multiple second algebraic templates, then the multiple second algebraic templates are traversed, and the highest similarity among the multiple similarity results is compared with a second preset threshold. If it is greater than the second preset threshold, it means that the second algebraic template corresponding to the highest similarity matches the waveform characteristics of the current R-wave.
[0099] Specifically, similarity is determined using the Pearson correlation coefficient, as shown in the formula below:
[0100] Suppose there exist two n-dimensional variables X(X0, X1, ..., Xn-1) and Y(Y0, Y1, ..., Yn-1), then the Pearson correlation coefficient r of X and Y is defined as:
[0101]
[0102] in,
[0103]
[0104]
[0105] Step 112: Construct a sixth algebraic template based on the waveform characteristics of the current QRS wave, and use the sixth algebraic template as the second algebraic template.
[0106] Specifically, if the waveform characteristics of the current QRS wave do not match the second algebraic template, a sixth algebraic template is constructed based on the waveform characteristics of the current QRS wave, and this sixth algebraic template is used as the second algebraic template for subsequent step 111. Then, the current QRS wave is output as the second classification result.
[0107] Step 113: Update the second algebraic template according to the waveform characteristics of the current QRS wave to obtain the updated second algebraic template, and finally use the updated second algebraic template as the second algebraic template.
[0108] Specifically, the method for updating the second algebraic template is as follows: averaging the QRS waveform signals yields the updated first algebraic template, as described in the formula below:
[0109] Assuming that there are n R-waves of the same type in class v, each R-wave having a waveform length of u, then the waveform data of the i-th R-wave is described as R(i) = {ri0,ri1,…,ri(u-1)}. The updated second algebraic template formula is then:
[0110]
[0111] Step 114 yields the second classification result.
[0112] The second classification result is the result obtained by matching with the second algebraic template. After classification using the second algebraic template, step 115 can be executed.
[0113] Step 115: Extract features from the current QRS wave to determine the geometric features of the current QRS wave.
[0114] The geometric features include at least one of the following: left amplitude, right amplitude, left width, right width, amplitude, width, and area features.
[0115] In one embodiment, such as Figure 3 As shown, Figure 3 This is a schematic diagram illustrating the selection of feature points for the QRS wave geometric features provided in this application embodiment. The QRS wave geometric features include the left amplitude LA, the right amplitude RA, the left width LW, the right width RW, the QRS wave amplitude Amp = max(LA,RA), the QRS wave width Wdt = LW + RW, and the QRS wave area Raera.
[0116] The QRS wave area Raera is given by the following formula.
[0117]
[0118] Where signal represents the input electrocardiogram signal, and s and e represent the start and end points of the QRS wave, respectively.
[0119] Step 116: Based on the second classification result, match the geometric features of the current QRS wave with the first geometric template that stores the reference geometric features of the first QRS wave to obtain the third classification result.
[0120] The geometric template stores the geometric reference features of the QRS wave, which are the geometric features of the classified QRS wave.
[0121] In one embodiment, before matching the R-wave geometric features of the current QRS wave with a first geometric template storing the first QRS wave reference geometric features, the method further includes:
[0122] Determine whether the first geometric template exists; if the first geometric template exists, perform the step of matching the geometric features of the current QRS wave with the first geometric template storing the reference geometric features of the first QRS wave; if the first geometric template does not exist, output the current QRS wave as the third classification result; then construct a third geometric template based on the geometric features of the current QRS wave, and use the third geometric template as the first geometric template.
[0123] In one embodiment, the geometric features of the current QRS wave are matched with a first geometric template storing the reference geometric features of the first QRS wave to obtain a third classification result, including:
[0124] If the geometric features of the current QRS wave match the first geometric template, a third classification result is obtained; the first geometric template is updated according to the geometric features of the current QRS wave to obtain an updated first geometric template, and the updated first geometric template is used as the first geometric template; if the geometric features of the current QRS wave do not match the first geometric template, a fourth geometric template is constructed according to the geometric features of the current QRS wave, and the fourth geometric template is used as the first geometric template; then the current QRS wave is output as the third classification result.
[0125] Specifically, the method for updating the first geometric template is as follows: the updated first geometric template is obtained by averaging the geometric features of each QRS wave of the same type, as described in the formula below:
[0126] Assuming there are n QRS waves of the same type in class v, and each QRS wave has v geometric features extracted, then the feature description extracted from the i-th R wave is GR(i) = {fi0,fi1,…,fi(v-1)}. The updated first geometric template formula is then:
[0127]
[0128] Step 117: Based on the third classification result, match the geometric features of the current QRS wave with the second geometric template that stores the reference geometric features of the second QRS wave to determine the classification type of the current QRS wave.
[0129] The second geometric template is a split geometric template, and the second QRS wave reference geometric feature is a subordinate feature of the first QRS wave reference geometric feature; that is, the second geometric template is a subordinate template of the first geometric template. For example, the first geometric template can classify the R wave into class C, and the second geometric template can classify the C wave into class c within class C.
[0130] In one embodiment, before matching the geometric features of the current QRS wave with a second geometric template storing the second QRS wave reference geometric features, the method further includes:
[0131] Determine whether the second geometric template exists; if the second geometric template exists, perform the step of matching the geometric features of the current QRS wave with the second geometric template that stores the reference geometric features of the second QRS wave; if the second geometric template does not exist, output the current QRS wave as the final classification result; then construct a fifth geometric template based on the geometric features of the current QRS wave, and use the fifth geometric template as the second geometric template.
[0132] In one embodiment, matching the geometric features of the current QRS wave with a second geometric template storing the reference geometric features of the second QRS wave includes:
[0133] If the geometric features of the current QRS wave match the second geometric template, the final classification result is determined; the second geometric template is updated according to the geometric features of the current QRS wave to obtain the updated second geometric template, and the updated second geometric template is used as the second geometric template; if the geometric features of the current QRS wave do not match the second geometric template, a sixth geometric template is constructed according to the geometric features of the current QRS wave, and the sixth geometric template is used as the second geometric template; then the current QRS wave is output as the final classification result.
[0134] Specifically, the method for updating the second geometric template is as follows: averaging the geometric features of each QRS wave of the same type yields the updated second geometric template, as described in the formula below:
[0135] Assuming there are n QRS waves of the same type in class v, and each QRS wave has v extracted geometric features, then the feature description extracted from the i-th QRS wave is GR(i) = {fi0,fi1,…,fi(v-1)}. The updated second geometric template formula is then:
[0136]
[0137] In one embodiment, after matching the geometric features of the current QRS wave with a second geometric template storing second QRS wave reference geometric features to determine the classification type of the current QRS wave, the method further includes: splitting the second algebraic template according to the QRS wave classification result; and splitting the second geometric template according to the QRS wave classification result.
[0138] Specifically, based on the QRS wave classification results, the waveform features of the QRS wave are reconstructed according to the aforementioned algebraic template update method. That is, if it is classified as the i-th class, the waveform features of the current QRS wave are included in the algebraic template of the i-th class. Let the fragmentation algebraic template of the i-th class be DAModel(i) = {DA0, DA1, ..., DAu-1}, and the sequence length of this algebraic template be u. The waveform features of the current QRS wave are R(i) = {ri0, ri1, ..., ri(u-1)}. If there is no fragmentation algebraic template, then DAModel(i) = R(i). If there is a fragmentation algebraic template, then the fragmentation algebraic template is updated to DAModel(i) = 7 / 8 * DAModel(i) + 1 / 8 * R(i).
[0139] Specifically, based on the QRS wave classification results, the geometric features of the QRS wave are reconstructed according to the aforementioned geometric template update method. That is, if it is classified as the i-th class, the geometric features of the current QRS wave are incorporated into the geometric template of the i-th class. Let the geometric rupture template of the i-th class be DGModel(i) = {DG0, DG1, ..., DGv-1}, and the sequence length of this geometric template is v. The geometric features of the current QRS wave are GR(i) = {fi0, fi1, ..., fi(v-1)}. If there is no rupture geometric template, then DGModel(i) = GR(i). If there is a rupture geometric template, then the rupture geometric template is updated to DGModel(i) = 7 / 8 * DGModel(i) + 1 / 8 * GR(i).
[0140] This application proposes a method for classifying heartbeats in electrocardiogram (ECG) signals. The method includes: detecting QRS waves in a target ECG signal to obtain multiple QRS waves and waveform features of each QRS wave; matching the waveform features of the current QRS wave with a first algebraic template storing first QRS wave reference waveform features to obtain a first classification result; matching the waveform features of the current QRS wave with a second algebraic template storing second QRS wave reference waveform features based on the first classification result to obtain a second classification result; extracting features from the current QRS wave to determine its geometric features; matching the geometric features of the current QRS wave with a first geometric template storing first QRS wave reference geometric features based on the second classification result to obtain a third classification result; and matching the geometric features of the current QRS wave with a second geometric template storing second QRS wave reference geometric features based on the third classification result to determine the classification type of the current QRS wave. This application first performs a first classification using a first algebraic template, and then a second classification using a second algebraic template. This effectively avoids similar signals being excluded from the template and effectively avoids disseminated signals from different types of signals, thereby improving the accuracy of heartbeat classification. The application then performs a third classification using a first geometric template and a fourth classification using a second geometric template. This effectively avoids template contamination caused by different amplitude signals in a uniform template shape, thereby effectively reflecting amplitude consistency and further improving the accuracy of heartbeat classification.
[0141] In one embodiment, this application provides a cardiac signal heartbeat classification device, such as... Figure 4 As shown, Figure 4 This is a schematic diagram of a cardiac signal heartbeat classification device provided in an embodiment of this application. The device includes:
[0142] The waveform feature acquisition module 401 is used to perform QRS wave detection on the target electrocardiogram signal to obtain multiple QRS waves of the target electrocardiogram signal and the waveform features of each QRS wave.
[0143] The first classification module 402 is used to match the waveform features of the current QRS wave with the first algebraic template that stores the reference waveform features of the first QRS wave to obtain the first classification result.
[0144] The second classification module 403 is used to match the waveform features of the current QRS wave with a second algebraic template storing the second QRS wave reference waveform features based on the first classification result, so as to obtain a second classification result.
[0145] The geometric feature acquisition module 404 is used to extract features from the current QRS wave and determine the geometric features of the current QRS wave.
[0146] The third classification module 405 is used to match the geometric features of the current QRS wave with the first geometric template storing the first QRS wave reference geometric features according to the second classification result, so as to obtain the third classification result.
[0147] The fourth classification module 406 is used to match the geometric features of the current QRS wave with a second geometric template storing the second QRS wave reference geometric features based on the third classification result, so as to determine the classification type of the heartbeat corresponding to the target electrocardiogram signal.
[0148] like Figure 5 The diagram shown illustrates the internal structure of a computer device in one embodiment. This computer device may be an electrocardiogram (ECG) signal heart rate classification device, or a terminal or server connected to such a device. Figure 5 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and may also store a computer program that, when executed by the processor, enables the processor to implement a method for classifying electrocardiogram (ECG) signals and heartbeats. The internal memory may also store a computer program that, when executed by the processor, enables the processor to implement an ECG signal and heartbeat classification method. The network interface is used for communication with external devices. Those skilled in the art will understand that… Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0149] In one embodiment, the electrocardiogram signal heartbeat classification method provided in this application can be implemented as a computer program, and the computer program can be implemented as follows: Figure 5 The device runs on the computer shown. The computer's memory can store various program templates that make up the ECG signal heartbeat classification device. For example, waveform feature acquisition module 401, first classification module 402, second classification module 403, geometric feature acquisition module 404, third classification module 405, and fourth classification module 406.
[0150] A computer device includes a memory and a processor. The memory stores a computer program that, when executed by the processor, causes the processor to perform the following steps: detecting QRS waves in a target electrocardiogram (ECG) signal to obtain multiple QRS waves of the target ECG signal and waveform features of each QRS wave; matching the waveform features of the current QRS wave with a first algebraic template storing first QRS wave reference waveform features to obtain a first classification result; matching the waveform features of the current QRS wave with a second algebraic template storing second QRS wave reference waveform features based on the first classification result to obtain a second classification result; extracting features from the current QRS wave to determine its geometric features; matching the geometric features of the current QRS wave with a first geometric template storing first QRS wave reference geometric features based on the second classification result to obtain a third classification result; and matching the geometric features of the current QRS wave with a second geometric template storing second QRS wave reference geometric features based on the third classification result to determine the classification type of the heartbeat corresponding to the target ECG signal.
[0151] In one possible implementation, before matching the waveform features of the current QRS wave with a first algebraic template storing the waveform features of a first QRS wave reference, the method further includes: determining whether the first algebraic template exists; if the first algebraic template exists, performing the step of matching the waveform features of the current QRS wave with the first algebraic template storing the waveform features of a first QRS wave reference; if the first algebraic template does not exist, outputting the current QRS wave as a classification; then constructing a third algebraic template based on the waveform features of the current QRS wave, using the third algebraic template as the first algebraic template, and finally using the next QRS wave as the current QRS wave, and performing the step of determining whether the first algebraic template exists.
[0152] In one possible implementation, matching the waveform features of the current QRS wave with a first algebraic template storing the waveform features of a first QRS wave reference to obtain a first classification result includes: if the waveform features of the current QRS wave match the first algebraic template, then obtaining the first classification result; updating the first algebraic template according to the waveform features of the current QRS wave to obtain an updated first algebraic template, and finally using the updated first algebraic template as the first algebraic template; if the waveform features of the current QRS wave do not match the first algebraic template, then constructing a fourth algebraic template according to the waveform features of the current QRS wave, and using the fourth algebraic template as the first algebraic template; and then outputting the current QRS wave as the first classification result.
[0153] In one possible implementation, before matching the waveform features of the current QRS wave with a second algebraic template storing second QRS wave reference waveform features based on the first classification result, the method further includes: determining whether a second algebraic template exists; if a second algebraic template exists, performing the step of matching the waveform features of the current QRS wave with the second algebraic template storing second QRS wave reference waveform features; if a second algebraic template does not exist, constructing a fifth algebraic template based on the waveform features of the current QRS wave and using the fifth algebraic template as the second algebraic template; and then outputting the current QRS wave as the second classification result.
[0154] In one possible implementation, the step of performing QRS wave detection on the target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave includes: acquiring the target ECG signal; preprocessing the target ECG signal to obtain a preprocessed target ECG signal; and performing QRS wave detection on the preprocessed target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave.
[0155] In one possible implementation, the step of performing QRS wave detection on the target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave includes: performing QRS wave detection on the target ECG signal using the Tompkins algorithm to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave.
[0156] In one possible implementation, the geometric features include at least one of the following: left amplitude, right amplitude, left width, right width, amplitude, width, and area features.
[0157] A computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to perform the following steps: detecting QRS waves in a target electrocardiogram (ECG) signal to obtain multiple QRS waves of the target ECG signal and waveform features of each QRS wave; matching the waveform features of the current QRS wave with a first algebraic template storing first QRS wave reference waveform features to obtain a first classification result; matching the waveform features of the current QRS wave with a second algebraic template storing second QRS wave reference waveform features based on the first classification result to obtain a second classification result; extracting features from the current QRS wave to determine its geometric features; matching the geometric features of the current QRS wave with a first geometric template storing first QRS wave reference geometric features based on the second classification result to obtain a third classification result; and matching the geometric features of the current QRS wave with a second geometric template storing second QRS wave reference geometric features based on the third classification result to determine the classification type of the heartbeat corresponding to the target ECG signal.
[0158] In one possible implementation, before matching the waveform features of the current QRS wave with a first algebraic template storing the waveform features of a first QRS wave reference, the method further includes: determining whether the first algebraic template exists; if the first algebraic template exists, performing the step of matching the waveform features of the current QRS wave with the first algebraic template storing the waveform features of a first QRS wave reference; if the first algebraic template does not exist, outputting the current QRS wave as a classification; then constructing a third algebraic template based on the waveform features of the current QRS wave, using the third algebraic template as the first algebraic template, and finally using the next QRS wave as the current QRS wave, and performing the step of determining whether the first algebraic template exists.
[0159] In one possible implementation, matching the waveform features of the current QRS wave with a first algebraic template storing the waveform features of a first QRS wave reference to obtain a first classification result includes: if the waveform features of the current QRS wave match the first algebraic template, then obtaining the first classification result; updating the first algebraic template according to the waveform features of the current QRS wave to obtain an updated first algebraic template, and finally using the updated first algebraic template as the first algebraic template; if the waveform features of the current QRS wave do not match the first algebraic template, then constructing a fourth algebraic template according to the waveform features of the current QRS wave, and using the fourth algebraic template as the first algebraic template; and then outputting the current QRS wave as the first classification result.
[0160] In one possible implementation, before matching the waveform features of the current QRS wave with a second algebraic template storing second QRS wave reference waveform features based on the first classification result, the method further includes: determining whether a second algebraic template exists; if a second algebraic template exists, performing the step of matching the waveform features of the current QRS wave with the second algebraic template storing second QRS wave reference waveform features; if a second algebraic template does not exist, constructing a fifth algebraic template based on the waveform features of the current QRS wave and using the fifth algebraic template as the second algebraic template; and then outputting the current QRS wave as the second classification result.
[0161] In one possible implementation, the step of performing QRS wave detection on the target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave includes: acquiring the target ECG signal; preprocessing the target ECG signal to obtain a preprocessed target ECG signal; and performing QRS wave detection on the preprocessed target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave.
[0162] In one possible implementation, the step of performing QRS wave detection on the target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave includes: performing QRS wave detection on the target ECG signal using the Tompkins algorithm to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave.
[0163] In one possible implementation, the geometric features include at least one of the following: left amplitude, right amplitude, left width, right width, amplitude, width, and area features.
[0164] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. This program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0165] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0166] The above embodiments merely illustrate several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A method for classifying cardiac beats using electrocardiogram signals, characterized in that, The method includes: QRS wave detection is performed on the target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave; The waveform features of the current QRS wave are matched with the first algebraic template that stores the waveform features of the first QRS wave reference to obtain the first classification result. Based on the first classification result, the waveform features of the current QRS wave are matched with the second algebraic template that stores the second QRS wave reference waveform features to obtain the second classification result; the second algebraic template is a split algebraic template, which is a lower-level template of the first algebraic template, and the second QRS wave reference waveform features are lower-level features of the first QRS wave reference waveform features; Feature extraction is performed on the current QRS wave to determine its geometric features; Based on the second classification result, the geometric features of the current QRS wave are matched with the first geometric template that stores the reference geometric features of the first QRS wave to obtain the third classification result; Based on the third classification result, the geometric features of the current QRS wave are matched with the second geometric template that stores the second QRS wave reference geometric features to determine the classification type of the heartbeat corresponding to the target ECG signal. The second geometric template is a split geometric template and is a lower template of the first geometric template. The second QRS wave reference geometric features are lower features of the first QRS wave reference geometric features.
2. The method according to claim 1, characterized in that, Before matching the waveform features of the current QRS wave with the first algebraic template storing the waveform features of the first QRS wave reference, the method further includes: Determine whether the first algebraic template exists; If the first algebraic template exists, then the step of matching the waveform features of the current QRS wave with the first algebraic template storing the reference waveform features of the first QRS wave is executed; If the first algebraic template does not exist, the current QRS wave is output as a classification; then, a third algebraic template is constructed based on the waveform characteristics of the current QRS wave, and the third algebraic template is used as the first algebraic template; finally, the next QRS wave is used as the current QRS wave, and the step of determining whether the first algebraic template exists is executed.
3. The method according to claim 1, characterized in that, The step of matching the waveform features of the current QRS wave with a first algebraic template storing the waveform features of a first QRS wave reference to obtain a first classification result includes: If the waveform features of the current QRS wave match the first algebraic template, a first classification result is obtained; and the first algebraic template is updated according to the waveform features of the current QRS wave to obtain an updated first algebraic template. Finally, the updated first algebraic template is used as the first algebraic template. If the waveform characteristics of the current QRS wave do not match the first algebraic template, a fourth algebraic template is constructed based on the waveform characteristics of the current QRS wave, and the fourth algebraic template is used as the first algebraic template; then the current QRS wave is output as the first classification result.
4. The method according to claim 1, characterized in that, Before matching the waveform features of the current QRS wave with the second algebraic template storing the second QRS wave reference waveform features based on the first classification result, the method further includes: Determine if the second algebraic template exists; If the second algebraic template exists, then the step of matching the waveform features of the current QRS wave with the second algebraic template storing the second QRS wave reference waveform features is performed; If the second algebraic template does not exist, a fifth algebraic template is constructed based on the waveform characteristics of the current QRS wave, and the fifth algebraic template is used as the second algebraic template; then the current QRS wave is output as the second classification result.
5. The method according to claim 1, characterized in that, The step of performing QRS wave detection on the target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave includes: Acquire the target electrocardiogram signal; The target electrocardiogram signal is preprocessed to obtain the preprocessed target electrocardiogram signal; The preprocessed target ECG signal is subjected to QRS wave detection to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave.
6. The method according to claim 1, characterized in that, The step of performing QRS wave detection on the target ECG signal to obtain multiple QRS waves of the target ECG signal and the waveform characteristics of each QRS wave includes: The Tompkins algorithm is used to detect QRS waves in the target ECG signal, resulting in multiple QRS waves and waveform characteristics of each QRS wave.
7. The method according to claim 1, characterized in that, The geometric features include at least one of the following: left amplitude, right amplitude, left width, right width, amplitude, width, and area features.
8. A cardiac signal heartbeat classification device, characterized in that, The device includes: The waveform feature acquisition module is used to detect QRS waves in the target electrocardiogram signal to obtain multiple QRS waves of the target electrocardiogram signal and the waveform features of each QRS wave. The first classification module is used to match the waveform features of the current QRS wave with the first algebraic template that stores the reference waveform features of the first QRS wave to obtain the first classification result; The second classification module is used to match the waveform features of the current QRS wave with a second algebraic template storing the second QRS wave reference waveform features according to the first classification result, so as to obtain a second classification result; the second algebraic template is a split algebraic template, which is a lower-level template of the first algebraic template, and the second QRS wave reference waveform features are lower-level features of the first QRS wave reference waveform features; The geometric feature acquisition module is used to extract features from the current QRS wave and determine the geometric features of the current QRS wave. The third classification module is used to match the geometric features of the current QRS wave with the first geometric template storing the reference geometric features of the first QRS wave based on the second classification result, so as to obtain the third classification result; The fourth classification module is used to match the geometric features of the current QRS wave with a second geometric template storing the second QRS wave reference geometric features based on the third classification result, and determine the classification type of the heartbeat corresponding to the target ECG signal. The second geometric template is a split geometric template, which is a lower template of the first geometric template, and the second QRS wave reference geometric feature is a lower feature of the first QRS wave reference geometric feature.
9. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method as claimed in any one of claims 1-7.
10. A computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the steps of the method as claimed in any one of claims 1-7.
Citation Information
Patent Citations
Method for generating heart beating waveform template and treating ventricular premature beat detection and device
CN102835954A