An electrocardiogram classification method based on improved parrot algorithm optimization residual network

By improving the Parrot algorithm and optimizing the ResNet network, and utilizing adaptive convergence factors and hybrid mutation strategies, the problem of local optima in ECG classification of the Parrot algorithm was solved, achieving higher classification accuracy and model performance.

CN120694656BActive Publication Date: 2026-02-24CHANGCHUN UNIV OF SCI & TECH
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510772554.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2026-02-24
Estimated Expiration
2045-06-11

AI Technical Summary

Technical Problem

The existing parrot algorithm has the problem of low initial population diversity in electrocardiogram classification, which makes it easy to get trapped in local optima and result in low classification accuracy.

Method used

An improved parrot algorithm is proposed by adopting an adaptive convergence factor and a hybrid Cauchy-Gaussian mutation strategy. The one-dimensional ResNet network model is optimized, population communication is enhanced by adaptive switching factors, and global search capability is improved by combining Cauchy and Gaussian mutation strategies to prevent getting trapped in local optima.

Benefits of technology

It improves the accuracy of electrocardiogram classification, avoids local optima, and enhances the classification performance and applicability of the model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120694656B_ABST
    Figure CN120694656B_ABST
Patent Text Reader

Abstract

The application discloses an electrocardiogram classification method based on an improved parrot algorithm optimized residual network, relates to the technical field of electrocardiogram classification based on a machine learning algorithm, and solves the problems of low initial population diversity of an existing parrot algorithm, easy falling of an optimization model into a local optimal solution, and low precision of a model classification result when an electrocardiogram classification and identification task is performed. The application extracts signal features from electrocardiogram signal data, divides the electrocardiogram signal data into a training set and a test set, constructs an electrocardiogram classification model of a ResNet, adopts two improved parrot algorithms of an adaptive convergence factor and a hybrid Cauchy Gaussian variation to optimize the classification model, updates the model by using optimized parameters, finally obtains a trained classification model, and inputs the test set into the trained classification model to realize accurate classification of electrocardiograms. The application has stronger global search capability and avoids the risk of falling into a local optimum. The classification effect of electrocardiogram data is more accurate.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of electrocardiogram (ECG) classification technology based on machine learning algorithms, and specifically to an ECG classification method based on an improved parrot algorithm optimized residual network (ResNet). Background Technology

[0002] Currently, applying machine learning algorithms to electrocardiogram (ECG) classification methods to construct an efficient ECG classification method can effectively improve the accuracy of ECG classification. This overcomes the limitation of existing classification models and enriches the application of machine learning algorithms in ECG classification. Many scholars have conducted research on ECG classification. For example, patent CN115153583A, entitled "A Method and System for ECG Signal Classification and Recognition Based on Feature Extraction," proposes an ECG signal classification and recognition method and system that analyzes continuous ECG signal time series through training and testing modes. This method extracts principal component data vectors of P waves, QRS waves, and T waves, and uses neural networks to model the nonlinear higher-order derivative features of time-varying data to better reflect the time-varying characteristics of ECG signals and improve fault tolerance to complex conditions. However, this invention is cumbersome and time-consuming in the feature extraction process, and is sensitive to noise; the feature extraction step may be sensitive to noise and artifacts in the data, affecting classification accuracy. The patent with publication number CN118469087A is entitled: "A combined prediction method for the calorific value of natural gas based on the parrot optimization algorithm". It uses the parrot optimization algorithm to solve the weight optimization model and combines the parrot optimization algorithm with strong optimization ability to establish a combined prediction model with higher prediction accuracy and stronger stability. However, the method using the traditional parrot algorithm has the problem of low initial population diversity and the optimization model is prone to getting trapped in local optima.

[0003] To address the problems existing in the above technologies, this invention adopts an improved parrot algorithm to optimize the one-dimensional ResNet network model, and improving the accuracy of electrocardiogram classification is the research focus of this invention. Summary of the Invention

[0004] This invention addresses the problems of low initial population diversity, susceptibility to local optima in optimization, and low accuracy in electrocardiogram (ECG) classification tasks caused by the existing Parrot algorithm. It provides an ECG classification method based on an improved Parrot algorithm and optimized residual networks. This method employs two improvement strategies—adaptive convergence factor and hybrid Cauchy-Gaussian mutation—to enhance global search capabilities and avoid the risk of getting trapped in local optima. Furthermore, the improved Parrot algorithm is used to optimize the ResNet network model parameters, further improving the model's classification performance and achieving greater accuracy in classifying ECG data.

[0005] An electrocardiogram (ECG) classification method based on an improved parrot algorithm with optimized residual networks is proposed. This method comprises the following steps:

[0006] Step 1: Obtain the electrocardiogram (ECG) dataset;

[0007] Step 2: Perform data preprocessing on the electrocardiogram dataset described in Step 1 to obtain noise-free electrocardiogram signal data;

[0008] Step 3: Extract ECG signal features from the ECG signal data described in Step 2, and divide the dataset from which features are extracted into a training set and a test set.

[0009] Step 4: Construct a ResNet ECG classification model. The ResNet ECG classification model uses a one-dimensional ResNet residual network. The training set is input into the ResNet residual network for ECG classification training. The parameters of the ResNet residual network are optimized using two improved parrot algorithms: adaptive convergence factor and hybrid Cauchy-Gaussian mutation. The optimized parameters are used to update the ResNet residual network, and finally, a trained ResNet neural network model is obtained.

[0010] Step 5: Input the test set into the trained ResNet neural network model to achieve accurate classification of electrocardiograms.

[0011] The beneficial effects of this invention are:

[0012] The electrocardiogram (ECG) classification method described in this invention employs two improvement strategies: adaptive switching factor and hybrid Cauchy-Gaussian mutation. The improved parrot optimization algorithm has stronger global search capabilities, avoiding the risk of getting trapped in local optima. The improved parrot algorithm is used to optimize the model parameters of the ResNet network, further enhancing the model's classification performance and resulting in more accurate classification of ECG data.

[0013] The electrocardiogram (ECG) classification method of this invention extracts heartbeat signals from an ECG dataset, using the R-wave position as the localization point, and extracts an estimated number of sampling points before and after the R-wave to form a heartbeat sample dataset. The first 70% of the extracted heartbeat sample dataset is used as the training set for training; the last 30% of the ECG dataset is used as the test set for classification.

[0014] The electrocardiogram (ECG) classification method described in this invention utilizes a ResNet model built based on an improved parrot algorithm and optimized ResNet network for ECG classification. This method can categorize ECGs into five subclasses: NORM (normal), MI (myocardial infarction), CD (cardiac conduction block), STTC (ST / T wave aberration), and HYP (hypertrophic myocardial infarction). The ResNet model effectively extracts features from the data through convolutional operations. Compared to traditional manually designed feature extraction methods, the ResNet model can learn more discriminative feature representations, thus exhibiting better versatility and applicability on complex datasets.

[0015] The electrocardiogram classification method described in this invention optimizes the ResNet-based model using an improved parrot algorithm. The improved parrot algorithm searches for the global optimum to prevent the model from getting stuck in local optima. The parameters of the ResNet model are optimized and adjusted to their optimal values ​​to achieve accurate classification. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating the overall process of an electrocardiogram classification method based on an improved parrot algorithm and optimized residual network, as described in this invention.

[0017] Figure 2 This is a residual block structure diagram in the electrocardiogram classification method based on the improved parrot algorithm to optimize the residual network described in this invention;

[0018] Figure 3 This is a flowchart of the data preprocessing process in the electrocardiogram classification method based on the improved parrot algorithm and optimized residual network described in this invention.

[0019] Figure 4 This is a flowchart of the improved parrot algorithm optimizing ResNet combinatorial model in the electrocardiogram classification method based on the improved parrot algorithm optimizing the residual network described in this invention;

[0020] Figure 5 This is a schematic diagram illustrating the R-wave annotation of ECG data in an electrocardiogram classification method based on an improved parrot algorithm and optimized residual network, as described in this invention.

[0021] Figure 6 This is a comparison of the loss function curves of the Parrot Algorithm and the improved Parrot Algorithm in the electrocardiogram classification method based on the improved Parrot Algorithm to optimize the residual network described in this invention. Detailed Implementation

[0022] Combination Figures 1 to 6 This embodiment describes an electrocardiogram (ECG) classification method based on an improved parrot algorithm to optimize residual networks. The method is implemented through the following steps:

[0023] Step 1: Obtain a usable electrocardiogram (ECG) dataset;

[0024] Step 2: Perform data preprocessing on the ECG data obtained in Step 1 to obtain noise-free electrocardiogram signal data;

[0025] Before analyzing electrocardiogram (ECG) signals, denoising preprocessing is required. For example... Figure 3 As shown, all ECG signal data are padded to a uniform length and normalized. Then, an adaptive wavelet threshold denoising method is used for denoising. The acquired ECG signal data includes ECG sample data, classification labels, and the correspondence between the two.

[0026] This paper describes a method for denoising signals using wavelet transform combined with a threshold setting. The process involves first inputting a noisy signal, then performing wavelet scaling, followed by wavelet thresholding for denoising, wavelet coefficient reconstruction, and finally obtaining the denoised signal. The specific steps are as follows:

[0027] The wavelet scaling decomposition involves analyzing and selecting a reasonable wavelet function and a specific decomposition scale to perform target layer decomposition on a noisy signal at a specific scale.

[0028] The wavelet threshold denoising process involves setting a threshold to select wavelet coefficients from the signal scale decomposition. If the amplitude of a wavelet coefficient is lower than the threshold, it is considered to be caused by noise, and the decomposition coefficient is discarded.

[0029] In traditional wavelet thresholding denoising methods, the threshold settings for wavelet coefficients at each layer are constant, resulting in poor adaptability and less than ideal denoising performance.

[0030] Therefore, as Figure 3 As shown in this embodiment, an adaptive wavelet thresholding denoising method is proposed. It adaptively adjusts the threshold according to the distribution of noise, and its threshold function can realize a variety of different soft and hard features through variable parameters. The adaptive threshold selection method realizes the innovation of adaptive wavelet denoising.

[0031] Threshold function selection: In the threshold quantization process, there are two common threshold functions: soft threshold and hard threshold. The hard threshold function is as follows:

[0032]

[0033] in, λ represents the wavelet coefficients after thresholding. e Given a threshold; |W ek | represents the absolute value of the wavelet coefficients;

[0034] The soft threshold function is as follows:

[0035]

[0036] in, W represents the wavelet coefficients after thresholding. jk For wavelet coefficients, λ j For the threshold of the high-frequency coefficients of the j-th layer, |W jk | represents the absolute value of the wavelet coefficients; sgn() is the sign function.

[0037] This embodiment proposes a parametric threshold function. To overcome the problems of discontinuity at the threshold in traditional hard threshold functions and loss of some high-frequency information caused by soft threshold functions, the new threshold function is as follows:

[0038]

[0039] Among them, w lk These are wavelet coefficients. The wavelet coefficients after thresholding, where α is a variable and λ is a variable. l The threshold value is the high-frequency coefficient of the l-th layer.

[0040] By using windows of different sizes to better represent the time and frequency domains of a signal, the aim is to address the non-stationarity of the signal. Time windows of varying lengths provide resolution for low and high frequencies respectively, making wavelet transform a suitable technique for pattern recognition of irregular data. For example, the Adaptive Wavelet Transform (AWT) for a continuous signal is defined as follows:

[0041]

[0042] As can be seen from the above formula, the wavelet transform has two variables: scale *a* and shift *τ*. Scale *a* controls the scaling of the wavelet function, and shift *τ* controls the translation of the wavelet function. f(t) represents the original function, and w is the wavelet function. Scale *a* corresponds to frequency (inversely proportional), and shift *τ* corresponds to time.

[0043] Wavelet coefficient reconstruction: Wavelet coefficients after one-dimensional wavelet reconstruction decomposition;

[0044] In summary, the signal is first transformed into different scale spaces using wavelet transform, then thresholding is used to filter out noise, which is then discarded, and finally reconstructed to obtain a noise-free signal.

[0045] Step 3: Feature Extraction of ECG Signals. After data denoising, to better classify ECG signals, feature extraction of the ECG signal is necessary. This involves extracting the positions of key waveforms from the ECG signal data as labels for subsequent reconstruction tasks. One common method for ECG signal feature extraction is to use the R-wave position as the localization point, extracting estimated sample numbers before and after it, and integrating the ECG sample data, classification labels, and their correspondence into a dataset. The dataset is then divided into training and validation sets according to a preset ratio.

[0046] In ECG image waveforms, the R-wave group has the most prominent features and the highest energy. Using the R-wave position as a location point, the estimated number of sampling points is extracted before and after it. To basically encompass all waveform characteristics, 8000 sample points are extracted before and after it, totaling 16001 sample points, to form an ECG sample dataset, which serves as the model input samples.

[0047] R-wave labeling as follows: Figure 5 As shown in the figure, the upper image is the ECG after denoising, and the lower image is the ECG after R-wave annotation. R-wave detection is achieved through a fixed differential threshold. The basic principle is to set a fixed peak threshold as a limiting condition. Generally, the capture condition threshold is set by acquiring the maximum and minimum values ​​of the ECG signal over a certain period of time. x represents the ECG data, and the calculation formula is as follows:

[0048] Threshhold=(max(x)-min(x))×0.7+min(x)

[0049] The model was trained using the first 70% of the obtained heartbeat sample dataset as the training set and the last 30% of the obtained heartbeat sample dataset as the test set for classification. An improved parrot algorithm was constructed to optimize the ResNet ECG classification model. The improved parrot algorithm was used to perform a global optimum search to prevent getting trapped in local optima. The parameters of the ResNet model were optimized to achieve accurate classification of ECGs. The ECG data can be divided into five subclasses: normal (NORM), myocardial infarction (MI), cardiac conduction block (CD), ST / T wave abnormality (STTC), and myocardial hypertrophy (HYP).

[0050] Step 4: Construct a ResNet ECG classification model. This model introduces a one-dimensional ResNet residual network. The training set after feature extraction is input into the ResNet residual network for ECG classification. Further optimization is performed using two improved parrot optimization algorithms, one with adaptive switching factor and the other with mixed Cauchy-Gaussian mutation, to obtain the optimized ResNet residual network.

[0051] An improvement on the original parrot algorithm;

[0052] In the communication phase of the parrot optimization algorithm, when the population gets stuck in a local optimum, it cannot effectively escape it. An adaptive convergence factor strategy is used to encourage more inter-population communication in the later stages of iteration, reducing inefficient information propagation. This can be represented as follows:

[0053] Y i t =K[X i (t-1)·e -kt +rand·(X best (t)-X i (t-1))]

[0054] In the formula, The location of population communication X after adding an adaptive convergence factor i (t) represents a reference variable or position at time t, X best (t) represents the optimal position or value at time t during the population exchange phase. After adding the convergence factor K, when the population position is close to the global optimum, and the second term of the velocity update formula is 0, the parrot's position will not be updated, resulting in stagnation. If this happens, the i-th position of the population is reinitialized to enhance population vitality and avoid getting stuck in a local optimum due to stagnation.

[0055] In the iterative process of the traditional parrot optimization algorithm, the rapid assimilation of individual parrots may cause the population to cluster around the current optimal position, thus getting trapped in local optima and failing to find the global optimum. Mutation operators are introduced to disturb individuals, increasing population diversity and helping them escape local optima. Therefore, an adaptive Gaussian-Cauchy hybrid mutation strategy is proposed, which combines the advantages of Cauchy mutation and Gaussian mutation.

[0056]

[0057] In the formula, The iteration position is represented by W1 and W2, which are weighting coefficients indicating the relative importance of different perturbations after fusing the adaptive Gaussian-Cauchy hybrid mutation strategy. Gauss(σ) represents a Gaussian (normal) random perturbation with standard deviation σ, and Couchy(σ) represents a Cauchy random perturbation with scale parameter σ. The random perturbations adjusted by W1 and W2 are used to explore the solution space and find new potential solutions. Gaussian and Cauchy perturbations provide different probability distribution characteristics to simulate different exploration behaviors or strategies.

[0058] like Figure 4 As shown, the process of optimizing the ResNet residual network using the improved parrot algorithm is as follows:

[0059] Step 4.1 Initialize the parameters of the (random) ResNet residual network; including the search location. Population size, Max iter The maximum number of iterations is 1000, the lower bound of the search space limit is 1, and the upper bound is 2.

[0060]

[0061] Where rand(0,1) represents a random number in the range [0,1].

[0062] Step 4.2: Determine the three parameters that need to be optimized for the ResNet residual network: the number of iterations of the ResNet residual network, the initial learning rate, and the regularization parameter.

[0063] Step 4.3: Initialize the improved parrot algorithm. Input the three determined optimization parameters into the improved parrot algorithm for parameter iterative optimization; expressed as follows:

[0064]

[0065] In the formula, X best This represents the optimal value of the parameters from the initial search to the current best position. This represents the position of particle i in iteration t+1. This indicates the position of particle i in iteration t; This indicates the population communication position after adding the adaptive convergence factor. Max represents the iteration position after fusing the adaptive Gaussian-Cauchy hybrid mutation strategy. iter This indicates the maximum number of iterations.

[0066] Step 4: Determine if the maximum number of iterations (Max) has been reached. iter If so, output the optimized ResNet network parameters using the improved parrot algorithm; otherwise, return to step four-three until the number of iterations equals the maximum number of iterations (Max). iter The iteration stops, and the three parameters of the optimized ResNet network are output: the number of iterations, the initial learning rate, and the regularization parameter.

[0067] Steps four and five: Update the ResNet residual network using the optimized three parameters, and input the training set into the ResNet residual network for training. During training, the classification loss function is used to calculate the deviation between the true value and the predicted value. The smaller the loss value, the more similar the true value and the predicted value are. The classification loss function is calculated through the constructed ResNet neural network, and the waveform detection loss function is calculated through the constructed network structure. The final loss function is obtained based on the calculated classification loss function and waveform detection loss function.

[0068] The formula for calculating the classification loss function is as follows:

[0069]

[0070] In the formula, S is the preprocessed electrocardiogram (ECG) sequence, Y is the category label, p() function predicts the probability that the current ECG belongs to a certain category, N is the number of categories, and y n It is the nth category.

[0071] The formula for calculating the loss function of waveform detection is:

[0072]

[0073] In the formula, S is the preprocessed electrocardiogram sequence, X represents the waveform position label, M is the total number of samples, C represents the confidence label, m represents the m-th sample, and λ coord λ represents the coefficients for regression of x relative to the x-coordinate. noobj These are coefficients representing the prediction results calculated for meshes without objects, used to control the proportion of positive and negative examples contributing to the results. and The value is 1 if there is an object or not, and 0 otherwise. and x represents the predicted true relative position and true confidence level of the object, respectively. m and c m These represent the relative position of the object predicted by the current model and the confidence level, respectively.

[0074] After detecting the R-wave and applying the classification loss function, the final loss function is as follows:

[0075]

[0076] In the formula, X R Labels indicating key locations of the R wave, C R Indicates the confidence level label for the R wave; L cla For the classification loss function, L dct-R This is the loss function for the R waveform.

[0077] By selecting the correct loss function to calculate the correlation between waveform factors and ECG data and the deviation from the true value, the network can be better constrained, allowing the network training to reach its optimal state.

[0078] like Figure 6 As shown, Figure 6The graph compares the loss function changes of the Parrot algorithm and the improved Parrot algorithm during model training. As the number of training epochs increases, the loss function gradually decreases, approaching 0, indicating a gradual increase in the optimization effect on the model. In contrast, the improved Parrot algorithm decreases faster than the standard Parrot algorithm, resulting in better model performance optimization. The initial learning rate was set to 0.001. When the training set loss function did not decrease for three consecutive epochs, the learning rate was reduced to one-tenth of its original value. Training ended if it did not decrease for five consecutive epochs, saving the best model parameters at each stage. Finally, the model was trained, and the trained model can be used for ECG detection and classification. Since the R wave is the most prominent in ECG waveforms, the model focuses more on the R wave, allowing it to concentrate on key ECG waveforms and thus improving model performance.

[0079] The specific process of training the ResNet electrocardiogram classification model:

[0080] ResNet residual network is a variant of CNN that uses residual blocks to train deeper neural networks. The structure of a residual block is as follows: Figure 2 As shown:

[0081] The ResNe residual network consists of multiple residual blocks chained together. After the data enters the model, it first passes through a convolutional layer (Conv), a batch normalization layer (BN), and a ReLU activation layer (ReLU) in sequence. Then it is divided into two parts: one part goes directly through a max pooling layer and a fully connected layer (Dense), and the other part goes through a series of layers before being added together. This design avoids the gradient vanishing problem during the training of deep networks and makes the network easier to train.

[0082] Step 5: Input the divided heart rate sample data test set into the trained model to obtain the ECG classification results, and evaluate the model's classification performance based on the classification results.

[0083] This embodiment also includes evaluation metrics for the model's classification performance, specifically accuracy and the area under the AUC (area of ​​difference). The AUC value is a numerical value between 0 and 1, used to measure the performance of the classification model. The higher the AUC value, the better the model's classification performance.

[0084]

[0085] TP represents true positives: the number of samples correctly predicted as positive by the model; tN represents true negatives: the number of samples correctly predicted as negative by the model; FP represents false positives: the number of samples incorrectly predicted as positive by the model; FN represents false negatives: the number of samples incorrectly predicted as negative by the model. Table 1 compares the performance of the improved parrot algorithm-optimized residual network model with other models.

[0086] Table 1

[0087] Model Accuracy AUC Resent 81.14% 0.8229 CNN 85.05% 0.8816 LSTM 86.53% 0.9060 IPO-Resent 88.18% 0.9198

[0088] As shown in Table 1, the classification performance data of the residual network optimized based on the improved parrot algorithm and other common models are compared. It can be seen that the model proposed in this invention has a significant advantage over other models.

[0089] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0090] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. An electrocardiogram (ECG) classification method based on an improved parrot algorithm with optimized residual networks, characterized by: This method is implemented by the following steps: Step 1: Obtain the electrocardiogram (ECG) dataset; Step 2: Perform data preprocessing on the electrocardiogram dataset described in Step 1 to obtain noise-free electrocardiogram signal data; Step 3: Extract ECG signal features from the ECG signal data described in Step 2, and divide the dataset from which features are extracted into a training set and a test set. Step 4: Construct a ResNet ECG classification model. The ResNet ECG classification model uses a one-dimensional ResNet residual network. The training set is input into the ResNet residual network for ECG classification training. The parameters of the ResNet residual network are optimized using two improved parrot algorithms: adaptive convergence factor and hybrid Cauchy-Gaussian mutation. The optimized parameters are used to update the ResNet residual network, and finally, a trained ResNet neural network model is obtained. Step 5: Input the test set into the trained ResNet neural network model to achieve accurate classification of electrocardiograms.

2. The electrocardiogram classification method based on an improved parrot algorithm and optimized residual network according to claim 1, characterized in that, Step two, data preprocessing, includes normalizing and denoising the acquired electrocardiogram (ECG) data; the specific process is as follows: The electrocardiogram signal data is padded to a uniform length and then normalized. Then, an adaptive wavelet threshold denoising method was used to denoise the electrocardiogram signal; In the adaptive wavelet threshold denoising method, a parameter threshold function is introduced to achieve adaptive wavelet denoising and obtain noise-free electrocardiogram signal data; expressed by the following formula: In the formula, sgn() is the sign function, and w lk For wavelet coefficients, |w lk | represents the absolute value of the wavelet coefficients; α is a variable. λ represents the wavelet coefficients after thresholding. l The threshold value is the high-frequency coefficient of the l-th layer.

3. The electrocardiogram classification method based on an improved parrot algorithm and optimized residual network according to claim 1, characterized in that: In step three, the process of extracting the electrocardiogram signal is as follows: Using the R-wave position as the location point, the estimated number of sample points is extracted before and after the R-wave. The number of sample points is used as the sample heartbeat dataset. The sample heartbeat dataset includes an electrocardiogram dataset integrated from electrocardiogram sample data, classification labels, and the correspondence between the two. The electrocardiogram dataset was divided into a training set and a test set.

4. The electrocardiogram classification method based on an improved parrot algorithm and optimized residual network according to claim 1, characterized in that: The specific process of training the ResNet residual network is as follows: Step 4.1 Initialize the search location of the ResNet residual network Population size is N, maximum number of iterations is Max iter The search space limits are the lower bound lb and the upper bound ub; Step 42: Determine the parameters for optimizing the ResNet residual network, namely: the number of iterations of ResNet, the initial learning rate, and the regularization parameters; Step 4.3: The parameters of the ResNet residual network are iteratively optimized using two improved parrot algorithms: adaptive convergence factor and hybrid Cauchy-Gaussian mutation. This is expressed as: In the formula, X best This represents the optimal value of the parameters from the initial search to the current best position. The position of particle i in iteration (t+1) is shown above; This indicates the position of particle i in iteration t; This indicates the population communication position after adding the adaptive convergence factor. This represents the iteration position after incorporating the adaptive Gaussian-Cauchy hybrid mutation strategy; Step 4: Determine if the maximum number of iterations (Max) has been reached. iter If so, output the parameters of the ResNet residual network after optimization using the improved parrot algorithm and proceed to steps four and five; otherwise, return to step four and three until the number of loops equals the maximum number of iterations (Max). iter The iteration stops, and the optimized ResNet residual network parameters are output. Steps four and five: Update the ResNet residual network using the optimized three parameters, input the training set into the updated ResNet residual network for training, and constrain the network according to the final loss function output by the network to obtain the trained ResNet residual network.

5. The electrocardiogram classification method based on an improved parrot algorithm and optimized residual network according to claim 4, characterized in that: The parameters of the ResNet residual network are optimized using two improved parrot algorithms: adaptive convergence factor and hybrid Cauchy-Gaussian mutation; expressed as follows: Y i t =K[X i (t-1)·e -kt +rand·(X best (t)-X i (t-1))] In the formula, K is the adaptive convergence factor, rand() is the random number generation function, and X... i (t-1) represents a reference variable or position at time t-1, X best (t) represents the optimal position or value at time t; An adaptive Gaussian-Cauchy hybrid mutation strategy, which combines the advantages of both Cauchy and Gaussian mutations, is expressed by the following formula: In the formula, The iteration position is defined by the fusion of the adaptive Gaussian-Cauchy hybrid mutation strategy, where W1 and W2 are weight coefficients, Gauss(σ) is the Gaussian random perturbation with standard deviation σ, and Cauchy(σ) is the Cauchy random perturbation with scale parameter σ.

6. The electrocardiogram classification method based on the improved parrot algorithm and optimized residual network according to claim 4, characterized in that: During the training of the ResNet residual network, the classification loss function and the waveform detection loss function are calculated. The final loss function is obtained based on these calculated loss functions. The final loss function is expressed as follows: In the formula, S is the preprocessed electrocardiogram sequence, Y is the category label, X is the waveform location label, C is the confidence label, and X0 is the confidence level label. R Labels for R-wave location, C R For the confidence label of the R wave; L cla For the classification loss function, L dct-R This is the loss function for the R waveform.

7. The electrocardiogram classification method based on an improved parrot algorithm and optimized residual network according to claim 6, characterized in that: The formula for calculating the classification loss function is: In the formula, S is the preprocessed electrocardiogram (ECG) sequence, Y is the category label, P() function predicts the probability that the current ECG belongs to a certain category, N is the number of categories, and y n It is the nth category.

8. The electrocardiogram classification method based on the improved parrot algorithm and optimized residual network according to claim 6, characterized in that: The formula for calculating the loss function of the waveform detection is as follows: In the formula, S is the preprocessed electrocardiogram sequence, X represents the waveform position label, M is the total number of samples, C represents the confidence label, m represents the m-th sample, and λ coord λ represents the coefficients for regression of x relative to the x-coordinate. noobj The coefficients represent the prediction results calculated for meshes without objects, and are used to control the proportion of positive and negative examples contributing to the results; and The value is 1 if there is an object or not, and 0 otherwise. and x represents the predicted true relative position and true confidence level of the object, respectively. m and c m These represent the relative position of the object predicted by the current model and the confidence level, respectively.

Citation Information

Patent Citations

  • Electrocardiosignal classification and identification method and system based on feature extraction

    CN115153583A

  • Natural gas calorific value combined prediction method based on parrot optimization algorithm

    CN118469087A

  • Power load combination prediction method and system, electronic equipment and medium

    CN119315528A

  • Control method of double-closed-loop direct-current speed regulation system based on improved parrot algorithm

    CN119472819A