Heart beat recognition method based on full-lead electrocardiosignals

Through the heartbeat recognition method of full-lead ECG signals, combined with the single waveform alignment and continuous waveform matching operations of multi-lead data, the problem that single-lead ECG is susceptible to noise interference is solved, and the accuracy and stability of heartbeat recognition are achieved.

CN120678443APending Publication Date: 2025-09-23WUXI JIANWEI INSTR CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510843885.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-23
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

In the existing technology, when heartbeat recognition is performed based on single-lead electrocardiogram data, it is easily affected by noise such as poor electrode contact, motion artifacts and power supply interference, resulting in false detection or missed detection, especially unstable recognition in complex heart rhythm situations.

Method used

A heartbeat recognition method based on full-lead ECG signals is adopted. After heartbeat recognition for each lead, single waveform alignment and continuous waveform matching operations are used to combine multi-lead data in the time domain and feature domain to eliminate noise interference and ensure the accuracy of the recognition results.

Benefits of technology

It improves the accuracy of heartbeat recognition, effectively eliminates noise interference, ensures stable recognition of complex heart rhythms, and reduces the amount of calculation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120678443A_ABST
    Figure CN120678443A_ABST
Patent Text Reader

Abstract

According to the heart beat recognition method based on the full-lead electrocardiosignals, the heart beats are recognized through full-lead electrocardiosignal data, after the heart beats in all lead data are recognized on the basis of an existing heart beat recognition method, the to-be-analyzed time period corresponding to the to-be-analyzed waveform is found, and the to-be-analyzed waveform is analyzed according to the to-be-analyzed time period. Whether heart beat data exist in other lead data or not is determined based on single waveform alignment operation, if the heart beat data exist in MatchN leads of other leads in the same time period, continuous waveform data where the waveform to be analyzed is located is further analyzed, and if all the MatchN lead data can be subjected to continuous waveform matching operation, the continuous waveform data of the to-be-analyzed waveform can be subjected to continuous waveform matching operation. The continuous waveform matched and aligned with the to-be-analyzed continuous waveform is found in the single cardiac beat matching lead waveform set corresponding to all leads, and the to-be-analyzed waveform is the correct waveform.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of heartbeat recognition, and in particular to a heartbeat recognition method based on full-lead electrocardiogram signals. Background Art

[0002] The electrocardiogram (ECG) is an important tool for monitoring and evaluating cardiac electrical activity in clinical diagnosis. Beat recognition, a fundamental step in automated ECG analysis, plays a key role in tasks such as arrhythmia screening, heart rate variability analysis, and ECG event detection. Currently, beat recognition algorithms primarily focus on single-lead ECG signals. Common methods include threshold detection based on time-domain features, the Pan-Tompkins algorithm based on differential operations, multi-scale analysis methods based on wavelet transforms, and the recently emerging deep learning methods such as convolutional neural networks (CNNs). For example, application number CN202311337864.8 is a machine learning-based ECG beat classification method currently being used by our company. This method uses the ECG signal from the primary lead (e.g., lead II) to identify the R wave using existing techniques such as the PT (Pan-Tompkins) algorithm before performing subsequent calculations.

[0003] However, in actual use, it was found that when performing R-wave recognition on the ECG data transmitted by the main lead, in actual application scenarios such as clinical or remote monitoring, the ECG signal is often affected by noise such as poor electrode contact, motion artifacts, and power supply interference. Single-lead recognition is easily affected by interference, resulting in false detection or missed detection. For complex heart rhythms such as premature beats, atrial fibrillation, and ventricular pacing, R-wave deformation or significant changes in amplitude may occur in some leads, making it difficult for the single-lead method to identify them stably. Summary of the Invention

[0004] In order to solve the problems in the existing technology that heartbeat recognition is always based on single-lead electrocardiogram data, which is susceptible to interference and leads to false detection or missed detection, and the recognition results of complex heart rhythm data are unstable, the present invention provides a heartbeat recognition method based on full-lead electrocardiogram signals, which can give full play to the synergistic advantages of full-lead data and improve the accuracy of heartbeat recognition.

[0005] The technical solution of the present invention is as follows: a heartbeat recognition method based on full-lead electrocardiogram signals, characterized in that it includes the following steps: S1: Obtain the electrocardiogram data collected by N leads in the same time period, which is recorded as the electrocardiogram data to be identified; S2: performing heartbeat recognition on each of the N pieces of electrocardiogram data to be recognized based on a heartbeat recognition algorithm; Arrange all the heartbeat recognition results corresponding to each lead in chronological order to obtain the waveform set of heartbeat data, which is recorded as: QRSn, where n is the nth lead, 1 <n≤N; Denote the waveform data included in each waveform set QRSn as: QRSn , where i is the waveform of the i-th heartbeat in the recognition result corresponding to the n-th lead; S3: Obtain any waveform set QRSn corresponding to a lead, denote it as: the waveform set of the lead to be analyzed, and denote the other waveform sets as: the comparison sets; Confirm the number of heartbeat data included in the waveform set of the lead to be analyzed, and assign it to M; Initialize the heartbeat data set temp to be empty; S4: In the waveform set of the lead to be analyzed, sequentially extract the waveform data QRSn of each heartbeat in chronological order i , denote it as: the waveform to be analyzed; Denote the start and end times corresponding to the waveform to be analyzed as: the time period to be analyzed; S5: Sequentially extract each waveform set QRSn in the comparison sets, and confirm whether there is heartbeat data in the waveform set QRSn within the time period to be analyzed; If there is, save all the heartbeat data existing within the time period to be analyzed into the heartbeat data set temp; S6: Confirm whether the heartbeat data set temp is empty; If the heartbeat data set temp is not empty, execute step S7; Otherwise, loop and execute steps S4~S6 until all M heartbeat data in the waveform set of the lead to be analyzed have participated in the calculation, and then execute step S11; S7: Sequentially read the waveform data in the heartbeat data set temp, denote it as: the alignment target data, and denote the waveform to be analyzed as: the data to be aligned; Perform a single waveform alignment operation on the alignment target data and the data to be aligned; Based on the single waveform alignment operation, find the heartbeat data that is temporally aligned and matched with the waveform to be analyzed in the heartbeat data set temp; Denote the heartbeat data that is temporally aligned and matched with the waveform to be analyzed found through the single waveform alignment operation as: the heartbeat data after matching; S8: After all the heartbeat data in the heartbeat data set temp have participated in the calculation, count the number MatchN of the heartbeat data after matching obtained; Compare MatchN with the preset matching threshold MatchThr; If MatchN < MatchThr, it means that the waveform to be analyzed is an abnormal waveform. Loop and execute steps S4~S8 until all M heartbeat data in the waveform set of the lead to be analyzed have participated in the calculation, and then execute step S11; Otherwise, execute step S9; S9: Find the continuous waveform where the waveform to be analyzed is located in the set of lead waveforms to be analyzed, and record it as the continuous waveform to be analyzed; Find the leads corresponding to all matched heartbeat data corresponding to the waveform to be analyzed, and record the waveform data set of each lead as: a single heartbeat matching lead waveform set; S10: performing a continuous waveform matching operation on each of the single beat matching lead waveform sets and the continuous waveform to be analyzed; Based on the continuous waveform matching operation, finding a continuous waveform that matches and aligns with the continuous waveform to be analyzed in the single beat matching lead waveform set, and if it can be found, it means that the single beat matching lead waveform set passes the matching operation; If all of the single beat matching lead waveform sets pass the continuous waveform matching operation, it indicates that the waveform to be analyzed is a correct waveform and the corresponding heartbeat data is correct heartbeat data; steps S4 to S10 are executed repeatedly until all M heartbeat data in the lead waveform set to be analyzed are included in the calculation, and then step S11 is executed; Otherwise, it indicates that the waveform to be analyzed is an abnormal waveform, and steps S4 to S10 are executed in a loop until all M heartbeat data in the lead waveform set to be analyzed are involved in the calculation, and then step S11 is executed; S11: Execute steps S3 to S10 repeatedly until all N-lead waveform sets are involved in the calculation, and then end this round of calculation; S12: splicing the recognition results corresponding to the electrocardiogram data to be recognized corresponding to the N leads to obtain the recognition result of the current heartbeat data.

[0006] It is further characterized by: The single waveform alignment operation includes the following steps: a1: confirm the time point corresponding to the highest point of the R wave of the data to be aligned, recorded as the time point to be analyzed T1; a2: confirm the time point corresponding to the highest point of the R wave of the alignment target data, recorded as matching time point T2; a3: Compare T1 and T2; If |T1-T2|≤THR, it means that the R waves of the two heartbeat data can be aligned and matched, and the corresponding alignment target data is recorded as: the matched heartbeat data; Otherwise, it means that the two heartbeat data cannot be aligned and matched; Wherein, THR is the preset time point alignment threshold, in milliseconds; The continuous waveform matching operation comprises the following steps: b1: Read the preset continuous waveform number judgment parameter conti, which meets the following conditions: 2*conti+1 <TotalMum; Wherein, TotalMum is the minimum number of heartbeat waveforms included in the waveform set corresponding to the lead; b2: Based on the waveform to be analyzed, find heartbeat data that forms a continuous waveform with the waveform to be analyzed in the lead waveform set to be analyzed, and construct the continuous waveform to be analyzed; The heartbeat data included in the continuous waveform to be analyzed are respectively recorded as: heartbeat data to be judged; The number of heartbeat data to be judged is 2*conti+1; b3: extracting each heartbeat data to be judged one by one; The start and end time corresponding to each of the heartbeat data to be determined is recorded as the time period to be matched; b4: extracting the corresponding waveform set included in the single beat matching lead waveform set, which is recorded as the to-be-matched lead waveform set; In each of the lead waveform sets to be matched, confirming whether a waveform of heartbeat data exists in each of the time periods to be matched; If any of the to-be-matched lead waveform sets does not have a waveform of heartbeat data in the to-be-matched time period, it is determined that the to-be-analyzed continuous waveform matching operation has not passed this continuous waveform matching operation, and this operation is stopped; Otherwise, if all the to-be-matched lead waveform sets have heartbeat data waveforms in the to-be-matched time period, the found heartbeat data is recorded as alignment target data, and a continuous waveform alignment heartbeat set is constructed; and step b5 is executed; b5: record the heartbeat data to be determined as data to be aligned; Performing the single waveform alignment operation on the alignment target data and the data to be aligned corresponding to each time period to be matched; If, in the single waveform alignment operation, any of the alignment target data and the heartbeat data to be determined cannot be aligned and matched, it is determined that the to-be-analyzed data has not passed this continuous waveform matching operation, and the operation is stopped; Otherwise, if all the alignment target data and the heartbeat data to be determined are aligned and matched, step b6 is executed; b6: Looping through steps b3 to b5 until all of the heartbeat data to be determined in the single heartbeat matching lead waveform set have passed the single waveform alignment operation and the corresponding matched heartbeat data have been found, then determining that the continuous waveform to be analyzed has passed this continuous waveform matching operation; In step b2, the method for constructing the continuous waveform to be analyzed includes the following steps: c1: confirming the position of the waveform to be analyzed in the set of lead waveforms to be analyzed; If the number of heartbeat data on either side of the waveform to be analyzed is less than conti, executing step c2; Otherwise, when the number of heartbeats on both sides of the waveform to be analyzed is greater than or equal to conti, execute step c3; c2: In the set of lead waveforms to be analyzed, take the beat data at the end of the side with fewer beat data than conti as the first data, and continuously read 2*conti+1 waveforms to the other side to construct a waveform set consisting of 2*conti+1 data, which is recorded as: continuous waveform to be analyzed; c3: Taking the waveform to be analyzed as the center point, continuously search for conti heartbeat data on both sides to construct a waveform set including 2*conti+1 data, which is recorded as: continuous waveform to be analyzed; In step S2, heartbeat recognition is performed on the to-be-recognized electrocardiogram data corresponding to each lead based on the pan-Tompkins method; When performing heartbeat recognition on the to-be-recognized electrocardiogram data based on the pan-Tompkins method, when detecting the peak value of the R wave by using the signal threshold and the noise threshold, the method further includes the following steps: d1: Combine the signal threshold and noise threshold for each time and save it as a value in the set Thre; d2: After each threshold combination is stored, the number Tm of combinations stored in the set Thre is confirmed; Compare Tm with the preset storage threshold QRSTNUMBER; When Tm>QRSTNUMBER, the earliest stored threshold combination in the set Thre is deleted; d3: extract each combination of signal threshold and noise threshold from the set Thre one by one, and record it as: threshold group to be compared; d4: The signal threshold included in the threshold group to be compared is recorded as ST, and the noise threshold is recorded as NT; d5: Based on the thresholds ST and NT, a dual-threshold comparison mechanism is used to detect the R wave peak value of this detection value; If the detected value is identified as an R wave, the identification of the ECG data to be identified is stopped and subsequent operations are performed; Otherwise, if the current detection value is identified as noise, steps d3 to d5 are executed in a loop until all QRSTNUMBER thresholds in the set Thre are involved in the calculation, and the ECG data to be identified is determined to be noise.

[0007] The present application provides a heartbeat recognition method based on full-lead ECG signals, which uses full-lead ECG data to identify heartbeats, and marks the waveform of heartbeat data based on the peak of the R wave. Because different leads record the projections of the same cardiac event in different directions and contain complementary spatiotemporal information, this method is based on the existing heartbeat recognition method. After identifying the heartbeats in all lead data, the time period to be analyzed corresponding to the waveform to be analyzed is found, and based on the single waveform alignment operation, it is confirmed whether there is heartbeat data in other lead data. If there is heartbeat data in the same time period in the MatchN leads of other leads, the continuous time period of the waveform to be analyzed is further aligned. Waveform data is analyzed. If all MatchN lead data can pass the continuous waveform matching operation, that is, a continuous waveform that matches and aligns with the continuous waveform to be analyzed is found in the set of single-beat matching lead waveforms corresponding to all leads, then the waveform to be analyzed is the correct waveform. Because random noise effects such as poor electrode contact, motion artifacts, and power supply interference only cause changes in a small number of leads, this application leverages the synergistic advantages of full-lead data, combining judgments from both the time domain and the feature domain. By sequentially performing single waveform alignment and continuous waveform matching operations, noisy waveforms are effectively eliminated, ensuring the accuracy of the identified heartbeat data results. This method is based on full-lead ECG data and utilizes the random influence characteristics of interference for anti-interference processing. It is more sensitive to interference noise in ECG data and ensures accurate elimination of noise effects. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] Figure 1 A flowchart of the heartbeat recognition method of this application; Figure 2 This is an example of full-lead ECG data to be identified; Figure 3 This is a schematic diagram of the ECG waveform structure corresponding to a standard heartbeat; Figure 4 This is an example of heartbeat data detection results based on traditional PT algorithm detection results; Figure 5 This is an example of heartbeat data detection results based on the improved PT algorithm detection results in this method; Figure 6 is an example of a continuous waveform to be analyzed. DETAILED DESCRIPTION

[0009] like Figure 1As shown, the present invention includes a heartbeat recognition method based on full-lead electrocardiogram signals, which includes the following steps.

[0010] S1: Obtain electrocardiogram data collected from N leads in the same time period, which is recorded as: electrocardiogram data to be identified.

[0011] The specific value of N depends on the ECG acquisition device. Some portable ECG acquisition devices have 6 leads. However, the conventional ECG in clinical practice has 12 leads. Figure 2 As shown, it includes 6 limb leads and 6 chest leads. The position of the limb leads: there are 4 electrodes connected to the wires, and the electrodes are placed at the ends of the limbs, that is, the wrist of the left upper limb, the ankle of the left lower limb, the wrist of the right upper limb and the ankle of the right lower limb. Leads I, II, III, aVR, aVL and aVF are recorded respectively, and the chest leads refer to the six leads V1 to V6. In some special cases, a 16-lead ECG is used. The 16-lead ECG is based on the 12-lead ECG with V7, V8, V3R and V4R leads added. This embodiment is explained using the 12-lead ECG as an example.

[0012] S2: Based on the heartbeat recognition algorithm, the heartbeat recognition is performed on N pieces of ECG data to be recognized respectively; Arrange all the heartbeat recognition results corresponding to each lead in chronological order to obtain the waveform set of heartbeat data, which is recorded as: QRSn, where n is the nth lead, 1 <n≤N; The waveform data included in each waveform set QRSn is recorded as: QRSn i , i is the waveform of the i-th heart beat in the recognition result corresponding to the n-th lead.

[0013] In this method, the heartbeat recognition is first performed on the ECG data in each lead based on various existing heartbeat recognition algorithms. Figure 3 The figure below shows a schematic diagram of the ECG waveform corresponding to a normal heartbeat. Because ECG data collected from different leads have different waveform characteristics, this method uses the peak position of the R wave to represent the waveform position of a heartbeat. When the same time domain point corresponds to the presence of an R wave peak in data from different leads, it can be determined that a heartbeat waveform exists in the data from these leads within the same time period. This eliminates the need to identify the entire waveform, effectively reducing the overall computational effort.

[0014] S3: Obtain the waveform set QRSn corresponding to any lead and record it as the waveform set of the lead to be analyzed, and record the other waveform sets as the comparison sets; Determine the number of heartbeat data included in the lead waveform set to be analyzed and assign it to M; Initialize the heartbeat data set temp to be empty.

[0015] S4: In the set of lead waveforms to be analyzed, the waveform data QRSn of each heartbeat is taken out one by one in chronological order. i , recorded as: waveform to be analyzed; the start and end time corresponding to the waveform to be analyzed is recorded as: time period to be analyzed.

[0016] S5: Take out each waveform set QRSn in the comparison set one by one, and confirm whether the waveform set QRSn has heart beat data in the time period to be analyzed; If so, all the heartbeat data within the time period to be analyzed are saved in the heartbeat data set temp.

[0017] S6: confirm whether the heartbeat data set temp is empty; If the heartbeat data set temp is not empty, execute step S7; Otherwise, steps S4 to S6 are executed in a loop until all M heartbeat data in the lead waveform set to be analyzed are involved in the calculation, and then step S11 is executed.

[0018] S7: Read the waveform data in the heartbeat data set temp one by one, record them as alignment target data, record the waveform to be analyzed as data to be aligned; perform a single waveform alignment operation on the alignment target data and the data to be aligned; Based on a single waveform alignment operation, heartbeat data that is temporally aligned with the waveform to be analyzed is found in the heartbeat data set temp; the heartbeat data that is temporally aligned with the waveform to be analyzed found through the single waveform alignment operation is recorded as: matched heartbeat data.

[0019] A single waveform alignment operation consists of the following steps: a1: confirm the time point corresponding to the highest point of the R wave of the data to be aligned, recorded as: time point to be analyzed T1; a2: confirm the time point corresponding to the highest point of the R wave of the alignment target data, recorded as: matching time point T2; a3: Compare T1 and T2; If |T1-T2|≤THR, it means that the R waves of the two heartbeat data can be aligned and matched, and the corresponding alignment target data is recorded as: the matched heartbeat data; Otherwise, it means that the two heartbeat data cannot be aligned and matched; THR is the preset time point alignment threshold, in milliseconds.

[0020] In specific implementation, considering the time difference in data transfer between different leads, a time threshold THR is set in this method. When the time difference between T1 and T2 is within plus or minus THR, it can be determined that they are at the same time point. The specific value of THR is set according to the calculation accuracy requirements. In this embodiment, THR is set to 10 ms.

[0021] As Figure 2 shown, assuming the electrocardiogram data of lead V6 is taken as an example, the position of the waveform to be analyzed is as shown in the figure. After a single waveform alignment operation on the waveform to be analyzed, it may be aligned and matched with the heartbeat data in the same period to be analyzed in leads II, III, aVF, V1 - V5. However, there are no R-wave peaks in leads I, aVR, and aVL in the same period to be analyzed. Therefore, the result of the single waveform alignment operation may be that no alignment and matching can be achieved.

[0022] S8: After all the heartbeat data in the heartbeat data set temp have participated in the calculation, the number of heartbeat data after matching, MatchN, is statistically obtained; Compare MatchN with the preset matching threshold MatchThr; among them, the value of MatchThr is set to 3; If MatchN < MatchThr, it indicates that the waveform to be analyzed is an abnormal waveform. Steps S4 - S8 are executed in a loop until all M heartbeat data in the waveform set of the lead to be analyzed have participated in the calculation, and then step S11 is executed; Otherwise, step S9 is executed.

[0023] In a multi-lead electrocardiogram, different leads record the projections of the same cardiac event in different directions, containing complementary spatio-temporal information. In practical application scenarios such as clinical or remote monitoring, the ECG signal is often affected by noises such as poor electrode contact, motion artifacts, and power interference. These random noises will appear in some individual leads or a few leads. This method improves the accuracy of the recognition result by setting the matching threshold MatchThr to filter out the randomly appearing interference noises. For complex heart rhythms such as premature beats, atrial fibrillation, and ventricular pacing, the R-wave deformation or significant amplitude change will occur simultaneously in some leads. By combining the multi-lead data in two aspects of the time domain and the feature domain, it is ensured that the waveforms of complex heart rhythms will not be missed.

[0024] S9: In the waveform set of the lead to be analyzed, find the continuous waveform where the waveform to be analyzed is located, denoted as: the continuous waveform to be analyzed; Find the leads corresponding to all the heartbeat data after matching for the waveform to be analyzed, and denote the waveform data set of each lead as: the single heartbeat matching lead waveform set.

[0025] S10: performing a continuous waveform matching operation on each single beat matching lead waveform set and the continuous waveform to be analyzed; Based on the continuous waveform matching operation, a continuous waveform that matches and aligns with the continuous waveform to be analyzed is found in the single beat matching lead waveform set. If it can be found, it means that the single beat matching lead waveform set passes the matching operation; If all single beat matching lead waveform sets pass the continuous waveform matching operation, it means that the waveform to be analyzed is a correct waveform and its corresponding heart beat data is correct heart beat data; steps S4 to S10 are executed repeatedly until all M heart beat data in the lead waveform set to be analyzed are included in the calculation, and then step S11 is executed; Otherwise, it indicates that the waveform to be analyzed is an abnormal waveform, and steps S4 to S10 are executed in a loop until all M heartbeat data in the lead waveform set to be analyzed are involved in the calculation, and then step S11 is executed.

[0026] The continuous waveform matching operation includes the following steps: b1: Read the preset continuous waveform number judgment parameter conti, which meets the following conditions: 2*conti+1 <TotalMum; Wherein, TotalMum is the minimum number of heartbeat waveforms included in the waveform set corresponding to the lead; the specific value of conti is preset according to actual calculation needs. In this embodiment, the value of conti is set to 2; b2: Based on the waveform to be analyzed, find the heartbeat data that forms a continuous waveform with the waveform to be analyzed in the set of lead waveforms to be analyzed, and construct the continuous waveform to be analyzed; The heartbeat data included in the continuous waveform to be analyzed are respectively recorded as: heartbeat data to be judged; The number of heartbeat data to be judged is 2*conti+1; b3: Take out each heartbeat data to be judged one by one; The start and end time corresponding to each heartbeat data to be judged is recorded as the time period to be matched; b4: extract the corresponding waveform set included in the single beat matching lead waveform set, which is recorded as the to-be-matched lead waveform set; In each set of lead waveforms to be matched, confirm whether there is a waveform of heartbeat data in each time period to be matched; If any of the lead waveform sets to be matched does not contain any heartbeat data waveform in the matching time period, it is determined that the analyzed sequence has not passed this continuous waveform matching operation, and the operation is stopped; Otherwise, if all the to-be-matched lead waveform sets have heartbeat data waveforms in the to-be-matched time period, the found heartbeat data is recorded as the alignment target data, and a continuous waveform alignment heartbeat set is constructed; and step b5 is executed; b5: record the heartbeat data to be judged as data to be aligned; Perform a single waveform alignment operation on the alignment target data and the data to be aligned corresponding to each time period to be matched; If, in a single waveform alignment operation, any of the alignment target data and the heartbeat data to be judged cannot be aligned, then it is determined that the data to be analyzed has not passed this continuous waveform matching operation, and the operation is stopped; Otherwise, if all the alignment target data and the heartbeat data to be judged are aligned and matched, step b6 is executed; b6: Loop through steps b3 to b5 until all the heartbeat data to be determined have passed the single waveform alignment operation in the single heartbeat matching lead waveform set and the corresponding matched heartbeat data have been found. Then, it is determined that the continuous waveform to be analyzed has passed this continuous waveform matching operation.

[0027] In step b2, the method for constructing the continuous waveform to be analyzed includes the following steps.

[0028] c1: Confirm the location of the waveform to be analyzed in the set of lead waveforms to be analyzed; If the number of heartbeat data on either side of the waveform to be analyzed is less than conti, execute step c2; Otherwise, when the number of heartbeats on both sides of the waveform to be analyzed is greater than or equal to conti, step c3 is executed.

[0029] c2: In the set of lead waveforms to be analyzed, take the beat data at the end of the side where the number of beat data is less than conti as the first data, and continuously read 2*conti+1 waveforms to the other side to construct a waveform set including 2*conti+1 data, which is recorded as: continuous waveform to be analyzed.

[0030] Refer to the attached Figure 6 In the figure, triangles represent the ECG data corresponding to a heartbeat, and red triangles represent the waveform to be analyzed. When the value of conti is 2, Examples 1 and 2 indicate that the number of beats on the left side of the waveform to be analyzed is less than 2, while Example 4 indicates that the number of beats on the right side is less than 2. Therefore, in both Examples 1 and 2, counting begins at the leftmost beat and reads five consecutive waveforms to the right to form the continuous waveform to be analyzed. In Example 4, starting with the rightmost beat as the first beat, five consecutive beats are read to the left to form the continuous waveform to be analyzed.

[0031] c3: Take the waveform to be analyzed as the center point, and continuously find conti heartbeat data on both sides to construct a waveform set including 2*conti+1 data, which is recorded as: continuous waveform to be analyzed. Figure 6 In Example 3, if there are more than two heartbeat data on both sides of the red waveform to be analyzed, two more heartbeat data are read continuously on both sides of the waveform to be analyzed, forming a continuous waveform of 5 heartbeats to be analyzed.

[0032] In this method, after performing a single waveform alignment operation on each waveform to be analyzed, it is also necessary to perform an alignment matching judgment on the continuous waveform containing the waveform to be analyzed. Because some relatively large noise can affect all leads at the same time, in this application, through the continuous waveform matching operation, it is ensured that the waveform to be analyzed corresponding to a single heartbeat, and its preceding and following waveforms are also present on the other MatchThr leads that have passed the single waveform alignment operation, effectively eliminating the impact of noise on the final recognition result. When the continuous 2*conti+1 waveforms on the MatchThr leads are the same, it can be judged that the waveform to be analyzed is a normal waveform.

[0033] like Figure 2 As shown in the figure, taking the ECG data of lead V6 as an example, the position of the continuous waveform to be analyzed is shown in the figure. After the continuous waveform matching operation, the continuous waveform to be analyzed may be aligned with the aVF and V1~V5 leads through the continuous waveform matching operation, but cannot be aligned with the heart beat data in the time period of leads I, II, III, aVR, and aVL.

[0034] S11: Execute steps S3 to S10 cyclically until all N-lead waveform sets are involved in the calculation, and then end this round of calculation.

[0035] S12: splicing the recognition results corresponding to the electrocardiogram data to be recognized corresponding to the N leads to obtain the recognition result of the current heartbeat data.

[0036] In this application, interference noise is considered random, but heartbeats are regular and fixed. Interference noise can cause waveform differences between different leads. If there are multiple consecutive waveform positions of MatchThr leads that are consistent, the waveforms of those MatchThr leads can be assumed to be correct. This application utilizes the random influence of interference to resist interference, making it more sensitive to interference and easier to eliminate.

[0037] Numerous heartbeat recognition algorithms exist in the prior art, such as those that calculate QRS waves based on template matching or QRS wave localization algorithms implemented through machine learning or deep learning. This embodiment uses the pan-Tompkins algorithm to identify the R wave in the ECG data corresponding to each lead, achieving a preliminary assessment of the heartbeat without having to calculate the entire waveform of the heartbeat data, effectively improving computational efficiency and reducing computational complexity. However, when using the PT algorithm for R-wave recognition, the presence of noise can significantly increase the threshold in the PT algorithm, leading to failure to identify the normal R-wave peak behind the noise.

[0038] Reference Figure 4 An example of detection results using an existing PT algorithm is shown in the figure. The top row of numbers in the figure represents the RR interval (in milliseconds). When an R wave in an ECG data point is identified, the RR interval between it and the R wave of the previous heartbeat is displayed in the result image. You can see that the heartbeats following the noise peak are not identified, so no corresponding RR interval data is displayed for the subsequent heartbeats.

[0039] In order to reduce the noise interference on the recognition results, the present application also improves the pan-Tompkins algorithm. Specifically, multiple groups of signal thresholds Signal Threshold and noise thresholds Noise Threshold are retained according to the preset threshold QRSTNUMBER. When the R wave is identified by dual thresholds, it is not only compared with the latest threshold, but is compared with the retained QRSTNUMBER dual thresholds. As long as it meets the detection requirements of one set of dual thresholds, it can be determined as an R wave. This prevents the problem of subsequent waveform recognition not being able to occur when encountering noise with a high amplitude. The specific value of QRSTNUMBER is set according to historical data. In this embodiment, the value of QRSTNUMBER is set to 15.

[0040] The improvement of the dual threshold in this application can be applied to any existing PT algorithm. The following embodiment uses the standard PT algorithm to illustrate the improvement method. Specifically, the improved PT algorithm includes the following steps.

[0041] SS1: Bandpass Filter: Used to remove myoelectric noise, baseline drift, and power frequency interference, usually combined with low-pass and high-pass filters: Low-pass filter: removes high-frequency interference, such as myoelectric noise (usually with a cutoff frequency of 11 Hz); High-pass filter: removes low-frequency noise, such as baseline drift (usually with a cutoff frequency of 5 Hz); The filter frequency band is generally 5 Hz to 15 Hz, matching the frequency range of the QRS wave.

[0042] SS2: Derivative Filter: Emphasizes the steep slope of the QRS wave and highlights its rapidly changing characteristics.

[0043] Digital difference formula: y(nT) = 1 / (8T) × [-x(nT-2T) - 2x(nT-T) + 2x(nT+T) + x(nT+2T)]; Where x(nT) is the ECG signal value at the current sampling point; T is the sampling period; y(nT) is the output after differentiation; n is the current time point; SS3: Squaring Function; squares each sampling point of the signal to enhance R-wave energy and suppress low-amplitude noise, making all values ​​positive.

[0044] SS4: Moving Window Integration extracts the morphological features of the QRS wave duration by calculating the average value of the sliding window.

[0045] y(nT) =1 / N×[xT-(N-1)T]+x(nT-(N-2)T+...+x(nT)]; Where N is the number of samples in the integration window width.

[0046] SS5: Thresholds and Adaptive Decision Logic Dual-threshold strategy: uses a fixed and adaptive dual-threshold comparison mechanism for R-wave peak detection: Signal Threshold: used to identify waveforms that may be QRS waves; Noise Threshold: Used to identify background noise or non-QRS interference.

[0047] If the detected peak value is greater than the Signal Threshold, it is judged as QRS; if it falls between the Noise Threshold and the Signal Threshold, it is regarded as a signal to be observed; if it is lower than the Noise Threshold, it is judged as noise.

[0048] Adaptive update mechanism: The threshold is not fixed, but is dynamically adjusted over time. The following variables are updated based on the most recently detected signal peak and noise peak: SPK (Signal Peak): records the most recent QRS signal peak value (moving average); NPK (Noise Peak): records the most recent noise peak value (moving average); Threshold1 = NPK + 0.25 × (SPK − NPK); Threshold2 = 0.5 × Threshold1 (lower alternative detection threshold); If a certain segment is misjudged, the threshold will be quickly adjusted to restore accurate detection.

[0049] When performing heartbeat recognition on ECG data based on the pan-Tompkins method, the peak value of the R wave is detected by using a signal threshold and a noise threshold, including the following steps: d1: Combine the signal threshold and noise threshold for each time and save it as a value in the set Thre; d2: After each threshold combination is stored, the number Tm of combinations stored in the set Thre is confirmed; Compare Tm with the preset storage threshold QRSTNUMBER; When Tm>QRSTNUMBER, the earliest stored threshold combination in the set Thre is deleted; d3: Take out each combination of signal threshold and noise threshold from the set Thre one by one, and record it as the threshold group to be compared; d4: The signal threshold included in the threshold group to be compared is recorded as ST, and the noise threshold is recorded as NT; d5: Based on the signal threshold ST and the noise threshold NT, a dual-threshold comparison mechanism is used to detect the R wave peak value of this detection value; If the detected value is identified as an R wave, the identification of the ECG data to be identified is stopped and subsequent operations are performed; Otherwise, if the current detection value is identified as noise, steps d3 to d5 are executed in a loop until all QRSTNUMBER thresholds in the set Thre are involved in the calculation, and the ECG data to be identified is determined to be noise.

[0050] In the dual-threshold method, the signal thresholds include ST1 and ST2, and the noise thresholds include SL1 and SL2. The initial values ​​of the signal threshold and the noise threshold are determined as follows: After integrating the moving window, extract all peak values ​​(C1) after preprocessing. Take one-third of the maximum signal peak value within two seconds as the initial signal threshold (ST1) and signal level (SL1). Take one-half of the average value of the peak value within two seconds as the initial noise threshold (NT1) and noise level (NL1). Using the same method as Yang, extract all peak values ​​(C2) after filtering, the initial signal threshold (ST2) and signal level (SL2), and the initial noise threshold (NT2) and noise level (NL2).

[0051] In step d5, based on the thresholds ST and NT, a dual-threshold comparison mechanism is used to detect the R wave peak value of the current detection value. The detailed process is implemented based on existing methods. Specifically, it includes the following situations.

[0052] (1): When the peak value C1 is greater than the signal threshold value ST1, it can be identified as an R peak, and the signal level SL1 is updated according to the following formula: SL1=0.125*C1+0.875*SL1; (2): When the peak value C1 is less than the signal threshold value ST1, ST1 is halved. When C1 is greater than 0.5ST1, it is identified as an R peak. At the same time, the signal level SL1 is updated according to the following formula.

[0053] SL1=0.25*C1+0.75*SL1; (3): When the peak value C1 is less than 0.5ST1, it is identified as a noise peak, and the signal level SL1 and noise level NL1 are updated according to the following formula.

[0054] SL1= 0.125*C1+0.875*SL1; NL1= 0.125*C1+0.875*NL1.

[0055] When making the next judgment, the signal threshold ST1 is updated according to the following formula: ST1= NL1 + 0.25*(SL1-NL1); Similarly, all peaks of C2 are determined according to the above rules and ST2, SL2, and NL2. Only when both C1 and C2 at the same moment are considered R peaks is the peak considered an R peak; otherwise, it is considered a noise peak. This rule is repeated until all signals are determined.

[0056] like Figure 5 As shown, based on Figure 4 In the example, after the ECG data is detected based on the improved PT algorithm in this method, it can be seen that the heartbeats after the noise peak are accurately identified, and the heartbeat data after the noise all show the corresponding RR interval data.

[0057] This method improves upon the PT algorithm with a simple concept and effective approach, effectively reducing the impact of noise on R-wave recognition. While the improved PT algorithm may identify noise as an R wave, this method leverages the synergistic advantages of full-lead data to identify heartbeat data. The heartbeat recognition process simultaneously references the characteristics of multi-lead data in both the time and feature domains. By sequentially performing single waveform alignment and continuous waveform matching operations, waveforms caused by noise can be effectively eliminated, ensuring the accuracy of final heartbeat recognition. This method is simple in design and computationally inefficient, making it particularly suitable for processing large amounts of data.

Claims

1. A heartbeat recognition method based on full-lead electrocardiogram signals, characterized in that: It includes the following steps: S1: Obtain the electrocardiogram data collected by N leads in the same time period, denoted as: the electrocardiogram data to be recognized; S2: Perform heartbeat recognition on the N pieces of the electrocardiogram data to be recognized respectively based on the heartbeat recognition algorithm; Arrange all the heartbeat recognition results corresponding to each lead in chronological order respectively to obtain a waveform set of heartbeat data, denoted as: QRSn, where n is the nth lead, 1 < n ≤ N; The waveform data included in each waveform set QRSn is recorded as: QRSn i , i is the waveform of the i-th heart beat in the recognition result corresponding to the n-th lead; S3: Obtain the waveform set QRSn corresponding to any one lead, denoted as: the waveform set of the lead to be analyzed, and denote the other waveform sets as: the comparison sets; Confirm the number of heartbeat data included in the waveform set of the lead to be analyzed, and assign it to M; Initialize the heartbeat data set temp to be empty; S4: In the set of lead waveforms to be analyzed, the waveform data QRSn of each heartbeat is taken out one by one in chronological order. i , recorded as: waveform to be analyzed; Denote the start and end times corresponding to the waveform to be analyzed as: the time period to be analyzed; S5: Take out each waveform set QRSn in the comparison sets one by one, and confirm whether there is heartbeat data in the waveform set QRSn within the time period to be analyzed; If there is, save all the heartbeat data existing within the time period to be analyzed into the heartbeat data set temp; S6: Confirm whether the heartbeat data set temp is empty; If the heartbeat data set temp is not empty, execute step S7; Otherwise, loop and execute steps S4 - S6 until all M heartbeat data in the waveform set of the lead to be analyzed participate in the calculation, and then execute step S11; S7: Read the waveform data in the heartbeat data set temp one by one, denoted as: the alignment target data, and denote the waveform to be analyzed as: the data to be aligned; Perform a single - waveform alignment operation on the alignment target data and the data to be aligned; Based on the single - waveform alignment operation, find the heartbeat data that is aligned and matched with the waveform to be analyzed in terms of time in the heartbeat data set temp; Denote the heartbeat data that is aligned and matched with the waveform to be analyzed in terms of time found through the single - waveform alignment operation as: the heartbeat data after matching; S8: When all the heartbeat data in the heartbeat data set temp have participated in the calculation, count the number of the heartbeat data after matching, denoted as MatchN; Compare MatchN with the preset matching threshold MatchThr; If MatchN < MatchThr, it means that the waveform to be analyzed is an abnormal waveform. Loop and execute steps S4 - S8 until all M heartbeat data in the waveform set of the lead to be analyzed have participated in the calculation, and then execute step S11; Otherwise, execute step S9; S9: In the waveform set of the lead to be analyzed, find the continuous waveform where the waveform to be analyzed is located, denoted as: the continuous waveform to be analyzed; Find the leads corresponding to all the heartbeat data after matching corresponding to the waveform to be analyzed, and denote the waveform data set of each lead as: the single - heartbeat - matching lead waveform set; S10: Perform a continuous - waveform matching operation on each of the single - heartbeat - matching lead waveform sets and the continuous waveform to be analyzed; Based on the continuous waveform matching operation, finding a continuous waveform that matches and aligns with the continuous waveform to be analyzed in the single beat matching lead waveform set, and if it can be found, it means that the single beat matching lead waveform set passes the matching operation; If all of the single beat matching lead waveform sets pass the continuous waveform matching operation, it indicates that the waveform to be analyzed is a correct waveform and the corresponding heartbeat data is correct heartbeat data; steps S4 to S10 are executed repeatedly until all M heartbeat data in the lead waveform set to be analyzed are included in the calculation, and then step S11 is executed; Otherwise, it indicates that the waveform to be analyzed is an abnormal waveform, and steps S4 to S10 are executed in a loop until all M heartbeat data in the lead waveform set to be analyzed are involved in the calculation, and then step S11 is executed; S11: Execute steps S3 to S10 repeatedly until all N-lead waveform sets are involved in the calculation, and then end this round of calculation; S12: splicing the recognition results corresponding to the electrocardiogram data to be recognized corresponding to the N leads to obtain the recognition result of the current heartbeat data.

2. The heartbeat recognition method based on full-lead electrocardiogram signals according to claim 1, characterized in that: The single waveform alignment operation includes the following steps: a1: confirm the time point corresponding to the highest point of the R wave of the data to be aligned, recorded as the time point to be analyzed T1; a2: confirm the time point corresponding to the highest point of the R wave of the alignment target data, recorded as matching time point T2; a3: Compare T1 and T2; If |T1-T2|≤THR, it means that the R waves of the two heartbeat data can be aligned and matched, and the corresponding alignment target data is recorded as: the matched heartbeat data; Otherwise, it means that the two heartbeat data cannot be aligned and matched; THR is the preset time point alignment threshold, in milliseconds.

3. The heartbeat recognition method based on full-lead ECG signals according to claim 1, characterized in that: The continuous waveform matching operation comprises the following steps: b1: Read the preset continuous waveform number judgment parameter conti, which meets the following conditions: 2*conti+1 <TotalMum; Wherein, TotalMum is the minimum number of heartbeat waveforms included in the waveform set corresponding to the lead; b2: Based on the waveform to be analyzed, find heartbeat data that forms a continuous waveform with the waveform to be analyzed in the lead waveform set to be analyzed, and construct the continuous waveform to be analyzed; The heartbeat data included in the continuous waveform to be analyzed are respectively recorded as: heartbeat data to be judged; The number of heartbeat data to be judged is 2*conti+1; b3: extracting each heartbeat data to be judged one by one; The start and end time corresponding to each of the heartbeat data to be determined is recorded as the time period to be matched; b4: extracting the corresponding waveform set included in the single beat matching lead waveform set, which is recorded as the to-be-matched lead waveform set; In each of the lead waveform sets to be matched, confirming whether a waveform of heartbeat data exists in each of the time periods to be matched; If any of the to-be-matched lead waveform sets does not have a waveform of heartbeat data in the to-be-matched time period, it is determined that the to-be-analyzed continuous waveform matching operation has not passed this continuous waveform matching operation, and this operation is stopped; Otherwise, if all the to-be-matched lead waveform sets have heartbeat data waveforms in the to-be-matched time period, the found heartbeat data is recorded as alignment target data, and a continuous waveform alignment heartbeat set is constructed; and step b5 is executed; b5: record the heartbeat data to be determined as data to be aligned; Performing the single waveform alignment operation on the alignment target data and the data to be aligned corresponding to each time period to be matched; If, in the single waveform alignment operation, any of the alignment target data and the heartbeat data to be determined cannot be aligned and matched, it is determined that the to-be-analyzed data has not passed this continuous waveform matching operation, and the operation is stopped; Otherwise, if all the alignment target data and the heartbeat data to be determined are aligned and matched, step b6 is executed; b6: Loop through steps b3 to b5 until all of the heartbeat data to be determined have passed the single waveform alignment operation in the single heartbeat matching lead waveform set and the corresponding matched heartbeat data have been found. Then, it is determined that the continuous waveform to be analyzed has passed this continuous waveform matching operation.

4. The heartbeat recognition method based on full-lead ECG signals according to claim 3, characterized in that: In step b2, the method for constructing the continuous waveform to be analyzed includes the following steps: c1: confirming the position of the waveform to be analyzed in the set of lead waveforms to be analyzed; If the number of heartbeat data on either side of the waveform to be analyzed is less than conti, executing step c2; Otherwise, when the number of heartbeats on both sides of the waveform to be analyzed is greater than or equal to conti, execute step c3; c2: In the set of lead waveforms to be analyzed, take the beat data at the end of the side with fewer beat data than conti as the first data, and continuously read 2*conti+1 waveforms to the other side to construct a waveform set consisting of 2*conti+1 data, which is recorded as: continuous waveform to be analyzed; c3: Taking the waveform to be analyzed as the center point, continuously search for conti heartbeat data on both sides to construct a waveform set including 2*conti+1 data, which is recorded as: continuous waveform to be analyzed.

5. The heartbeat recognition method based on full-lead electrocardiogram signals according to claim 1, characterized in that: In step S2, heart beat recognition is performed on the to-be-recognized electrocardiogram data corresponding to each lead based on the pan-Tompkins method.

6. The heartbeat recognition method based on full-lead ECG signals according to claim 5, characterized in that: When performing heartbeat recognition on the electrocardiogram data to be recognized based on the pan-Tompkins method, when detecting the peak value of the R wave by using the signal threshold and the noise threshold, the method further includes the following steps: d1: Combine the signal threshold and noise threshold for each time and save it as a value in the set Thre; d2: After each threshold combination is stored, the number Tm of combinations stored in the set Thre is confirmed; Compare Tm with the preset storage threshold QRSTNUMBER; When Tm>QRSTNUMBER, the earliest stored threshold combination in the set Thre is deleted; d3: extract each combination of signal threshold and noise threshold from the set Thre one by one, and record it as: threshold group to be compared; d4: The signal threshold included in the threshold group to be compared is recorded as ST, and the noise threshold is recorded as NT; d5: Based on the thresholds ST and NT, a dual-threshold comparison mechanism is used to detect the R wave peak value of this detection value; If the detected value is identified as an R wave, the identification of the ECG data to be identified is stopped and subsequent operations are performed; Otherwise, if the current detection value is identified as noise, steps d3 to d5 are executed in a loop until all QRSTNUMBER thresholds in the set Thre are involved in the calculation, and the ECG data to be identified is determined to be noise.

Citation Information

Patent Citations

  • Electrocardiogram heart beat classification method based on machine learning

    CN117398107A