Arrhythmia detection method based on multivariate phase space and Riemannian manifold
Through the multivariate phase space and Riemann manifold methods, the high-dimensional spatial domain characteristics of the ECG signal are extracted, which solves the problems of insufficient accuracy of central arrhythmia detection and large manual intervention in the prior art, and achieves efficient and accurate arrhythmia detection and early warning.
Patent Information
- Application Number
- CN202411915512.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-18
AI Technical Summary
Existing ECG signal processing technology is difficult to effectively extract the spatial domain characteristics of ECG signals, resulting in insufficient accuracy of arrhythmia detection, and relies on artificial experience and complex matrix eigenvalue calculations, increasing the amount of calculation and manual intervention.
Using the multivariate phase space and Riemann manifold method, the high-dimensional spatial domain characteristics of the signal are obtained by constructing the multivariate phase space matrix and calculating the covariance matrix. Then, the spatial domain feature vector of the signal is extracted using the tangent spatial mapping and vectorization operation of the Riemann manifold as input to the arrhythmia recognition model.
It realizes high-dimensional information capture and dynamic characteristic analysis of ECG signals, reduces manual intervention, improves the accuracy and efficiency of arrhythmia detection, and is suitable for real-time monitoring and multi-channel signal analysis.
Smart Images

Figure CN119837540A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electrocardiogram signal processing, and in particular to a method for detecting arrhythmia based on multivariate phase space and Riemann manifold. Background Art
[0002] The detection of arrhythmias is crucial for the early detection, diagnosis and treatment of cardiovascular diseases. High-precision arrhythmia detection can effectively help analyze human health conditions, such as calculating the three high indicators related to cardiovascular diseases. Arrhythmias refer to abnormal heart rhythms, including fast, slow or irregular heart rates. In the current arrhythmia detection methods based on electrocardiogram (ECG) signals, the feature extraction part of the signal is obtained in the time and frequency domain of the signal itself. In order to obtain high-dimensional features in the nonlinear transformation domain of ECG signals and capture the dynamic characteristics of the heart, it is necessary to improve the feature extraction process of ECG signals, such as considering the spatial domain characteristics of the signal, so as to achieve the high-precision requirements of arrhythmia detection technology.
[0003] The analysis and processing of multi-channel signals based on geometric tools of Riemann manifolds has gradually become a research hotspot. The covariance matrix used for Riemann manifold analysis can characterize the high-order statistical characteristics of the signal. The covariance matrix is a symmetric positive definite matrix. Therefore, Riemannian geometry tools can be used to conduct in-depth research on ECG signal sequences and explore high-dimensional latent spatial structure information.
[0004] However, in the prior art, Riemannian electrocardiogram signal classification uses Riemannian geometry representation and support vector machine to classify two psychological states based on ECG signals. First, the ECG signal is extracted into 4 different frequency bands through a bandpass filter, and then a 4x4 covariance matrix is calculated based on the power distribution characteristics in different frequency bands; then, other important ECG time-frequency domain features are calculated, and these newly added eigenvalues are added on the diagonal to finally form a 10x10 covariance matrix using 10 feature types. The extended covariance matrix will be used to calculate the tangent space projection matrix and vectorized representation of the Riemann space, and the obtained eigenvector is used as the input of the support vector machine classification model. Its disadvantage is that the covariance matrix of this method is a covariance matrix containing 10 feature types that depends on manual operation for calculation. It is necessary to manually define the division method of different frequency bands before calculating the 4x4 covariance matrix. When the covariance matrix is expanded using more features, a large number of features are also calculated manually, and then feature selection algorithms are used to screen features to obtain an extended matrix. Therefore, the overall covariance matrix acquisition process in this method is deeply dependent on human experience, and it is necessary to ensure the perfection of the data set range in order to obtain a more objective operation setting, thereby ensuring the validity of the feature vector used as the input of the classification model. The overall method has not been used in arrhythmia detection applications, and the relevant parameters are not referenceable.
[0005] At the same time, there is also a load assessment method based on the tangent space features of EEG signals and the heart rate variability features of ECG signals. First, the EEG signals are preprocessed, including filtering, downsampling and other steps, and then the covariance matrix is calculated based on the Oracle shrinkage approximation estimator OAS algorithm, which is used to extract its tangent space features in the Riemannian geometry space. In terms of the heart rate variability of the ECG signal, it uses some common time domain and frequency domain features, such as the time interval between two consecutive heartbeats, the standard deviation of the NN interval, the root mean square of the continuous difference of the NN interval, etc., to extract the characteristics of the heart rate variability of the participants' ECG signals. Its disadvantages are: it fails to extract the spatial domain features of the ECG signal to characterize its dynamic information, and only uses common time domain and frequency domain features. In the calculation of EEG signals, when calculating the covariance matrix used for Riemannian space calculation, it is necessary to introduce a shrinkage coefficient for improvement, and it is necessary to calculate the eigenvalues of the signal matrix directly composed of multi-channel signals. The eigenvalue calculation process of the high-dimensional matrix here is highly complex, which will greatly increase the amount of calculation and calculation time. At the same time, the covariance calculation process cannot include the information of the signal in each state space, that is, the dynamic information of the signal cannot be obtained.
[0006] In summary, most of the current methods are to manually extract effective features from ECG signals, or design feature extraction models based on deep neural networks to complete the feature extraction process of ECG signals. In addition to the local features in the time-frequency domain mentioned in the above two technical solutions, global statistics such as the mean, variance, autocorrelation function and cross-correlation function of ECG signals can also be calculated as signal features. Machine learning algorithms, such as the ARMA model, can also be used to process ECG signals and use their coefficients as features, or deep learning methods, such as deep learning algorithms such as convolutional neural networks (CNNs), can be used to classify ECG signals. None of the above feature extraction methods for ECG signals can clearly characterize the spatial domain characteristics of ECG signals under dynamic conditions. Some of these methods are highly dependent on the parameter settings of signal processing or feature selection based on human experience, or cannot adjust and control the feature calculation process, such as using the "black box idea" to obtain a deep learning model that can be used for feature extraction, but when the model has generalization problems, it is impossible to manually adjust the model, and the feature extraction process is unexplainable. Summary of the invention
[0007] The present invention provides an arrhythmia detection method based on multivariate phase space and Riemann manifold, which uses the tangent space mapping component in the Riemann space to calculate the spatial domain characteristics of the multi-channel signal as a whole, and adopts the multivariate phase space method to form a multi-state multi-channel signal matrix, so that the calculated covariance matrix contains multi-dimensional dynamic information, and can also include signal relationship information between channels, which helps to identify arrhythmia problems with higher accuracy, and can provide problem warnings through signal relationships.
[0008] The present invention provides a method for detecting arrhythmia based on multivariate phase space and Riemann manifold, comprising:
[0009] A multi-channel ECG data set is produced by using a multi-lead ECG acquisition device to record multi-channel ECG signals;
[0010] The multivariate phase space method is used to construct information about the signal's different state changes and spatial information, and the covariance matrix is calculated based on this;
[0011] Calculate the spatial domain eigenvector corresponding to the covariance matrix through the Riemann manifold space as the signal feature during this period of time;
[0012] The signal features are input into a random forest-based arrhythmia recognition model to perform arrhythmia recognition and arrhythmia problem warning.
[0013] Furthermore, the step of using a multi-lead electrocardiogram acquisition device to record multi-channel ECG signals to produce a multi-channel electrocardiogram data set includes:
[0014] A multi-lead ECG acquisition device is used to place multiple electrodes on different parts of the body to collect multi-channel ECG data. The number of data channels is chnn, and the sampling rate of each channel is f.
[0015] Signal data of a set time length is collected from a set number of volunteers with different heart health conditions, and the signal of each volunteer is segmented, and the segmentation time length is t; wherein, each channel signal is segmented at the same time window position to ensure that each channel signal in a set of signal sets corresponds to the same time window;
[0016] Labels of heart rhythm health levels are marked; wherein the labels include normal heart rhythm, sinus arrhythmia, ectopic rhythm, and impulse conduction abnormalities.
[0017] Furthermore, the step of constructing information including signal state change information and spatial information by a multivariate phase space method and calculating a covariance matrix based on the information includes:
[0018] Let x i =[x i,1 … x i,N ] T For the i th The ECG signal of each channel, N is the length of the signal N = t*f, and the signal vectors of all channels in the same period are arranged to form a signal matrix X:
[0019]
[0020] Obtain the state space matrix: define the state embedding parameter j, the number of states K and the delay τ, for each x i , if the first column in the signal matrix is x i,j , the second column is x i,j+τ , the third column is x i,j+2τ , and so on, the Kth column is x i,j+(K-1)τ , we get the matrix V j It is defined as the state space matrix under j, with size chnn rows and K columns:
[0021]
[0022] Reconstructing the multivariate phase space matrix: Multiple state space matrices can be arranged into a multivariate phase space matrix. Define the embedding dimension as M, let j = 1,…,M, where M = N-(K-1)τ, then the multivariate phase space Y can be composed of M state space matrices, that is, Y = [V1,…,V M ] T , the matrix size is (chnn*M) rows and K columns;
[0023] Compute the covariance matrix of a multivariate phase space matrix The size of the covariance matrix S is (chnn*M) rows and (chnn*M) columns, and it is a symmetric positive definite matrix.
[0024] Furthermore, the step of calculating the spatial domain eigenvector corresponding to the covariance matrix through the Riemann manifold space as the signal feature during the period of time includes:
[0025] The Riemann distance is defined according to the covariance matrix, and the Riemann mean of all covariance matrices is calculated by an iterative algorithm;
[0026] The tangent space mapping of the covariance matrix is calculated, and the eigenvector is calculated according to the tangent space mapping in a vectorized manner, and the eigenvector is used as the feature of the signal.
[0027] Furthermore, the step of defining the Riemann distance according to the covariance matrix and calculating the Riemann mean value comprises:
[0028] Each covariance matrix S corresponds to a point in the Riemann space. Suppose the two covariance matrices are S1 and S2 respectively. Their Riemann distance d can be calculated using the geodesic distance, that is: Among them, ||·|| F represents the Frobenius norm calculation, σ i For S1 -1 The real eigenvalue of S2, D is the number of real eigenvalues;
[0029] Assume there are p covariance matrices, S1,…,S pFirst, select the first covariance matrix S1 as the starting Riemann mean and calculate its difference with other covariance matrices S i The Riemann distance The calculation method is The calculation process of the Riemann distance The covariance matrix S i The weight of S1 is So we can calculate the new Riemann mean Calculate the Riemann distance between the new Riemann mean and all covariance matrices, iterate the Riemann mean, and set the distance threshold to d threshold In each iteration, after calculating the Riemann distance between the Riemann mean and all covariance matrices, the Riemann distance is compared with Is it less than d? threshold If it is not satisfied, the iteration will continue. When the sum of the Riemann distances of this iteration is less than the distance threshold, the Riemann average value will be used as the center point S of the entire Riemann manifold. mean , whose tangent space on Riemann space serves as the basis for mapping each covariance matrix in the tangent space.
[0030] Furthermore, the step of calculating the tangent space mapping of the covariance matrix, and calculating the eigenvector according to the tangent space mapping in a vectorized manner, and using the eigenvector as the feature of the signal includes:
[0031] For any S i , using logarithmic mapping to calculate the projection matrix C on the tangent space of the Riemann manifold i , the calculation formula is:
[0032]
[0033] Tangent space projection matrix C i Perform vectorization operation, and the obtained vector is used as the feature vector c of the signal set. The vectorization process is:
[0034] c i = {vec(upper(C i ))}
[0035] Among them, vec(·) represents an operator that performs vectorized operations, and upper(·) is an operator that extracts the upper triangular part of a symmetric matrix.
[0036] Furthermore, the step of inputting the signal features into a random forest-based arrhythmia recognition model to perform arrhythmia recognition and arrhythmia problem warning includes:
[0037] The classification results of the heart rhythm health level labels are numbered, with 1 representing normal heart rhythm, 2 representing sinus arrhythmia, 3 representing ectopic rhythm, and 4 representing impulse conduction abnormality. The labels of each signal set will have a unique digital label as the arrhythmia identification result;
[0038] All data are randomly divided, 70% of the signal set and the corresponding label are used as the training set, and the remaining 30% are used as the test set. The feature vector corresponding to the signal set in the training set is used as the input of the arrhythmia recognition model based on random forest, and the corresponding label is used as the output. The model training is carried out until the number of decision trees constructed by the model reaches the total number of decision trees, and the model training stops; the feature vector corresponding to the signal set in the test set is used as the model input to obtain the corresponding recognition label;
[0039] In the model output of the test set, the result with the largest number of decision tree judgment results in the model is obtained as the final arrhythmia recognition type; at the same time, the judgment results of each type of arrhythmia recognition model based on random forest for a certain signal set are extracted. When the number of judgment results of certain categories is similar to the result of the final recognition type, it is considered that the subject may have multiple arrhythmia problems at the same time, so as to remind the subject to pay attention to another arrhythmia problem that has not been directly identified.
[0040] The present invention also provides a device for detecting arrhythmia based on multivariate phase space and Riemann manifold, comprising:
[0041] A production module, used for recording multi-channel ECG signals using a multi-lead electrocardiogram acquisition device to produce a multi-channel electrocardiogram data set;
[0042] The first calculation module is used to construct information including different state changes of the signal and spatial information through a multivariate phase space method, and calculate the covariance matrix based on the information;
[0043] A second calculation module is used to calculate the spatial domain eigenvector corresponding to the covariance matrix through the Riemann manifold space as the signal feature in this period of time;
[0044] The recognition module is used to input the signal features into a random forest-based arrhythmia recognition model to perform arrhythmia recognition and arrhythmia problem warning.
[0045] The present invention also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0046] The present invention also provides a computer-readable storage medium on which a computer program is stored, and the computer program implements the steps of the above method when executed by a processor.
[0047] The beneficial effects of the present invention are:
[0048] 1. It can capture the high-dimensional information of multi-channel physiological signals, that is, analyze their geometric features and hidden nonlinear dynamic features in high-dimensional manifolds. At the same time, the overall technical solution can automatically complete decomposition and analysis, reduce the need for manual intervention, and improve signal analysis efficiency.
[0049] 2. The covariance calculation process in the present invention does not involve complex processes such as matrix eigenvalues that require computational effort, which can help the overall technical solution be applied to real-time monitoring. Its multivariate phase space construction method can quickly form a signal space containing multidimensional and dynamic information, which can promote the effectiveness of spatial domain feature extraction and help understand the intrinsic structure and dynamic characteristics of the signal.
[0050] 3. The overall technical solution can be applied to the spatial domain analysis and application of various multi-channel signals. In particular, in signal analysis, the spatial domain feature vectors extracted by multivariate phase space and Riemann space methods can be used for cluster analysis to analyze the similarity of heart conditions between individuals or the same individual at different times. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 The figure is a schematic diagram of a method flow according to an embodiment of the present invention.
[0052] Figure 2 This is a waveform diagram of a normal heart rate in the present invention.
[0053] Figure 3 FIG. 1 is a schematic diagram of a device structure according to an embodiment of the present invention.
[0054] Figure 4 The figure is a schematic diagram of the internal structure of a computer device according to an embodiment of the present invention.
[0055] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0056] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.
[0057] like Figure 1 As shown, the present invention provides an arrhythmia detection method based on multivariate phase space and Riemann manifold, and its process is roughly as follows: multi-channel ECG data set production → calculation of covariance matrix based on multivariate phase space construction → calculation of Riemann mean → calculation of tangent space mapping of covariance matrix → vectorization calculation of eigenvector → arrhythmia recognition model training and arrhythmia problem warning.
[0058] The specific steps of the method are as follows:
[0059] S1. Perform multi-channel ECG signal recording, specifically using a multi-lead ECG acquisition device to place multiple electrodes on different parts of the body to comprehensively monitor the electrical activity of the heart in all directions, so as to locate the types of arrhythmias representing different heart problems. Professionals diagnose the heart health of the person being collected and the corresponding arrhythmia problem as a label for the signal data over a period of time.
[0060] Step S1 specifically includes:
[0061] S101. Use a multi-lead ECG acquisition device to place multiple electrodes on different parts of the body to comprehensively monitor the electrical activity of the heart in all directions, and collect multi-channel ECG data. Let the number of data channels be chnn, and the sampling rate of each channel be f. In the present invention, a 12-lead ECG device can be used, and the sampling rate is set to 256Hz. That is, chnn=12, f=256Hz.
[0062] S102. Collect signal data for at least 30 minutes from at least 150 volunteers with different heart health conditions to ensure the comprehensiveness and quantity of the data content. Segment the signal of each volunteer, and the segmentation time length is t. It is necessary to ensure that each channel signal is segmented at the same time window position, and ensure that each channel signal in a set of signals corresponds to the same time window.
[0063] S103, in the present invention, t = 30s. The heart rhythm health level label is marked, and the label will be divided into 4 situations, namely, normal heart rhythm (such as Figure 2 As shown in the figure), sinus arrhythmia (mainly judged by P wave), ectopic rhythm (mainly judged by QRS complex), impulse conduction abnormality (mainly judged by changes in PR interval). The label definition process will require professionals to observe the main problems of each set of signals.
[0064] S2. Through the multivariate phase space method, a covariance matrix can be constructed that can contain information about changes in different signal states and spatial information. The covariance matrix calculated based on this can contain high-dimensional nonlinear dynamic change information of ECG signals.
[0065] Step S2 specifically includes:
[0066] S201, let x i =[x i,1 … x i,N ] T For the i th The ECG signals of channels, N is the length of the signal N = t * f, in the present invention, N = 30 * 256. The signal vectors of all channels in the same period are arranged to form a signal matrix X:
[0067]
[0068] S202, obtain the state space matrix: define the state embedding parameter j, the number of states K and the delay τ, for each x i , if the first column in the signal matrix is x i,j , the second column is x i,j+τ , the third column is x i,j+2τ , and so on, the Kth column is x i,j+(K-1)τ , then the matrix:
[0069]
[0070] It is defined as the state space matrix under j, with a size of chnn rows and K columns. In the present invention, K=f,τ=1.
[0071] S203, Reconstructing the multivariate phase space matrix: Multiple state space matrices can be arranged into a multivariate phase space matrix, and the embedding dimension is defined as M. Let j = 1, ..., M, where M = N-(K-1)τ, then the multivariate phase space Y can be composed of M state space matrices, that is, Y = [V1, ..., V M ] T , the matrix size is (chnn*M) rows and K columns.
[0072] S204. Calculate the covariance matrix of the multivariate phase space matrix The size of the covariance matrix S is (chnn*M) rows and (chnn*M) columns, and it is a symmetric positive definite matrix. Therefore, the calculated S is in the space of symmetric positive definite matrices, or in the space of Riemann manifolds, that is, the covariance matrix can be regarded as a point on the Riemann space curve and can be mapped on the tangent space. Therefore, the Riemann space method can be used as a feature descriptor to describe the differential information of various physiological signals.
[0073] S3. The spatial domain feature vector corresponding to the covariance is calculated through the Riemann manifold space as the signal feature during this period of time, which will be used as the input of the subsequent recognition model.
[0074] Step S3 specifically includes:
[0075] S301. Define a Riemann distance according to the covariance matrix.
[0076] Each covariance matrix S corresponds to a point in the Riemann space. Suppose the two covariance matrices are S1 and S2 respectively. Their Riemann distance d can be calculated using the geodesic distance, that is: in,‖·‖ F represents the Frobenius norm calculation, σ i For S1 -1 The real eigenvalue of S2, D is the number of such real eigenvalues.
[0077] S302, using an iterative algorithm to calculate the Riemann mean of all covariance matrices.
[0078] Assume there are p covariance matrices, S1,…,S p First, select the first covariance matrix S1 as the starting Riemann mean and calculate its difference with other covariance matrices S i The Riemann distance Calculation method see above The calculation process of the Riemann distance The covariance matrix S i The weight of S1 is So we can calculate the new Riemann mean Next, the Riemann distance between the new Riemann mean and all covariance matrices is calculated and the Riemann mean is iterated. Set the distance threshold to d threshold In each iteration, after calculating the Riemann distance between the Riemann mean and all covariance matrices, the Riemann distance is compared with Is it less than d? threshold If it is not satisfied, the iteration will continue. When the sum of the Riemann distances of this iteration is less than the distance threshold, the Riemann average value will be used as the center point S of the entire Riemann manifold. mean , its tangent space on the Riemann space will serve as the basis for the subsequent mapping of each covariance matrix in the tangent space.
[0079] S303, calculating the tangent space mapping of the covariance matrix, and calculating the eigenvector according to the tangent space mapping by vectorization, and taking the eigenvector as the feature of the signal.
[0080] Step S303 specifically includes:
[0081] S3031, for any S i , using logarithmic mapping to calculate the projection matrix C on the tangent space of the Riemann manifold i , the calculation formula is:
[0082]
[0083] S3032, tangent space projection matrix C i Perform vectorization operation, and the obtained vector is used as the feature vector c of the signal set. The vectorization process is:
[0084] c i = {vec(upper(C i ))}
[0085] Among them, vec(·) represents the operator that performs vectorization operations, and upper(·) is the operator that extracts the upper triangular part of the symmetric matrix. The above two operators work together to map the covariance matrix in the tangent space to the vector in the vector space.
[0086] S4. Inputting the signal features into a random forest-based arrhythmia recognition model to perform arrhythmia recognition and arrhythmia problem warning.
[0087] Based on the training of arrhythmia recognition model by random forest, an early warning of arrhythmia problems can be performed at the same time. Since ECG signals are used to detect the electrical activity of the heart, the signal source is relatively single, and the signal-to-noise ratio of ECG signals can be very high. Therefore, the overall technical solution does not specifically perform a signal noise reduction process (it also avoids many empirical interventions in artificially setting noise reduction parameters). However, since the signal itself still has some noise caused by the motion artifacts of the subject, it may cause errors in the signal feature extraction. Therefore, in the selection of the recognition model, the present invention will use the random forest method as the heart rhythm recognition model, taking advantage of its advantages of not being easy to overfit and having good robustness to noise data, to obtain a heart rhythm classification model with wide applicability.
[0088] Step S4 specifically includes:
[0089] S401. Label digitization: Label the classification results of the heart rhythm health level labels, with 1 representing normal heart rhythm, 2 representing sinus arrhythmia, 3 representing ectopic rhythm, and 4 representing impulse conduction abnormality. The label of each signal set will have a unique digital label as the arrhythmia identification result.
[0090] S402, model training and identification of arrhythmia types: All data are randomly divided, 70% of the signal set and the corresponding label are used as the training set, and the remaining 30% is used as the test set. For the relevant parameters of the decision tree in the random forest, such as the number of decision trees, decision tree depth and other model performance parameters, the feature vector corresponding to the signal set in the training set is used as the input of the random forest model, and the corresponding label is used as the output to train the model until the number of decision trees constructed by the model reaches the total number of decision trees, and the model training stops. The feature vector corresponding to the signal set in the test set is used as the model input to obtain the corresponding identification label.
[0091] S403, arrhythmia warning: In the model output of the test set, the result with the largest number of decision tree judgment results in the model will be obtained as the final arrhythmia identification type. At this time, you can also check the judgment results of each type of the random forest model for a certain signal set. When the number of judgment results of certain categories is similar to the result of the final identification type, it can be considered that the subject may have multiple arrhythmia problems at the same time, indicating that he may have two heart problems at the same time, and the subject can be reminded to pay attention to another arrhythmia problem that has not been directly identified.
[0092] The present invention can capture the high-dimensional information of multi-channel physiological signals, that is, analyze their geometric features and hidden nonlinear dynamic features in high-dimensional manifolds. At the same time, the overall technical solution can automatically complete decomposition and analysis, reduce the need for manual intervention, and improve signal analysis efficiency. The covariance calculation process does not involve complex processes such as matrix eigenvalues that require computational effort, which can help the overall technical solution for real-time monitoring. Its multivariate phase space construction method can quickly form a signal space containing multidimensional and dynamic information, which can promote the effectiveness of spatial domain feature extraction and help understand the intrinsic structure and dynamic characteristics of the signal. The overall technical solution can be used in the spatial domain analysis and application of various types of multi-channel signals. In signal analysis, the spatial domain feature vectors extracted by the multivariate phase space and Riemann space methods can also be used for cluster analysis to analyze the similarity of heart conditions between individuals or the same individual at different times.
[0093] like Figure 3 As shown, the present invention also provides a device for detecting arrhythmia based on multivariate phase space and Riemann manifold, comprising:
[0094] Production module 1, used for recording multi-channel ECG signals using a multi-lead electrocardiogram acquisition device to produce a multi-channel ECG data set;
[0095] The first calculation module 2 is used to construct information including different state changes of the signal and spatial information through a multivariate phase space method, and calculate the covariance matrix based on the information;
[0096] A second calculation module 3 is used to calculate the spatial domain eigenvector corresponding to the covariance matrix through the Riemann manifold space as the signal feature in this period of time;
[0097] The recognition module 4 is used to input the signal features into the arrhythmia recognition model based on random forest to perform arrhythmia recognition and arrhythmia problem warning.
[0098] In one embodiment, the production module 1 includes:
[0099] The first acquisition unit is used to use a multi-lead electrocardiogram acquisition device to place multiple electrodes on different body parts to acquire multi-channel electrocardiogram data, where the number of data channels is chnn and the sampling rate of each channel is f;
[0100] The second acquisition unit is used to collect signal data of a set time length from a set number of volunteers with different heart health conditions, and segment the signal of each volunteer, and the segment time length is t; wherein, each channel signal is segmented at the same time window position to ensure that each channel signal in a set of signal sets corresponds to the same time window;
[0101] The labeling unit is used to label the heart rhythm health level; wherein the labels include normal heart rhythm, sinus arrhythmia, ectopic rhythm, and impulse conduction abnormality.
[0102] In one embodiment, the first calculation module 2 includes:
[0103] The permutation unit is used to make x i =[x i,1 … x i,N ] T For the i th The ECG signal of each channel, N is the length of the signal N = t*f, and the signal vectors of all channels in the same period are arranged to form a signal matrix X:
[0104]
[0105] The space matrix unit is used to obtain the state space matrix: define the state embedding parameter j, the number of states K and the delay τ, for each x i , if the first column in the signal matrix is x i,j , the second column is x i,j+τ , the third column is x i,j+2τ , and so on, the Kth column is x i,j+(K-1)τ , we get the matrix V j It is defined as the state space matrix under j, with size chnn rows and K columns:
[0106]
[0107] Reconstruction unit, used to reconstruct the multivariate phase space matrix: multiple state space matrices can be arranged into a multivariate phase space matrix, and the embedding dimension is defined as M. Let j = 1, ..., M, where M = N-(K-1)τ, then the multivariate phase space Y can be composed of M state space matrices, that is, Y = [V1, ..., V M ] T , the matrix size is (chnn*M) rows and K columns;
[0108] Computational unit for calculating the covariance matrix of the multivariate phase space matrix The size of the covariance matrix S is (chnn*M) rows and (chnn*M) columns, and it is a symmetric positive definite matrix.
[0109] In one embodiment, the second calculation module 3 includes:
[0110] an average value calculation unit, used for defining the Riemann distance according to the covariance matrix, and calculating the Riemann average values of all covariance matrices by using an iterative algorithm;
[0111] The vector calculation unit is used to calculate the tangent space mapping of the covariance matrix, and to vectorize and calculate the eigenvector according to the tangent space mapping, and use the eigenvector as the feature of the signal.
[0112] In one embodiment, the average value calculation unit includes:
[0113] Define subunits, where each covariance matrix S corresponds to a point in the Riemann space. Suppose the two covariance matrices are S1 and S2, and their Riemann distance d can be calculated using the geodesic distance, that is: Among them, ||·|| F represents the Frobenius norm calculation, σ i For S1 - 1 The real eigenvalue of S2, D is the number of real eigenvalues;
[0114] The first calculation subunit is used to assume that there are p covariance matrices, which are S1,…,S p First, select the first covariance matrix S1 as the starting Riemann mean and calculate its difference with other covariance matrices S i The Riemann distance The calculation method is The calculation process of the Riemann distance The covariance matrix S i The weight of S1 is So we can calculate the new Riemann mean Calculate the Riemann distance between the new Riemann mean and all covariance matrices, iterate the Riemann mean, and set the distance threshold to d threshold In each iteration, after calculating the Riemann distance between the Riemann mean and all covariance matrices, the Riemann distance is compared with Is it less than d? threshold If it is not satisfied, the iteration will continue. When the sum of the Riemann distances of this iteration is less than the distance threshold, the Riemann average value will be used as the center point S of the entire Riemann manifold. mean , whose tangent space on Riemann space serves as the basis for mapping each covariance matrix in the tangent space.
[0115] In one embodiment, the vector calculation unit includes:
[0116] The second computing subunit is used to calculate any S i , using logarithmic mapping to calculate the projection matrix C on the tangent space of the Riemann manifold i , the calculation formula is:
[0117]
[0118] Vectorized subunit for tangent space projection matrix C i Perform vectorization operation, and the obtained vector is used as the feature vector c of the signal set. The vectorization process is:
[0119] c i = {vec(upper(C i ))}
[0120] Among them, vec(·) represents an operator that performs vectorized operations, and upper(·) is an operator that extracts the upper triangular part of a symmetric matrix.
[0121] In one embodiment, the identification module 4 includes:
[0122] The labeling unit is used to label the classification results of the heart rhythm health level labels, with 1 representing normal heart rhythm, 2 representing sinus arrhythmia, 3 representing ectopic heart rhythm, and 4 representing impulse conduction abnormality. The label of each signal set will have a unique digital label as the arrhythmia identification result;
[0123] The partitioning unit is used to randomly partition all data, with 70% of the signal set and the corresponding label as the training set and the remaining 30% as the test set. The feature vector corresponding to the signal set in the training set is used as the input of the arrhythmia recognition model based on random forest, and the corresponding label is used as the output. The model training is performed until the number of decision trees constructed by the model reaches the total number of decision trees, and the model training stops; the feature vector corresponding to the signal set in the test set is used as the model input to obtain the corresponding recognition label;
[0124] The recognition unit is used to obtain the result with the largest number of decision tree judgment results in the model output of the test set as the final arrhythmia recognition type; at the same time, it extracts the judgment results of various types of arrhythmia recognition model based on random forest for a certain signal set. When the number of judgment results of certain categories is similar to the result of the final recognition type, it is considered that the subject may have multiple arrhythmia problems at the same time, so as to remind the subject to pay attention to another arrhythmia problem that is not directly recognized.
[0125] The above modules, units and sub-units are used to execute the corresponding steps in the above arrhythmia detection method based on multivariate phase space and Riemann manifold. The specific implementation method thereof is described in the above method embodiment and will not be repeated here.
[0126] like Figure 4 As shown, the present invention also provides a computer device, which can be a server, and its internal structure can be as shown in Figure 4 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store all data required for the process of the arrhythmia detection method based on multivariate phase space and Riemann manifold. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the arrhythmia detection method based on multivariate phase space and Riemann manifold is implemented.
[0127] Those skilled in the art will understand that Figure 4 The structure shown in is merely a block diagram of a portion of the structure related to the present application solution and does not constitute a limitation on the computer device to which the present application solution is applied.
[0128] An embodiment of the present application further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, any one of the above-mentioned arrhythmia detection methods based on multivariate phase space and Riemann manifold is implemented.
[0129] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media provided in this application and used in the embodiments may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0130] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, device, article or method including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, device, article or method. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, device, article or method including the element.
[0131] The above description is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. Any equivalent structure or equivalent process transformation made by using the contents of the present invention specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present invention.
Claims
1. A method for detecting arrhythmia based on multivariate phase space and Riemann manifold, characterized in that: include: A multi-channel ECG data set is produced by using a multi-lead ECG acquisition device to record multi-channel ECG signals; The multivariate phase space method is used to construct information about the signal's different state changes and spatial information, and the covariance matrix is calculated based on this; Calculate the spatial domain eigenvector corresponding to the covariance matrix through the Riemann manifold space as the signal feature during this period of time; The signal features are input into a random forest-based arrhythmia recognition model to perform arrhythmia recognition and arrhythmia problem warning.
2. The arrhythmia detection method based on multivariate phase space and Riemann manifold according to claim 1, characterized in that: The step of using a multi-lead electrocardiogram acquisition device to record multi-channel ECG signals to produce a multi-channel electrocardiogram data set includes: A multi-lead ECG acquisition device is used to place multiple electrodes on different parts of the body to collect multi-channel ECG data. The number of data channels is chnn, and the sampling rate of each channel is f. Signal data of a set time length is collected from a set number of volunteers with different heart health conditions, and the signal of each volunteer is segmented, and the segmentation time length is t; wherein, each channel signal is segmented at the same time window position to ensure that each channel signal in a set of signal sets corresponds to the same time window; Labels of heart rhythm health levels are marked; wherein the labels include normal heart rhythm, sinus arrhythmia, ectopic rhythm, and impulse conduction abnormalities.
3. The arrhythmia detection method based on multivariate phase space and Riemann manifold according to claim 2, characterized in that: The step of constructing information including signal state change information and spatial information by a multivariate phase space method and calculating a covariance matrix based on the information includes: Let x i =[x i,1 …x i,N ] T For the i th The ECG signal of each channel, N is the length of the signal N = t*f, and the signal vectors of all channels in the same period are arranged to form a signal matrix X: Obtain the state space matrix: define the state embedding parameter j, the number of states K and the delay τ, for each x i , if the first column in the signal matrix is x i,j , the second column is x i,j+τ , the third column is x i,j+2τ , and so on, the Kth column is x i,j+(K-1)τ , we get the matrix V j It is defined as the state space matrix under j, with size chnn rows and K columns: Reconstructing the multivariate phase space matrix: Multiple state space matrices can be arranged into a multivariate phase space matrix. Define the embedding dimension as M, let j = 1, ..., M, where M = N-(K-1)τ, then the multivariate phase space Y can be composed of M state space matrices, that is, Y = [V1, ..., V M ] T , the matrix size is (chnn*M) rows and K columns; Compute the covariance matrix of a multivariate phase space matrix The size of the covariance matrix S is (chnn*M) rows and (chnn*M) columns, and it is a symmetric positive definite matrix.
4. The arrhythmia detection method based on multivariate phase space and Riemann manifold according to claim 3, characterized in that: The step of calculating the spatial domain feature vector corresponding to the covariance matrix through the Riemann manifold space as the signal feature during the period of time includes: The Riemann distance is defined according to the covariance matrix, and the Riemann mean of all covariance matrices is calculated by an iterative algorithm; The tangent space mapping of the covariance matrix is calculated, and the eigenvector is calculated according to the tangent space mapping in a vectorized manner, and the eigenvector is used as the feature of the signal.
5. The arrhythmia detection method based on multivariate phase space and Riemann manifold according to claim 4, characterized in that: The step of defining the Riemann distance according to the covariance matrix and calculating the Riemann mean value comprises: Each covariance matrix S corresponds to a point in the Riemann space. Suppose the two covariance matrices are S1 and S2 respectively. Their Riemann distance d can be calculated using the geodesic distance, that is: Among them, ||·|| F represents the Frobenius norm calculation, σ i For S1 -1 The real eigenvalue of S2, D is the number of real eigenvalues; Assume there are p covariance matrices, S1,...,S p First, select the first covariance matrix S1 as the starting Riemann mean and calculate its difference with other covariance matrices S i The Riemann distance The calculation method is The calculation process of the Riemann distance The covariance matrix S i The weight of S1 is So we can calculate the new Riemann mean Calculate the Riemann distance between the new Riemann mean and all covariance matrices, iterate the Riemann mean, and set the distance threshold to d threshold In each iteration, after calculating the Riemann distance between the Riemann mean and all covariance matrices, the Riemann distance is compared with Is it less than d? threshold If it is not satisfied, the iteration will continue. When the sum of the Riemann distances of this iteration is less than the distance threshold, the Riemann average value will be used as the center point S of the entire Riemann manifold. mean , whose tangent space on Riemann space serves as the basis for mapping each covariance matrix in the tangent space.
6. The arrhythmia detection method based on multivariate phase space and Riemann manifold according to claim 5, characterized in that: The step of calculating the tangent space mapping of the covariance matrix, calculating the eigenvector according to the tangent space mapping, and using the eigenvector as the feature of the signal includes: For any S i , using logarithmic mapping to calculate the projection matrix C on the tangent space of the Riemann manifold i , the calculation formula is: Tangent space projection matrix C i Perform vectorization operation, and the obtained vector is used as the feature vector c of the signal set. The vectorization process is: c i ={vec(upper(C i ))} Among them, vec(·) represents an operator that performs vectorized operations, and upper(·) is an operator that extracts the upper triangular part of a symmetric matrix.
7. The arrhythmia detection method based on multivariate phase space and Riemann manifold according to claim 2, characterized in that: The step of inputting the signal features into a random forest-based arrhythmia recognition model to perform arrhythmia recognition and arrhythmia problem warning includes: The classification results of the heart rhythm health level labels are numbered, with 1 representing normal heart rhythm, 2 representing sinus arrhythmia, 3 representing ectopic rhythm, and 4 representing impulse conduction abnormality. The labels of each signal set will have a unique digital label as the arrhythmia identification result; All data are randomly divided, 70% of the signal set and the corresponding label are used as the training set, and the remaining 30% are used as the test set. The feature vector corresponding to the signal set in the training set is used as the input of the arrhythmia recognition model based on random forest, and the corresponding label is used as the output. The model training is carried out until the number of decision trees constructed by the model reaches the total number of decision trees, and the model training stops; the feature vector corresponding to the signal set in the test set is used as the model input to obtain the corresponding recognition label; In the model output of the test set, the result with the largest number of decision tree judgment results in the model is obtained as the final arrhythmia recognition type; at the same time, the judgment results of each type of arrhythmia recognition model based on random forest for a certain signal set are extracted. When the number of judgment results of certain categories is similar to the result of the final recognition type, it is considered that the subject may have multiple arrhythmia problems at the same time, so as to remind the subject to pay attention to another arrhythmia problem that has not been directly identified.
8. A device for detecting arrhythmia based on multivariate phase space and Riemann manifold, characterized in that: include: A production module, used for recording multi-channel ECG signals using a multi-lead electrocardiogram acquisition device to produce a multi-channel electrocardiogram data set; The first calculation module is used to construct information including different state changes of the signal and spatial information through a multivariate phase space method, and calculate the covariance matrix based on the information; A second calculation module is used to calculate the spatial domain eigenvector corresponding to the covariance matrix through the Riemann manifold space as the signal feature in this period of time; The recognition module is used to input the signal features into a random forest-based arrhythmia recognition model to perform arrhythmia recognition and arrhythmia problem warning.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Cardiovascular surgery patient circulation state image real-time monitoring and early warning system
CN121015161A