An ECG waveform clustering method and system based on spectral space representation learning

By using a spectral space representation learning method and training a feature extraction model with neural networks and Euclidean distance loss function, the problems of large data volume and high computational complexity in dynamic electrocardiogram analysis are solved, and efficient heartbeat clustering is achieved.

CN116304765BActive Publication Date: 2026-02-13SHAN DONG MSUN HEALTH TECH GRP CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310288132.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-20
Publication Date
2026-02-13
Estimated Expiration
2043-03-20

AI Technical Summary

Technical Problem

Existing technologies for dynamic electrocardiogram analysis suffer from problems such as large data volume and high computational complexity, while deep learning-based waveform clustering methods suffer from feature loss and cumbersome subsequent processing.

Method used

A method based on spectral space representation learning is adopted. The relative features of the heartbeat in the spectral space are learned through neural network, and the waveform is clustered. The loss function is constructed by using the Euclidean distance between the relative and absolute features of the spectral space of the individual leads. The feature extraction model is trained to obtain the absolute features of the heartbeat in the individual leads, and then the k-means clustering algorithm is used for clustering.

Benefits of technology

It improves the quality of feature representation, reduces computational complexity, solves the problems of large data volume and high computational complexity in dynamic electrocardiogram analysis, and simplifies the feature processing process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116304765B_ABST
    Figure CN116304765B_ABST
Patent Text Reader

Abstract

The application provides an ECG waveform clustering method and system based on spectral space representation learning, relates to the technical field of electrocardiogram waveform clustering, acquires multi-lead electrocardiogram data, constructs a training data set composed of multi-lead electrocardiogram data and relative features of a spectral space of a heartbeat of each lead, trains a constructed feature extraction model based on the training data set, learns spectral space representation, inputs multi-lead electrocardiogram data to be clustered into the trained feature extraction model, obtains absolute features of a heartbeat of each lead, clusters the absolute features of the heartbeat of each lead, and obtains a clustering result of the heartbeat. The application uses a neural network to learn relative features of a spectral space center heartbeat, clusters waveforms, focuses on improving feature expression quality, avoids the cumbersome problem of subsequent feature processing after direct feature extraction of a traditional waveform clustering method, and solves the problems of a large amount of data and high computational complexity in a dynamic electrocardiogram actual application analysis process.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of electrocardiogram waveform clustering, and particularly relates to an ECG waveform clustering method and system based on spectral space representation learning. BACKGROUND

[0002] The statements in this section merely provide background information related to the present application and do not necessarily constitute prior art.

[0003] As a technology that can directly show the process of heart excitation, Electrocardiogram (ECG) has been widely used in clinical health examination in the field of cardiovascular since its inception; and in order to more directly and real-time observe and monitor the heart work of a patient in a physiological cycle of 24 hours, dynamic electrocardiogram technology is born, and after decades of development, it is widely used in the field of non-invasive electrocardiogram auxiliary diagnosis technology, and becomes one of the most commonly used heart examination and medical monitoring tools in clinical practice.

[0004] The dynamic electrocardiogram is usually collected for 24 hours, which makes the electrocardiogram data generally include about 80,000 heartbeats. For such a large amount of electrocardiogram data, doctors must rely on reliable electrocardiogram analysis software to analyze and diagnose the electrocardiogram of the patient.

[0005] In dynamic electrocardiogram analysis, superimposed processing and analysis of waveform data is indispensable. Many electrocardiogram manufacturers call the superimposed processing and analysis part of electrocardiogram analysis as template analysis, that is, heartbeats with high superimposed similarity are classified into a template (category). The use of intersection over union (IOU) to measure superimposed similarity is more accurate. Among the methods of clustering pairwise similarity, spectral clustering is a more intuitive and effective method. If spectral clustering method is used, dynamic electrocardiogram usually includes about 80,000 heartbeats, and the matrix with a dimension of about (80,000 x 80,000) needs to be processed. Therefore, the existing dynamic electrocardiogram practical application analysis process has the problems of large data volume and high computational complexity.

[0006] There is also a waveform clustering method based on deep learning, which uses deep learning to extract features. Because the data volume is large, there are problems of feature loss and repetition. Moreover, after extracting the features, a large number of primary feature processing operations are required, so the subsequent feature processing is tedious, and therefore the overall efficiency is not high. SUMMARY

[0007] In order to overcome the above-mentioned deficiencies of the prior art, the present application provides an ECG waveform clustering method and system based on spectral space representation learning, which uses a neural network to learn the relative features of the spectral space center beat, clusters the waveforms, focuses on improving the feature expression quality, avoids the cumbersome problem of subsequent feature processing after direct feature extraction of the traditional waveform clustering method, and solves the problems of large data volume and high computational complexity in the dynamic electrocardiogram actual application analysis process.

[0008] To achieve the above object, one or more embodiments of the present application provide the following technical solutions:

[0009] The present application provides an ECG waveform clustering method based on spectral space representation learning in the first aspect;

[0010] An ECG waveform clustering method based on spectral space representation learning comprises:

[0011] Obtaining multi-lead electrocardiogram data, constructing a training data set composed of multi-lead electrocardiogram data and lead-by-lead spectral space relative features of heartbeats;

[0012] Based on the training data set, the multi-lead electrocardiogram data is taken as input, and the lead-by-lead absolute features of heartbeats are taken as output, a constructed feature extraction model is trained, and spectral space representation is learned, wherein a loss function is constructed based on the Euclidean distance between the lead-by-lead spectral space relative features of heartbeats and the lead-by-lead absolute features, and the training of the feature extraction model is constrained;

[0013] The multi-lead electrocardiogram data to be clustered is input into the trained feature extraction model, and the lead-by-lead absolute features of heartbeats are obtained;

[0014] The obtained lead-by-lead absolute features of heartbeats are clustered to obtain the clustering result of heartbeats.

[0015] Further, the construction step of the training data set is:

[0016] The positions of heartbeats in the multi-lead electrocardiogram data are manually identified, the identified heartbeat positions are arranged in time sequence, and a heartbeat position data set is constructed;

[0017] Based on the heartbeat position data set, the heartbeats of each lead are calculated in pairs to obtain an adjacency matrix of each lead;

[0018] According to the adjacency matrix of each lead, the lead-by-lead spectral space relative features of heartbeats are calculated;

[0019] The multi-lead electrocardiogram data and the finally calculated lead-by-lead spectral space relative features of heartbeats constitute the training data set.

[0020] Further, the IOU calculation of the heartbeats of each lead in pairs is specifically:

[0021] Padding operation is performed on any two heart beat data on each lead;

[0022] An IOU value between the two heart beat data after padding is calculated to construct a connection matrix of each lead, and the specific calculation method of the IOU value is as follows:

[0023]

[0024]

[0025]

[0026] Wherein, pre, pos represent two heart beat data, pre beat, pos beat represent two heart beat data after padding, pre up, pos up represent the part of pre beat, pos beat less than zero, respectively, the waveform is set to 0, pre down, pos down represent the part of pre beat,

[0027] pos beat greater than zero, respectively, the waveform is set to 0.

[0028] Further, the calculation of the sub-lead spectral space relative feature of the heart beat is as follows:

[0029] According to the adjacency matrix of each lead, the degree matrix is calculated, and the Laplace matrix is calculated according to the adjacency matrix and the degree matrix;

[0030] The Laplace matrix is standardized, and the Laplace matrix after standardization is characteristic decomposed to obtain a plurality of characteristic values and corresponding primary eigenvectors;

[0031] The plurality of characteristic values are arranged in ascending order, and the characteristic vectors are sorted according to the order of the characteristic values, and the primary eigenvalues corresponding to the inflection points of the ascending order are found by using the second difference method, and the primary eigenvalues corresponding to the inflection points are recorded as K in the order of the characteristic values in the ascending order.

[0032] The first K eigenvectors after sorting are taken as the relative feature of the heart beat, that is, the sub-lead spectral space relative feature of the current lead heart beat is obtained.

[0033] Further, the calculation method of the sub-lead absolute feature is as follows:

[0034] The primary feature in the multi-lead electrocardiogram data is extracted by convolutional neural network;

[0035] According to the lead and the heart beat position, the primary feature corresponding to each heart beat on each lead is obtained;

[0036] The heart beat features on each lead are averaged to obtain the heart beat absolute features on each lead, which constitute the sub-lead absolute features of the heart beat.

[0037] Further, the loss function is constructed based on the Euclidean distance between the sub-lead spectral space relative features and the sub-lead absolute features of the heart beat, specifically:

[0038] The Euclidean distance matrix of the sub-lead spectral space relative features and the Euclidean distance matrix of the sub-lead absolute features

[0039]

[0040]

[0041] wherein, E re,g represents the heart beat spectral space relative features of the gth lead, E re,g (i) is the i th row data of E re,g , [E re,g (i)]1is the i th row and l th column data of E re,g , E ab,g represents the heart beat absolute features of the gth lead, K and E_S are the dimensions of the heart beat spectral space relative features and the heart beat absolute features respectively;

[0042] The loss function is the mean square error (MSE) of the two Euclidean distance matrices, specifically:

[0043]

[0044] wherein, A1 g and A2 g are both (N, N) dimensional matrices.

[0045] Further, the loss function of the feature extraction model further includes the mean square error (MSE) of the coincident heart beats, specifically:

[0046] The multi-lead electrocardiogram data is cut twice to obtain two multi-lead sub-electrocardiogram data, so that the two multi-lead sub-electrocardiogram data after cutting have coincident heart beats;

[0047] The feature extraction model is used to obtain the sub-lead absolute features of the heart beat from the two multi-lead sub-electrocardiogram data respectively;

[0048] Based on the sub-lead absolute features of the two multi-lead sub-electrocardiogram data with coincident heart beats, the mean square error (MSE) of each coincident heart beat is calculated, specifically:

[0049]

[0050] wherein, C1g , C2 g indicates the relative feature of the spectrum space of the two multi-lead sub-electrocardiogram data gth lead corresponding to the coincident heartbeat.

[0051] The second aspect of the application provides an ECG waveform clustering system based on spectrum space representation learning.

[0052] An ECG waveform clustering system based on spectrum space representation learning, comprising a data construction module, a model construction module, a feature extraction module and a heartbeat clustering module:

[0053] The data construction module is configured to: acquire multi-lead electrocardiogram data, and construct a training data set composed of the multi-lead electrocardiogram data and the sub-lead spectrum space relative feature of the heartbeat;

[0054] The model construction module is configured to: based on the training data set, taking the multi-lead electrocardiogram data as the input and the sub-lead absolute feature of the heartbeat as the output, train the constructed feature extraction model, and learn the spectrum space representation, wherein the loss function is constructed based on the Euclidean distance between the sub-lead spectrum space relative feature of the heartbeat and the sub-lead absolute feature, and the training of the feature extraction model is constrained;

[0055] The feature extraction module is configured to: input the multi-lead electrocardiogram data to be clustered into the trained feature extraction model to obtain the sub-lead absolute feature of the heartbeat;

[0056] The heartbeat clustering module is configured to: cluster the obtained sub-lead absolute feature of the heartbeat to obtain the clustering result of the heartbeat.

[0057] The third aspect of the application provides a computer readable storage medium, which stores a program, and the program is executed by a processor to realize the steps of the ECG waveform clustering method based on spectrum space representation learning according to the first aspect of the application.

[0058] The fourth aspect of the application provides an electronic device, comprising a memory, a processor and a program stored in the memory and executable on the processor, and the processor executes the program to realize the steps of the ECG waveform clustering method based on spectrum space representation learning according to the first aspect of the application.

[0059] The above one or more technical solutions have the following beneficial effects:

[0060] The application provides an ECG waveform clustering method based on spectral space representation learning, which clusters waveforms through a neural network and spectral space representation learning, and is specifically applied to heartbeat clustering in 12-lead electrocardiogram; relative characteristics of a spectral space center beat are first obtained, and then absolute characteristic model output of the heartbeat is obtained through a characteristic extraction model, the absolute characteristic model output learns the relativity of the spectral space relative characteristics, and the absolute characteristic model output guarantees the absoluteness of the heartbeat expression of the model output through the method of cutting the data coincident heartbeat expression as mse; unlike the traditional waveform clustering method, the application pays more attention to improving the quality of feature expression, avoids the cumbersome problem of subsequent feature processing after direct feature extraction of the traditional waveform clustering method, and solves the problems of large data volume and high computational complexity in the dynamic electrocardiogram actual application analysis process.

[0061] Advantages of the additional aspects of the application will be partially given in the following description, partially will become obvious from the following description, or will be known by the practice of the application. BRIEF DESCRIPTION OF DRAWINGS

[0062] The accompanying drawings, which form a part of the specification, are included to provide a further understanding of the application and are incorporated herein for explanation by illustrating a preferred embodiment of the application.

[0063] Figure 1 The method flowchart of the first embodiment.

[0064] Figure 2 The system structure diagram of the second embodiment. DETAILED DESCRIPTION

[0065] The application will be further described below in combination with the drawings and embodiments.

[0066] Embodiment one

[0067] The embodiment discloses an ECG waveform clustering method based on spectral space representation learning;

[0068] As shown in the figure, an ECG waveform clustering method based on spectral space representation learning comprises: Figure 1

[0069] Step S1: acquiring multi-lead electrocardiogram data, constructing a training data set composed of multi-lead electrocardiogram data and heartbeat split-lead spectral space relative characteristics, and the specific steps are as follows:

[0070] Step S101: acquiring complete standard 12-lead electrocardiogram data wave len , in the format of (12, len), and len is the length of the electrocardiogram data; wave len ​The heartbeat locations were manually identified, and the identified heartbeat locations were arranged in chronological order to construct a heartbeat location dataset {beat1, beat2, ..., beat...}. N}, record the start and end points of each heartbeat, where N is the number of heartbeats.

[0071] Step S102: Calculate the adjacency matrix based on the heartbeat location data set {beat1,beat2,...,beat...} N} Take the heartbeat of each lead, and perform IOU calculations on every pair of heartbeats in the g-th lead to obtain the adjacency matrix of the g-th lead with dimension (N,N), denoted as W. g To reduce subsequent model training time, the W adjacency matrix corresponding to each lead is saved to obtain the entire 12-lead ECG data wave. len The adjacency matrix: {W1, W2, ..., W 12}

[0072] Specifically, take two heart rate data points, pre and pos, from the same lead, with data formats of (1, length1) and (1, length2), respectively.

[0073] The waveform `pre` is padded with `length2` zeros at the beginning and end, and this waveform is denoted as `pre_beat`. The waveform `pos` is padded with `j` zeros at the beginning and `length1 + length2 - j` zeros at the end, and this waveform is denoted as `pos_beat`. `j` is an integer value ranging from 0 to `length1 + length2`. This processing ensures that `pre_beat` and `pos_beat` have the same waveform length, facilitating subsequent phase addition and subtraction operations on the waveforms.

[0074] Let the waveforms with the less-than-zero parts of pre_beat and pos_beat set to 0 be pre_up and pos_up, respectively, and the waveforms with the greater-than-zero parts set to 0 be pre_down and pos_down, respectively.

[0075] The IOU of pre and pos is calculated using the following formula:

[0076]

[0077]

[0078]

[0079] This allows us to obtain the IOU data for each pair of heartbeats on the g-th lead, where inter is the intersection value, unit is the union value, and beat_wave is the beat number. g (i) represents the heartbeat data of the i-th lead in the g-th lead, and the adjacency matrix W of the g-th lead.g (i, j) = IOU(beat_wave g (i), beat_wave g (j)), 0 < i, j < N, then for the entire 12 - lead electrocardiogram data wave len 's W adjacency matrix: {W1, W2, …, W 12}}.

[0080] Step S103: Learning the spectral - space representation of heartbeats to obtain relative spectral - space features

[0081] According to the adjacency matrix W g of the g - th lead, calculate the relative spectral - space feature matrix E N of the heartbeats {beat1, beat2, …, beat re,g}, with dimension (N, K), where K is the length of the representation vector of the heartbeats in the current spectral space. Then obtain the relative spectral - space features Express relative = {E re,1 , re,2 , …, re,12}}, specifically:

[0082] (1) Based on the adjacency matrix W g of the g - th lead, obtain its degree matrix D g . From the W g , D g matrices, calculate the (N, N) - dimensional Laplacian matrix L g = D g - D g according to the formula. g .

[0083] (2) Normalize the Laplacian matrix L g according to the formula . Further, perform eigenvalue decomposition on the S_L g matrix to obtain N eigenvalues and N N - dimensional primary eigenvectors.

[0084] (3) Sort the N eigenvalues in ascending order, and sort the eigenvectors according to the order of the eigenvalues. Use the second - order difference method to find the eigenvalue S corresponding to the inflection point of the ascending order, and record the serial number of S in the ascending order of eigenvalues as K.

[0085] (4) Take the first K eigenvectors after sorting as the relative spectral - space features of the N heartbeats, that is, obtain the relative spectral - space feature matrix E re,g of the N heartbeats in the current lead, with dimension (N, K). Then the relative spectral - space features Express relative of the heartbeats in the entire electrocardiogram can be obtained = {E re,1E re,2 ,…,E re,12}。

[0086] Step S2: Based on the training data set, taking the multi-lead electrocardiogram data as input and the lead-specific absolute feature of the heartbeat as output, the constructed feature extraction model is trained to learn the spectral space representation, wherein the loss function is constructed based on the Euclidean distance between the lead-specific spectral space relative feature and the lead-specific absolute feature of the heartbeat, and the training of the feature extraction model is constrained.

[0087] The feature extraction model is constructed based on a convolutional neural network and includes two parts: a convolutional neural network and a post-processing module. The convolutional neural network is used to extract primary features of the multi-lead electrocardiogram data through convolution operation, and the post-processing module is used to calculate absolute features from the primary features. Therefore, the specific processing steps of the feature extraction model are as follows:

[0088] Step S201: Extracting the primary feature wave len from the multi-lead electrocardiogram data wave out_len through the convolutional neural network, wherein the primary feature wave out_len has a format of ((12×E_S), out_len), and E_S represents the mapping tensor dimension of each data point output by the convolutional neural network, and out_len is the output length corresponding to the len dimension after convolution, i.e., the data of each lead in the electrocardiogram is mapped to a (1×E_S) vector, and the primary feature of the gth lead is the (g-1)×E_S to g×E_S row data of wave out_len .

[0089] Step S201: According to the heartbeat recognition position data {beat1, beat2, …, beat N} of wave len , the primary feature beat out,g corresponding to each heartbeat on the gth lead can be obtained, and the data format is (ls, E_S), wherein ls is the number of heartbeat data after network convolution.

[0090] Step S202: Taking the average value of the heartbeat features on each lead to obtain the absolute feature of the heartbeat on each lead, which constitutes the lead-specific absolute feature of the heartbeat.

[0091] Taking the average value of the primary feature (ls, E_S) of the heartbeat according to the first dimension ls, the model output expression of the heartbeat is an E_S-dimensional vector; i.e., the (N, E_S)-dimensional absolute feature of the N heartbeats on the gth lead, i.e., E ab,g , can be obtained, and the absolute feature Express absolute of the entire electrocardiogram heartbeat can be obtained. ab,1 ={E ab,2..., E ab,12}。

[0092] The feature extraction model needs to be trained by a training data set to learn the feature representation of the spectrum space. In the training process, the multi-lead electrocardiogram data in the training data set is taken as the input, and the beat absolute feature of each lead is taken as the output. A loss function is constructed to constrain the training process. The loss function includes two constraint terms, which are specifically:

[0093] (1) The electrocardiogram data wave len The absolute feature Express absolute The loss value of learning the relative feature Express relative of the spectrum space is recorded as loss1.

[0094] The electrocardiogram wave len The relative feature Express relative of the spectrum space of the beat and the absolute feature Express absolute have been obtained. The relative feature matrix of the spectrum space of the gth lead is recorded as E re,g , the absolute feature matrix is recorded as E ab,g , and the relative feature Euclidean distance matrix A1 g and the absolute feature Euclidean distance matrix A2 g are calculated according to the following formula:

[0095]

[0096]

[0097] Among them, E re,g (i) is the ith row data of E re,g , and [E re,g (i)] l is the data of the ith row and the lth column of E re,g .

[0098] A1 g and A2 g are both (N, N) dimensional, and the mean square error mse of the two Euclidean distance matrices is calculated according to the following formula:

[0099]

[0100] The sum of the mes of the 12 leads is taken as the first loss loss1.

[0101] (2) To ensure the absolute nature of the feature output by each beat model, that is, to ensure that the same beat has no effect on the absolute feature of the beat at different positions of the electrocardiogram data, the loss value is recorded as loss2.

[0102] The electrocardiogram data wave len Cut twice to obtain two cut electrocardiogram data respectively denoted as wave1 len , wave2 len , and the data formats are (12, len1), (12, len2) respectively, and the corresponding time-ordered heartbeat position data are {beat1, beat2, …, beat N1}, {beat1, beat2, …, beat N2} respectively. When cutting data, 60% or more length can be selected to ensure that the two cut electrocardiogram data have overlapping heartbeats.

[0103] wave1 len , wave2 len are respectively input into the feature extraction model to obtain the absolute features of the heartbeats, and the absolute feature matrix of the gth lead of the heartbeat is denoted as B1 g , B2 g , the dimension of B1 g is (N1, E_S), and the dimension of B2 g is (N2, E_S).

[0104] Assuming that the number of overlapping heartbeats of wave1 len , wave2 len is n, the absolute feature matrix C1 g , C2 g of the corresponding overlapping heartbeat of the gth lead of wave1 len , wave2 len can be obtained from B1 g , B2 g , and the dimension of C1 g , C2 g is (n, E_S). According to this, the expression of each overlapping heartbeat is calculated by mse:

[0105]

[0106] The sum of the mes of the 12 leads is taken as the second loss loss2.

[0107] (3) The training weights weight1 and weight2 of loss1 and loss2 of each generation are determined by a dynamic gradient balancing method, and the training loss is loss = loss1 x weight1 + loss2 x weight2.

[0108] Step S3: inputting the multi-lead electrocardiogram data to be clustered into the trained feature extraction model to obtain the split-lead absolute features of the heartbeats.

[0109] The complete 12-lead electrocardiogram data of the heart beat to be clustered is input into the trained feature extraction model to obtain the lead-specific absolute features Express of the heart beat, where E 12} and the dimension is (N, E_S). i} and the dimension is (N, E_S).

[0110] Step S4: clustering the obtained lead-specific absolute features of the heart beat to obtain the clustering result of the heart beat.

[0111] The k-means clustering algorithm is used to cluster the lead-specific absolute features of the heart beat output by the feature extraction model, and each cluster of the clustered heart beat can be superimposed and visualized.

[0112] Embodiment Two

[0113] The embodiment discloses an ECG waveform clustering system based on spectral space representation learning.

[0114] As shown in Figure 2 , an ECG waveform clustering system based on spectral space representation learning includes a data construction module, a model construction module, a feature extraction module, and a heart beat clustering module:

[0115] The data construction module is configured to: obtain multi-lead electrocardiogram data, and construct a training data set composed of the multi-lead electrocardiogram data and the lead-specific spectral space relative features of the heart beat.

[0116] The model construction module is configured to: based on the training data set, taking the multi-lead electrocardiogram data as input and the lead-specific absolute features of the heart beat as output, training the constructed feature extraction model to learn the spectral space representation, wherein the loss function is constructed based on the Euclidean distance between the lead-specific spectral space relative features and the lead-specific absolute features of the heart beat to constrain the training of the feature extraction model.

[0117] The feature extraction module is configured to: input the multi-lead electrocardiogram data to be clustered into the trained feature extraction model to obtain the lead-specific absolute features of the heart beat.

[0118] The heart beat clustering module is configured to: cluster the obtained lead-specific absolute features of the heart beat to obtain the clustering result of the heart beat.

[0119] Embodiment Three

[0120] The purpose of the embodiment is to provide a computer readable storage medium.

[0121] The computer readable storage medium stores a computer program, which is executed by a processor to implement the steps in the ECG waveform clustering method based on spectral space representation learning according to Embodiment One of the present disclosure.

[0122] Embodiment Four

[0123] An electronic device is provided.

[0124] An electronic device includes a memory, a processor, and a program stored in the memory and executable on the processor, and the processor implements the steps in the ECG waveform clustering method based on spectral space representation learning according to an embodiment of the present disclosure when executing the program.

[0125] The preferred embodiments of the present application have been described above with the preferred embodiments, the present application is not limited to the above examples, and for those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for ECG waveform clustering based on spectral space representation learning, characterized in that, The method comprises the following steps: obtaining multi-lead electrocardiogram data, and constructing a training data set composed of the multi-lead electrocardiogram data and relative spectral space features of heartbeats of each lead; training a feature extraction model based on the training data set, taking the multi-lead electrocardiogram data as input and the absolute features of the heartbeats of each lead as output, and learning spectral space representation, wherein a loss function is constructed based on the Euclidean distance between the relative spectral space features of the heartbeats of each lead and the absolute features of the heartbeats of each lead, and the training of the feature extraction model is constrained; inputting multi-lead electrocardiogram data to be clustered into the trained feature extraction model to obtain the absolute features of the heartbeats of each lead; clustering the obtained absolute features of the heartbeats of each lead to obtain a clustering result of the heartbeats.

2. The ECG waveform clustering method based on spectral space representation learning of claim 1, wherein, The training data set is constructed by the following steps: manually identifying the positions of the heartbeats in the multi-lead electrocardiogram data, arranging the identified positions in time sequence, and constructing a heartbeat position data set; based on the heartbeat position data set, calculating the IOU of the heartbeats of each lead in pairs to construct an adjacency matrix of each lead; calculating the relative spectral space features of the heartbeats of each lead according to the adjacency matrix of each lead; the multi-lead electrocardiogram data and the finally calculated relative spectral space features of the heartbeats of each lead constitute the training data set.

3. The ECG waveform clustering method based on spectral space representation learning of claim 2, wherein, The IOU of the heartbeats of each lead in pairs is calculated by the following steps: performing a padding operation on any two heartbeat data of each lead; constructing an adjacency matrix of each lead by calculating the IOU value between the two heartbeat data after padding, and the specific calculation method of the IOU value is as follows: wherein, denote two heart beat data, denote two heart beat data after padding, , denote , the part less than zero is set to waveform, , denote , the part greater than zero is set to waveform.

4. The ECG waveform clustering method based on spectral space representation learning of claim 2, wherein, The relative spectral space features of the heartbeats of each lead are calculated by the following steps: calculating a degree matrix according to the adjacency matrix of each lead, and calculating a Laplacian matrix from the adjacency matrix and the degree matrix; standardizing the Laplacian matrix and performing eigenvalue decomposition on the standardized Laplacian matrix to obtain a plurality of eigenvalues and corresponding primary eigenvectors; The plurality of characteristic values are arranged in ascending order, and the characteristic vectors are sorted according to the order of the characteristic values; the primary characteristic values corresponding to the inflection points in the ascending arrangement are found by using a second-order difference method, and the serial numbers of the primary characteristic values corresponding to the inflection points in the ascending arrangement of the characteristic values are denoted as ; Take the sorted first Feature vectors as the relative characteristics of heartbeats, that is, the sub-lead space relative characteristics of the current lead central beat.

5. The ECG waveform clustering method based on spectral space representation learning of claim 1, wherein, The calculation method of the absolute features of the heartbeats of each lead is as follows: extracting the primary features in the multi-lead electrocardiogram data through a convolutional neural network; obtaining the primary features corresponding to each heartbeat on each lead according to the lead and the position of the heartbeat; taking the average value of the heartbeat features on each lead to obtain the absolute features of the heartbeats on each lead, and constructing the absolute features of the heartbeats of each lead.

6. The ECG waveform clustering method based on spectral space representation learning of claim 1, wherein, The loss function is constructed based on the Euclidean distance between the relative spectral space features of the heartbeats of each lead and the absolute features of the heartbeats of each lead by the following steps: Euclidean distance matrix of spatial relative features of sub-channels Euclidean distance matrix of absolute features of sub-channels : wherein, denotes a cardiac-spectrum spatial relative feature of the th lead, is a cardiac-spectrum spatial relative feature of the th lead, is a cardiac-spectrum spatial relative feature of the th lead, is a cardiac-spectrum spatial relative feature of the th lead, is a cardiac-spectrum spatial relative feature of the th lead, denotes a cardiac-spectrum absolute feature of the th lead, is a cardiac-spectrum spatial relative feature and a cardiac-spectrum absolute feature, respectively; The loss function is mean square error of two Euclidean distance matrices Specifically, wherein , are each matrices.

7. The ECG waveform clustering method based on spectral space representation learning as claimed in claim 6, wherein, The loss function of the feature extraction model further comprises a mean square error of coinciding heartbeats Specifically, cutting the multi-lead electrocardiogram data twice to obtain two multi-lead sub-electrocardiogram data, and ensuring that the two multi-lead sub-electrocardiogram data after cutting have overlapping heartbeats; obtaining the absolute features of the heartbeats of each lead from the two multi-lead sub-electrocardiogram data respectively by using the feature extraction model; Based on the absolute features of two multi-lead sub-ECG data of a coincident heartbeat, the mean square error of each coincident heartbeat is calculated , specifically: wherein, , denote the absolute feature matrix of the corresponding coincident heartbeats of the two multi-lead sub-ECG data of the i-th lead, both with dimension . .

8. A system for ECG waveform clustering based on spectral space representation learning, the system comprising: The method comprises a data construction module, a model construction module, a feature extraction module and a heartbeat clustering module: The data construction module is configured to obtain multi-lead electrocardiogram data, and construct a training data set composed of the multi-lead electrocardiogram data and relative spectral space features of heartbeats of each lead; The model construction module is configured to train the constructed feature extraction model based on a training data set, taking multi-lead electrocardiogram data as input and lead-specific absolute features of heartbeats as output, and learning spectral space representation, wherein a loss function is constructed based on the Euclidean distance between lead-specific spectral space relative features and lead-specific absolute features of heartbeats to constrain the training of the feature extraction model. The feature extraction module is configured to input the multi-lead electrocardiogram data to be clustered into the trained feature extraction model to obtain lead-specific absolute features of heartbeats. The heartbeat clustering module is configured to cluster the obtained lead-specific absolute features of heartbeats to obtain a clustering result of heartbeats.

9. An electronic device, comprising: a memory for non-transiently storing computer readable instructions; and a processor for executing the computer readable instructions, wherein the computer readable instructions, when executed by the processor, perform the method of any one of claims 1-7.

10. A storage medium characterized by, non-transiently storing computer readable instructions, wherein when the non-transient computer readable instructions are executed by a computer, instructions of the method of any one of claims 1-7 are executed.