A method and apparatus for identifying ectopic heartbeats using autocorrelation clustering
By using autocorrelation clustering and employing sliding window and Euclidean distance calculations, ectopic heartbeats in electrocardiogram signals can be automatically identified, solving the problems of inaccurate and time-consuming ectopic heartbeat identification in existing technologies and achieving efficient and accurate ectopic heartbeat identification.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI SID MEDICAL CO LTD
- Filing Date
- 2023-08-15
- Publication Date
- 2026-07-03
AI Technical Summary
Existing ectopic heartbeat selection algorithms are inaccurate in extracting the R-wave peak position and determining the heartbeat, resulting in inaccurate results and making the selection process time-consuming and laborious.
Using the autocorrelation clustering method, by collecting and preprocessing electrocardiogram signal data, and using sliding window and Euclidean distance calculations, a correlation dataset is established to identify atrial premature contractions, ventricular premature contractions and normal heartbeats, and to automatically identify the location and type of R waves.
It improves the accuracy of ectopic heartbeat identification, avoids the accumulation of errors, and simplifies the selection process for ectopic heartbeats.
Smart Images

Figure CN117243612B_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of medical technology, and in particular relates to an ectopic heartbeat identification method based on autocorrelation clustering. Background Technology
[0002] An electrocardiogram (ECG) is a widely used clinical examination. By recording the electrical activity of the heart during each cycle, it helps diagnose cardiac abnormalities. Each pacing cycle of the heart is represented as a heartbeat on an ECG, and these continuous heartbeats form the ECG. Ventricular premature contractions (VPCs) and atrial premature contractions (AFPCs) are common ectopic heartbeats in clinical practice; they refer to abnormal contractions of the ventricles or atria caused by premature heartbeats. Identifying ectopic heartbeats from long-term ECGs and statistically analyzing their morphology and number is crucial for diagnosing organic changes in the heart. However, because long-term ECGs contain a large number of heartbeats, identifying ectopic heartbeats is time-consuming and laborious. Therefore, developing automatic ectopic heartbeat identification algorithms is particularly important.
[0003] Most current ectopic heartbeat detection algorithms first extract the position of the R-wave peak, and then diagnose the heartbeat containing a specific R-wave. Inaccurate R-wave peak extraction or an inaccurate heartbeat detection algorithm can lead to inaccurate results. Summary of the Invention
[0004] The technical problem to be solved by this invention is to provide an autocorrelation clustering method for identifying ectopic heartbeats, in order to overcome the shortcomings of existing ectopic heartbeat selection algorithms.
[0005] The technical solution adopted by this invention to solve its technical problem is:
[0006] An ectopic heartbeat identification method based on autocorrelation clustering, characterized by comprising the following steps:
[0007] Step 1, Collect ECG signal data: Collect a certain number of 12-lead ECG signals from patients in a resting state. The data should include a certain number of 12-lead resting atrial premature contractions (PAC), a certain number of 12-lead resting ventricular premature contractions (PVC), and a certain number of 12-lead normal data. These data will be used as a dataset, and medical experts will manually annotate all the data, including the position of the R wave peak and the heartbeat type in which the R wave is located.
[0008] Step 2, Data Preprocessing: First, the ECG signal in the second lead is preprocessed by bandpass filtering;
[0009] In each data point, extract all data points t1 before the R-wave peak and t2 after the peak to form data markers for each heartbeat position; denote all n heartbeat datasets as V = {V1, V2, ..., V...} n}, where V p ={v1, v2, ..., v m}, where p∈(1,n), v1, v2, ..., v m The data consists of voltage values at each point in time for this heartbeat.
[0010] Each heartbeat in each data entry is labeled with [0], [1], or [2]. If the heartbeat signal is an atrial premature contraction, the heartbeat label vector is 1. If the heartbeat signal is a ventricular premature contraction, the heartbeat label vector is 2. If the heartbeat signal is normal, the heartbeat label vector is 0.
[0011] Step 3, Moving the sliding window: Simultaneously, for each heartbeat signal, a sliding window with a step size of t seconds and a length of 0.1 seconds is used to extract the signal, denoted as .
[0012] V p,i ={v pi,1 v pi,2 , ..., v pi,m}, i∈[0,1,2,…,e]
[0013] t is in the millisecond range. Since t is very small, there will be many sampling points in 0.1 seconds.
[0014] Where v pi,1 v pi,2 , ..., v pi,m The voltage data for each point in the i-th sliding window of this heartbeat, ordered by time.
[0015] Step 4, create the function as follows:
[0016] R p (i)=E(V p ·V p,i ); R p (i) are two vectors V p and V p,i The expected value after dot product;
[0017] The heartbeat data and the expected value of the heartbeat sliding window data are obtained from the heartbeat data.
[0018] {R p (0), R p (1), ..., R p (e)};
[0019] Step 5, create the function as follows:
[0020]
[0021] get
[0022] This yields a dataset related to premature atrial contractions. Dataset related to premature ventricular contractions Normal heartbeat related dataset
[0023] Step 6, calculate Φ PAC Euclidean distance between any two vectors in the vector matrix:
[0024]
[0025] Find the vector from it. For Φ PAC Vectors in the set that satisfy the condition: With Φ PAC The set whose sum of Euclidean distances to other vectors is minimized; the specific logic is as follows:
[0026] 1. In Φ PAC In the set;
[0027] 2. There are other vectors in the set;
[0028] 3. It has a Euclidean distance from any other vector;
[0029] 4. Summing the Euclidean distance with other vectors in the set;
[0030] 5. The sum of the Euclidean distances between any other vector and all other vectors in the set is greater than... The sum of the Euclidean distances to other vectors in the set is greater than the sum of the distances to other vectors in the set.
[0031]
[0032] Find Φ PVC Euclidean distance between any two vectors in the vector matrix:
[0033]
[0034] Find the vector from it. For Φ PVC Vectors in the set,
[0035]
[0036] Find Φ N Euclidean distance between any two vectors in the vector matrix:
[0037]
[0038] Find the vector from it. For Φ N Vectors in the set,
[0039]
[0040] Step 7, create the function as follows:
[0041]
[0042] Obtain vector With Φ PVC The maximum Euclidean distance of vectors existing in the set
[0043] Obtain vector With Φ PVC The maximum Euclidean distance of vectors existing in the set
[0044] Obtain vector With Φ N The maximum Euclidean distance of vectors existing in the set
[0045] Step 8: Obtain a clinical electrocardiogram signal of length L to be tested. Perform the same preprocessing operation as in step 2 on the obtained data to be tested to obtain an electrocardiogram signal in the form of (L, 1).
[0046] The electrocardiogram signal is segmented into signal segments by a sliding window with a step size of t seconds and a length of t1+t2, and represented by a matrix S, where S = {s1, s2, ..., s...} n}; Obtain the voltage data V for each signal segment. t,p ={v1, v2, ..., v m For each signal segment, repeat steps 3, 4, and 5 to obtain the signal segment's...
[0047] Obtain vector Φ i with vector European distance with vector European distance with vector European distance
[0048] Step 9, Prediction:
[0049] Detect a segment of electrocardiogram signal;
[0050] like Therefore, the signal segment t1 is identified as the peak of the R wave and is a premature atrial contraction.
[0051] like Therefore, the signal segment t1 is identified as the peak of the R wave and is a ventricular premature contraction.
[0052] like Then the signal segment t1 is determined to be the peak position of the R-wave and is considered normal;
[0053] If the signal is not within the above range, proceed to the next signal detection segment until the entire ECG signal detection is completed.
[0054] Furthermore, in the autocorrelation clustering ectopic heartbeat identification method of the present invention, step 1 involves collecting electrocardiogram (ECG) signal data: 30,000 12-lead ECG signals from patients in a resting state are collected at a sampling frequency of 500 Hz, with each ECG signal being 10 seconds long. This includes 10,000 12-lead resting atrial premature contraction (PAC) data, 10,000 12-lead resting ventricular premature contraction (PVC) data, and 10,000 12-lead normal data. These data are used as a dataset, and medical experts manually annotate all the data, marking the R-wave peak position and the heartbeat type of the heartbeat in which the R-wave is located: atrial premature contraction (PAC), ventricular premature contraction (PVC), and normal heartbeat (N).
[0055] Furthermore, in the autocorrelation clustering ectopic heartbeat identification method of the present invention, in step 1, each electrocardiogram (ECG) data is determined by at least two professional cardiologists to determine the heartbeat location and label. If the opinions of the two cardiologists are inconsistent, the heartbeat location and label of the ECG signal are determined by a third cardiologist. After determining the heartbeat location and label of each ECG signal, these labels are formed into a label set.
[0056] Furthermore, in the autocorrelation clustering method for identifying ectopic heartbeats of the present invention, in step 2, data preprocessing is performed: firstly, the ECG signal of the second lead is preprocessed by bandpass filtering using Butterworth filters with upper and lower cutoff frequencies of 1Hz and 100Hz, respectively.
[0057] Furthermore, in the autocorrelation clustering method for identifying ectopic heartbeats of the present invention, t1 = 0.3 seconds and t2 = 1 second.
[0058] The present invention provides an ectopic heartbeat identification device based on autocorrelation clustering, which can perform the above-described ectopic heartbeat identification method based on autocorrelation clustering.
[0059] The beneficial effect of this invention is that it can simultaneously provide the location of the R wave and the heartbeat type, avoiding the superposition of errors. Attached Figure Description
[0060] The technical solution of this application will be further described below with reference to the accompanying drawings and embodiments.
[0061] Figure 1This is a flowchart of the steps of the autocorrelation clustering method for identifying ectopic heartbeats according to an embodiment of this application. Detailed Implementation
[0062] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other.
[0063] In the description of this application, it should be understood that the terms "center," "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships based on the orientation or positional relationships shown in the accompanying drawings, are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as limiting the scope of protection of this application. Furthermore, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first," "second," etc., may explicitly or implicitly include one or more of that feature. In the description of this invention, unless otherwise stated, "a plurality of" means two or more.
[0064] In the description of this application, it should be noted that, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances. The X, Y, and Z directions or X, Y, and Z axes mentioned in this embodiment are all based on the Cartesian coordinate system.
[0065] The technical solution of this application will now be described in detail with reference to the accompanying drawings and embodiments.
[0066] Example
[0067] This embodiment provides an ectopic heartbeat identification method based on autocorrelation clustering, such as Figure 1 As shown, it includes the following steps:
[0068] Step 1, Collect ECG signal data: Collect a certain number of 12-lead ECG signals from patients in a resting state. The data should include a certain number of 12-lead resting atrial premature contractions (PAC), a certain number of 12-lead resting ventricular premature contractions (PVC), and a certain number of 12-lead normal data. These data will be used as a dataset, and medical experts will manually annotate all the data, including the position of the R wave peak and the heartbeat type in which the R wave is located.
[0069] Step 2, Data Preprocessing: First, the ECG signal in the second lead is preprocessed by bandpass filtering;
[0070] In each data point, extract all data points t1 before the R-wave peak and t2 after the peak to form data markers for each heartbeat position; denote all n heartbeat datasets as V = {V1, V2, ..., V...} n}, where V p ={v1, v2, ..., v m}, where p∈(1,n), v1, v2, ..., v m The data consists of voltage values at each point in time for this heartbeat.
[0071] Each heartbeat in each data entry is labeled with [0], [1], or [2]. If the heartbeat signal is an atrial premature contraction, the heartbeat label vector is 1. If the heartbeat signal is a ventricular premature contraction, the heartbeat label vector is 2. If the heartbeat signal is normal, the heartbeat label vector is 0.
[0072] Step 3, Moving the sliding window: Simultaneously, for each heartbeat signal, a sliding window with a step size of t seconds and a length of 0.1 seconds is used to extract the signal, denoted as .
[0073] V p,i ={v pi,1 v pi,2 , ..., v pi,m}, i∈[0,1,2,…,e]
[0074]
[0075] Where V pi,1 ={v pi,2 , ..., v pi,m} represents the voltage data at each point in the i-th sliding window of this heartbeat, ordered by time;
[0076] Step 4, create the function as follows:
[0077] R p (i)=E(V p ·V p,i );
[0078] The heartbeat data and the expected value of the heartbeat sliding window data are obtained from the heartbeat data.
[0079] {R p (0), R p (1), ..., R p (e)};
[0080] Step 5, create the function as follows:
[0081]
[0082] get
[0083] This yields a dataset related to premature atrial contractions. Dataset related to premature ventricular contractions Normal heartbeat related dataset
[0084] Step 6, calculate Φ PAC Euclidean distance between any two vectors in the vector matrix:
[0085]
[0086] Find the vector from it. For Φ PAC Vectors in the set that satisfy the condition: With Φ PAC The sum of the Euclidean distances of all other vectors in the set is minimized.
[0087]
[0088] Find Φ PVC Euclidean distance between any two vectors in the vector matrix:
[0089]
[0090] Find the vector from it. For Φ PVC Vectors in the set,
[0091]
[0092] Find Φ N Euclidean distance between any two vectors in the vector matrix:
[0093]
[0094] Find the vector from it. For Φ N Vectors in the set,
[0095]
[0096] Step 7, create the function as follows:
[0097]
[0098] Obtain vector With Φ PVC The maximum Euclidean distance of vectors existing in the set
[0099] Obtain vector With Φ PVC The maximum Euclidean distance of vectors existing in the set
[0100] Obtain vector With Φ N The maximum Euclidean distance of vectors existing in the set
[0101] Step 8: Obtain a clinical electrocardiogram signal of length L to be tested. Perform the same preprocessing operation as in step 2 on the obtained data to be tested to obtain an electrocardiogram signal in the form of (L, 1).
[0102] The electrocardiogram signal is segmented into signal segments by a sliding window with a step size of t seconds and a length of t1+t2, and represented by a matrix S, where S = {s1, s2, ..., s...} n}; Obtain the voltage data V for each signal segment. t,p ={v1, v2, ..., v m For each signal segment, repeat steps 3, 4, and 5 to obtain the signal segment's...
[0103] Obtain vector Φ i with vector European distance with vector European distance with vector European distance
[0104] Step 9, Prediction:
[0105] Detect a segment of electrocardiogram signal;
[0106] like Therefore, the signal segment t1 is identified as the peak of the R wave and is a premature atrial contraction.
[0107] like Therefore, the signal segment t1 is identified as the peak of the R wave and is a ventricular premature contraction.
[0108] like Then the signal segment t1 is determined to be the peak position of the R-wave and is considered normal;
[0109] If the signal is not within the above range, proceed to the next signal detection segment until the entire ECG signal detection is completed.
[0110] Preferably, in this embodiment, in step 1, electrocardiogram (ECG) signal data is collected: 30,000 12-lead ECG signals from patients in a resting state are collected at a sampling frequency of 500 Hz, with each ECG signal being 10 seconds long. This includes 10,000 12-lead resting atrial premature contraction (PAC) data, 10,000 12-lead resting ventricular premature contraction (PVC) data, and 10,000 12-lead normal data. These data are used as a dataset, and medical experts manually annotate all the data, marking the R-wave peak position and the heartbeat type of the heartbeat in which the R-wave is located: atrial premature contraction (PAC), ventricular premature contraction (PVC), and normal heartbeat (N).
[0111] Preferably, in this embodiment, in step 1, each ECG data is determined by at least two professional cardiologists to determine the heartbeat location and label. If the opinions of the two cardiologists are inconsistent, the heartbeat location and label of the ECG signal are determined by a third cardiologist. After determining the heartbeat location and label of each ECG signal, these labels are formed into a label set.
[0112] Preferably, in this embodiment, in step 2, data preprocessing: firstly, the second lead ECG signal is preprocessed by using Butterworth filters with upper and lower cutoff frequencies of 1Hz and 100Hz for bandpass filtering.
[0113] Preferably, in this embodiment, t1 is set to 0.3 seconds and t2 is set to 1 second.
[0114] This embodiment provides an ectopic heartbeat identification device based on autocorrelation clustering, which can perform the aforementioned ectopic heartbeat identification method based on autocorrelation clustering.
[0115] Based on the above-described preferred embodiments according to this application, and through the foregoing description, those skilled in the art can make various changes and modifications without departing from the technical concept of this application. The technical scope of this application is not limited to the contents of the specification, but must be determined according to the scope of the claims.
Claims
1. A method for identifying ectopic heartbeats from a self-correlated cluster, characterized by, Includes the following steps: Step 1, Collect ECG signal data: Collect a certain number of 12-lead ECG signals from patients in a resting state. The data should include a certain number of 12-lead resting atrial premature contractions, a certain number of 12-lead resting ventricular premature contractions, and a certain number of 12-lead normal data. These data will be used as a dataset, and medical experts will manually annotate all the data, including the position of the R wave peak and the heartbeat type in which the R wave is located. Step 2, Data Preprocessing: First, the ECG signal of the second lead is preprocessed by bandpass filtering; All data points before the R-wave peak by t1 and all data points after the R-wave peak by t2 in each data are intercepted to form each heartbeat position data marker; all n heartbeat data sets are recorded as wherein wherein , is the voltage data of the heartbeat points in time sequence; Each heartbeat in each data entry is labeled with [0], [1], or [2]. If the heartbeat signal is an atrial premature contraction, the heartbeat label vector is 1. If the heartbeat signal is a ventricular premature contraction, the heartbeat label vector is 2. If the heartbeat signal is normal, the heartbeat label vector is 0. Step 3, moving sliding window: the signal is truncated with a sliding window of length seconds with a step of t seconds for each heartbeat signal, denoted by in The voltage data for each point in the i-th sliding window of this heartbeat, ordered by time. Step 4: Create the function as follows: ; expected value after dot multiplication; The expected value is obtained from heart rate data and heart rate sliding window data. ; Step 5, create the function as follows: obtained , thereby obtaining a ventricular extrasystole related dataset , ventricular extrasystole related dataset , Normal heartbeat related data set ; Step 6, find Euclidean distance between any two vectors: ; Find the vector from the set , For the vector in the set, meet the condition: The sum of the Euclidean distance with other vectors in the set is minimum; ; Find Euclidean distance between any two vectors: ; find the vector from the center , for the set of vectors ; Find Euclidean distance between any two vectors: ; find the vector from the center , for the set of vectors ; Step 7, create the function as follows: ; Obtain vector and The maximum Euclidean distance of vectors existing in the set ; ; Obtain vector and The maximum Euclidean distance of vectors existing in the set ; ; Obtain vector and The maximum Euclidean distance of vectors existing in the set ; Step 8: Obtain a clinical electrocardiogram signal of length L to be tested. Perform the same preprocessing operation as in step 2 on the obtained data to be tested to obtain an electrocardiogram signal in the form of (L, 1). The electrocardiogram signal is segmented into signal segments using a sliding window with a step size of t seconds and a length of t1+t2, and represented by a matrix S, where... ; Obtain voltage data for each signal segment. For each signal segment, repeat steps 3, 4, and 5 to obtain the signal segment. ; Obtain vector with vector European distance , and vector European distance , and vector European distance ; Step 9, Prediction: Detect a segment of electrocardiogram signal; like If so, the signal segment t1 is identified as the peak of the R wave and is a premature atrial contraction; like If so, the signal segment t1 is identified as the peak of the R wave and is a ventricular premature contraction; like If so, then the signal segment t1 is considered to be the peak position of the R-wave and is normal; If the signal is not within the above range, proceed to the next signal detection segment until the entire ECG signal detection is completed.
2. The ectopic heartbeat identification method based on autocorrelation clustering according to claim 1, characterized in that, In step 1, ECG signal data is collected: 30,000 12-lead ECG signals from patients in a resting state are collected at a sampling frequency of 500Hz, with each ECG signal being 10s long. This includes 10,000 12-lead resting atrial premature contraction data, 10,000 12-lead resting ventricular premature contraction data, and 10,000 12-lead normal data. These data are used as a dataset, and medical experts manually annotate all data, marking the R-wave peak position and the heartbeat type of the heartbeat in which the R-wave is located: atrial premature contraction data, ventricular premature contraction data, and normal heartbeat.
3. The ectopic heartbeat identification method based on autocorrelation clustering according to claim 2, characterized in that, In step 1, each ECG data is identified and labeled by at least two professional cardiologists. If the opinions of the two cardiologists are inconsistent, a third cardiologist is consulted to identify the heartbeat location and label of the ECG signal. After identifying the heartbeat location and label for each ECG signal, these labels are combined into a label set.
4. The ectopic heartbeat identification method based on autocorrelation clustering according to claim 1, characterized in that, In step 2, data preprocessing: First, the ECG signal of the second lead is preprocessed by bandpass filtering using Butterworth filters with upper and lower cutoff frequencies of 1 Hz and 100 Hz, respectively.
5. The method for identifying ectopic heartbeats using autocorrelation clustering according to any one of claims 1-4, characterized in that, t1 = 0.3 seconds, t2 = 1 second.
6. An ectopic heartbeat recognition device based on autocorrelation clustering, characterized in that, It is capable of performing the ectopic heartbeat identification method based on autocorrelation clustering as described in any one of claims 1-5.