Arrhythmia classification method and system for optimizing long-term memory network and support vector machine based on whale algorithm, product and medium
Through the whale algorithm, the combination of long-term memory network and support vector machine is optimized, and the noise interference and small sample problems in ECG signal classification are solved, and the high-accuracy arrhythmia classification is achieved, and the denoising quality and classification performance of ECG signal are improved.
Patent Information
- Application Number
- CN202510516558.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-08-08
AI Technical Summary
Existing ECG signal classification methods are difficult to achieve accurate classification, especially the identification and diagnosis of arrhythmia when facing noise interference, multi-sample problems and small-sample problems.
The combination method of long-term memory network and support vector machine is used to optimize the denoising and classification process of electrocardiogram signals through variational modal decomposition, wavelet threshold denoising, synthesis of a few oversampling technologies and model fusion.
It significantly improves the denoising quality and classification accuracy of the ECG signal, enhances the adaptability and generalization ability of the model, solves the problem of small samples, and reduces the misdiagnosis rate.
Smart Images

Figure CN120448938A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of biomedical engineering, and specifically relates to an arrhythmia classification method, system, product and medium based on whale algorithm optimization of long-term memory network and support vector machine. Background Art
[0002] Arrhythmia is a disease that seriously affects a patient's quality of life and even their safety. Its classification and diagnosis are of great clinical significance. Electrocardiogram (ECG) is the primary method for arrhythmia diagnosis. By analyzing the characteristics of ECG signals, different types of arrhythmias can be effectively identified and differentiated. However, ECG signals are often affected by various noise artifacts, such as motion artifacts and electrode position variations, which can seriously affect the accurate identification of arrhythmias.
[0003] In addition, arrhythmias come in many types and in various forms, making accurate classification challenging. Existing arrhythmia classification methods mainly include traditional machine learning-based methods and deep learning-based methods. Traditional machine learning methods such as support vector machines (SVM) and random forests (RF) often perform poorly when processing complex data. Deep learning-based methods such as convolutional neural networks (CNN) and recurrent neural networks (RNN) can capture the deep features of the data, but are often inefficient when processing long time series data and are prone to overfitting.
[0004] Furthermore, the small sample size of ECG signals is another challenge facing existing technologies. ECG signal acquisition often requires specific environments, and due to significant differences between individuals, the number of available training samples is limited. This makes it difficult for the classifier to learn sufficient features during training, thus affecting classification accuracy. Summary of the Invention
[0005] The purpose of the present invention is to provide a method, system, product and medium for classifying arrhythmias based on the whale algorithm to optimize the long-term memory network and support vector machine, so as to reduce misdiagnosis caused by noise interference and electrocardiogram signal characteristics.
[0006] The purpose of the present invention is achieved through the following technical solutions:
[0007] The arrhythmia classification method based on the whale algorithm optimized long-term memory network and support vector machine is as follows:
[0008] Step 1: Obtain ECG signal data and preprocess the data;
[0009] Step 2: Based on the preprocessed data, the Whale Algorithm (WOA) is used to optimize the parameters of the variational mode decomposition algorithm, and then combined with the wavelet threshold denoising VMD-WT.
[0010] Step 3: Generate training and test sets based on the denoising results, and use the synthetic minority oversampling technique (SMOTE) to expand the number of samples in the training set;
[0011] Step 4: Input the expanded training set samples into the long short-term memory network model LSTM and the support vector machine model SVM respectively to obtain the classification results of the two models;
[0012] Step 5: Use the weighted average method to fuse the classification results of the two models in step 4 to obtain the final ECG classification result.
[0013] Furthermore, the electrocardiogram signal data acquired in step 1 is divided into four categories according to AAMI: N normal or bundle branch block beat, S supraventricular abnormal beat, V ventricular abnormal beat, and F fusion beat.
[0014] Furthermore, step 2 first confirms the modal number K and the penalty factor α as parameters to be optimized, sets the dimension to 2, sets the upper and lower boundaries of K to 3 and 7 respectively, sets the upper and lower boundaries of α to 100 and 2000 respectively, determines the population size of WOA to be 50, and the maximum number of iterations to be 20; then uses the information entropy evaluation index as the fitness function to obtain the decomposition result of the optimal value; then uses the optimized parameters to perform VMD decomposition to obtain several modal components, first performs wavelet transform on each modal component, and then processes the wavelet coefficients according to a specific threshold processing strategy; finally, obtains the denoised modal components through inverse wavelet transform, and sums these components to obtain the final denoised signal.
[0015] Furthermore, the step 2 is processed using wavelet decomposition with wavelet coefficient db6:
[0016]
[0017] Among them, x i is the threshold of the ith IMF function, N is the signal length, f i is the signal data related to the i-th IMF;
[0018] The specific threshold function is:
[0019]
[0020] where ω j,k is the wavelet decomposition coefficient, W j,k is the wavelet coefficient after threshold processing. Finally, the denoised modal components are obtained through inverse wavelet transform, and the final denoised signal is obtained by summing these components.
[0021] Furthermore, step 3 adds a corresponding category label to each denoised signal data in step 2, and then divides the data set into a training set and a test set in a ratio of 8:2 according to the random principle, and uses SMOTE to expand the number of samples in the training set.
[0022] Furthermore, in step 4, WOA is used to optimize and adjust the number of units in the LSTM three-layer structure, the penalty parameter C of the SVM, and the kernel parameter of the radial basis kernel function. The LSTM population size is set to 5, the maximum number of iterations is 20, and the parameter dimension LSTM is 3, corresponding to the number of three-layer units; the SVM population size is set to 50, the maximum number of iterations is 100, and the parameter dimension is 2, corresponding to the penalty parameter C and the kernel parameter; the fitness functions of the two models are the same, and the error value of the model on the test set is used as the fitness function; the accuracy between the prediction result and the true label is calculated and the error value is obtained by taking the inverse; guided by error minimization, WOA is driven to continuously approach the parameter combination that makes the model have the lowest error on the test set during the parameter search process.
[0023] Furthermore, in step 5, P LSTM (i) represents the predicted probability vector of the LSTM model for the i-th sample, P SVM (i) represents the predicted probability vector of the WOA-SVM model for the i-th sample, ω LSTM and ω SVM are the fusion weights of the corresponding models, and satisfy ω LSTM +ω SVM =1; then the prediction probability vector P of the fusion model for the i-th sample fusion (i) The calculation formula is as follows:
[0024] P fusion (i) = ω LSTM ×P LSTM (i)+ω SVM ×P SVM (i)
[0025] When determining the final classification results, select P fusion The category with the largest probability value in (i) is taken as the fusion prediction category of the sample.
[0026] A computer device / equipment / system comprises a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of an arrhythmia classification method based on optimizing a long-term memory network and a support vector machine using a whale algorithm.
[0027] A computer-readable storage medium stores a computer program / instruction, which, when executed by a processor, implements the steps of an arrhythmia classification method based on optimizing a long-term memory network and a support vector machine using a whale algorithm.
[0028] A computer program product includes a computer program / instruction, which, when executed by a processor, implements the steps of an arrhythmia classification method based on whale algorithm optimization of long-term memory network and support vector machine.
[0029] The beneficial effects of the present invention are:
[0030] This invention uses the whale algorithm to optimize the parameters of the variational mode decomposition (VMD) algorithm to improve the quality of ECG signal denoising. It also combines long short-term memory networks (LSTMs) and support vector machines for classification, and by fusing the classification results of the two models, it improves classification accuracy. Compared with existing technologies, this invention has the following advantages:
[0031] 1. Reduce misdiagnosis rate: By optimizing the denoising algorithm, reduce noise interference and improve classification accuracy.
[0032] 2. Improve adaptability: The combination of long short-term memory network and support vector machine enables the model to adapt to different types of arrhythmias.
[0033] 3. Enhanced generalization ability: The model shows good performance on both the training set and the test set.
[0034] 4. Solve the small sample problem: Expand the number of samples through synthetic minority oversampling technology (SMOTE) and perform model fusion between long short-term memory network and support vector machine to improve the overall classification accuracy.
[0035] The classification model of the present invention not only automatically extracts features from ECG signals but also finds an optimal hyperplane that maximizes the separation between two classes of samples. For a small number of samples, a support vector machine (SVM) can more accurately find a classification boundary because it doesn't require extensive adjustments to accommodate a large number of data points. Therefore, a model combining a long short-term memory network (LSTM) and a support vector machine (SVM) can achieve both high classification efficiency for a large number of samples and accurate classification for a small number of samples. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 Flowchart for the model optimization based on the whale algorithm;
[0037] Figure 2 Classify AAMI ECG signals;
[0038] Figure 3 This is the WOA-VMD flow chart;
[0039] Figure 4 Comparison of four types of signals before and after denoising;
[0040] Figure 5 is the confusion matrix of the three models;
[0041] Figure 6 Comparison of evaluation indicators of three types of models. DETAILED DESCRIPTION
[0042] The present invention will be further described below with reference to the accompanying drawings.
[0043] The present invention provides a method, system, product and medium for classifying arrhythmias based on the whale algorithm to optimize the long-term memory network and support vector machine. This method is based on existing biomedical engineering technology and algorithms, improves and optimizes algorithm parameters, improves the quality of electrocardiogram signal denoising, and combines the advantages of long-term memory network and support vector machine to achieve accurate classification of arrhythmias. This method not only improves the accuracy of classification, but also has high clinical application value, can effectively identify arrhythmias, and provide patients with timely and effective treatment plans. Figure 1 , the specific steps of the present invention are as follows:
[0044] Step 1: Obtain ECG signal data and preprocess the data.
[0045] Get ECG signal data, according to Figure 2 The obtained ECG signals are divided into five categories according to AAMI: N (normal or bundle branch block beat), S (supraventricular abnormal beat), V (ventricular abnormal beat), F (fusion beat), and Q (unclassified beat). Figure 2 As shown, since Q is an unclassifiable signal, the present invention only classifies four types of signals: N, S, V, and F.
[0046] Step 2: Perform variational mode decomposition combined with wavelet threshold denoising (VMD-WT) on the ECG signal.
[0047] ECG signals usually contain multiple frequency components. Variational modal decomposition is an effective signal decomposition method that can decompose ECG signals into multiple modal components. These modal components can better reflect the characteristics of ECG signals and help with subsequent classification processing. In order to improve the decomposition effect, the present invention uses the whale algorithm (WOA) to optimize the parameters of the variational modal decomposition algorithm to obtain the best decomposition effect. The decomposed modal components may still contain noise components, affecting the subsequent classification accuracy. The present invention uses a threshold wavelet denoising method to denoise the modal components to improve signal quality. The denoised modal components will more accurately reflect the true characteristics of the ECG signal.
[0048] according to Figure 3 The specific steps are as follows:
[0049] First, we identified two key parameters in VMD: the modal number K and the penalty factor α. Their dimension was set to 2. Based on experience and preliminary analysis of ECG signal characteristics, we set upper and lower bounds for K to 3 and 7, respectively, and for α to 100 and 2000, respectively. We also set the population size of the WOA to 50 and the maximum number of iterations to 20.
[0050] In the WOA VMD parameter optimization process, an information entropy-based evaluation metric is used as the fitness function. The goal is to guide the algorithm to find the parameter combination that minimizes the uncertainty of the signal after VMD decomposition, thereby achieving the best decomposition effect. Through a series of iterative optimizations, the optimal value is determined. The information entropy calculation steps are as follows:
[0051] Assume there are M data sequences in total. For the i-th sequence (i=1,2,…,M), the data is represented as u[i,:]. First, perform Hilbert transform on the given i and remove the absolute value to obtain the sequence H i , for H i Each element H in ij (j=1,2,…n), calculate the probability p ij :
[0052]
[0053] Then calculate the information entropy e, and all the calculated e ij Add together to get the information entropy E of the i-th sequence i , the information entropy E of all M sequences i After adding, divide by M to get the final average information entropy s:
[0054] e ij =-p ij log2(p ij )
[0055]
[0056] Next, the optimized parameters are used to perform VMD decomposition to obtain several modal components. The specific steps are as follows:
[0057] (1) Through Hilbert transform, we can get each μ k The analytical signal of (t):
[0058]
[0059] (2) Through exponential correction, each μ k (t) Adjust to the corresponding baseband:
[0060]
[0061] By analyzing the Gaussian smoothness of the signal, that is, the square norm of the signal echelon, each u is estimated k (t) width, construct a constrained variational problem:
[0062]
[0063] Among them, μ k (t) represents the k mode functions obtained by VMD decomposition, ω k Represents the frequency center of each modal component. In order to find the optimal solution to the variational problem, the quadratic penalty factor α and the Lagrangian operator λ(t) are introduced to transform the constrained variational problem into an unconstrained variational problem. The augmented Lagrangian expression is as follows:
[0064]
[0065] Then, wavelet threshold denoising technology is used for each modal component. First, wavelet transform is performed, and a fixed threshold method is used to process the wavelet decomposition with a wavelet coefficient of db6:
[0066]
[0067] Among them, x i is the threshold of the ith IMF function, and N is the signal length. The threshold function is as follows:
[0068]
[0069] Among them, ω j,k is the wavelet decomposition coefficient, W j,k is the wavelet coefficient after threshold processing. Finally, the denoised modal components are obtained through inverse wavelet transform, and the final denoised signal is obtained by summing these components.
[0070] The Whale Algorithm (WOA) simulates whale foraging behavior, updating the position of each individual in the population by simulating whales' behaviors such as surrounding prey, attacking with a bubble net, and random search, thereby finding the global optimal solution. It mainly consists of three phases: surrounding prey, attacking with a bubble net, and searching for prey. The specific algorithm steps are as follows:
[0071] (1) Surrounding the prey
[0072] In the "surrounding prey" phase, the WOA algorithm simulates the behavior of whales surrounding their prey. Since the location of the optimal solution is unknown during the search process, the algorithm considers the current best candidate solution as the prey. Other search agents adjust their positions according to the following equation to approach or find the optimal solution:
[0073] D=|C·X * (t)-X(t)|
[0074] X(t+1)=X * (t)-A·D
[0075] Where t represents the current iteration number, A and C are coefficient vectors, and .X * (t). is the position vector of the best solution currently obtained, and X(t) is the position vector. If a better solution exists, X needs to be adjusted in each iteration step. * (t) is updated. A and C are calculated as follows:
[0076] A=2×a×r1-a
[0077] C=2×r2
[0078] where a is a linearly decreasing weight from 2 to 0, and r1 and r2 are random vectors in [0,1].
[0079] (2) Bubble net predation
[0080] Humpback whales have two main hunting mechanisms: encirclement and bubble net. Since humpback whales exhibit two different hunting methods when approaching prey, WOA will choose between bubble net and encirclement based on probability p. The position update formula is as follows:
[0081]
[0082] Where D' is the distance between the current search individual and the current optimal solution, b is the spiral shape parameter, l is a uniformly distributed random number in the range [-1, 1], and p is the probability of the predation mechanism, a random number in the range [0, 1].
[0083] (3) Searching for prey
[0084] To ensure the comprehensiveness of the search, WOA uses |A| to control whether it is in the search phase or the surround phase. When |A| < 1, the whales gradually surround the current optimal solution, which belongs to the local optimization phase. When |A| ≥ 1, the whales will perform random searches based on each other's positions. The mathematical description is as follows:
[0085] D”=|C·X rand (t)-X(t)|
[0086] X(t+1)=X rand (t)-A·D
[0087] Among them, D” is the distance between the current search individual and the random individual, X rand (t) is the current position of the random individual.
[0088] according to Figure 4 , it can be seen that after the above denoising process, the noise in the ECG signal is significantly reduced, and the features that were originally affected by the noise are now more prominent. This provides clearer and more representative data for subsequent ECG signal classification tasks, enabling the classification model to more accurately capture key information in the signal, thereby effectively improving the performance and reliability of classification, and laying a solid data preprocessing foundation for the accuracy of the entire ECG signal classification research.
[0089] Step 3: Divide the dataset and use the synthetic minority oversampling technique (SMOTE) to expand the number of training set samples.
[0090] The small sample size of ECG signals limits the classifier's learning ability and accuracy. To address this issue, this paper uses synthetic minority oversampling technology to expand the denoised ECG signal samples. SMOTE technology increases the sample size by synthesizing new sample points, thereby improving the classifier's learning ability for minority classes.
[0091] The present invention aims to classify four types of signals: normal heart rhythm (N), supraventricular premature beats (S), ventricular premature beats (V), and ventricular fusion heartbeats (F). First, for the CSV files of these four types of signals, the redundant header information or irrelevant first line data that may exist in the file is removed to ensure the purity and availability of the data. Subsequently, a corresponding category label is added to each piece of data, where the N type signal is marked as 0, the V type is marked as 1, the S type is marked as 2, and the F type is marked as 3, so that the subsequent classification model can accurately identify signal data of different categories. The processed data of these four categories are then integrated into a complete data set, and the integrated data set is divided into a training set and a test set according to a ratio of 80% and 20%. The division process follows the randomization principle to ensure that both the training set and the test set can reasonably cover all types of signal data, so that the trained model has good generalization ability and accuracy. The divided training set is used for model training and parameter optimization, while the test set is specifically used to evaluate the performance of the trained model. The performance on the test set is used to measure the accuracy of the model in classifying the four types of signals and its application potential on unknown data, ultimately providing reliable data support and evaluation basis for the signal classification task of the entire experiment.
[0092] The small sample size of ECG signals limits the classifier's learning ability and accuracy. To address this issue, this paper uses synthetic minority oversampling technology to expand the denoised ECG signal samples. SMOTE technology increases the sample size by synthesizing new sample points, thereby improving the classifier's learning ability for minority classes.
[0093] Step 4: Input the expanded samples into the long short-term memory network (LSTM) and support vector machine (SVM) models for classification.
[0094] Long short-term memory (LSTM) networks are a special type of recurrent neural network that can capture long-term dependencies in ECG signals, improving classification accuracy. Support vector machines (SVMs) are classifiers based on statistical learning theory and have strong generalization capabilities. This paper inputs the expanded samples into both LSTM and SVM models, leveraging their respective strengths for classification.
[0095] Whether using LSTM or SVM, the performance of the model is highly dependent on the settings of key parameters. The core goal of this technology is to optimize the number of units in the LSTM three-layer structure, the SVM penalty parameter C, and the kernel parameters of the radial basis kernel function using WOA, thereby enhancing the model's classification ability for the four types of ECG signals (N, S, V, and F).
[0096] Parameters to be optimized and their impact:
[0097] LSTM model:
[0098] Number of LSTM units in the first layer: As the layer that directly interacts with the input ECG signal, the number of units in the first layer determines its ability to extract preliminary features from the original signal. Too few units can easily miss key signal features; too many units can lead to overfitting and poor adaptability to new data.
[0099] The number of LSTM units in the second layer is responsible for deepening and integrating the features extracted in the first layer. Insufficient number of units will result in insufficient feature mining, while too many units will increase model complexity and cause overfitting.
[0100] The number of LSTM units in the third layer directly affects the quality of the model's output. Too few units will not generate sufficiently discriminative feature vectors; too many units will increase computational costs and training difficulty.
[0101] SVM model
[0102] Penalty parameter C: Its value directly determines the degree of penalty for misclassified samples. Smaller C values allow more misclassified samples, which can enhance the model's generalization ability but may reduce training accuracy. Larger C values encourage the model to fit the training data well, but can easily lead to overfitting.
[0103] Kernel parameter: This parameter primarily controls the distribution of data in the feature space after radial basis kernel mapping, determining the influence range of each sample point. A larger kernel parameter reduces the influence range of a sample point, causing the model to focus on local details and be prone to overfitting. A smaller kernel parameter expands the influence range of a sample point, allowing the model to consider global features, but may lose local information and affect classification accuracy.
[0104] The LSTM population size was set to 5, the maximum number of iterations was set to 20, and the parameter dimension of LSTM was set to 3, corresponding to the number of units in the three layers. The SVM population size was set to 50, the maximum number of iterations was set to 100, and the parameter dimension was set to 2, corresponding to the penalty parameter C and kernel parameter. The fitness function for both models is the same, using the model error on the test set as the fitness function. The error is calculated by negating the accuracy between the predicted result and the true label. With error minimization as the guide, WOA continuously approaches the parameter combination that minimizes the model error on the test set during the parameter search process, thereby improving model performance.
[0105] Step 5: Fusion the classification results of the two models.
[0106] The LSTM and SVM models may provide different classification results. To improve overall classification accuracy, the present invention uses a weighted average method to fuse the classification results of the two models. By fusing the classification results of the two models, the present invention can obtain a more accurate and reliable final classification result.
[0107] The above is only the core idea of this weighted average fusion, which is to assign corresponding weights based on the performance of different models in the classification process, and then linearly combine the prediction results of each model according to the weights to obtain the final fusion prediction result. For the ECG signal classification problem in this study, assuming P LSTM (i) represents the predicted probability vector of the LSTM model for the i-th sample, P SVM (i) represents the predicted probability vector of the WOA-SVM model for the i-th sample, ω LSTM and ω SVM are the fusion weights of the corresponding models, and satisfy ω LSTM +ω SVM =1. Then the prediction probability vector P of the fusion model for the i-th sample is fusion (i) The calculation formula is as follows:
[0108] P fusion (i) = ω LSTM ×P LSTM (i)+ω SVM ×P SVM (i)
[0109] When determining the final classification results, select P fusion The category with the largest probability value in (i) is taken as the fusion prediction category of the sample. For example, if P fusion In (i), the probability of the corresponding category C1 is the largest, so the sample is classified as category C1. The flowchart is as follows Figure 5 shown.
[0110] In order to fully understand the superiority of the joint model, we analyze the confusion matrix of the model. Figure 6 As shown in the confusion matrix comparison, the joint model successfully combines the advantages of the Whale Optimization Algorithm-based Long Short-Term Memory (WOA-LSTM) and Support Vector Machine (WOA-SVM). In terms of specific classification performance, the joint model's classification accuracy for category 0 exceeds that of the LSTM alone, while its classification accuracy for categories 1, 2, and 3 is superior to that of the SVM alone. This fully demonstrates that the joint model effectively combines the capabilities of the WOA-LSTM in processing sequential data with the advantages of the WOA-SVM in classification accuracy, achieving improved performance. Table 1 further verifies the above conclusions and confirms the effectiveness of the WOA-LSTM-SVM joint model in improving classification accuracy and consistency. This study provides a new approach for future research in ECG signal classification and related fields. The high level of performance and consistency demonstrates that this method has the potential for widespread adoption in practical applications in healthcare and beyond.
[0111] Table 1
[0112]
[0113] The functions of the arrhythmia classification system based on the whale algorithm to optimize the long-term memory network and support vector machine of the present invention can be described by the aforementioned arrhythmia classification method based on the whale algorithm to optimize the long-term memory network and support vector machine. The system includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method described in the above embodiment. Various programs and data required for the operation of the rescue response system are also stored in RAM 303. CPU 301, ROM 302 and RAM 303 are connected to each other via bus 304. Input / output (I / O) interface 305 is also connected to bus 304.
[0114] The following components are connected to the I / O interface 305: an input section 306 including an audio input device, a push button switch, and the like; an output section 307 including a liquid crystal display (LCD), an audio output device, an indicator light, and the like; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card or a modem. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. Removable media 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, and the like, is installed in the drive 310 as needed so that computer programs read therefrom can be installed into the storage section 308 as needed.
[0115] In particular, according to an embodiment of the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present invention includes a computer program product that includes a computer program carried on a computer-readable medium, the computer program including a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 309 and / or installed from a removable medium 311. When the computer program is executed by the central processing unit (CPU) 301, the various functions defined in the present invention are performed.
[0116] It should be noted that specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0117] Specifically, the arrhythmia classification system based on the whale algorithm to optimize the long-term memory network and support vector machine in this embodiment includes a processor and a memory, and a computer program is stored in the memory. When the computer program is executed by the processor, the arrhythmia classification method based on the whale algorithm to optimize the long-term memory network and support vector machine provided in the above embodiment is implemented.
[0118] As another aspect, the present invention further provides a computer-readable storage medium, which may be included in the arrhythmia classification system based on the whale algorithm-optimized long-term memory network and support vector machine described in the above embodiments; or it may exist independently and not be incorporated into the arrhythmia classification system based on the whale algorithm-optimized long-term memory network and support vector machine. The above storage medium carries one or more computer programs, which, when executed by a processor of the arrhythmia classification system based on the whale algorithm-optimized long-term memory network and support vector machine, enable the arrhythmia classification system based on the whale algorithm-optimized long-term memory network and support vector machine to implement the arrhythmia classification method based on the whale algorithm-optimized long-term memory network and support vector machine provided in the above embodiments.
[0119] As described above, the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the above embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
Claims
1. Arrhythmia classification method based on whale algorithm optimization of long-term memory network and support vector machine, characterized by: The specific steps are as follows: Step 1: Obtain ECG signal data and preprocess the data; Step 2: Based on the preprocessed data, the Whale Algorithm (WOA) is used to optimize the parameters of the variational mode decomposition algorithm, and then combined with the wavelet threshold denoising VMD-WT. Step 3: Generate training and test sets based on the denoising results, and use the synthetic minority oversampling technique (SMOTE) to expand the number of samples in the training set; Step 4: Input the expanded training set samples into the long short-term memory network model LSTM and the support vector machine model SVM respectively to obtain the classification results of the two models; Step 5: Use the weighted average method to fuse the classification results of the two models in step 4 to obtain the final ECG classification result.
2. The arrhythmia classification method based on whale algorithm optimization of long-term memory network and support vector machine according to claim 1, characterized in that: The electrocardiogram signal data obtained in step 1 is divided into four categories according to AAMI: N normal or bundle branch block beat, S supraventricular abnormal beat, V ventricular abnormal beat, and F fusion beat.
3. The arrhythmia classification method based on whale algorithm optimization of long-term memory network and support vector machine according to claim 1, characterized in that: In step 2, the modal number K and the penalty factor α are first confirmed as parameters to be optimized, the dimension is set to 2, the upper and lower boundaries of K are set to 3 and 7 respectively, the upper and lower boundaries of α are set to 100 and 2000 respectively, the population size of WOA is determined to be 50, and the maximum number of iterations is determined to be 20; then, the information entropy evaluation index is used as the fitness function to obtain the decomposition result of the optimal value; then, VMD decomposition is performed using the optimized parameters to obtain several modal components, each modal component is first subjected to wavelet transform, and then the wavelet coefficients are processed according to a specific threshold processing strategy; finally, the denoised modal components are obtained by inverse wavelet transform, and these components are summed to obtain the final denoised signal.
4. The arrhythmia classification method based on whale algorithm optimization of long-term memory network and support vector machine according to claim 3 is characterized by: Step 2 is processed using wavelet decomposition with wavelet coefficient db6: Among them, x i is the threshold of the ith IMF function, N is the signal length, f i is the signal data related to the i-th IMF; The specific threshold function is: Among them, ω j,k is the wavelet decomposition coefficient, W j,k is the wavelet coefficient after threshold processing. Finally, the denoised modal components are obtained through inverse wavelet transform, and the final denoised signal is obtained by summing these components.
5. The arrhythmia classification method based on whale algorithm optimization of long-term memory network and support vector machine according to claim 1, characterized in that: In step 3, each denoised signal data in step 2 is added with a corresponding category label, and then the data set is divided into a training set and a test set in a ratio of 8:2 according to the random principle, and the number of samples in the training set is expanded using SMOTE.
6. The arrhythmia classification method based on whale algorithm optimization of long-term memory network and support vector machine according to claim 1, characterized in that: In step 4, WOA is used to optimize and adjust the number of units in the LSTM three-layer structure, the penalty parameter C of the SVM, and the kernel parameter of the radial basis kernel function. The LSTM population size is set to 5, the maximum number of iterations is 20, and the parameter dimension LSTM is 3, corresponding to the number of three-layer units; the SVM population size is set to 50, the maximum number of iterations is 100, and the parameter dimension is 2, corresponding to the penalty parameter C and the kernel parameter; the fitness functions of the two models are the same, and the error value of the model on the test set is used as the fitness function; the error value is obtained by calculating the accuracy between the prediction result and the true label and taking the inverse; guided by error minimization, WOA is driven to continuously approach the parameter combination that gives the model the lowest error on the test set during the parameter search process.
7. The arrhythmia classification method based on whale algorithm optimization of long-term memory network and support vector machine according to claim 1, characterized in that: In step 5, P LSTM (i) represents the predicted probability vector of the LSTM model for the i-th sample, P SVM (i) represents the predicted probability vector of the WOA-SVM model for the i-th sample, ω LSTM and ω SVM are the fusion weights of the corresponding models, and satisfy ω LSTM +ω SVM =1; then the prediction probability vector P of the fusion model for the i-th sample fusion (i) The calculation formula is as follows: P fusion (i)=ω LSTM ×P LSTM (i)+ω SVM ×P SVM (i) When determining the final classification results, select P fusion The category with the largest probability value in (i) is taken as the fusion prediction category of the sample.
8. A computer device / apparatus / system comprising a memory, a processor, and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
9. A computer-readable storage medium having a computer program / instruction stored thereon, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer program product comprising a computer program / instructions, characterized in that: When the computer program / instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.