A cardiac arrhythmia detection system based on graph neural network
Through the arrhythmia detection system based on graph neural network, the problem of poor accuracy of central arrhythmia detection in the prior art is solved, and effective capture of spatiotemporal characteristics of ECG signals and improved accuracy of arrhythmia detection is achieved.
Patent Information
- Application Number
- CN202411960734.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-30
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-30
AI Technical Summary
The prior art has poor accuracy in arrhythmia detection, cannot effectively capture the spatiotemporal characteristics of ECG signals, and the model is poor interpretability.
Arrhythmia detection system based on graph neural network is adopted, and arrhythmia detection system is obtained by acquiring multiple electrocardiograms, a time feature extraction encoder is used to obtain signal characteristics, build a topology map, and enhance the graph structure through the time attenuation matrix and spatial knowledge guidance matrix. Finally, a graph neural network is used for feature extraction and arrhythmia detection.
It improves the accuracy of arrhythmia detection, enhances the information richness and accuracy of the topology map, and improves the interpretability of the model.
Smart Images

Figure CN119377648B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of medical big data technology, and in particular to an arrhythmia detection system based on graph neural network. Background Art
[0002] Electrocardiogram (ECG) is a key biological signal that records the electrical activity of the heart. This inexpensive and non-invasive test can provide rich information and is of great significance for diagnosing and monitoring heart disease.
[0003] Traditional ECG diagnosis mainly relies on manual analysis and subjective judgment by well-trained clinical experts. The process is cumbersome, time-consuming and labor-intensive, and is limited by the knowledge and experience of medical experts, which is prone to misdiagnosis or missed diagnosis. In recent years, with the rapid development of intelligent medical care, intelligent detection of arrhythmias based on electrocardiograms can assist doctors in ECG diagnosis. At present, there are limited research results in this area, and how to improve the accuracy of automatic detection of arrhythmias is the key to the problem. In traditional research, many scholars use machine learning methods such as support vector machines and decision trees to study ECG signals, but such methods require researchers to have certain medical knowledge and extract useful features to input models for training. Similarly, deep learning methods are also applied to ECG research. Domestic and foreign scholars input ECG data into architectures such as convolutional neural networks (CNN) and recurrent neural networks (RNN) to extract features from ECG signals to achieve the ultimate research purpose. However, such research methods often regard neural networks as black boxes, and the interpretability of the models is poor.
[0004] In clinical practice, 12-lead ECG is often used. The standard 12-lead ECG places 10 electrodes on the body surface to record the depolarization and repolarization currents of the heart in 12 different directions. For multi-lead research, previous studies often simply added multiple leads or directly used a spliced matrix without fully considering the relationship between multiple leads. In fact, multi-lead ECG uses electrodes placed on the chest and limbs to generate potential differences and measure the electrical activity of the heart from multiple angles. According to the spatial position of the electrodes, different leads have a relative position relationship physiologically. Therefore, it is very necessary to comprehensively consider the time characteristics within the lead and the spatial characteristics between the leads for the efficient diagnosis of arrhythmias.
[0005] In order to overcome the limitation of not being able to capture ECG spatial features, researchers began to explore how to apply graph neural networks (GNNs) to ECG data. The advantage of GNNs lies in their ability to model complex graph structures, which coincides with the characteristics of ECG data. ECG data can be viewed as time series data, but can also be converted into graphs, where each time point or time window can be used as a node of the graph, and the connection between nodes represents the temporal relationship. This graph structure helps capture the temporal relationship and local patterns between cardiac signals, thereby improving the sensitivity and accuracy of the diagnosis of cardiac events. However, directly converting time series into graphs does not capture the multi-scale features of time series well. On the contrary, the structural learning of the graph limits the size of the receptive field, thereby losing important temporal features. Similarly, a graph between multiple leads can also be constructed, and the structure of GNN can be used to explore the relationship between each lead to extract spatial features more comprehensively. However, the construction of these graphs is generally based on a predefined graph structure, without effective prior knowledge to support the construction of the graph, and it is impossible to dynamically capture the spatial relationship of the leads at different time steps. Compared with the traditional method of using only time encoders, these works have made some improvements and began to consider spatial correlation. However, they process each graph independently, ignoring the correlation between different leads at different time steps. This correlation is crucial in ECG feature extraction networks. For example, the disappearance of the P wave in lead I will not only affect the waveform of the subsequent lead I, but also the waveforms of leads II and III. In addition, when performing spatial feature extraction, most existing solutions use flat pooling schemes to reduce nodes, which will lose the structural information between leads and fail to fully capture the spatiotemporal information of ECG signals, resulting in poor accuracy in arrhythmia detection. Summary of the invention
[0006] The present application provides an arrhythmia detection system based on a graph neural network, which can solve the problem of poor accuracy of arrhythmia detection.
[0007] The embodiment of the present application provides an arrhythmia detection system based on a graph neural network, and the arrhythmia detection system includes:
[0008] An acquisition module is used to acquire multiple ECG lead data; the ECG lead data includes ECG signals of multiple time periods, and the multiple ECG lead data correspond to multiple lead positions of the detection object;
[0009] The embedding module is used to obtain the signal features of the ECG signal of each ECG lead data in each time period by using the time feature extraction encoder, and embed all the signal features to obtain a topological graph; the multiple nodes of the topological graph correspond to the multiple signal features one by one, and the edge between two nodes is the correlation between the corresponding two signal features;
[0010] A construction module is used to construct a time decay matrix and a spatial knowledge guidance matrix, and multiply the time decay matrix, the spatial knowledge guidance matrix and the adjacency matrix of the topological map to obtain a related adjacency matrix of the topological map; the time decay matrix is used to describe the correlation between multiple time periods, and the spatial knowledge guidance matrix is used to describe the spatial relationship between multiple lead positions;
[0011] An updating module is used to update the edges of the topological graph using the relevant adjacency matrix of the topological graph to obtain the final topological graph, and to extract features from the final topological graph using a graph neural network to obtain an overall feature representation of the final topological graph;
[0012] The arrhythmia detection module is used to perform arrhythmia detection based on the overall feature representation to obtain an arrhythmia detection result.
[0013] Optionally, a time feature extraction encoder is used to obtain the signal features of the ECG signal of each ECG lead data in each time period, including:
[0014] The time feature extraction encoder is used to obtain the time coding information of the ECG signal of each ECG lead data in each time period;
[0015] The position code of each time period is obtained, and each time code information is added to the position code of the corresponding time period to obtain the signal characteristics of each ECG lead data in each time period.
[0016] Optionally, get the position code for each time period, including:
[0017] By formula:
[0018] ;
[0019] Calculate the In the time period The position vector of the ECG signal ;
[0020] in, represents the frequency parameter, Represents the index parameter, , Indicates the number of time periods, , Indicates the number of ECG signals in a time period;
[0021] The first The position vectors corresponding to the time periods are integrated into a set to obtain the Position encoding of time segment .
[0022] Optionally, each time code information is added to the position code of the corresponding time period to obtain the signal characteristics of each ECG lead data in each time period, including:
[0023] By formula:
[0024] ;
[0025] Calculate the ECG lead data is in Signal characteristics of each time period ;
[0026] in, Indicates ECG lead data is in Time coding information for a time period, , Indicates the number of ECG lead data.
[0027] Optionally, a graph neural network is used to extract features from the final topology map to obtain an overall feature representation of the final topology map, including:
[0028] Perform multi-layer update on the signal characteristics of each node in the final topology graph to obtain the updated signal characteristics of each node at each layer;
[0029] All signal features of all nodes are concatenated to obtain the overall feature representation of the final topology graph.
[0030] Optionally, a graph neural network is used to extract features from the final topology map to obtain an overall feature representation of the final topology map, including:
[0031] By formula:
[0032]
[0033] For Node Update the signal characteristics;
[0034] in, Indicates Layer Node The signal characteristics of , represents the last layer to be updated, Indicates Layer Node The signal characteristics of Indicates Layer Node The signal characteristics of Represents the nodes in the final topology graph The set of adjacent nodes of Indicates The parameters of the layer, Indicates Layer of multilayer perceptron, when hour, Representation Node signal characteristics.
[0035] Optionally, the final signal features of all nodes are concatenated to obtain the overall feature representation of the final topology graph, including:
[0036] By formula:
[0037] ;
[0038] Calculate the overall feature representation of the final topology graph ;
[0039] in, Represents a splicing operation, Represents the set of all nodes in the final topology graph.
[0040] Optionally, the temporal feature extraction encoder includes a convolution model, a first feature extraction model, a second feature extraction model and an average pooling model connected in sequence;
[0041] The input end of the convolution model is the input end of the temporal feature extraction encoder, and the output end of the average pooling model is the output end of the temporal feature extraction encoder.
[0042] Optionally, the first feature extraction model and the second feature extraction model are both one feature extraction model;
[0043] The feature extraction model includes a multi-scale convolution module, a multi-dimensional permutation attention module, a multiplication module, and an addition module;
[0044] The input end of the multi-scale convolution module and the input end of the addition module are both input ends of the feature extraction model, and the output end of the addition module is the output end of the feature extraction model;
[0045] The output end of the multi-scale convolution module is connected to the input end of the multidimensional permutation attention module and the input end of the multiplication module respectively, the output end of the multidimensional permutation attention module is connected to the input end of the multiplication module, and the output end of the multiplication module is connected to the input end of the addition module.
[0046] Optionally, the multi-dimensional permutation attention module includes a segmentation unit, a permutation unit, an activation function unit, and a random shuffle unit;
[0047] The input end of the segmentation unit is the input end of the multi-dimensional permutation attention module, and the output end of the random shuffle unit is the output end of the multi-dimensional permutation attention module;
[0048] The output end of the segmentation unit is connected to the input end of the permutation unit and the input end of the activation function unit respectively, the output end of the permutation unit is connected to the input end of the activation function unit, and the output end of the activation function unit is connected to the input end of the random shuffle unit;
[0049] The replacement unit includes: an average pooling subunit, a maximum pooling subunit, a first convolution subunit, a second convolution subunit, an addition subunit, an activation function subunit, a normalization subunit, a multiplication subunit, and a convolution pooling subunit;
[0050] The input end of the average pooling subunit, the input end of the maximum pooling subunit, the input end of the convolution pooling subunit, and the input end of the activation function subunit are all input ends of the permutation unit, and the output end of the multiplication subunit is the output end of the permutation unit;
[0051] The output end of the average pooling subunit is connected to the input end of the first convolution subunit, the output end of the maximum pooling subunit is connected to the input end of the second convolution subunit, the input end of the addition subunit is respectively connected to the output end of the first convolution subunit and the output end of the second convolution subunit, the output end of the addition subunit is connected to the input end of the activation function subunit, the output end of the activation function subunit is connected to the input end of the normalization subunit, and the input end of the multiplication subunit is respectively connected to the output end of the normalization subunit and the output end of the convolution pooling subunit;
[0052] The first convolution subunit and the second convolution subunit are both convolution subunits, the convolution subunit includes a first convolution layer, a first activation function layer, and a second convolution layer connected in sequence, the input end of the first convolution layer is the input end of the convolution subunit, and the output end of the second convolution layer is the output end of the convolution subunit;
[0053] The convolutional pooling subunit includes a third convolutional layer, an average pooling layer, and a second activation function layer connected in sequence. The input end of the third convolutional layer is the input end of the convolutional pooling subunit, and the output end of the second activation function layer is the output end of the convolutional pooling subunit.
[0054] The above solution of the present application has the following beneficial effects:
[0055] In an embodiment of the present application, multiple ECG lead data are obtained, and then the signal features of the ECG signal of each ECG lead data in each time period are obtained by using a time feature extraction encoder, and a topological map is constructed based on all signal features, and then a time decay matrix and a spatial knowledge guidance matrix are constructed, and the time decay matrix, the spatial knowledge guidance matrix and the adjacency matrix of the topological map are multiplied to obtain the relevant adjacency matrix of the topological map, and then the relevant adjacency matrix of the topological map is used to update the edges of the topological map to obtain the final topological map, and the graph neural network is used to extract features of the final topological map to obtain the overall feature representation of the final topological map, and finally arrhythmia detection is performed based on the overall feature representation to obtain the arrhythmia detection result. Among them, the structure of the topological map is enhanced and updated by using the time decay matrix and the spatial knowledge guidance matrix, and the relationship between the ECG signals in the two dimensions of time and space is expressed, which improves the information richness and accuracy of the topological map, thereby improving the accuracy of the overall feature representation of the topological map, and performing arrhythmia detection based on the accurate overall feature representation, which effectively improves the accuracy of arrhythmia detection.
[0056] Other beneficial effects of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0058] Figure 1 A schematic diagram of the structure of an arrhythmia detection system based on a graph neural network provided in one embodiment of the present application;
[0059] Figure 2 A flowchart of the use process of the arrhythmia detection system based on graph neural network provided in one embodiment of the present application;
[0060] Figure 3 A schematic diagram of the structure of a temporal feature extraction encoder provided in one embodiment of the present application;
[0061] Figure 4 A schematic diagram of the structure of a multi-dimensional permutation attention module provided in one embodiment of the present application. DETAILED DESCRIPTION
[0062] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0063] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0064] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0065] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0066] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0067] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0068] In view of the low accuracy of existing arrhythmia detection, the embodiment of the present application provides an arrhythmia detection system based on a graph neural network. The arrhythmia detection system obtains multiple ECG lead data, and then uses a time feature extraction encoder to obtain the signal features of the ECG signal of each ECG lead data in each time period, and constructs a topological map based on all signal features, and then constructs a time decay matrix and a spatial knowledge guidance matrix, multiplies the time decay matrix, the spatial knowledge guidance matrix and the adjacency matrix of the topological map to obtain the relevant adjacency matrix of the topological map, and then uses the relevant adjacency matrix of the topological map to update the edges of the topological map to obtain the final topological map, and uses the graph neural network to extract features of the final topological map to obtain the overall feature representation of the final topological map, and finally performs arrhythmia detection based on the overall feature representation to obtain the arrhythmia detection result. Among them, the structure of the topological map is enhanced and updated by using the time decay matrix and the spatial knowledge guidance matrix, and the relationship between the ECG signals in the two dimensions of time and space is expressed, which improves the information richness and accuracy of the topological map, thereby improving the accuracy of the overall feature representation of the topological map, and performing arrhythmia detection based on the accurate overall feature representation, which effectively improves the accuracy of arrhythmia detection.
[0069] like Figure 1 As shown, the arrhythmia detection system 100 based on graph neural network provided by the present application includes:
[0070] The acquisition module 101 is used to acquire a plurality of ECG lead data; the ECG lead data includes ECG signals of a plurality of time periods, and the plurality of ECG lead data corresponds to a plurality of lead positions of the detection object;
[0071] The embedding module 102 is used to obtain the signal features of the ECG signal of each ECG lead data in each time period by using a time feature extraction encoder, and embed all the signal features to obtain a topological graph; the multiple nodes of the topological graph correspond to the multiple signal features one by one, and the edge between two nodes is the correlation between the corresponding two signal features;
[0072] A construction module 103 is used to construct a time decay matrix and a spatial knowledge guidance matrix, and multiply the time decay matrix, the spatial knowledge guidance matrix and the adjacency matrix of the topological map to obtain a related adjacency matrix of the topological map; the time decay matrix is used to describe the correlation between multiple time periods, and the spatial knowledge guidance matrix is used to describe the spatial relationship between multiple lead positions;
[0073] An updating module 104 is used to update the edges of the topological graph using the relevant adjacency matrix of the topological graph to obtain a final topological graph, and to extract features from the final topological graph using a graph neural network to obtain an overall feature representation of the final topological graph;
[0074] The arrhythmia detection module 105 is used to perform arrhythmia detection based on the overall feature representation to obtain an arrhythmia detection result.
[0075] like Figure 2 As shown, the arrhythmia detection system based on graph neural network provided by the present application includes the following steps during use:
[0076] Step 21, obtaining multiple ECG lead data.
[0077] The above ECG lead data include ECG signals of multiple time periods, where the time period is a historical time period. For example, if the current time is 11 o'clock, the time period may be from 8 o'clock to 9 o'clock, and the ECG signals in this time period are all ECG signals from 8 o'clock to 9 o'clock. Multiple ECG lead data correspond to multiple lead positions of the detection object (positions for detecting ECG signals, such as chest, upper limbs, lower limbs, etc.), and multiple ECG lead data all belong to the same human body. Multiple ECG lead data can be obtained by collecting ECG signals of ECG detection instruments at multiple positions.
[0078] Step 22, using a time feature extraction encoder to obtain the signal features of the ECG signal of each ECG lead data in each time period, and constructing a topology map based on all signal features.
[0079] The multiple nodes in the above topological graph correspond one-to-one to the multiple signal features. Specifically, the node corresponds to the ECG signal of the central lead in the time period, the node feature of the node is the signal feature corresponding to the ECG signal, and the edge between two nodes is the correlation between the corresponding two signal features (the correlation between the signal features can be obtained by calculating the dot product between the signal features).
[0080] In some embodiments of the present application, the temporal feature extraction encoder is as follows: Figure 3 As shown, it includes a convolution model, a first feature extraction model, a second feature extraction model and an average pooling model connected in sequence;
[0081] The input end of the convolution model is the input end of the temporal feature extraction encoder, and the output end of the average pooling model is the output end of the temporal feature extraction encoder.
[0082] The first feature extraction model and the second feature extraction model are both feature extraction models;
[0083] The feature extraction model includes a multi-scale convolution module, a multi-dimensional permutation attention module, a multiplication module, and an addition module;
[0084] The input end of the multi-scale convolution module and the input end of the addition module are both input ends of the feature extraction model, and the output end of the addition module is the output end of the feature extraction model;
[0085] The output end of the multi-scale convolution module is connected to the input end of the multidimensional permutation attention module and the input end of the multiplication module respectively, the output end of the multidimensional permutation attention module is connected to the input end of the multiplication module, and the output end of the multiplication module is connected to the input end of the addition module.
[0086] Multi-dimensional permutation attention module such as Figure 4 As shown, it includes a segmentation unit, a permutation unit, an activation function unit, and a random shuffle unit;
[0087] The input end of the segmentation unit is the input end of the multi-dimensional permutation attention module, and the output end of the random shuffle unit is the output end of the multi-dimensional permutation attention module;
[0088] The output end of the segmentation unit is connected to the input end of the permutation unit and the input end of the activation function unit respectively, the output end of the permutation unit is connected to the input end of the activation function unit, and the output end of the activation function unit is connected to the input end of the random shuffle unit;
[0089] The replacement unit includes: an average pooling subunit, a maximum pooling subunit, a first convolution subunit, a second convolution subunit, an addition subunit, an activation function subunit, a normalization subunit, a multiplication subunit, and a convolution pooling subunit;
[0090] The input end of the average pooling subunit, the input end of the maximum pooling subunit, the input end of the convolution pooling subunit, and the input end of the activation function subunit are all input ends of the permutation unit, and the output end of the multiplication subunit is the output end of the permutation unit;
[0091] The output end of the average pooling subunit is connected to the input end of the first convolution subunit, the output end of the maximum pooling subunit is connected to the input end of the second convolution subunit, the input end of the addition subunit is respectively connected to the output end of the first convolution subunit and the output end of the second convolution subunit, the output end of the addition subunit is connected to the input end of the activation function subunit, the output end of the activation function subunit is connected to the input end of the normalization subunit, and the input end of the multiplication subunit is respectively connected to the output end of the normalization subunit and the output end of the convolution pooling subunit;
[0092] The first convolution subunit and the second convolution subunit are both convolution subunits, the convolution subunit includes a first convolution layer, a first activation function layer, and a second convolution layer connected in sequence, the input end of the first convolution layer is the input end of the convolution subunit, and the output end of the second convolution layer is the output end of the convolution subunit;
[0093] The convolutional pooling subunit includes a third convolutional layer, an average pooling layer, and a second activation function layer connected in sequence. The input end of the third convolutional layer is the input end of the convolutional pooling subunit, and the output end of the second activation function layer is the output end of the convolutional pooling subunit.
[0094] It should be noted that the multi-scale convolution module is used to perform multi-scale convolution operations on the input data, the multidimensional permutation attention module is used to capture the channel characteristics of the input data, the multiplication module is used to perform multiplication operations on the input data, the addition module is used to perform addition operations on the input data, the segmentation unit is used to segment the input data into multiple data and output them to the permutation unit, the permutation unit is used to extract temporal features of the input data, the activation function unit is used to perform activation function operations on the input data, the operation in the random shuffle unit is the shuffle function, which is used to shuffle the order of the input data, the average pooling subunit is used to perform average pooling operations on the input data, the maximum pooling subunit is used to perform maximum pooling operations on the input data, the first convolution subunit and the second convolution subunit are both used to perform convolution operations on the input data, the addition subunit is used to perform addition calculations on the input data, the activation function subunit is used to perform activation function operations on the input data, the normalization subunit is used to normalize the input data, the multiplication subunit is used to multiply the input data, and the convolution pooling subunit is used to perform convolution operations and pooling operations on the input data.
[0095] The average pooling subunit, the maximum pooling subunit, the first convolution subunit and the second convolution subunit form a one-dimensional branch. On the one-dimensional branch, the spatial information of the input data is first aggregated through average pooling and maximum pooling operations to generate two different spatial context features. and , representing the average pooling feature and the maximum pooling feature, respectively. Then, these two features are sent to the shared network (the first convolutional layer, the first activation function layer, and the second convolutional layer connected in sequence) to generate the channel attention map. The shared network consists of a multi-layer perceptron (MLP) with a one-dimensional convolutional block as the main body. The two channel attention maps obtained by MLP are added together, and then multiplied with the initial features through a group normalization layer to obtain the feature output on the one-dimensional branch. The attention calculation on the one-dimensional branch is:
[0096]
[0097] The convolutional pooling subunits form a two-dimensional branch. On the two-dimensional branch, the one-dimensional data is first reshaped into two dimensions, and a 3x3 convolution kernel is stacked to capture multi-scale feature representations. Then, the two-dimensional output is encoded with global spatial information using two-dimensional global average pooling. The natural nonlinear function Softmax of the two-dimensional Gaussian mapping is used at the output of the two-dimensional global average pooling to fit the above linear transformation to obtain the feature output on the two-dimensional branch. The attention calculation on the two-dimensional branch is:
[0098]
[0099] The above steps of using the time feature extraction encoder to obtain the signal features of the ECG signal of each ECG lead data in each time period and constructing a topology map based on all signal features are specifically as follows:
[0100] In the first step, a time feature extraction encoder is used to obtain the time coding information of the ECG signal of each ECG lead data in each time period.
[0101] Specifically, multiple ECG signals of all ECG lead data in each time period are input into the above-mentioned time feature extraction encoder, and the time feature extraction encoder outputs the time coding information of the ECG signal of each ECG lead data in each time period.
[0102] The time coding information is used to describe the time-related information of the ECG signal of the ECG lead data in a time period, such as the position of the time corresponding to the ECG signal in the time of all ECG signals in the time period.
[0103] The second step is to obtain the position code of each time period, and add each time code information to the position code of the corresponding time period to obtain the signal characteristics of each ECG lead data in each time period.
[0104] Specifically, through the formula:
[0105] ;
[0106] Calculate the In the time period The position vector of the ECG signal ;
[0107] in, represents the frequency parameter used in position encoding, Represents the index parameter used to distinguish different position codes. , Indicates the number of time periods, , Indicates the number of ECG signals in a time period.
[0108] The first The position vectors corresponding to the time periods are integrated into a set to obtain the Position encoding of time segment .
[0109] Then add each time code information to the position code of the corresponding time period to obtain the signal characteristics of each ECG lead data in each time period. Specifically, the formula is:
[0110] ;
[0111] Calculate the ECG lead data is in Signal characteristics of each time period .
[0112] in, Indicates ECG lead data is in Time coding information for a time period, , Indicates the number of ECG lead data.
[0113] The third step is to construct a topological map based on all signal features.
[0114] Specifically, taking multiple signal features as multiple nodes, the correlation between the signal features can be obtained by calculating the dot product between the signal features, and the correlation is used as the weight of the edge between the corresponding two nodes to obtain a weighted fully connected topological graph.
[0115] It is worth mentioning that the topological map not only contains the spatiotemporal correlation in each time period, but also includes the correlation between different ECG lead data in different time periods, which enables the comprehensive spatiotemporal dependency to be modeled in multi-ECG lead data.
[0116] Step 23, construct a time decay matrix and a spatial knowledge guidance matrix, multiply the time decay matrix, the spatial knowledge guidance matrix and the adjacency matrix of the topological graph, and obtain the relevant adjacency matrix of the topological graph.
[0117] The above time decay matrix is used to describe the correlation between multiple time periods, and the spatial knowledge guidance matrix is used to describe the spatial relationship between multiple locations. The adjacency matrix of the topological graph is a matrix composed of the weights of all edges in the topological graph.
[0118] In some embodiments of the present application, the elements in the above time decay matrix are the correlations between multiple time periods, and the values are , is a constant, Indicates The time period and The absolute value of the difference between the numbers of the time periods, such as the correlation between the first time period and the third time period is The elements in the spatial knowledge guidance matrix are the spatial relationships between multiple positions, such as full connection between chest leads and full connection between limb leads.
[0119] Step 24, using the relevant adjacency matrix of the topological graph to update the edges of the topological graph to obtain the final topological graph, and using the graph neural network to extract features of the final topological graph to obtain the overall feature representation of the final topological graph.
[0120] In some embodiments of the present application, the elements in the relevant adjacency matrix are assigned to the weights of the corresponding edges in the topological graph to obtain the final topological graph. The above-mentioned steps of extracting features from the final topological graph using the graph neural network to obtain the overall feature representation of the final topological graph are specifically as follows:
[0121] In the first step, the signal characteristics of each node in the final topology graph are updated in multiple layers to obtain the updated signal characteristics of each node in each layer.
[0122] Specifically, through the formula:
[0123] ;
[0124] For Node Update the signal characteristics;
[0125] in, Indicates Layer Node The signal characteristics of , represents the last layer to be updated, Indicates Layer Node The signal characteristics of Indicates Layer Node The signal characteristics of Represents the nodes in the final topology graph The set of adjacent nodes of Indicates The parameters of the layer, Indicates Layer of multilayer perceptron, when hour, Representation Node signal characteristics.
[0126] In the second step, all signal features of all nodes are concatenated to obtain the overall feature representation of the final topology graph.
[0127] Specifically, through the formula:
[0128] ;
[0129] Calculate the overall feature representation of the final topology graph ;
[0130] in, Represents a splicing operation, Represents the set of all nodes in the final topology graph.
[0131] It can be understood that the above expressions for updating the signal features and the expressions for calculating the overall feature representation of the final topological graph are expressions of the graph neural network.
[0132] It should be noted that in the graph neural network, after the signal features of each layer are updated, they will be pooled. Some common pooling methods, such as maximum pooling, average pooling and sum pooling, aggregate a vector or even a feature matrix into several features, which is flat and may lose a lot of information. In some embodiments of the present application, the pooling process is: aggregate the internal information of the lead, and perform graph structure learning in layers, so that the number of simplified nodes can be controlled while retaining the structural characteristics of the graph. While the graph structure features are extracted, the node features are subjected to corresponding feature dimensionality reduction, and global pooling is used to obtain the attention score of the node, obtain the node features with high scores, and assign them to the corresponding nodes. It is applied hierarchically after each graph neural network layer to achieve multiple updates to the final topological map obtained each time and the overall feature representation, and obtain the final overall feature representation for the next step.
[0133] It is worth mentioning that by summing up all signal features of each layer (from layer 0 to layer K), and then connecting them, the overall feature representation of the graph is formed. This method can comprehensively consider the information of each level, making the overall feature representation richer and more comprehensive.
[0134] Step 25, performing arrhythmia detection based on the overall feature representation to obtain an arrhythmia detection result.
[0135] The above arrhythmia detection results include the values of the evaluation index of arrhythmia (such as the correlation values with various cardiovascular diseases, etc.), so that medical personnel can evaluate the probability of the person to whom the ECG lead data belongs suffering from cardiovascular disease based on the evaluation index. For example, if the correlation value with myocardial infarction among cardiovascular diseases is 0.3 and the correlation value with coronary heart disease is 0.6, it can be evaluated that the probability of the person suffering from coronary heart disease is greater than that of myocardial infarction.
[0136] In some embodiments of the present application, the overall features are input into a classification model for arrhythmia detection to obtain an arrhythmia detection result. The above-mentioned classification model includes a first classification module, a second classification module, and a third classification module connected in sequence. The input end of the first classification module is the input end of the classification model, and the output end of the third classification module is the output end of the classification model. The first classification module, the second classification module, and the third classification module are all a classification module. The classification module includes a batch normalization layer and a neural network layer connected in sequence. The input end of the batch normalization layer is the input end of the classification module, and the output end of the neural network layer is the output end of the classification module. The neural network layer can be a commonly used neural network layer, such as a neural network layer based on Kolmogorov-Arnold Networks (KAN). The expression of the neural network layer is:
[0137] ;
[0138] in, is a parameterized function of the learnable parameters. In the Kolmogorov-Arnold theorem, the inner function forms a The KAN layer, the external function forms a Therefore, the above formula represents a simple combination of two KAN layers.
[0139] It should be noted that before performing this step, the classification model needs to be trained first, multiple ECG lead data of multiple sample human bodies are obtained, and the diagnosis code labeled for each ECG lead data (used to describe the cardiovascular disease corresponding to the ECG lead data, such as myocardial infarction, normal, etc.) is obtained. These ECG lead data and diagnosis codes are used as training data to train the classification model (training methods such as loss function method can be used for training) so that the performance of the classification model meets expectations.
[0140] It is worth mentioning that the structure of the topological map is enhanced and updated by using the time attenuation matrix and the spatial knowledge guidance matrix, which describes the relationship between ECG signals in the two dimensions of time and space, improves the information richness and accuracy of the topological map, and then improves the accuracy of the overall feature representation of the topological map. Arrhythmia detection is performed based on the precise overall feature representation, which effectively improves the accuracy of arrhythmia detection.
[0141] The system of the present application is exemplarily described below with reference to a specific example.
[0142] A variety of models were selected for performance comparison with the system of this application.
[0143] The Residual Network (Resnet101) with 101 layers is a deep convolutional neural network designed with residual blocks, which performs well in many computer vision tasks, such as image classification and object detection.
[0144] The network for electrocardiogram (ECGNet) uses a hybrid network that combines convolutional neural network (CNN) and long short-term memory network (LSTM) to directly extract features and classify two-second ECG signals without any preprocessing. The CNN network uses convolution kernels and residual blocks of different sizes to extract features, while the LSTM network captures the long-term dependencies of ECG signals.
[0145] The Interpretable Multi-level Multi-channel Model for ECG Classification (IMLE-Net) utilizes multi-lead information from standard 12-lead ECG records and learns patterns at the heartbeat, rhythm, and channel levels. The heartbeat-level block includes a CNN and an attention layer, and contains 6 residual blocks, using skip connections to optimize model training. The attention mechanism helps identify more important areas within a heartbeat segment. The rhythm-level block consists of an ECG rhythm signal consisting of multiple heartbeat segments, including a bidirectional long short-term memory network (LSTM) and a rhythm-level attention layer. The channel-level block uses a channel-level attention mechanism to determine which channels contain more important information for specific heart disease symptom features.
[0146] A multi-scale deep residual network with squeeze-and-excitation module for ECG signal classification (SE-ECGNet) proposes to process multi-lead signals as two-dimensional matrices and combine multi-scale two-dimensional convolution blocks with one-dimensional convolution blocks for feature extraction. Multi-scale and different-sized kernel convolution blocks are used for effective feature extraction, while the squeeze excitation module (SE, Squeeze-and-Excitation) is used to focus on more important features to complete the arrhythmia classification task on multi-lead ECG data.
[0147] Attention-based Time-Incremental Convolutional Neural Network (ATI-CNN) is a time-incremental convolutional neural network based on the attention mechanism, which is used to detect multiple types of arrhythmias from 12-lead variable-length ECG signals. This method combines convolutional neural networks (CNNs), recurrent units (such as LSTMs), and attention modules to achieve the fusion of spatial and temporal information of ECG signals. The convolutional layer is similar to the structure of the Visual Geometry Group (VGG) network.
[0148] Multi-View Multi-Scale Network (MVMSNet) proposes a multi-view, multi-scale deep neural network that uses different leads as different viewpoints for ECG classification tasks. MVMSNet uses a multi-view method to effectively fuse the features of different leads, and uses a multi-scale convolutional neural network structure to obtain the temporal features of ECG signals at different scales. In addition, coordinate attention is used to capture the spatial information and channel relationship of ECG features to enhance the feature representation of the network.
[0149] A temporal dynamic graph neural network TodyNet is used to classify multivariate time series, which can extract the hidden spatiotemporal dependencies of multivariate time series without undefined graph structure. The associations between different time slots are captured through the dynamic graph mechanism, and a global graph-level representation is obtained for graph learning with learnable temporal parameters using a temporal graph pooling layer.
[0150] The Multi-Scale Adaptive Graph Neural Network (MAGNN) is used to predict multivariate time series. It can learn a time representation that fully reflects multi-scale time series patterns and dependencies between variables at a specific scale. Through a multi-layer pyramid structure, the original time series is converted from a smaller scale to a larger scale feature representation. The adaptive graph learning module is used to build the relationship between time series, and a multi-scale time series graph neural network is introduced to jointly model the internal and external variable dependencies at each time scale.
[0151] The above-mentioned model and the system of the present application are respectively subjected to comparative experiments on a large publicly available first electrocardiogram dataset, a second electrocardiogram dataset, and a third electrocardiogram dataset. The performance comparison of the experimental results of the first electrocardiogram dataset is shown in Table 1.
[0152] Table 1
[0153]
[0154] Among them, ACC represents accuracy, AUC represents the area under the ROC curve (Receiver Operating Characteristic Curve), and F1 represents the harmonic mean of precision and recall.
[0155] The performance comparison of the experimental results on the second ECG dataset is shown in Table 2.
[0156] Table 2
[0157]
[0158] The performance comparison of the experimental results on the third ECG dataset is shown in Table 3.
[0159] Table 3
[0160]
[0161] It can be seen from Table 1 that the classification performance of the system of the present application on the first electrocardiogram dataset is the highest, with an accuracy of 89.68, an AUC of 93.94%, and an F1 score of 81.98%. On the second electrocardiogram dataset, the accuracy was 96.22%, the AUC was 96.55%, and the F1 score was 83.89%; on the third electrocardiogram dataset, it reached an accuracy of 99.07%, an AUC of 92.64%, and an F1 score of 94.65%. This fully demonstrates the advancement of the system of the present application in the task of arrhythmia classification. As can be seen from Table 1, for the macro-average AUC, the system of the present application has improved by 0.66% for the best model, and the F1-score has improved by 0.35%, which shows that the system of the present application has higher accuracy and efficiency when classifying arrhythmias. Table 1 shows that MAGNN performs the worst on the first ECG dataset. This may be because MAGNN is good at capturing long-term dependencies, and the ECG data in the dataset has only 1,000 sampling points, which makes MAGNN unable to fully capture time-dependent features. As shown in Table 2, on the second ECG dataset, compared with the optimal model ECGNet, the system of this application has a 0.5% improvement in AUC, and the accuracy and F1 score are also higher than the best model. As shown in Table 3, although the system of this application is slightly inferior to the ECGNet model in accuracy, it has achieved the best in AUC and F1 scores, which is 1 percentage point higher than the best method.
[0162] It can be seen that the system of the present application has high accuracy in arrhythmia detection and has great application potential in the clinical deployment of computers for arrhythmia diagnosis.
[0163] In addition, the system of the present application first divides the ECG signal into time periods and extracts features based on the time periods. A time feature extraction encoder is proposed to fully capture the multi-scale time information within the time block and complete the feature embedding of the node. The feature matrix completed by embedding is combined with the knowledge-guided attenuation matrix to complete the generation of the relevant adjacency matrix, which not only combines the similarities between different time blocks, but also retains the time difference between time blocks and the inherent spatial relationship between leads. In terms of spatial feature extraction, the present application uses a graph convolutional network for convolution to extract spatial features, and then uses a specific pooling scheme to further extract high-dimensional features in the spatial dimension while reducing the number of nodes. This scheme is conducive to modeling comprehensive spatiotemporal dependencies in multi-lead ECG data. Finally, in order to achieve the final classification detection output, a KAN-based model is used to replace the classification block in the traditional neural network to complete the classification output of the disease. Experimental results show that the system of the present application is advanced and superior in the detection of multi-label arrhythmias on multiple data sets.
[0164] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0165] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0166] The above is a preferred embodiment of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles described in the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A cardiac arrhythmia detection system based on graph neural network, characterized in that: include: An acquisition module, used for acquiring a plurality of ECG lead data; the ECG lead data includes ECG signals of a plurality of time periods, and the plurality of ECG lead data corresponds to a plurality of lead positions of the detection object; An embedding module is used to obtain the signal features of the ECG signal of each ECG lead data in each time period by using a time feature extraction encoder, and embed all the signal features to obtain a topological graph; the multiple nodes of the topological graph correspond to the multiple signal features one by one, and the edge between two nodes is the correlation between the corresponding two signal features; A construction module is used to construct a time decay matrix and a spatial knowledge guidance matrix, and multiply the time decay matrix, the spatial knowledge guidance matrix and the adjacency matrix of the topological graph to obtain a related adjacency matrix of the topological graph; The time decay matrix is used to describe the correlation between the multiple time periods, and the spatial knowledge guidance matrix is used to describe the spatial relationship between the multiple lead positions; An updating module, used to update the edges of the topological graph using the relevant adjacency matrix of the topological graph to obtain a final topological graph, and to extract features from the final topological graph using a graph neural network to obtain an overall feature representation of the final topological graph; The arrhythmia detection module is used to perform arrhythmia detection based on the overall feature representation to obtain an arrhythmia detection result.
2. The arrhythmia detection system according to claim 1, characterized in that: The method of using a time feature extraction encoder to obtain the signal features of the ECG signal of each ECG lead data in each time period includes: The time feature extraction encoder is used to obtain the time coding information of the ECG signal of each ECG lead data in each time period; The position code of each time period is obtained, and each time code information is added to the position code of the corresponding time period to obtain the signal characteristics of each ECG lead data in each time period.
3. The arrhythmia detection system according to claim 2, characterized in that: The obtaining of the position code of each time period includes: By formula: ; Calculate the In the time period The position vector of the ECG signal ; in, represents the frequency parameter, Represents the index parameter, , Indicates the number of time periods, , Indicates the number of ECG signals in a time period; The first The position vectors corresponding to the time periods are integrated into a set to obtain the Position encoding of time segments .
4. The arrhythmia detection system according to claim 3, characterized in that: The step of adding each time code information to the position code of the corresponding time period to obtain the signal characteristics of each ECG lead data in each time period includes: By formula: ; Calculate the ECG lead data is in Signal characteristics of each time period ; in, Indicates the ECG lead data is in Time coding information for a time period, , Indicates the number of ECG lead data.
5. The arrhythmia detection system according to claim 1, characterized in that: The extracting features of the final topological graph by using a graph neural network to obtain an overall feature representation of the final topological graph includes: Perform multi-layer update on the signal characteristics of each node in the final topology graph to obtain the updated signal characteristics of each node at each layer; All signal features of all nodes are concatenated to obtain an overall feature representation of the final topology graph.
6. The arrhythmia detection system according to claim 5, characterized in that: The extracting features of the final topological graph by using a graph neural network to obtain an overall feature representation of the final topological graph includes: By formula: ; For Node Update the signal characteristics; in, Indicates Layer Node The signal characteristics of , represents the last layer to be updated, Indicates Layer Node The signal characteristics of Indicates Layer Node The signal characteristics of Represents the nodes in the final topology graph The set of adjacent nodes of Indicates The parameters of the layer, Indicates Layers of multilayer perceptron, when hour, Representation Node signal characteristics.
7. The arrhythmia detection system according to claim 6, characterized in that: The final signal features of all nodes are concatenated to obtain the overall feature representation of the final topology graph, including: By formula: ; Calculate the overall feature representation of the final topological graph ; in, Represents a splicing operation, Represents the set of all nodes in the final topology graph.
8. The arrhythmia detection system according to claim 1, characterized in that: The temporal feature extraction encoder includes a convolution model, a first feature extraction model, a second feature extraction model and an average pooling model connected in sequence; The input end of the convolution model is the input end of the temporal feature extraction encoder, and the output end of the average pooling model is the output end of the temporal feature extraction encoder.
9. The arrhythmia detection system according to claim 8, characterized in that: The first feature extraction model and the second feature extraction model are both feature extraction models; The feature extraction model includes a multi-scale convolution module, a multi-dimensional permutation attention module, a multiplication module, and an addition module; The input end of the multi-scale convolution module and the input end of the addition module are both input ends of the feature extraction model, and the output end of the addition module is the output end of the feature extraction model; The output end of the multi-scale convolution module is respectively connected to the input end of the multidimensional permutation attention module and the input end of the multiplication module, the output end of the multidimensional permutation attention module is connected to the input end of the multiplication module, and the output end of the multiplication module is connected to the input end of the addition module.
10. The arrhythmia detection system according to claim 9, characterized in that: The multi-dimensional permutation attention module includes a segmentation unit, a permutation unit, an activation function unit, and a random shuffle unit; The input end of the segmentation unit is the input end of the multi-dimensional permutation attention module, and the output end of the random shuffling unit is the output end of the multi-dimensional permutation attention module; The output end of the segmentation unit is connected to the input end of the permutation unit and the input end of the activation function unit respectively, the output end of the permutation unit is connected to the input end of the activation function unit, and the output end of the activation function unit is connected to the input end of the random scrambling unit; The replacement unit includes: an average pooling subunit, a maximum pooling subunit, a first convolution subunit, a second convolution subunit, an addition subunit, an activation function subunit, a normalization subunit, a multiplication subunit, and a convolution pooling subunit; The input end of the average pooling subunit, the input end of the maximum pooling subunit, the input end of the convolution pooling subunit, and the input end of the activation function subunit are all input ends of the permutation unit, and the output end of the multiplication subunit is the output end of the permutation unit; The output end of the average pooling subunit is connected to the input end of the first convolution subunit, the output end of the maximum pooling subunit is connected to the input end of the second convolution subunit, the input end of the addition subunit is respectively connected to the output end of the first convolution subunit and the output end of the second convolution subunit, the output end of the addition subunit is connected to the input end of the activation function subunit, the output end of the activation function subunit is connected to the input end of the normalization subunit, and the input end of the multiplication subunit is respectively connected to the output end of the normalization subunit and the output end of the convolution and pooling subunit; The first convolution subunit and the second convolution subunit are both convolution subunits, and the convolution subunit includes a first convolution layer, a first activation function layer, and a second convolution layer connected in sequence, the input end of the first convolution layer is the input end of the convolution subunit, and the output end of the second convolution layer is the output end of the convolution subunit; The convolutional pooling subunit includes a third convolutional layer, an average pooling layer, and a second activation function layer connected in sequence, the input end of the third convolutional layer is the input end of the convolutional pooling subunit, and the output end of the second activation function layer is the output end of the convolutional pooling subunit.
Citation Information
Patent Citations
II lead electrocardiosignal classification method
CN113180684A
Arrhythmia detection method based on graph neural network
CN114652319A