Arrhythmia classification method based on statistical manifold

By using statistical manifold and graph convolution network methods in the classification of ECG signals, combined with dynamic time regularization and Gaussian kernel matrix, the problem of insufficient extraction of dynamic timing and geometric structure characteristics of ECG signals in the prior art is solved, and the classification accuracy of arrhythmia is significantly improved.

CN119961737AActive Publication Date: 2025-05-09JILIN UNIVERSITY

Patent Information

Application Number
CN202510439127.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-09
Publication Date
2025-05-09
Estimated Expiration
2045-04-09

AI Technical Summary

Technical Problem

The existing ECG signal classification methods have shortcomings in capturing the dynamic timing and geometric characteristics of ECG signals, resulting in low classification accuracy.

Method used

The electrocardiogram signal classification method based on statistical manifold and graph convolution network is adopted to construct a covariance manifold structure through dynamic time regular distance and Gaussian kernel matrix, and classify it in combination with graph convolution network, which significantly improves the classification accuracy.

Benefits of technology

It significantly improves the classification accuracy of complex arrhythmias and can more comprehensively capture the dynamic timing and geometric characteristics of ECG signals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119961737A_ABST
    Figure CN119961737A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of medical data processing and machine learning, and relates to a statistical manifold-based arrhythmia classification method, which comprises the following steps of: heart beat segmentation and subsequence division: carrying out R wave crest detection, preprocessing, heart beat extraction and subsequence division; constructing a Gaussian kernel matrix: calculating a DTW distance, providing distance measurement for the Gaussian kernel matrix, and constructing the Gaussian kernel matrix based on the DTW distance so as to capture a geometric structure relationship among the subsequences; constructing a statistical manifold: forming the statistical manifold by all N * N symmetric positive definite matrixes, generating a Gaussian kernel matrix set, performing manifold local geometric modeling and generating a graph structure; and constructing a graph convolutional network on the manifold: carrying out tangent space projection, and carrying out graph convolutional network architecture design. According to the method, the DTW distance is combined with the statistical manifold space modeling technology, the dynamic statistical characteristics of the electrocardiosignals are effectively extracted, modeling is conducted on the manifold geometrical relation of the heart beat mode through the graph convolution network, and the classification accuracy of complex arrhythmia is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of medical data processing and machine learning, and specifically relates to an electrocardiogram signal classification method based on statistical manifolds and graph convolutional networks, which is suitable for automated detection of arrhythmias. Background Art

[0002] Electrocardiogram (ECG) is a core tool for clinical diagnosis of arrhythmia, which reflects abnormal heart rhythm by recording cardiac electrical activity. However, traditional ECG analysis relies on manual interpretation, which has the problems of low efficiency and strong subjectivity.

[0003] In recent years, machine learning and deep learning methods such as convolutional neural networks (CNN) and long short-term memory networks (LSTM) have been widely used in ECG automatic classification, significantly improving detection efficiency and accuracy. However, there are still two limitations: 1. Insufficient extraction of dynamic features of time series: ECG signals are essentially multi-scale time series. Although existing models (such as CNN and LSTM) can capture local features, their modeling capabilities for global temporal dependencies and statistical relationships between subsequences are limited, making it difficult to fully characterize the dynamic evolution pattern of signals; 2. Lack of geometric structure modeling: Traditional ECG classification methods often focus on the extraction of features such as waveform amplitude and duration, but usually ignore the complex correlation of ECG signals in time and space dimensions, such as the precise alignment between P-QRS-T waves, the consistent changes in RR intervals, and the continuity of waveform morphology. These geometric and dynamic features are crucial for understanding the electrophysiological state of the heart.

[0004] Based on this, it is urgent to develop a new arrhythmia classification method that can combine dynamic time warping with manifold space modeling and optimize feature representation, so as to more comprehensively capture the dynamic timing and geometric structure characteristics of ECG signals and improve classification accuracy to effectively solve the above problems. Summary of the invention

[0005] The purpose of the present invention is to provide an ECG signal classification method based on statistical manifolds and graph convolutional networks (GCN), which integrates the classification framework of dynamic time warping (DTW) distance, statistical manifolds and graph convolutional networks. By modeling the covariance manifold structure of ECG subsequences, the dynamic timing and geometric structure characteristics of ECG signals can be effectively captured, the classification accuracy can be improved, and efficient geometric space classification can be achieved.

[0006] The objective of the present invention is achieved through the following technical solutions: A method for classifying arrhythmias based on statistical manifolds comprises the following steps: A. Heartbeat segmentation and subsequence division: First, input the ECG signal, detect the R wave peak and segment the ECG data into single heart beats; then evenly divide the single heart beat sequence into N subsequences, N>1, and each subsequence covers a specific ECG waveform segment; B. Subsequence feature modeling and Gaussian kernel matrix construction: The dynamic time warping distance, i.e., DTW distance, between two subsequences is calculated to characterize their nonlinear time series alignment relationship; then the Gaussian kernel matrix of the subsequences is constructed based on the DTW distance; C. Construct a statistical manifold. All sample kernel matrices constitute a statistical manifold: Each Gaussian kernel matrix is ​​a symmetric positive definite SPD matrix, and each Gaussian kernel matrix corresponds to a point on the Riemann manifold, i.e., the statistical manifold; D. Constructing graph convolutional networks on manifolds: First, the graph structure is constructed: the covariance matrix is ​​used as the graph node, the geodesic distance is used as the edge weight, and the threshold is retained; then the tangent space is mapped to obtain the tangent vector, and the node feature mapping is completed: each SPD matrix is ​​projected to the tangent space through logarithmic mapping, and the tangent vector is obtained as the node feature; finally, the graph convolutional network classification model is obtained, and graph convolution classification is performed: a multi-layer graph convolutional network is used to aggregate neighborhood information and output the heartbeat category probability.

[0007] Furthermore, step A specifically includes the following steps: A1. Heart beat segmentation: A11, R wave peak detection, using Pan-Tompkins algorithm to detect the R wave peak position from the original ECG signal; A12, heartbeat extraction, taking the R peak detected in step A11 as the center, taking fixed time windows before and after, and intercepting the complete heartbeat; then, aligning the intercepted heartbeat with the time axis to ensure that the R peak is located in the center of the window, and standardizing the voltage value to zero mean and unit variance to eliminate the amplitude difference between individuals; A2: Subsequence division: a single heart beat is evenly divided into 11 subsequences, covering the key ECG waveform segments; the division rule is to divide equally along the time axis.

[0008] Furthermore, step A11 specifically includes the following steps: A111 preprocessing: bandpass filtering is performed on the ECG signal with a passband of 5-15 Hz to suppress baseline drift and high-frequency noise, and the QRS complex characteristics are enhanced using a differential filter and square operation; A112, Threshold detection: Set a dynamic threshold. When the amplitude of the filtered signal exceeds the threshold, it is marked as a candidate R peak. Combined with the RR interval rule, pseudo peaks are eliminated.

[0009] Furthermore, in step A12, the front segment is taken as 150ms before the R peak, corresponding to the start of the P wave to the R peak, and the rear segment is taken as 350ms after the R peak, corresponding to the R peak to the end of the T wave, and the total heart beat length is 500ms.

[0010] Furthermore, in step A2, the length of each subsequence is about 45 ms, and the specific segments correspond to ECG physiological characteristics: subsequences 1-4, covering the PR interval, corresponding to the atrial depolarization stage; subsequences 5-7, covering the QRS complex, corresponding to the ventricular depolarization stage; subsequences 8-11: covering the ST segment and T wave, corresponding to the ventricular repolarization stage.

[0011] Furthermore, step B specifically includes the following steps: B1. Calculate DTW distance: B11. Construct a cumulative distance matrix and limit the path slope to 1, that is, adjacent steps are only allowed to move horizontally, vertically or diagonally to avoid excessive distortion of the temporal relationship; B12. Set the global path window to limit the maximum offset of the path on the time axis; B13. Perform DTW distance normalization, that is, normalize the cumulative distance of the optimal path to eliminate the influence of the subsequence length difference. DTW distance normalization is performed according to the following formula: ; In the formula, For the A heart electron sequence, For the A heart electron sequence, is the cumulative distance matrix, P and Q Respectively The heart electron sequence and the The length of the electron sequence; B2. Construct Gaussian kernel matrix based on DTW distance: B21. Kernel function design. Define the Gaussian kernel function based on the DTW distance, map the distance to a similarity measure, and thus construct the Gaussian kernel matrix: ; In the formula, is the DTW distance, For the A heart electron sequence, For the A heart electron sequence, is the kernel function bandwidth; B22, Gaussian kernel matrix is a symmetric matrix. In addition, a small unit matrix perturbation is added to ensure its positive definiteness: ,in, .

[0012] Furthermore, in step B21, the optimal The objective function is to minimize the classification error of the validation set, and the initial value of is 1 / 4 of the median of all DTW distances.

[0013] Furthermore, step C specifically includes the following steps: C1. All Symmetric positive definite matrices form a statistical manifold, namely a Riemann manifold, denoted by , the geodesic distance on the manifold is defined by the following formula: ; In the formula, is the trace of the matrix; C2, Gaussian kernel matrix set generation, input is heartbeat samples, each corresponding to a Gaussian kernel matrix; output is a set of points on the statistical manifold ; C3. Manifold local geometry modeling. First, calculate the geodesic distance between all kernel matrices. Define neighborhood relationships, then build a distance matrix ,in ; C4. Generate graph structure: Each kernel matrix Corresponding to a node in the graph, for each node , retain the front with the smallest distance to its geodesic The edge weight is defined as the inverse of the geodesic distance, that is, , is the scale parameter; the total mutual information between nodes is used as a measure of the edge threshold size, that is, the definition: ,here is the number of nodes, Is a node The structural mutual information between When there is no edge relationship between them, define ;here is a monotonic function of the threshold, when When the curve has an obvious turning point, the corresponding number of edges is the number of edges that need to be retained.

[0014] Further, step D specifically includes the following steps: D1, cut space projection, SPD matrix Projecting to the tangent space through logarithmic mapping, we get the vector representation in Euclidean space: ; The logarithmic mapping is defined as: ; In the formula, for The eigenvector matrix of is the eigenvalue; using symmetry, only the upper triangular elements are retained and expanded into vectors, and the dimension is compressed to ; D2. Graph convolutional network architecture design, including network layer design and parameter setting; D3. Model training and optimization. The loss function uses the following weighted cross entropy loss to alleviate the problem of category imbalance: ; In the formula, is the number of samples, is the number of categories, is the category label, as weights to increase the severity of penalties for minority categories.

[0015] Furthermore, in step D3, the optimization strategy adopted is: Optimizer: Adam, initial learning rate , decaying to 0.5 times every 20 rounds; batch training: full-graph training is adopted, and sub-graph sampling is switched when memory is insufficient; early stopping mechanism: training is terminated when the validation set loss does not decrease for 5 consecutive rounds.

[0016] Compared with the prior art, the present invention has the following beneficial effects: The arrhythmia classification method based on statistical manifolds in the present invention adopts DWT distance combined with statistical manifold space modeling technology to effectively extract the dynamic statistical characteristics of ECG signals. On this basis, the manifold geometric relationship of the heartbeat pattern is modeled through a graph convolutional network, which significantly improves the classification accuracy of complex arrhythmias. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0018] Figure 1 Flow chart of the principle of arrhythmia classification; Figure 2Schematic diagram of heart beat segmentation; Figure 3 Schematic diagram of graph structure generation; Figure 4 Tangent space projection principle diagram; Figure 5 Graph convolutional network structure diagram. DETAILED DESCRIPTION

[0019] The present invention will be further described below in conjunction with embodiments: The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0020] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0021] like Figure 1 As shown, the arrhythmia classification method based on statistical manifold of the present invention can realize efficient and accurate classification of MIT-BIH arrhythmia data set, including the following steps: A. Heart beat segmentation and subsequence division.

[0022] First, the ECG signal is input, the R wave peak is detected and the ECG data is segmented into single heart beats; then, the single heart beat sequence is evenly divided into N subsequences (N>1), each subsequence covering a specific ECG waveform segment, such as the PR interval, QRS complex, and ST segment.

[0023] B. Gaussian kernel matrix construction.

[0024] The dynamic time warping distance, i.e., DTW distance, between each pair of subsequences is calculated to characterize their nonlinear time alignment relationship. Then, the Gaussian kernel matrix of the subsequences is constructed based on the DTW distance. Specifically, the Gaussian kernel matrix The construction formula is as follows: ; In the formula, is the DTW distance, For the A heart electron sequence, For the A heart electron sequence, is the kernel function bandwidth.

[0025] C. Construct a statistical manifold. All sample kernel matrices constitute a statistical manifold.

[0026] Each Gaussian kernel matrix is ​​a symmetric positive definite SPD (symmetric positive definite) matrix. Therefore, each Gaussian kernel matrix corresponds to a point on the Riemann manifold, i.e., the statistical manifold. In order to measure the distance between points on the manifold, the geodesic distance defined by the following formula is used: ; in, is the trace of the matrix.

[0027] D. Constructing graph convolutional networks on manifolds.

[0028] First, we construct a graph structure: we use the covariance matrix as the graph node and the geodesic distance as the edge weight, and perform threshold retention. Specifically, we retain the weight according to the amount of network information. k % of the edge. Then, the tangent space is mapped to obtain the tangent vector, and the node feature mapping is completed: each SPD matrix is ​​projected to the tangent space through logarithmic mapping, and the tangent vector is obtained as the node feature. Finally, the graph convolution network classification model is obtained, and the graph convolution classification is performed: a multi-layer graph convolution network is used to aggregate the neighborhood information and output the heartbeat classification result, that is, the heartbeat category probability.

[0029] Specifically, the arrhythmia classification method based on statistical manifold of the present invention comprises the following steps: A. Heartbeat segmentation and subsequence division: A1. Heart beat segmentation A11, R wave peak detection. The Pan-Tompkins algorithm is used to detect the R wave peak position from the original ECG signal. The specific steps are: A111 preprocessing: The ECG signal is band-pass filtered with a passband of 5-15 Hz to suppress baseline drift and high-frequency noise, and the QRS complex characteristics are enhanced using a differential filter and square operation.

[0030] A112, Threshold detection: Set a dynamic threshold. When the amplitude of the filtered signal exceeds the threshold, it is marked as a candidate R peak. Combined with the RR interval rule, pseudo peaks are eliminated.

[0031] A12. Heartbeat extraction. With the R peak detected in step A11 as the center, take fixed time windows before and after to intercept the complete heartbeat. Take 150ms before the R peak (corresponding to the start of the P wave to the R peak) in the front section, and 350ms after the R peak (corresponding to the R peak to the end of the T wave) in the back section. The total heartbeat length is 500ms. Then, align the intercepted heartbeats on the time axis to ensure that the R peak is located in the center of the window, and standardize the voltage value to zero mean and unit variance to eliminate the amplitude differences between individuals.

[0032] A2: Subsequence division. A single heartbeat is evenly divided into 11 subsequences, covering the key ECG waveform segments. For specific division, please refer to Figure 2 The division rule is to divide the time axis equally, and the length of each subsequence is about 45ms. The specific segments correspond to ECG physiological characteristics: subsequences 1-4, covering the PR interval (atrial depolarization stage); subsequences 5-7, covering the QRS complex (ventricular depolarization stage); subsequences 8-11: covering the ST segment and T wave (ventricular repolarization stage).

[0033] For specific arrhythmia types, subsequence division can be adjusted dynamically. In addition, based on waveform inflection point detection, multiple heart beats and their subsequence boundaries are superimposed to ensure that the division is consistent with the physiological waveform. For heart beats with R peak detection errors or noise interference, interpolation or elimination strategies are adopted.

[0034] B. Subsequence feature modeling and Gaussian kernel matrix construction: B1. Calculate the DTW distance to provide a distance metric for the Gaussian kernel matrix. DTW minimizes the cumulative distance path by flexibly aligning the time axes of the two subsequences, and is suitable for nonlinear time deformation of ECG signals. First, construct a cumulative distance matrix and limit the path slope to 1, that is, adjacent steps are only allowed to move horizontally, vertically or diagonally to avoid excessive distortion of the timing relationship. Then, set the global path window to limit the maximum offset of the path on the time axis. Finally, perform DTW distance normalization, that is, normalize the cumulative distance of the optimal path to eliminate the influence of subsequence length differences. DTW distance normalization is performed according to the following formula: ; In the formula, For the A heart electron sequence, For the A heart electron sequence, is the cumulative distance matrix, P and Q Respectively The heart electron sequence and the The length of the electron sequence.

[0035] B2. Construct a Gaussian kernel matrix based on DTW distance to capture the geometric structural relationship between subsequences. DTW overcomes the limitation of traditional Euclidean distance on rigid alignment of the time axis and accurately captures the dynamic deformation of ECG waveforms, such as changes in the width of the QRS complex. The symmetric positive definiteness of the Gaussian kernel matrix meets the requirements of Riemannian manifold geometry and provides a mathematical basis for subsequent graph convolution.

[0036] B21. Kernel function design. Define the Gaussian kernel function based on the DTW distance, map the distance to a similarity measure, and construct the Gaussian kernel matrix: ; In the formula, is the DTW distance, For the A heart electron sequence, For the A heart electron sequence, is the kernel function bandwidth. The cross-validation method is used to select the optimal The objective function is to minimize the classification error of the validation set. The initial value of is taken as 1 / 4 of the median of all DTW distances to avoid the kernel matrix being too sparse or dense.

[0037] B22, Gaussian kernel matrix is a symmetric matrix. In addition, a small unit matrix perturbation is added to ensure its positive definiteness: ,in, .

[0038] C. Constructing statistical manifolds: C1. All Symmetric positive definite matrices form a statistical manifold, namely a Riemann manifold, denoted by The geodesic distance on a manifold is defined by the following formula: ; In the formula, is the trace of the matrix.

[0039] C2, Gaussian kernel matrix set generation. The input is heartbeat samples, each corresponding to a Gaussian kernel matrix; output is a set of points on the statistical manifold .

[0040] C3. Manifold local geometry modeling. First, calculate the geodesic distance between all kernel matrices. Define neighborhood relationships and then build a distance matrix ,in .

[0041] C4, graph structure generation. Each kernel matrix Corresponding to a node in the graph, for each node , retain the front with the smallest distance to its geodesic The edge (such as ), the edge weight is defined as the inverse of the geodesic distance, that is , is the scale parameter. The total mutual information between nodes is used as a measure of the edge threshold size, that is, defined as: ,here is the number of nodes, Is a node The structural mutual information between When there is no edge relationship between them, define .here is a monotonic function of the threshold, when When the curve has an obvious turning point, the corresponding number of edges is the number of edges that need to be retained.

[0042] D. Constructing graph convolutional networks on manifolds: D1, tangent space projection. SPD matrix Projecting to the tangent space through logarithmic mapping, we get the vector representation in Euclidean space: ; The logarithmic mapping is defined as: ; In the formula, for The eigenvector matrix of is the eigenvalue. Using symmetry, only the upper triangular elements are retained and expanded into vectors, and the dimension is compressed to .

[0043] D2. Graph convolutional network architecture design, including network layer design and parameter setting.

[0044] D3. Model training and optimization. The loss function uses the following weighted cross entropy loss to alleviate the problem of class imbalance: ; In the formula, is the number of samples, is the number of categories, is the category label, as weights to increase the severity of penalties for minority categories.

[0045] The optimization strategy used is: Optimizer: Adam, initial learning rate , decaying to 0.5 times every 20 rounds. Batch training: Full-batch training is used, and when memory is insufficient, it is switched to cluster sampling; Early stopping mechanism: training is terminated when the validation set loss does not decrease for 5 consecutive rounds.

[0046] Embodiment 1: A method for classifying arrhythmias based on statistical manifolds comprises the following steps: A. Heartbeat segmentation and subsequence division: A1. Heart beat segmentation A11, R wave peak detection. The Pan-Tompkins algorithm is used to detect the R wave peak position from the original ECG signal. The specific steps are: A111 preprocessing: The ECG signal is band-pass filtered with a passband of 5-15 Hz to suppress baseline drift and high-frequency noise, and the QRS complex characteristics are enhanced using a differential filter and square operation.

[0047] A112, Threshold detection: Set a dynamic threshold. When the amplitude of the filtered signal exceeds the threshold, it is marked as a candidate R peak. Combined with the RR interval rule, such as the minimum interval of 200ms, pseudo peaks are eliminated.

[0048] A12, heartbeat extraction. With the R wave peak detected in step A11 as the center, take fixed time windows before and after to intercept the complete heartbeat. The first segment takes 150ms before the R peak, corresponding to the start of the P wave to the R peak, and the second segment takes 350ms after the R peak, corresponding to the R peak to the end of the T wave. The total heartbeat length is 500ms. The sampling rate is 360 Hz, with a total of 180 sampling points. Then, the intercepted heartbeat is aligned on the time axis to ensure that the R peak is located in the center of the window, and the voltage value is standardized to zero mean and unit variance to eliminate the amplitude differences between individuals.

[0049] A2: Subsequence division. A single heartbeat is evenly divided into 11 subsequences, covering the key ECG waveform segments. The specific division is as follows: Figure 2 As shown. The division rule is to divide equally according to the time axis, and the length of each subsequence is about 45ms. The total length is 180 points, with 16-17 sampling points in each segment. The specific segments correspond to ECG physiological characteristics: subsequences 1-4, covering the PR interval (atrial depolarization stage); subsequences 5-7, covering the QRS complex (ventricular depolarization stage); subsequences 8-11: covering the ST segment and T wave (ventricular repolarization stage).

[0050] For specific arrhythmia types and wide QRS complexes, the subsequence division can be adjusted dynamically. If the QRS complex is prolonged, the number of sampling points of subsequences 5-7 can be increased. In addition, the QRS start and end points can be located based on waveform inflection point detection, such as derivative extremes. By superimposing multiple heart beats and their subsequence boundaries, the division is ensured to be consistent with the physiological waveform. For heart beats with R peak detection errors or noise interference, interpolation or elimination strategies are used.

[0051] B. Modeling the subsequence features of the MIT-BIH dataset and constructing a Gaussian kernel matrix: B1. Calculate the DTW distance to provide a distance metric for the Gaussian kernel matrix. DTW minimizes the cumulative distance path by flexibly aligning the time axes of the two subsequences, and is suitable for nonlinear time deformation of ECG signals. First, construct a cumulative distance matrix and limit the path slope to 1, that is, adjacent steps are only allowed to move horizontally, vertically or diagonally to avoid excessive distortion of the timing relationship. Then, set the global path window to limit the maximum offset of the path on the time axis, such as the window width is 10% of the subsequence length. Finally, perform DTW distance normalization, that is, normalize the cumulative distance of the optimal path to eliminate the impact of subsequence length differences. DTW distance normalization is performed according to the following formula: ; In the formula, For the A heart electron sequence, For the A heart electron sequence, is the cumulative distance matrix, P and Q Respectively The heart electron sequence and the The length of the electron sequence.

[0052] B2. Construct a Gaussian kernel matrix based on DTW distance to capture the geometric structural relationship between subsequences. DTW overcomes the limitation of traditional Euclidean distance on rigid alignment of the time axis and accurately captures the dynamic deformation of ECG waveforms, such as changes in the width of the QRS complex. The symmetric positive definiteness of the Gaussian kernel matrix meets the requirements of Riemannian manifold geometry and provides a mathematical basis for subsequent graph convolution.

[0053] B21. Kernel function design. Define the Gaussian kernel function based on the DTW distance, map the distance to a similarity measure, and construct the Gaussian kernel matrix: ; In the formula, is the DTW distance, For the A heart electron sequence, For the A heart electron sequence, is the kernel function bandwidth. The cross-validation method is used to select the optimal The objective function is to minimize the classification error of the validation set. The initial value of is taken as 1 / 4 of the median of all DTW distances to avoid the kernel matrix being too sparse or dense.

[0054] B22, Gaussian kernel matrix is a symmetric matrix. In addition, a small unit matrix perturbation is added to ensure its positive definiteness: ,in, .

[0055] Specifically, input data, extract 11 subsequences from the preprocessed heartbeat library, each subsequence length 16-17 sampling points. Then, for each pair of subsequences (total Finally, for each heartbeat, The kernel matrix characterizes the dynamic correlation of its internal subsequences and generates a Gaussian kernel matrix. The kernel matrix example (partial) is as follows: .

[0056] C. Constructing statistical manifolds: C1. All Symmetric positive definite matrices form a statistical manifold, namely a Riemann manifold, denoted by The geodesic distance on a manifold is defined by the following formula: ; In the formula, is the trace of the matrix.

[0057] C2, Gaussian kernel matrix set generation. The input is heartbeat samples, each corresponding to a Gaussian kernel matrix; output is a set of points on the statistical manifold .

[0058] C3. Manifold local geometry modeling. First, the geodesic distance between all kernel matrices is calculated Define neighborhood relationships and then build a distance matrix ,in .

[0059] C4, graph structure generation. Each kernel matrix Corresponding to a node in the graph, for each node , retain the front with the smallest distance to its geodesic The edge (such as ), the edge weight is defined as the inverse of the geodesic distance, that is , is the scale parameter. The total mutual information between nodes is used as a measure of the edge threshold size, that is, defined as: ,here is the number of nodes, Is a node The structural mutual information between When there is no edge relationship between them, define .here is a monotonic function of the threshold, when When the curve has an obvious turning point, the corresponding number of edges is the number of edges that need to be retained.

[0060] Examples of graph structure generation are as follows Figure 3 As shown, each It is a point on the manifold and also a node in the graph structure. Whether there is an edge between the nodes is determined by the above-mentioned mutual information-based method.

[0061] Specifically, 5000 heartbeat samples are input, and each sample generates Gaussian kernel matrix. Calculate geodesic distance: For each pair of kernel matrices ,calculate The total amount of calculation is Second distance calculation. Set the edge retention ratio , each node retains about 1000 edges to generate a graph structure.

[0062] D. Constructing graph convolutional networks on manifolds: D1, tangent space projection. SPD matrix Projecting to the tangent space through logarithmic mapping, we get the vector representation in Euclidean space: ; The logarithmic mapping is defined as: ; In the formula, for The eigenvector matrix of is the eigenvalue. Using symmetry, only the upper triangular elements are retained and expanded into vectors, and the dimension is compressed to The principle of tangent space projection, such as Figure 4 shown.

[0063] D2. Graph convolutional network architecture design, including network layer design and parameter setting. The basic structure diagram of convolutional neural network is as follows: Figure 5 As shown, it mainly contains 3 graph convolution layers.

[0064] D21, network layer design. Multi-layer graph convolution (GCN) is used to aggregate neighborhood information. The specific structure is as follows: Input layer: node features , the adjacency matrix .

[0065] Graph Convolutional Layer: , in, , For the The node representation of the layer, , is the learnable weight matrix, is the activation function (such as ReLU).

[0066] Output layer: Final layer node representation ( is the number of categories); the category probability output by the Softmax function is: ; D22, parameter setting.

[0067] Number of layers: Experiments show that too deep a convolutional layer may lead to over-smoothing. This example selects three convolutional layers. Hidden layer dimension: 256 → 128 → 64; Activation function: ReLU (middle layer), no activation (output layer); Regularization: Dropout (ratio 0.5) suppresses overfitting; Weight decay: L2 regularization, coefficient .

[0068] D3. Model training and optimization. The loss function uses the following weighted cross entropy loss to alleviate the problem of class imbalance: ; In the formula, is the number of samples, is the number of categories, is the category label, as weights to increase the severity of penalties for minority categories.

[0069] The optimization strategy used is: Optimizer: Adam, initial learning rate , decaying to 0.5 times every 20 rounds; Batch training: full-batch training is adopted, and sub-graph sampling (Cluster Sampling) is switched when memory is insufficient; Early stopping mechanism: training is terminated when the validation set loss does not decrease for 5 consecutive rounds.

[0070] Specifically, the input graph structure: number of nodes M=5000, feature dimension D=66 (N=11); adjacency matrix sparsity is about 20% (10 million non-zero elements). Training configuration: 3-layer GCN, hidden layer dimension 256-128-64; 100 rounds of training, each round takes about 15 seconds (NVIDIA A6000 GPU). Performance indicators are: accuracy 98.7%, F1-score 97.2%; compared with the baseline (CNN, LSTM), it is improved by more than 2.5%. The arrhythmia classification method based on statistical manifolds of the present invention can significantly improve the classification accuracy of complex arrhythmias.

[0071] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for classifying arrhythmias based on statistical manifolds, characterized in that: The following steps are involved: A. Heartbeat segmentation and subsequence division: First, input the ECG signal, detect the R wave peak and segment the ECG data into single heart beats; then evenly divide the single heart beat sequence into N subsequences, N>1, and each subsequence covers a specific ECG waveform segment; B. Subsequence feature modeling and Gaussian kernel matrix construction: The dynamic time warping distance, i.e., DTW distance, between each pair of subsequences is calculated to characterize their nonlinear time series alignment relationship. Then, the Gaussian kernel matrix of the subsequences is constructed based on the DTW distance. C. Construct a statistical manifold. All sample kernel matrices constitute a statistical manifold: Each Gaussian kernel matrix is ​​a symmetric positive definite SPD matrix, and each Gaussian kernel matrix corresponds to a point on the Riemann manifold, i.e., the statistical manifold; D. Constructing graph convolutional networks on manifolds: First, the graph structure is constructed: the covariance matrix is ​​used as the graph node, the geodesic distance is used as the edge weight, and the threshold is retained; then the tangent space is mapped to obtain the tangent vector, and the node feature mapping is completed: each SPD matrix is ​​projected to the tangent space through logarithmic mapping, and the tangent vector is obtained as the node feature; finally, the graph convolutional network classification model is obtained, and graph convolution classification is performed: a multi-layer graph convolutional network is used to aggregate neighborhood information and output the heartbeat category probability.

2. The method for classifying arrhythmias based on statistical manifold according to claim 1, characterized in that: Step A specifically comprises the following steps: A1. Heart beat segmentation: A11, R wave peak detection, using Pan-Tompkins algorithm to detect the R wave peak position from the original ECG signal; A12, heartbeat extraction, taking the R peak detected in step A11 as the center, taking fixed time windows before and after, and intercepting the complete heartbeat; then, aligning the intercepted heartbeat with the time axis to ensure that the R peak is located in the center of the window, and standardizing the voltage value to zero mean and unit variance to eliminate the amplitude difference between individuals; A2: Subsequence division: a single heart beat is evenly divided into 11 subsequences, covering the key ECG waveform segments; the division rule is to divide equally along the time axis.

3. The method for classifying arrhythmias based on statistical manifold according to claim 2, characterized in that: Step A11 specifically includes the following steps: A111 preprocessing: bandpass filtering is performed on the ECG signal with a passband of 5-15 Hz to suppress baseline drift and high-frequency noise, and the QRS complex characteristics are enhanced using a differential filter and square operation; A112, Threshold detection: Set a dynamic threshold. When the amplitude of the filtered signal exceeds the threshold, it is marked as a candidate R peak. Combined with the RR interval rule, pseudo peaks are eliminated.

4. The method for classifying arrhythmias based on statistical manifold according to claim 2, characterized in that: Step A12, the front segment is taken as 150ms before the R peak, corresponding to the start of the P wave to the R peak, and the rear segment is taken as 350ms after the R peak, corresponding to the R peak to the end of the T wave. The total heart beat length is 500ms.

5. The method for classifying arrhythmias based on statistical manifold according to claim 4, characterized in that: In step A2, the length of each subsequence is about 45 ms, and the specific segments correspond to ECG physiological characteristics: subsequences 1-4 cover the PR interval, corresponding to the atrial depolarization stage; subsequences 5-7 cover the QRS complex, corresponding to the ventricular depolarization stage; subsequences 8-11: cover the ST segment and T wave, corresponding to the ventricular repolarization stage.

6. The method for classifying arrhythmias based on statistical manifold according to claim 1, characterized in that: Step B specifically comprises the following steps: B1. Calculate DTW distance: B11. Construct a cumulative distance matrix and limit the path slope to 1, that is, adjacent steps are only allowed to move horizontally, vertically or diagonally to avoid excessive distortion of the temporal relationship; B12. Set the global path window to limit the maximum offset of the path on the time axis; B13. Perform DTW distance normalization, that is, normalize the cumulative distance of the optimal path to eliminate the influence of the subsequence length difference. DTW distance normalization is performed according to the following formula: ; In the formula, For the A heart electron sequence, For the A heart electron sequence, is the cumulative distance matrix, P and Q Respectively The heart electron sequence and the The length of the electron sequence; B2. Construct Gaussian kernel matrix based on DTW distance: B21. Kernel function design. Define the Gaussian kernel function based on the DTW distance, map the distance to a similarity measure, and thus construct the Gaussian kernel matrix: ; In the formula, is the DTW distance, For the A heart electron sequence, For the A heart electron sequence, is the kernel function bandwidth; B22, Gaussian kernel matrix is a symmetric matrix. In addition, a small unit matrix perturbation is added to ensure its positive definiteness: ,in, .

7. The method for classifying arrhythmias based on statistical manifold according to claim 6, characterized in that: Step B21, using cross-validation method to select the optimal The objective function is to minimize the classification error of the validation set, and the initial value of is 1 / 4 of the median of all DTW distances.

8. The method for classifying arrhythmias based on statistical manifold according to claim 1, characterized in that: Step C specifically comprises the following steps: C1. All Symmetric positive definite matrices form a statistical manifold, namely a Riemann manifold, denoted by , the geodesic distance on the manifold is defined by the following formula: ; In the formula, is the trace of the matrix; C2, Gaussian kernel matrix set generation, input is heartbeat samples, each corresponding to a Gaussian kernel matrix; output is a set of points on the statistical manifold ; C3. Manifold local geometry modeling. First, calculate the geodesic distance between all kernel matrices. Define neighborhood relationships, then build a distance matrix ,in ; C4. Generate graph structure: Each kernel matrix Corresponding to a node in the graph, for each node , retain the front with the smallest distance to its geodesic The edge weight is defined as the inverse of the geodesic distance, that is, , is the scale parameter; the total mutual information between nodes is used as a measure of the edge threshold size, that is, the definition: ,here is the number of nodes, Is a node The structural mutual information between When there is no edge relationship between them, define ;here is a monotonic function of the threshold, when When the curve has an obvious turning point, the corresponding number of edges is the number of edges that need to be retained.

9. The method for classifying arrhythmias based on statistical manifold according to claim 1, characterized in that: Step D specifically comprises the following steps: D1, cut space projection, SPD matrix Projecting to the tangent space through logarithmic mapping, we get the vector representation in Euclidean space: ; The logarithmic mapping is defined as: ; In the formula, for The eigenvector matrix of is the eigenvalue; using symmetry, only the upper triangular elements are retained and expanded into vectors, and the dimension is compressed to ; D2. Graph convolutional network architecture design, including network layer design and parameter setting; D3. Model training and optimization. The loss function uses the following weighted cross entropy loss to alleviate the problem of category imbalance: ; In the formula, is the number of samples, is the number of categories, is the category label, as weights to increase the severity of penalties for minority categories.

10. The method for classifying arrhythmias based on statistical manifold according to claim 9, characterized in that: Step D3, the optimization strategy used is: Optimizer: Adam, initial learning rate , decays to 0.5 times every 20 rounds; Batch training: use full-image training, and switch to sub-image sampling when memory is insufficient; Early stopping mechanism: training is terminated when the validation set loss does not decrease for 5 consecutive rounds.

Citation Information

Patent Citations

  • 3D skeleton action recognition method based on space-time manifold trajectory mapping

    CN114627557A

  • Arrhythmia classification method based on self-attention mechanism

    CN115530788A

  • Space-time diagram node attribute prediction method fusing adaptive graph diffusion convolutional network

    CN115828990A

  • Premature ventricular beat detection method based on in-beat characteristic wavelet complex network

    CN116269248A

  • Hyperspectral image classification method based on multi-manifold measurement

    CN116612320A

Cited By

  • PICC (Peripherally Inserted Central Catheter) tip precise navigation fixing method and system based on electrocardiogram real-time positioning

    CN120919492A

  • Arrhythmia real-time detection method, system and device based on morphological fidelity consistency constraint

    CN121101514A