Intelligent cardiovascular disease identification method based on multi-scale integrated network and stacked attention mechanism

The intelligent identification method for cardiovascular diseases using multi-scale integrated networks and stacked attention mechanisms solves the robustness problem of cross-patient diagnosis and imbalanced data, achieving high accuracy in electrocardiogram classification, especially maintaining high recognition accuracy in noisy environments.

CN120899267APending Publication Date: 2025-11-07NANJING UNIV OF INFORMATION SCI & TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511024498.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-24
Publication Date
2025-11-07

AI Technical Summary

Technical Problem

Existing intelligent identification technologies for cardiovascular diseases are not robust enough in cross-patient diagnosis, processing of imbalanced data and multi-type noise data. They are difficult to effectively classify unseen patient electrocardiograms and process imbalanced electrocardiograms, and are sensitive to different types and levels of noise.

Method used

A cardiovascular disease intelligent identification method based on multi-scale ensemble network and stacked attention mechanism is adopted. By combining multi-scale scanning module, multi-angle convolutional layer, stacked attention mechanism and fully connected layer, combined with linear support vector machine and multi-power weighted average module, the method processes electrocardiogram signals to achieve robust classification of electrocardiogram.

Benefits of technology

It achieved high classification accuracy in both in-patient and out-of-patient experiments, and maintained high recognition accuracy even in extremely imbalanced data and noisy environments, demonstrating excellent robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120899267A_ABST
    Figure CN120899267A_ABST
Patent Text Reader

Abstract

The invention provides an intelligent cardiovascular disease recognition method based on a multi-scale integrated network and a stacked attention mechanism. The method comprises the steps that electrocardiosignals are preprocessed; establishing five sub-networks, wherein each sub-network comprises a multi-scale scanning module, a multi-angle convolution layer, a secondary convolution layer, a stacking attention mechanism module and a full connection layer; processing is carried out through the five sub-networks respectively; performing decision value evaluation on the features of each self-network through a linear support vector machine; by establishing a multi-power weighted average module, decision values based on the linear support vector machine under all sub-networks are fused to obtain a final classification result. According to the method, the recognition accuracy rates of five types of noiseless electrocardiograms in patients and among patients under normal forms respectively reach 99.6% and 96.62%, the recognition accuracy rate of electrocardiograms containing Gaussian noise exceeds 89%, and the recognition accuracy rate of electrocardiograms containing power frequency interference exceeds 96%.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of biomedical signal processing and intelligent recognition, and particularly relates to a cardiovascular disease intelligent recognition method based on a multi-scale integrated network and a stacked attention mechanism. BACKGROUND

[0002] Cardiovascular disease (CVD) is one of the main causes of death in the global population. According to the data of the World Health Organization, nearly 20 million people die of cardiovascular disease every year, accounting for about one-third of the global death toll. Coronary artery disease (CAD) and atrial fibrillation (AFIB) are two common cardiovascular diseases that affect hundreds of millions of people and usually lead to a decline in heart function in patients. More seriously, long-term atrial fibrillation and coronary artery disease can lead to congestive heart failure (CHF) and ventricular fibrillation (VFIB), which have a high mortality rate. Therefore, it is crucial to diagnose and treat CVD patients in a timely manner. An electrocardiogram is an electrophysiological signal that records the electrical activity of myocardial cells. It mainly consists of P waves, QRS wave groups, and T waves. Among them, the P wave records the depolarization process of the atrium, and the QRS wave group and the T wave record the depolarization and repolarization processes of the ventricle, respectively. Therefore, by observing the changes in various waveforms of the electrocardiogram, the health status of the heart can be effectively evaluated. However, since the changes in electrocardiogram waveforms are usually subtle and similar, manually monitoring long-term electrocardiograms is both time-consuming and labor-intensive. Therefore, it is very important to develop a computer-aided electrocardiogram analysis system for timely diagnosis of cardiovascular diseases.

[0003] To date, relevant researchers have developed a series of electrocardiogram automatic classification systems. As a few representative examples, in order to detect CAD, relevant researchers first extracted PCA features from electrocardiograms, then processed the above features using SVM, implemented electrocardiogram classification, and achieved an accuracy rate of 93.8%. In the aspect of CHF detection, relevant researchers developed an electrocardiogram classification method consisting of continuous wavelet transform (CWT) and pre-trained CNN, extracted time-frequency features from electrocardiograms using CWT, then input them into the pre-trained CNN to achieve deep feature extraction and classification, thereby achieving an accuracy rate of 98.7%. In addition, relevant researchers used Superlet transform and GoogleNet to gradually extract time-frequency features and deep features to classify electrocardiograms. In the experiment, the recognition accuracy of AFIB and VFIB reached 99.92%. These examples show that a series of methods have achieved excellent performance in electrocardiogram classification and CVF diagnosis.

[0004] Although good results have been achieved in distinguishing electrocardiograms using the methods in the above studies, there are still several issues to be addressed. 1) First, most of the above studies do not explicitly show that the methods of the relevant researchers have been validated in patient-to-patient experiments. Specifically, in clinical practice, there are usually many unseen patients' electrocardiograms that need to be classified. However, most researchers only point out the ratio between training data and test data, without explaining whether they come from the same patient. Since electrocardiograms contain both heart state information and individual identity information, the classification model based on patient-to-patient experiments may overestimate the performance of heart disease identification, making it difficult for them to effectively classify the electrocardiograms of unseen patients. For example, in 2022, researchers proposed a method of combining time-frequency representation and BLSTM for electrocardiogram classification, which achieved an accuracy of 98.5% in patient-to-patient experiments. However, the performance of this method in patient-to-patient experiments was ignored, making it impossible to verify the generalization of their method. Although the researchers tested the performance of the method in patient-to-patient electrocardiogram classification experiments, the accuracy in identifying ventricular tachycardia and ventricular fibrillation was 81.46% and 89.29%, respectively, indicating that more than 10% of patients could not be effectively diagnosed. Therefore, it is crucial to ensure that the proposed method has excellent identification ability for unseen patients' electrocardiograms. 2) Second, the above studies do not guarantee the performance of their methods in handling imbalanced electrocardiograms. Specifically, in real-world scenarios, the number of electrocardiograms from normal patients is usually significantly higher than that from abnormal patients, and there is also a certain degree of difference in the number of electrocardiograms between various diseases. In addition, the degree of imbalance between different types of electrocardiograms also varies in different collection environments. However, common deep learning methods tend to learn more key features from large-scale electrocardiograms than from small-scale electrocardiograms, making it difficult to effectively identify the type of small-scale electrocardiograms. Therefore, when developing electrocardiogram classification methods, it is necessary to ensure the ability of these methods to handle multi-level imbalanced data. 3) Third, the above studies have not verified the performance of their methods in handling electrocardiograms with different types and levels of noise. Specifically, during the collection of electrocardiograms, electrocardiogram waveforms are often affected by noise such as baseline drift, power frequency interference, and high-frequency noise during the collection process, making feature extraction difficult. Although most of the noise can be removed by using denoising algorithms, due to the diversity of noise types and levels in different patients' electrocardiograms, it is particularly difficult to choose the appropriate denoising algorithm and corresponding parameters. In addition, denoising algorithms often inevitably delete some useful information from electrocardiograms. In summary, in order to avoid excessive reliance on denoising algorithms, it is necessary to ensure that the proposed electrocardiogram classification system has good robustness to different types and levels of noise. SUMMARY

[0005] Invention purposes: The purpose of the present application is to solve the problems of the existing intelligent recognition technology of cardiovascular diseases, such as insufficient robustness for cross-patient diagnosis, unbalanced data and multi-type noise data, and to propose an intelligent recognition method of cardiovascular diseases based on multi-scale integrated network and stacking attention mechanism (MASI-Net), comprising the following steps:

[0006] Step 1, preprocessing the electrocardio signal, first segmenting the electrocardio signal into single cycle heartbeat, using Pan-Tompkins detection method to locate the position of R peak; for each R peak, setting the previous peak and the next peak as R1 and R2 respectively; then, setting the point 0.1 seconds after R1 and the point before R2 as A1 and A2 respectively; at the same time, the point 0.06s before R is set as point B1, and the point 0.06s after R is set as B2; finally, A1~B1, B1~B2 and B2~A2 are respectively resampled to sampling points to obtain F1 segment, F2 segment and F3 segment; then the F1 segment, F2 segment and F3 segment are connected into a heartbeat containing sampling points;

[0007] Then the amplitude range of the heartbeat is normalized to 0~1 by the maximum and minimum normalization algorithm, and reconstructed into an electrocardio matrix with size m*n; wherein m represents the number of rows of the electrocardio matrix, and n represents the number of columns of the electrocardio matrix;

[0008] Step 2, establishing five sub-networks, the structures of the five sub-networks are the same, all containing multi-scale scanning module, multi-angle convolution layer, secondary convolution layer, stacking attention mechanism module and full connection layer; the five sub-networks are respectively recorded as first sub-network, second sub-network, third sub-network, fourth sub-network and fifth sub-network;

[0009] Step 3, processing through the multi-angle convolution layer of the first sub-network;

[0010] Step 4, processing through the multi-angle convolution layer of the second sub-network;

[0011] Step 5, processing through the multi-angle convolution layer of the third sub-network;

[0012] Step 6, processing through the multi-angle convolution layer of the fourth sub-network;

[0013] Step 7, processing through the multi-angle convolution layer of the fifth sub-network;

[0014] Step 8, processing through the secondary convolution layer of each sub-network;

[0015] Step 9, processing through the stacking attention module of each sub-network;

[0016] Step 10, processing through the full connection layer of each sub-network;

[0017] Step 11, decision value evaluation of each self-network feature by linear support vector machine LSVM;

[0018] Step 12, fusion of all sub-networks based on linear support vector machine LSVM decision values to obtain the final classification result by establishing a multi-power weighted average module MPWA.

[0019] Step 2 includes the following processing by the multi-scale scanning module of the first to fifth sub-networks: dividing the electrocardiogram matrix into electrocardiogram data of different scales, first setting the dual-lead electrocardiogram matrix as Wherein represents the ith electrocardiogram matrix of the cth lead, N is the total number of electrocardiogram matrices, c is the lead number, represents the real number space, and a square window with a side length of k×k=3×3, 5×5 is used to scan each electrocardiogram matrix, thereby obtaining a series of data blocks Wherein represents the mth data block of the ith electrocardiogram matrix of the cth lead, and k is an odd number;

[0020] The mean value of all data blocks is removed to obtain the mean value-free data block Then, the first stage matrix is obtained by concatenating Wherein is the first stage matrix of the ith electrocardiogram of the cth lead, represents the mean value-free data block of the mth data block of the ith electrocardiogram matrix of the cth lead;

[0021] Finally, the preliminary processing matrix of all electrocardiogram matrices of the cth lead is obtained

[0022] Step 3 includes processing the preliminary processing matrix X c using task-related component analysis TRCA technology to obtain L1 task-related component analysis TRCA convolution kernels Wherein g1(X c ) is a task-related component analysis TRCA convolution kernel extraction function, represents the l1th task-related component analysis TRCA convolution kernel of the electrocardiogram of the cth lead;

[0023] Then, each convolution kernel is convolved with each electrocardiogram matrix to obtain a TRCA feature block Wherein represents the l1th TRCA feature block of the ith electrocardiogram of the cth lead.

[0024] Step 4 includes: processing the initial matrix X using canonical correlation analysis (CCA) techniques. c The L2 canonical correlation analysis CCA convolution kernels of the electrocardiogram in lead c were obtained. Where g2(X) c () is the canonical correlation analysis (CCA) convolution kernel extraction function. This represents the 12th canonical correlation analysis CCA convolution kernel of the ECG in lead c;

[0025] Each convolution kernel With each ECG matrix Perform convolution to obtain canonical correlation analysis (CCA) feature blocks. in The l2 canonical correlation analysis CCA feature block represents the i-th electrocardiogram in lead c.

[0026] Step 5 includes: processing the initial matrix X using independent component analysis (ICA) technology. c Thus, the L3 independent component analysis (ICA) convolutional kernels of the electrocardiogram in lead c are obtained. Among them g3(X) c ) is the independent component analysis (ICA) convolution kernel extraction function. This represents the 13th independent component analysis (ICA) convolution kernel of the ECG in lead c;

[0027] Each convolution kernel With each ECG matrix Perform convolution to obtain Independent Component Analysis (ICA) feature blocks. in This represents the l3rd ICA feature block of the i-th electrocardiogram in lead c.

[0028] Step 6 includes: processing the initial matrix X using principal component analysis (PCA) techniques. c The L4 PCA convolutional kernels of the electrocardiogram in lead c were obtained. Where g4(X) c Principal component analysis (PCA) convolution kernel extraction function. This represents the 14th principal component analysis (PCA) convolution kernel of the ECG in lead c; then, each convolution kernel... With each ECG matrix Perform convolution to obtain principal component analysis (PCA) feature blocks. in The l2 principal component analysis (PCA) feature block represents the i-th electrocardiogram in lead c.

[0029] Step 7 includes: processing the initial matrix X using Reliable Component Analysis (RCA) techniques. cThus, the L5 reliable component analysis RCA convolution kernels of the ECG in lead c were obtained. Among them g5(X) c ) is the RCA convolution kernel extraction function for reliable component analysis. This represents the 15th reliable component analysis RCA convolution kernel of the ECG in lead c;

[0030] Each convolution kernel With each ECG matrix Perform convolution to obtain reliable component analysis RCA feature blocks in The 15th reliable component analysis RCA feature block represents the i-th electrocardiogram in lead c.

[0031] Step 8 includes: in the secondary convolutional layer, using a window of size k×k with a stride of 1 to scan the feature blocks. To obtain a series of secondary data blocks Where β = 1, 2, ..., 5; z = 1, 2, ..., mn; This represents the result of the multi-angle convolutional layer of the β-th subnetwork processing the i-th electrocardiogram, resulting in the l-th... β One feature block;

[0032] The secondary data blocks are mean-removed and reconstructed into vectors. in express The reconstructed vector;

[0033] After processing all feature blocks Afterwards, according to The secondary unprocessed matrix Y of all ECG matrices in lead c under the β subnetwork is obtained. c,β ,in Represents the l-th ECG matrix in the c-th lead i-th subnetwork of the β-th subnetwork. β Submatrices; This represents the result of splicing all secondary matrices under the β-th subnetwork of the i-th ECG matrix in the c-th lead;

[0034] Then, L6 reliable component analysis RCA convolution kernels are computed. Among them g5(X) c ) is the RCA convolution kernel extraction function for reliable component analysis. The ζ-th reliable component analysis RCA convolution kernel representing the c-th lead ECG in the secondary convolutional layer; finally, based on The secondary feature block (SLF) is calculated, where This represents the ECG matrix of lead c, i, in the β subnetwork, sequentially convolved with the l-th layer of the multi-angle convolutional layer. βa secondary feature block obtained by convolving the first secondary feature block with the first convolution kernel and the ζth convolution kernel in the secondary convolution layer.

[0035] Step 9 includes: performing a stacked attention mechanism, first combining the first secondary feature block and the second secondary feature block of the second lead to obtain a three-dimensional data block where C = 2, representing the depth of each three-dimensional block; then, performing a first channel attention mechanism CAM according to formula (1) to obtain a first weight matrix A c :

[0036]

[0037] where σ is a sigmoid function, MLP is a multi-layer perceptron, G avg and G max respectively represent global average and maximum pooling processes;

[0038] Then, the first attention mapping result

[0039] For the second channel attention mechanism CAM, a second weight matrix B C :

[0040]

[0041] Then, the second attention mapping result

[0042] For the third channel attention mechanism CAM, a third weight matrix F C :

[0043]

[0044] According to the second attention mapping result

[0045] Finally, the three-dimensional matrix is split into two two-dimensional feature matrices

[0046] Step 10 includes: converting each two-dimensional feature matrix into a binary matrix H(EL) according to formula (4):

[0047]

[0048] where EL represents Elements in;

[0049] Then, according to Calculate the decimal matrix

[0050] Next, through a dimension of u×u and an overlap rate of O rate Sliding window scanning decimal matrix Obtain local feature blocks in For the β-th subnetwork, the l-th β The p-th local feature block of all feature blocks under multi-angle convolution kernels, where P is the total number of local feature blocks; u represents the height and width of the sliding window;

[0051] Next, using histogram statistics, all feature blocks... Processing is performed to obtain feature vectors Where f i β The histogram function f represents the feature vector of the i-th ECG matrix in the β-th subnetwork. The histogram function f is the statistical histogram feature function. Ultimately, five types of feature vectors f will be obtained. i β ,β=1,2,…,5;

[0052] Step 11 includes: after processing all f i β Then, the five sets of distances between the sample and the decision hyperplane are obtained as the decision values. Where h represents the possible labels of the i-th ECG matrix, and H represents the total number of labels for all ECGs; for each f i β Using the highest The labels of the values ​​are used as the categories in the ECG matrix, thus obtaining the overall classification accuracy TA. β ;

[0053] Step 12 includes: using the min-max normalization method to determine the decision values ​​for the H latent labels corresponding to each ECG matrix. Mapping to the range of 0 to 1 yields the standardized decision value of the i-th ECG matrix corresponding to the h-th label in the β-th subnetwork. Secondly, for each ECG matrix, a multi-power weighted average method was constructed to fuse H decision values, using the m-th power of the TA. β As weights to amplify the differences in importance between features, the weighted average of all decision values ​​is obtained according to equation (5):

[0054]

[0055] Where v i,h,newis the new decision value of the i-th electrocardiogram corresponding to the h-th label; finally, the i-th electrocardiogram matrix has the highest h-th label as the predicted label result.

[0056] The present application has the following beneficial effects: (1) by identifying the electrocardiogram of normal, coronary heart disease, heart failure, atrial fibrillation and ventricular fibrillation patients, 99.92% and 96.62% accuracy is respectively achieved in patient-in and patient-out paradigm experiments.

[0057] (2) In extremely unbalanced data (the number of electrocardiograms of normal patients is 120 times that of abnormal patients), the method achieves more than 96% F1 score in identifying the electrocardiograms of coronary heart disease and heart failure patients, and more than 88% F1 score in identifying the electrocardiograms of atrial fibrillation and ventricular fibrillation patients.

[0058] (3) When the signal-to-noise ratio is 10dB, the recognition accuracy of the method for electrocardiograms containing Gaussian noise in patient-out paradigm is more than 89%, and the recognition accuracy for electrocardiograms containing power frequency interference is more than 96%. BRIEF DESCRIPTION OF DRAWINGS

[0059] Figure 1 is the overall flowchart of the method of the present application.

[0060] Figure 2 is the experimental result graph of the present application in patient-in data.

[0061] Figure 3 is the experimental result graph of the present application in unbalanced data (recall rate curve).

[0062] Figure 4 is the experimental result graph of the present application in unbalanced data (precision rate curve).

[0063] Figure 5 is the experimental result graph of the present application in unbalanced data (specificity curve).

[0064] Figure 6 is the experimental result graph of the present application in unbalanced data (F1 score curve).

[0065] Figure 7 is the classification result of the present application in atrial fibrillation and non-atrial fibrillation.

[0066] Figure 8 is the classification result of the present application in ventricular fibrillation and non-ventricular fibrillation.

[0067] Figure 9 is the classification result of the present application in heart failure and non-heart failure.

[0068] Figure 10 is the classification result of the present application in coronary heart disease and non-coronary heart disease.

[0069] Figure 11 Figure for experimental results of the present application in five-class patient data.

[0070] Figure 12 Figure for classification results of Gaussian noise electrocardiogram.

[0071] Figure 13 Figure for classification results of power interference electrocardiogram. DETAILED DESCRIPTION

[0072] The above and / or other aspects of the present application will become apparent and more readily appreciated from the following description, taken in conjunction with the accompanying drawings in which:

[0073] As shown in the drawings, Figure 1 The embodiment of the present application provides a cardiovascular disease intelligent recognition method based on a multi-scale integrated network and a stacked attention mechanism, and the method comprises the following steps:

[0074] Step 1, preprocessing the electrocardiogram signal, first segmenting the electrocardiogram signal into single-cycle heartbeats, and using the Pan-Tompkins detection method to locate the position of the R peak; for each R peak, setting the previous peak and the next peak as R1 and R2 respectively; then, setting the point 0.1 seconds after R1 and the point before R2 as A1 and A2 respectively; at the same time, setting the point 0.06 seconds before R as point B1, and setting the point 0.06 seconds after R as point B2; finally, respectively resampling A1-B1, B1-B2 and B2-A2 to 100 sampling points to obtain F1 segment, F2 segment and F3 segment; then connecting F1 segment, F2 segment and F3 segment into a heartbeat containing 300 sampling points.

[0075] Then the amplitude range of the heartbeat is normalized to 0-1 by the maximum and minimum normalization algorithm, and is reconstructed into an electrocardiogram matrix with a size of m*n; wherein m represents the number of rows of the electrocardiogram matrix, and n represents the number of columns of the electrocardiogram matrix;

[0076] Step 2, establishing five sub-networks, the structures of the five sub-networks are the same, and each contains a multi-scale scanning module, a multi-angle convolution layer, a secondary convolution layer, a stacked attention mechanism module and a full connection layer; the five sub-networks are respectively denoted as a first sub-network, a second sub-network, a third sub-network, a fourth sub-network and a fifth sub-network.

[0077] Firstly, the multi-scale scanning module of the first to fifth sub-networks is processed as follows: the electrocardiogram matrix is divided into electrocardiogram data of different scales, and first set the double-lead electrocardiogram matrix as Wherein represents the i-th electrocardiogram matrix of the c-th lead, N is the total number of electrocardiogram matrices, c is the lead number, represents a real number space, each electrocardiogram matrix is scanned using a square window with a side length of k x k = 3 x 3, 5 x 5, so as to obtain a series of data blocks wherein represents the mn-th data block of the i-th electrocardiogram matrix of the c-th lead, and k is an odd number;

[0078] The mean value of all data blocks is removed to obtain a mean-free data block Then, the first stage matrix is obtained by concatenation wherein is the first stage matrix of the i-th electrocardiogram of the c-th lead, represents the mean-free data block of the mn-th data block of the i-th electrocardiogram matrix of the c-th lead;

[0079] Finally, the primary processing matrix of all electrocardiogram matrices of the c-th lead is obtained

[0080] Step 3, the first sub-network multi-angle convolution layer is processed as follows: a task-related component analysis (TRCA) algorithm is constructed. The primary processing matrix X is processed by using a task-related component analysis (TRCA) technique c , to obtain L1 task-related component analysis (TRCA) convolution kernels wherein g1(X c ) is a task-related component analysis (TRCA) convolution kernel extraction function, represents the l1-th task-related component analysis (TRCA) convolution kernel of the electrocardiogram of the c-th lead;

[0081] Then, each convolution kernel is convolved with each electrocardiogram matrix to obtain a TRCA feature block wherein represents the l1-th TRCA feature block of the i-th electrocardiogram of the c-th lead;

[0082] Step 4, the second sub-network multi-angle convolution layer is processed as follows: for the multi-angle convolution layer of the second sub-network, a canonical correlation analysis (CCA) algorithm is constructed. The primary processing matrix X is processed by using a canonical correlation analysis (CCA) technique c , to obtain L2 canonical correlation analysis (CCA) convolution kernels of the electrocardiogram of the c-th lead wherein g2(X c ) is a canonical correlation analysis (CCA) convolution kernel extraction function, represents the l2-th canonical correlation analysis (CCA) convolution kernel of the electrocardiogram of the c-th lead;

[0083] Each convolution kernel is convolved with each electrocardiogram matrix performing convolution to obtain canonical correlation analysis (CCA) feature blocks wherein represents the 12th CCA feature block of the i-th electrocardiogram of the c-th lead;

[0084] Step 5, the following processing is performed by the multi-angle convolution layer of the third sub-network: an independent component analysis (ICA) algorithm is constructed. The initial processing matrix X is processed by using the independent component analysis (ICA) technology c , so as to obtain L3 independent component analysis (ICA) convolution kernels of the electrocardiogram of the c-th lead wherein g3(X c ) is an independent component analysis (ICA) convolution kernel extraction function, represents the 13th ICA convolution kernel of the electrocardiogram of the c-th lead;

[0085] Each convolution kernel is convolved with each electrocardiogram matrix to obtain independent component analysis (ICA) feature blocks wherein represents the 13th ICA feature block of the i-th electrocardiogram of the c-th lead.

[0086] Step 6, the following processing is performed by the multi-angle convolution layer of the fourth sub-network: a principal component analysis (PCA) algorithm is constructed. The initial processing matrix X is processed by using the principal component analysis (PCA) technology c , so as to obtain L4 PCA convolution kernels of the electrocardiogram of the c-th lead wherein g4(X c ) is a principal component analysis (PCA) convolution kernel extraction function, represents the 14th PCA convolution kernel of the electrocardiogram of the c-th lead. Then, each convolution kernel is convolved with each electrocardiogram matrix to obtain principal component analysis (PCA) feature blocks wherein represents the 14th PCA feature block of the i-th electrocardiogram of the c-th lead.

[0087] Step 7, the following processing is performed by the multi-angle convolution layer of the fifth sub-network: a reliable component analysis (RCA) algorithm is constructed. The initial processing matrix X is processed by using the reliable component analysis (RCA) technology c , so as to obtain L5 RCA convolution kernels of the electrocardiogram of the c-th lead wherein g5(X c ) is a reliable component analysis (RCA) convolution kernel extraction function, the 15th reliable component analysis (RCA) kernel of the i-th electrocardiogram of the c-th lead;

[0088] convolve each kernel with each electrocardiogram matrix to obtain a reliable component analysis (RCA) feature block wherein represents the 15th reliable component analysis (RCA) feature block of the i-th electrocardiogram of the c-th lead.

[0089] Step 8, by the secondary convolution layer of each subnetwork, the following processing is performed: in the secondary convolution layer, a window with a size of k x k is used to scan the feature block with a step size of 1 to obtain a series of secondary data blocks wherein β = 1, 2, …, 5; z = 1, 2, …, mn; represents the 1th feature block obtained after processing the i-th electrocardiogram by the multi-angle convolution layer of the βth subnetwork; β

[0090] The secondary data blocks are de-meaned and reconstructed into a vector wherein represents the reconstructed vector;

[0091] After processing all the feature blocks , according to obtain the secondary to-be-processed matrix Y of the c-th lead under the β subnetworks c,β , wherein represents the 1th secondary matrix of the i-th electrocardiogram matrix of the c-th lead under the βth subnetwork; β represents the splicing result of all the secondary matrices of the i-th electrocardiogram matrix of the c-th lead under the βth subnetwork.

[0092] Then, calculate L6 reliable component analysis (RCA) kernels wherein g5(X c ) is a reliable component analysis (RCA) kernel extraction function, represents the ζth reliable component analysis (RCA) kernel of the electrocardiogram of the c-th lead in the secondary convolution layer; finally, according to calculate the secondary feature block (SLF), wherein represents the secondary feature block obtained by sequentially convolving the 1th kernel of the multi-angle convolution layer and the ζth kernel in the secondary convolution layer with the i-th electrocardiogram matrix of the c-th lead under the βth subnetwork; β

[0093] ​​​Step 9, by the stacked attention module of each subnetwork, the following processing is performed: perform the stacked attention mechanism, first combine the secondary feature blocks of the first lead and the secondary feature blocks of the second lead to obtain a three-dimensional data block where C=2, representing the depth of each three-dimensional block; then, perform the first channel attention mechanism CAM according to formula (1) to obtain a primary weight matrix A C :

[0094]

[0095] where σ is the sigmoid function, MLP is the multi-layer perceptron, G avg and G max represent the global average and maximum pooling processes, respectively.

[0096] Then, the first attention mapping result

[0097] For the second channel attention mechanism CAM, calculate the second weight matrix B C :

[0098]

[0099] Then, calculate the second attention mapping result

[0100] For the third channel attention mechanism CAM, calculate the third weight matrix F C :

[0101]

[0102] According to the calculation of the second attention mapping result

[0103] Finally, split the three-dimensional matrix into two two-dimensional feature matrices

[0104] Step 10, by the fully connected layer of each subnetwork, the following processing is performed: convert each two-dimensional feature matrix into a binary matrix H(EL) according to formula (4):

[0105]

[0106] where EL represents the elements in ;

[0107] Then, according to Calculate the decimal matrix

[0108] Next, through a dimension of u×u and an overlap rate of O rate Sliding window scanning decimal matrix Obtain local feature blocks in For the β-th subnetwork, the l-th β The p-th local feature block of all feature blocks under multi-angle convolution kernels, where P is the total number of local feature blocks; u represents the height and width of the sliding window;

[0109] Next, using histogram statistics, all feature blocks... Processing is performed to obtain feature vectors Where f i β Let f represent the feature vector of the i-th ECG matrix in the β-th subnetwork, and hist() be the statistical histogram feature function. Therefore, we will ultimately obtain five types of feature vectors f. i β ,β=1,2,…,5.

[0110] Step 11: Evaluate the decision values ​​for the features of each sub-network using a Linear Support Vector Machine (LSVM). Specifically, since the five features extracted by the five sub-networks are high-dimensional, a LSVM is used to process the massive data and high-dimensional features to estimate the corresponding decision values. After processing all f... i β Then, the five sets of distances between the sample and the decision hyperplane are obtained as the decision values. Where h represents the possible labels of the i-th ECG matrix, and H represents the total number of labels for all ECGs; for each f i β Using the highest The labels of the values ​​are used as the categories in the ECG matrix, thus obtaining the overall classification accuracy TA. β .

[0111] Step 12 involves establishing a Multiple Power Weighted Average (MPWA) module to fuse the decision values ​​from all sub-networks based on Linear Support Vector Machine (LSVM) to obtain the final classification result. Firstly, since the decision values ​​between networks vary significantly, this will negatively impact the subsequent fusion process. Therefore, a minimum-maximum normalization method is proposed to be used to normalize the decision values ​​of each ECG matrix corresponding to the H latent label. Mapping to the range of 0 to 1 yields the standardized decision value of the i-th ECG matrix corresponding to the h-th label in the β-th subnetwork. Secondly, for each electrocardiogram matrix, a multi-power weighted average method is constructed to fuse H decision values. The total accuracy TA of classification under each feature of the electrocardiogram matrix β can reflect the contribution of different features to classification to some extent. However, since the TA β difference between different features is small, it is difficult to reflect the importance difference between features. In order to solve this problem, the TA β of m times is used as a weight to amplify the importance difference between features, and the weighted average value of all decision values is obtained according to equation (5):

[0112]

[0113] where v i,h,new is the new decision value of the i-th electrocardiogram corresponding to the h-th label. Finally, the h-th label with the highest TA for the i-th electrocardiogram matrix is taken as its predicted label result.

[0114] In this embodiment, MATLAB 2023b software is used for performance verification, and electrocardiograms of normal, coronary heart disease, heart failure, atrial fibrillation and ventricular fibrillation patients in the public normal rhythm database, St. Petersburg 12-lead arrhythmia database, congestive heart failure database, MIT-BIH atrial fibrillation database and MIT-BIH malignant ventricular ectopic database are used as experimental data, which include 18 normal individuals, 7 coronary heart disease patients, 15 heart failure patients, 13 atrial fibrillation patients and 4 ventricular fibrillation patients. First, six experimental data groups are set, wherein group A is used to test the classification experimental performance of the system on normal, coronary heart disease, heart failure, atrial fibrillation and ventricular fibrillation beats of patients in the intra-patient paradigm, and groups B-E are used to test the discrimination ability of the system on coronary heart disease and non-coronary heart disease, heart failure and non-heart failure, atrial fibrillation and non-atrial fibrillation, and ventricular fibrillation and non-ventricular fibrillation in the inter-patient paradigm. Finally, group F is used to test the classification experimental performance of the system on normal, coronary heart disease, heart failure, atrial fibrillation and ventricular fibrillation beats of patients in the inter-patient paradigm. In addition, the proportion of beats between each class in group A is adjusted to test the robustness of the method to unbalanced data, and multi-level high-frequency noise and power frequency interference are added to the beats in groups B-F to test the robustness of the method to noise.

[0115] Figure 2 is the experimental result curve of the system in set A. From Figure 2It can be seen that 99.67% of the heartbeats were correctly classified, while the misclassification rate was 0.33%. In identifying normal, atrial fibrillation, ventricular fibrillation, and coronary heart disease heartbeats, all the metrics exceeded 99.95%. For ventricular fibrillation heartbeats, only 19 heartbeats were misclassified, while the specificity reached 99.82%. In addition, the accuracy of each type of heartbeat exceeded 99.7%. More importantly, although Group A contained imbalanced electrocardiograms, the proposed method still achieved 97.52% and 99.91% F1 scores in identifying ventricular fibrillation and coronary heart disease, where the number of electrocardiogram recordings was significantly less than that of normal, atrial fibrillation, and heart failure patients. Overall, the proposed method performed well in in-vivo experiments on patients.

[0116] Figure 3 , Figure 4 , Figure 5 , Figure 6 The evaluation metrics of the proposed method in processing multi-class imbalanced electrocardiograms of atrial fibrillation, ventricular fibrillation, heart failure, and coronary heart disease on Group A were recorded, where the number of normal heartbeats was M(1-120) times that of each type of abnormal heartbeat. From Figure 3 , Figure 4 , Figure 5 , Figure 6 It can be seen that the values of recall and F1 score decreased as M increased, which indicates that the increase in imbalance had a negative impact on the ability of the proposed method to identify small-scale data. However, even when the normal samples were 20 times higher than each abnormal sample, the recall and F1 score of each type of heartbeat still exceeded 96%. More importantly, when M was 120, the method achieved a recall and F1 score of more than 90%. In addition, as shown in Figure 4 , Figure 5 , the precision and specificity of the method did not significantly decrease as M increased. When M changed from 1 to 120, their values exceeded 95% and 99.7%, respectively. Overall, the proposed method had excellent robustness to extremely imbalanced heartbeats.

[0117] Figure 7 , Figure 8 , Figure 9 , Figure 10 The confusion matrices and evaluation metrics for distinguishing two types of electrocardiograms on Groups B-E are shown, respectively. It can be seen that there was a significant imbalance between the two heartbeats in each group. According to Figure 7 , Figure 8 , Figure 9 , Figure 10 , the accuracy of distinguishing non-atrial fibrillation and atrial fibrillation, non-ventricular fibrillation and ventricular fibrillation, heart failure and non-heart failure, and coronary heart disease and non-coronary heart disease exceeded 95%. According to Figure 8 and Figure 10, only 0.02% and 0.37% of the heartbeats were misclassified, which shows that the proposed method has excellent performance in detecting AFIB and CAD patients. According to Figure 7 , only 3.83% of the non-AFib heartbeats were misclassified, while all the AFib heartbeats were correctly classified. In distinguishing non-CHF and CHF heartbeats, Figure 7 , it is shown that although the sensitivity of CHF class is only 80.47%, its precision is close to 100%. More importantly, a total of 95.46% of the heartbeats were correctly identified, with a misclassification rate of 4.54%. In summary, the proposed method can effectively detect AFib, VFib, CHF, or CAD on imbalanced ECGs among patients.

[0118] Figure 11 The classification results of five ECGs based on inter-patient experiments are shown. According to Figure 11 , the accuracy of distinguishing five types of ECGs is 96.62%, with only 3.38% of the heartbeats being misclassified. In terms of sensitivity, more than 97% is achieved by identifying normal, AFib, VFib, and CAD heartbeats. In identifying CHF heartbeats, although the sensitivity obtained is only 86.75, the precision and F1 score reach 98.94% and 92.44%, respectively. More importantly, for all types of heartbeats, the specificity and F1 score exceed 95% and 92%, respectively. Therefore, the proposed method has excellent performance in identifying unseen patients.

[0119] Figure 12 The experimental results of the present invention in noisy data are shown. According to Figure 12 , the proposed method achieved an accuracy of more than 90% on heartbeats containing Gaussian noise in groups B-E. More importantly, when the signal-to-noise ratio is 5dB, although the proposed algorithm achieved an accuracy of 89.73% and 84.7% in groups D and F, respectively, the accuracy of groups B-D still exceeds 92% even though the waveform of the heartbeat cannot be identified by the naked eye. In terms of power frequency noise, as Figure 13 shown, when the signal-to-noise ratio is -5dB, the accuracy of groups B-F still exceeds 91%, which shows that even if the ECG is severely disturbed by power frequency noise, the method of the present invention can still effectively distinguish ECGs to achieve effective classification of AFIB, VFIB, CHF, and CAD.

[0120] The application provides a cardiovascular disease intelligent identification method based on a multi-scale integrated network and a stacked attention mechanism. The method and approach for specifically implementing the technical solution are various, and the above description is only the preferred embodiment of the application. It should be pointed out that, for ordinary skilled persons in the technical field, several improvements and refinements can be made without departing from the principle of the application, and these improvements and refinements should also be regarded as the protection scope of the application. The components not explicitly described in the embodiment can be implemented by using the prior art.

Claims

1. A cardiovascular disease intelligent identification method based on a multi-scale integrated network and a stacked attention mechanism, characterized in that, Comprising the following steps: Step 1, preprocessing the electrocardio signal, first segmenting the electrocardio signal into single cycle heartbeats, using Pan-Tompkins detection method to locate the position of R peak; for each R peak, setting the previous peak and the next peak as R1 and R2 respectively; then, setting the point 0.1 seconds after R1 and the point before R2 as A1 and A2 respectively; at the same time, setting the point 0.06 seconds before R as point B1, and setting the point 0.06 seconds after R as point B2; finally, respectively resampling A1-B1, B1-B2 and B2-A2 to sampling points to obtain F1 segment, F2 segment and F3 segment; then connecting F1 segment, F2 segment and F3 segment into a heartbeat containing sampling points; Then the amplitude range of the heartbeat is normalized to 0-1 by the maximum minimum normalization algorithm, and reconstructed into an electrocardio matrix with size m*n; Where m represents the number of rows of the electrocardio matrix, and n represents the number of columns of the electrocardio matrix; Step 2, establishing five sub-networks, the structures of the five sub-networks are the same, all containing a multi-scale scanning module, a multi-angle convolution layer, a secondary convolution layer, a stacked attention mechanism module and a fully connected layer; the five sub-networks are respectively denoted as the first sub-network, the second sub-network, the third sub-network, the fourth sub-network and the fifth sub-network; Step 3, processing through the multi-angle convolution layer of the first sub-network; Step 4, processing through the multi-angle convolution layer of the second sub-network; Step 5, processing through the multi-angle convolution layer of the third sub-network; Step 6, processing through the multi-angle convolution layer of the fourth sub-network; Step 7, processing through the multi-angle convolution layer of the fifth sub-network; Step 8, processing through the secondary convolution layer of each sub-network; Step 9, processing through the stacked attention module of each sub-network; Step 10, processing through the fully connected layer of each sub-network; Step 11, evaluating the decision value of the feature of each sub-network through linear support vector machine LSVM; Step 12, fusing the decision values based on linear support vector machine LSVM of all sub-networks through the establishment of multi-power weighted average module MPWA to obtain the final classification result.

2. The method of claim 1, wherein, Step 2 includes: through the multi-scale scanning module of the first to fifth sub-networks, processing the electrocardio matrix as follows: dividing the electrocardio matrix into electrocardio data of different scales, first setting the double-lead electrocardio matrix as wherein represents the ith electrocardio matrix of the cth lead, N is the total number of electrocardio matrixes, c is the lead serial number, represents the real number space, using a square window with a side length of k x k = 3 x 3, 5 x 5 to scan each electrocardio matrix, thereby obtaining a series of data blocks wherein represents the mth data block of the ith electrocardio matrix of the cth lead, k is an odd number; remove the mean of all data blocks to obtain the mean-free data blocks then the sum is the first stage matrix wherein is the first stage matrix of the i-th electrocardiogram of the c-th lead, represents the mean-free data block of the mn-th data block of the i-th electrocardiogram of the c-th lead; Finally, the first-order to-be-processed matrix of all electrocardio matrixes of lead c is obtained 3. The method of claim 2, wherein, Step 3 includes: processing the initial matrix X using Task Relevant Component Analysis (TRCA) technique. c L1 task-related component analysis TRCA convolution kernels were obtained. Where g1(X) c ) is the TRCA convolution kernel extraction function for task-related component analysis. This represents the TRCA convolution kernel for the l1st task-related component analysis of the c-th lead electrocardiogram; Then, each convolution kernel is convolved with each electrocardiogram matrix to obtain a TRCA feature block wherein represents the 11th TRCA feature block of the i th electrocardiogram of the c th lead.

4. The method of claim 3, wherein, Step 4 includes: processing the initial matrix X using canonical correlation analysis (CCA) techniques. c The L2 canonical correlation analysis CCA convolution kernels of the electrocardiogram in lead c were obtained. Where g2(X) c () is the canonical correlation analysis (CCA) convolution kernel extraction function. This represents the 12th canonical correlation analysis CCA convolution kernel of the ECG in lead c; convolve each convolution kernel with each electrocardiogram matrix to obtain a canonical correlation analysis CCA feature block wherein represents the 12th canonical correlation analysis CCA feature block of the i th electrocardiogram of the c th lead.

5. The method of claim 4, wherein, Step 5 comprises: processing the primary to-be-processed matrix X by using an independent component analysis (ICA) technology c , thereby obtaining the L3 independent component analysis (ICA) kernels of the cth lead electrocardiogram , wherein g3(X c ) is an independent component analysis (ICA) kernel extraction function, represents the lth independent component analysis (ICA) kernel of the cth lead electrocardiogram convolve each convolution kernel with each electrocardiogram matrix to obtain independent component analysis, ICA, feature blocks wherein represents the 13th ICA feature block of the i th electrocardiogram of the c th lead.

6. The method of claim 5, wherein, Step 6 includes: using principal component analysis (PCA) technology to process the initial to-be-processed matrix X to obtain L4 PCA convolution kernels of the cth lead electrocardiogram c Wherein g4(X c ) is a principal component analysis (PCA) convolution kernel extraction function, represents the lth principal component analysis (PCA) convolution kernel of the cth lead electrocardiogram; then, each convolution kernel is convolved with each electrocardiogram matrix to obtain a principal component analysis (PCA) feature block Wherein represents the lth principal component analysis (PCA) feature block of the i th electrocardiogram of the cth lead.​ 7. The method of claim 6, wherein, Step 7 comprises: processing the primary to-be-processed matrix X by using a reliable component analysis (RCA) technology c , thereby obtaining L5 reliable component analysis (RCA) convolution kernels of the ECG of the cth lead , wherein g5(X c ) is a reliable component analysis (RCA) convolution kernel extraction function, represents the lth reliable component analysis (RCA) convolution kernel of the ECG of the cth lead convolve each convolution kernel with each electrocardiogram matrix to obtain reliable component analysis, RCA, feature blocks wherein represents the 15th reliable component analysis, RCA, feature block of the i-th electrocardiogram of the c-th lead.

8. The method of claim 7, wherein, Step 8 comprises: in the secondary convolutional layer, using a window with a size of k x k to scan the feature block with a step of 1 to obtain a series of secondary data blocks wherein β = 1, 2, …, 5; z = 1, 2, …, mn; represents the lth feature block obtained after processing the i th electrocardiogram by the multi-angle convolutional layer of the βth subnetwork β . The secondary data blocks are mean-removed and reconstructed into vectors wherein denotes reconstructed vectors; After all feature blocks are processed , according to Get the secondary to-be-processed matrix Y of all electrocardio matrices of the cth lead under the βth subnetwork c,β , wherein represents the lth secondary matrix of the ith electrocardio matrix of the cth lead under the βth subnetwork; β represents the splicing result of all secondary matrices of the ith electrocardio matrix of the cth lead under the βth subnetwork;​ Then, L6 reliable component analysis (RCA) convolution kernels are calculated where g5(X c ) is a reliable component analysis (RCA) convolution kernel extraction function, represents the z-th reliable component analysis (RCA) convolution kernel in the secondary convolution layer of the c-th lead electrocardiogram; finally, the secondary feature block (SLF) is calculated according to represents the secondary feature block obtained by sequentially performing convolution on the i-th electrocardiogram matrix of the c-th lead with the l-th convolution kernel of the multi-angle convolution layer and the z-th convolution kernel in the secondary convolution layer under the b-th sub-network. β convolution kernel of the multi-angle convolution layer and the z-th convolution kernel in the secondary convolution layer under the b-th sub-network.​ 9. The method of claim 8, wherein, Step 9 comprises: performing a stacked attention mechanism, first combining the secondary feature blocks of the first lead and the secondary feature blocks of the second lead to obtain a three-dimensional data block where C = 2, for representing the depth of each three-dimensional block; then, performing a first channel attention mechanism CAM according to formula (1) to obtain a primary weight matrix A C : where σ is a sigmoid function, MLP is a multi-layer perceptron, G avg and G max denote global average and max pooling procedures, respectively; Then, the first attention mapping result is calculated For the second channel attention mechanism CAM, the second weight matrix B is calculated according to formula (2) C : Then, a second attention map result is calculated For the third channel attention mechanism CAM, the third weight matrix F is calculated according to formula (3) C : According to the second attention mapping result Finally, the three-dimensional matrix is split into two two-dimensional feature matrices 10. The method of claim 9, wherein, Step 10 comprises converting each two-dimensional feature matrix into a binary matrix H(EL) according to equation (4) wherein EL represents an element in the group consisting of and the like. Then, according to The decimal matrix is calculated Next, through a dimension of u×u and an overlap rate of O rate Sliding window scanning decimal matrix Obtain local feature blocks in For the β-th subnetwork, the l-th β The p-th local feature block of all feature blocks under multi-angle convolution kernels, where P is the total number of local feature blocks; u represents the height and width of the sliding window; Next, by using the histogram statistical method, all feature blocks are processed to obtain feature vectors where f i β represents the feature vector of the i-th electrocardiogram matrix under the β-th sub-network, and hist() is a statistical histogram feature function. Finally, five types of feature vectors f i β , β = 1, 2, …, 5; Step 11 includes: after processing all f i β The five sets of distances between the samples and the decision hyperplane are obtained as decision values Where h represents the possible label of the i-th electrocardiogram matrix, H represents the total number of labels of all electrocardiograms; for each f i β The label with the highest value is used as the category of the ECG matrix, so as to obtain the total accuracy TA β ; Step 12 includes: using the maximum-minimum value normalization method to obtain the decision value of each electrocardio matrix corresponding to the h-th label Mapping to 0 to 1, obtaining the normalized decision value of the i-th electrocardio matrix corresponding to the h-th label under the β-th sub-network Secondly, for each electrocardio matrix, a multi-power weighted average method is constructed to fuse H decision values, using the m-th power of TA β As the weight to amplify the difference in importance between features, the weighted average value of all decision values is obtained according to equation (5): where v i,h,new is the new decision value of the i-th electrocardiogram corresponding to the h-th label; finally, the i-th electrocardiogram matrix has the highest h-th label as the predicted label result.