Electrocardiogram classification method for optimizing residual network based on improved parrot algorithm
By improving the Parrot algorithm to optimize the ResNet network and using the adaptive convergence factor and mixed Cauchy-Gaussian mutation strategy, the problems of low population diversity and local optimality of the Parrot algorithm in electrocardiogram classification are solved, and higher classification accuracy is achieved.
Patent Information
- Application Number
- CN202510772554.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-11
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2045-06-11
AI Technical Summary
The existing Parrot algorithm has low initial population diversity in electrocardiogram classification and is prone to falling into local optimal solutions, resulting in low classification accuracy.
The adaptive convergence factor and hybrid Cauchy-Gauss mutation strategy are used to improve the Parrot algorithm and optimize the one-dimensional ResNet network model. The adaptive switching factor is used to enhance population communication. The Cauchy-Gauss mutation strategy is combined to increase the global search capability and prevent falling into the local optimum.
The accuracy of ECG classification is improved, local optimal solutions are avoided, the classification performance of the model is improved, and the classification effect of ECG data is more accurate.
Smart Images

Figure CN120694656A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electrocardiogram classification based on machine learning algorithms, and in particular to an electrocardiogram classification method based on a residual network (Residual Network, ResNet) optimized by an improved Parrot algorithm. Background Art
[0002] At present, applying machine learning algorithms to electrocardiogram classification methods and constructing an efficient electrocardiogram classification method can effectively improve the accuracy of electrocardiogram classification. It makes up for the single problem of existing classification model solutions and enriches the content of applying machine learning algorithms to electrocardiogram classification. Many scholars have conducted research on the problem of electrocardiogram classification. For example, the patent with publication number CN115153583A, entitled: A method and system for classifying and identifying electrocardiogram signals based on feature extraction, proposes a method and system for classifying and identifying electrocardiogram signals, which analyzes continuous electrocardiogram signal time series through training and testing modes. The method extracts the principal component data vectors of P waves, QRS waves, and T waves, and uses neural networks to model the nonlinear high-order derivative features of time-varying data to better reflect the time-varying characteristics of electrocardiogram signals and improve the fault tolerance to complex condition changes. However, the feature extraction process of this invention is cumbersome and time-consuming, and it is sensitive to noise. The feature extraction step may be sensitive to noise and artifacts in the data, affecting the classification accuracy. The patent publication number is CN118469087A, and its name is: A natural gas calorific value combined prediction method based on the Parrot optimization algorithm. The Parrot optimization algorithm is used to solve the weight optimization model, and the Parrot optimization algorithm with strong optimization ability is combined to establish a combined prediction model with higher prediction accuracy and stronger stability. However, this method uses the traditional Parrot algorithm, which has the problem of low initial population diversity and the optimization model easily falls into the local optimal solution.
[0003] In response to the problems existing in the above technologies, the present invention adopts the improved Parrot algorithm to optimize the one-dimensional ResNet network model, and improving the accuracy of electrocardiogram classification is the research focus of the present invention. Summary of the Invention
[0004] In order to solve the problems of low initial population diversity and easy local optimal solution of the optimization model in the existing Parrot algorithm, as well as low accuracy of model classification results when performing electrocardiogram classification and recognition tasks, the present invention provides an electrocardiogram classification method based on the improved Parrot algorithm to optimize the residual network. By using two improvement strategies, adaptive convergence factor and mixed Cauchy-Gaussian mutation, this method has a stronger global search capability and avoids the risk of falling into local optimality. The improved Parrot algorithm is used to optimize the model parameters of the ResNet network, so that the classification performance of the model is further improved, and the classification effect of electrocardiogram data is more accurate.
[0005] An electrocardiogram classification method based on an improved Parrot algorithm to optimize a residual network is implemented by the following steps:
[0006] Step 1: Obtain the electrocardiogram dataset;
[0007] Step 2: preprocessing the electrocardiogram data set described in step 1 to obtain noise-free electrocardiogram signal data;
[0008] Step 3: extracting electrocardiogram signal features from the electrocardiogram signal data described in step 2, and dividing the feature-extracted data set into a training set and a test set;
[0009] Step 4: Construct a ResNet electrocardiogram classification model. The ResNet electrocardiogram classification model adopts a one-dimensional ResNet residual network. The training set is input into the ResNet residual network for electrocardiogram classification training. The parameters of the ResNet residual network are optimized using two improved Parrot algorithms, namely, adaptive convergence factor and mixed Cauchy-Gaussian mutation. The ResNet residual network is updated using the optimized parameters to finally obtain a trained ResNet neural network model.
[0010] Step 5: Input the test set into the trained ResNet neural network model to achieve accurate classification of the electrocardiogram.
[0011] Beneficial effects of the present invention:
[0012] The electrocardiogram classification method described in the present invention uses two improvement strategies, namely, an adaptive switching factor and a mixed Cauchy-Gaussian mutation. The improved Parrot optimization algorithm has a stronger global search capability, avoids the risk of falling into local optimality, and uses the improved Parrot algorithm to optimize the model parameters of the ResNet network, so that the classification performance of the model is further improved, and the classification effect of the electrocardiogram data is more accurate.
[0013] The electrocardiogram classification method described in the present invention extracts heartbeat signals from an electrocardiogram dataset, using the R-wave position as a positioning point and extracting an estimated number of sampling points before and after the interception to form a heartbeat sample dataset. The first 70% of the intercepted heartbeat sample dataset is used as the training set for training; the last 30% of the electrocardiogram dataset is used as the test set for classification.
[0014] The electrocardiogram (ECG) classification method described herein utilizes a ResNet model optimized using the improved Parrot algorithm to classify ECGs into five subcategories: NORM (normal), MI (myocardial infarction), CD (heart block), STTC (ST / T wave abnormalities), and HYP (hypertrophy). The ResNet model effectively extracts features from data through convolution operations. Compared to traditional manually designed feature extraction methods, the ResNet model can learn more discriminative feature representations, resulting in improved versatility and applicability across complex datasets.
[0015] The electrocardiogram classification method described in the present invention uses the improved Parrot algorithm to optimize the ResNet model, uses the improved Parrot algorithm to search for the global optimal value, prevents the model from falling into the local optimal value, optimizes the parameters of the ResNet model, adjusts the parameters to the optimal value, and realizes accurate classification of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 This is an overall flow chart of the electrocardiogram classification method based on the improved Parrot algorithm optimized residual network according to the present invention;
[0017] Figure 2 This is a diagram of the residual block structure in the electrocardiogram classification method based on the improved Parrot algorithm to optimize the residual network described in the present invention;
[0018] Figure 3 This is a data preprocessing flow chart of the electrocardiogram classification method based on the improved Parrot algorithm to optimize the residual network according to the present invention;
[0019] Figure 4 This is a flow chart of the improved Parrot algorithm optimizing the ResNet combined model in the electrocardiogram classification method based on the improved Parrot algorithm optimizing the residual network described in the present invention;
[0020] Figure 5 This is a schematic diagram of R-wave annotation of electrocardiogram data in an electrocardiogram classification method based on an improved Parrot algorithm optimized residual network according to the present invention;
[0021] Figure 6 This is a comparison diagram 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 the present invention. DETAILED DESCRIPTION
[0022] Combine Figures 1 to 6 This embodiment describes an electrocardiogram classification method based on an improved Parrot algorithm to optimize a residual network. The method is implemented by the following steps:
[0023] Step 1: Obtain an available electrocardiogram (ECG) dataset;
[0024] Step 2: preprocess the ECG data obtained in step 1 to obtain noise-free electrocardiogram signal data;
[0025] Before analyzing the ECG signal, it needs to be pre-processed for noise removal. Figure 3 As shown in Figure 2, all ECG signal data are padded to a uniform length and normalized. Then, adaptive wavelet threshold denoising is used to denoise the data. The collected ECG signal data includes ECG sample data, classification labels, and the corresponding relationship between the two.
[0026] The idea of wavelet transform is combined with the method of setting threshold to denoise the signal. First, the noisy signal is input, decomposed by wavelet scale, and denoised by wavelet threshold. The wavelet coefficients are reconstructed and the denoised signal is finally obtained. The specific process is as follows:
[0027] The wavelet scale decomposition: by analyzing and selecting a reasonable wavelet function and a specific decomposition scale, the noisy signal is decomposed into a target number of layers of a specific scale;
[0028] The wavelet threshold denoising process: setting a threshold to select the wavelet coefficients decomposed from the signal scale. If the amplitude of the wavelet coefficient is lower than the threshold, it is considered to be caused by noise and the decomposition coefficient is discarded.
[0029] In the traditional wavelet threshold denoising method, since the setting of the wavelet coefficient threshold of each layer is constant, the use of a fixed threshold has poor adaptability and the denoising effect is not ideal.
[0030] Therefore, if Figure 3 As shown, in this embodiment, an adaptive wavelet threshold denoising method is proposed, which can adaptively modify 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, and realize the innovation of adaptive wavelet denoising through an adaptive threshold selection method.
[0031] Selection of threshold function: In the threshold quantization process, there are two conventional threshold functions: soft threshold and hard threshold function; the hard threshold function is as follows:
[0032]
[0033] in, is the wavelet coefficient after threshold processing, λ e is a given threshold; |W ek | is the absolute value of the wavelet coefficient;
[0034] The soft threshold function is as follows:
[0035]
[0036] in, is the wavelet coefficient after threshold processing, W jk is the wavelet coefficient, λ j is the threshold of the high-frequency coefficient of the jth layer, |W jk | is the absolute value of the wavelet coefficient; sgn() is the sign function.
[0037] In this embodiment, a parameter threshold function is proposed. To overcome the problem that the traditional hard threshold function is discontinuous at the threshold and the soft threshold function causes some high-frequency information to be lost, the new threshold function is as follows:
[0038]
[0039] Among them, w lk is the wavelet coefficient, is the wavelet coefficient after threshold processing, α is a variable, λ l is the threshold of the high-frequency coefficients of the lth layer.
[0040] The purpose of using windows of different sizes to better represent the time and frequency domain of the signal is to solve the problem of signal non-stationarity. Different time windows provide low-frequency and high-frequency resolution respectively, which makes the wavelet transform a suitable technique for irregular data pattern recognition. For example, the adaptive wavelet transform (AWT) of 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 translation τ. Scale a controls the expansion and contraction of the wavelet function, and translation τ 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 translation τ corresponds to time.
[0043] Wavelet coefficient reconstruction: One-dimensional wavelet reconstruction of the wavelet coefficients after decomposition;
[0044] In general, the signal is first converted into different scale spaces through wavelet transform, and then the noise is filtered out through threshold processing, and then the noise is discarded, and finally reconstructed back to obtain a noise-free signal.
[0045] Step 3: Feature extraction of the ECG signal. After data denoising is complete, ECG signal feature extraction is required to better perform ECG classification. The locations of key waveforms are extracted from the ECG signal data as labels for the subsequent reconstruction task. A common method for ECG signal feature extraction is to use the R-wave position as the positioning point, intercepting the estimated number of sampling points before and after, and integrating the ECG sample data, classification labels, and the corresponding relationship between the two into a dataset. The dataset is then divided into a training set and a validation set according to a preset ratio.
[0046] In ECG image waveforms, the R wave group has the most distinct characteristics and the highest energy. Using the R wave position as the anchor point, we estimated the number of sample points forward and backward. To encompass all waveform characteristics, we collected 8,000 sample points forward and backward, totaling 16,001 points, as an ECG sample dataset, which served as model input.
[0047] R waves are marked as Figure 5 As shown in the figure, the upper figure is the ECG after the ECG signal is denoised, and the lower figure is the ECG after the R wave is annotated. 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 obtaining 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 first 70% of the obtained heartbeat sample data set is used as the training set for training, and the last 30% of the obtained heartbeat sample data set is used as the test set for classification. An improved Parrot algorithm is constructed to optimize the ResNet electrocardiogram classification model. The improved Parrot algorithm is used to perform global optimal search to prevent falling into local optimality. The parameters of the ResNet model are optimized to achieve accurate classification of the electrocardiogram. The electrocardiogram data can be divided into five subclasses: normal (NORM), myocardial infarction (MI), heart 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 divided after feature extraction is input into the ResNet residual network for ECG classification. The optimized ResNet residual network is obtained by further optimizing the improved Parrot optimization algorithm using the adaptive switching factor and the mixed Cauchy-Gaussian mutation.
[0051] Improvements to the original Parrot algorithm;
[0052] During the communication behavior phase of the Parrot optimization algorithm, when the population is stuck in a local optimum, it cannot effectively escape the local optimum. Using the adaptive convergence factor strategy, the Parrots can be encouraged to communicate more with each other in the later stages of the iteration, reducing inefficient information dissemination behavior, which can be expressed as follows:
[0053] Y i t =K[X i (t-1)·e -kt +rand·(X best (t)-X i (t-1))]
[0054] Where, The population communication position X after adding the 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 communication phase. After adding the convergence factor K, when the population position approaches the global optimal position and the second term of the speed update formula is 0, the parrot position will not be updated, resulting in stagnation. If this occurs, the population position i is reinitialized to enhance population vitality and avoid falling into a local optimum due to stagnation.
[0055] During the iterations of the traditional parrot optimization algorithm, the rapid assimilation of individual parrots can cause the population to cluster near the current optimal position, resulting in a local optimum and preventing the discovery of a global optimal solution. Introducing a mutation operator to perturb individuals increases the diversity of the population and helps escape local optima. Therefore, an adaptive Gaussian-Cauchy hybrid mutation strategy is proposed, combining the advantages of both Cauchy and Gaussian mutations.
[0056]
[0057] Where, The iterative position after integrating the adaptive Gaussian-Cauchy hybrid mutation strategy. W1 and W2 are weight coefficients representing the relative importance of different perturbations. Gauss(σ) represents a Gaussian (normal) random perturbation with a standard deviation of σ, and Couchy(σ) represents a Cauchy random perturbation with a scale parameter of σ. The random perturbations adjusted by W1 and W2 are used to explore the solution space and search for new potential solutions. Gaussian and Cauchy perturbations provide different probability distribution characteristics, which are used to simulate different exploration behaviors or strategies.
[0058] like Figure 4 As shown in Figure 2, the process of optimizing the ResNet residual network of the improved Parrot algorithm is:
[0059] Step 4.1. Initialize (randomly) the parameters of the ResNet residual network; including the search position Population size, Max iter The maximum number of iterations is 1000, the lower bound lb of the search space limit is 1, and the upper bound ub is 2;
[0060]
[0061] Among them, 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; namely, the number of iterations of the ResNet residual network, the initial learning rate, and the regularization parameter;
[0063] Step 43: Initialize the improved Parrot algorithm and input the three optimized parameters into the improved Parrot algorithm for parameter cycle optimization; it can be expressed as follows:
[0064]
[0065] Where, X best Indicates the optimal position from the initial search to the current search, and the optimal value of the parameter optimization; represents the position of particle i at iteration t+1, represents the position of particle i at iteration t; represents the population exchange position after adding the adaptive convergence factor, Represents the iterative position after integrating the adaptive Gauss-Cauchy hybrid mutation strategy, Max iter Indicates the maximum number of iterations.
[0066] Step 4. Determine whether the maximum number of iterations Max has been reached iter If yes, then output the ResNet network parameters after the improved Parrot algorithm optimization; otherwise, return to step 43 until the number of cycles is equal to the maximum number of iterations Max iter , the iteration stops and the three parameters of the optimized ResNet network are output, namely: the number of ResNet iterations, the initial learning rate, and the regularization parameter;
[0067] Steps 4 and 5: Update the ResNet residual network using the optimized three parameters, input the training set into the ResNet residual network for training. During the training process, 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 using the constructed ResNet neural network, and the waveform detection loss function is calculated using the constructed network structure. The final loss function is derived based on the calculated classification loss function and the waveform detection loss function.
[0068] The calculation formula of the classification loss function is:
[0069]
[0070] Where S is the preprocessed ECG sequence, Y is the category label, the p() function is the probability of predicting that the current ECG belongs to a certain category, N is the number of categories, and y n is the nth category.
[0071] The calculation formula of the loss function of waveform detection is:
[0072]
[0073] Where S is the preprocessed ECG sequence, X represents the waveform position label, M is the total number of samples, C represents the confidence label, m represents the mth sample, and λ coord Indicates the coefficient of x-relative coordinate regression, λ noobj Represents the coefficient of the prediction result calculated for the grid without objects, which is used to control the contribution ratio of positive and negative examples to the results. and The value is 1 when there is an object or no object, otherwise it is 0; and Represent the true relative position and true confidence of the predicted object, x m and c m They represent the relative position and confidence of the object predicted by the current model respectively.
[0074] After detecting the R wave and adding the classification loss function, the final loss function is as follows:
[0075]
[0076] Where, X R Labels indicating key positions of R waves, C R Indicates the confidence label of the R wave; L cla is the classification loss function, L dct-R is the R waveform loss function.
[0077] By choosing the correct loss function to calculate the deviation between the correlation between the waveform factor and the ECG data and the true value, the network can be better constrained and the network training can be optimized.
[0078] like Figure 6 As shown, Figure 6This figure compares the loss function changes of the Parrot algorithm and the improved Parrot algorithm during model training. As the number of training rounds increases, the loss function gradually decreases, approaching 0, and the optimization effect on the model gradually increases. In comparison, the improved Parrot algorithm shows a faster decrease than the Parrot algorithm, resulting in better optimization of model performance. The initial learning rate is set to 0.001. When the loss function of the training set does not decrease for three consecutive rounds, the learning rate is reduced to one-tenth of the original value. If it does not decrease for five consecutive rounds, training is terminated, and the best model parameters are saved each time. Finally, the model is trained and used for ECG detection and classification. Since the R wave is the most prominent in the ECG waveform, the model focuses more on the R wave, allowing the model to focus on the key ECG waveform, thereby improving model performance.
[0079] The specific process of training the ResNet ECG classification model:
[0080] ResNet is a variant of CNN that introduces residual blocks to train deeper neural networks. The structure of the residual block is as follows: Figure 2 As shown:
[0081] The ResNe residual network consists of multiple residual blocks connected in series. After data enters the model, it first passes through a convolutional layer (Conv), a batch normalization layer (BN), and a ReLU activation layer (ReLU). It is then divided into two parts. One part directly passes through a maximum pooling layer (Max pooling) and a fully connected layer (Dense). The other part passes through a series of layers before being added together. This design avoids the vanishing gradient problem during deep network training and makes the network easier to train.
[0082] Step 5: Input the divided heartbeat sample data test set into the trained model to obtain the ECG classification results, and evaluate the model's classification performance indicators based on the classification results.
[0083] In this embodiment, the classification performance evaluation model is further evaluated using metrics including accuracy and area under the curve (AUC). The AUC is a value between 0 and 1 that measures the performance of the classification model. A higher AUC indicates better 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; and 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, based on the comparison table of classification performance data of the improved Parrot algorithm-optimized residual network and other common models, it can be seen that the performance of the model proposed in the present invention has obvious advantages over other models.
[0089] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned 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 above-described embodiments merely illustrate several implementations of the present invention, and while their descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the patent. It should be noted that a person skilled in the art would be able to make numerous variations and improvements without departing from the spirit of the present invention, all of which fall within the scope of protection of the present invention. Therefore, the scope of protection of the patent for this invention shall be determined by the appended claims.
Claims
1. An electrocardiogram classification method based on an improved Parrot algorithm to optimize a residual network, characterized by: The method is implemented by the following steps: Step 1: Obtain the electrocardiogram dataset; Step 2: preprocessing the electrocardiogram data set described in step 1 to obtain noise-free electrocardiogram signal data; Step 3: extracting electrocardiogram signal features from the electrocardiogram signal data described in step 2, and dividing the feature-extracted data set into a training set and a test set; Step 4: Construct a ResNet electrocardiogram classification model. The ResNet electrocardiogram classification model adopts a one-dimensional ResNet residual network. The training set is input into the ResNet residual network for electrocardiogram classification training. The parameters of the ResNet residual network are optimized using two improved Parrot algorithms, namely, adaptive convergence factor and mixed Cauchy-Gaussian mutation. The ResNet residual network is updated using the optimized parameters to finally obtain a trained ResNet neural network model. Step 5: Input the test set into the trained ResNet neural network model to achieve accurate classification of the electrocardiogram.
2. The electrocardiogram classification method based on the improved Parrot algorithm optimized residual network according to claim 1, characterized in that: The data preprocessing in step 2 includes normalizing and denoising the acquired ECG data. The specific process is as follows: The ECG signal data is padded to a uniform length for normalization; Then the ECG signal is denoised using the adaptive wavelet threshold denoising method; In the adaptive wavelet threshold denoising method, a parameter threshold function is introduced to implement adaptive wavelet denoising to obtain noise-free electrocardiogram signal data; it can be expressed as follows: Where sgn() is the sign function, w lk is the wavelet coefficient, |w lk | is the absolute value of the wavelet coefficient; α is a variable, is the wavelet coefficient after threshold processing, λ l is the threshold of the high-frequency coefficients of the lth layer.
3. The electrocardiogram classification method based on the improved Parrot algorithm optimized residual network according to claim 1, characterized in that: In step three, the process of extracting the ECG signal is as follows: Taking the R wave position as the positioning point, an estimated number of sample points are intercepted before and after the R wave, and the sample points are used as a sample heartbeat dataset, wherein the sample heartbeat dataset includes an electrocardiogram dataset integrated by electrocardiogram sample data, classification labels, and the corresponding relationship between the two; The ECG dataset is divided into training and testing sets.
4. The electrocardiogram classification method based on the improved Parrot algorithm 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 position of ResNet residual network The population size is N, and the maximum number of iterations is Max iter , the search space limit lower bound lb and upper bound ub; Step 42: Determine the parameters for optimizing the ResNet residual network, namely: the number of ResNet iterations, the initial learning rate, and the regularization parameter; Step 4.3: Use two improved Parrot algorithms, adaptive convergence factor and mixed Cauchy-Gaussian mutation, to cyclically optimize the parameters of the ResNet residual network; expressed as follows: Where, X best Indicates the optimal position from the initial search to the current search, and the optimal value of the parameter optimization; represents the position of particle i at the (t+1)th iteration, as shown above; represents the position of particle i at iteration t; represents the population exchange position after adding the adaptive convergence factor, is the iterative position after integrating the adaptive Gauss-Cauchy hybrid mutation strategy; Step 4. Determine whether the maximum number of iterations Max has been reached iter If yes, then output the ResNet residual network parameters after the improved Parrot algorithm optimization and execute steps 4 and 5; otherwise, return to step 4 and 3 until the number of cycles is equal to the maximum number of iterations Max iter , the iteration stops and the optimized ResNet residual network parameters are output; Step 4 and 5: Use the optimized three parameters to update the ResNet residual network, input the training set into the updated ResNet residual network for training, constrain the network according to the final loss function output by the network, and obtain the trained ResNet residual network.
5. The electrocardiogram classification method based on the improved Parrot algorithm 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 mixed Cauchy-Gaussian mutation; they are expressed as follows: Y i t =K[X i (t-1)·e -kt +rand·(X best (t)-X i (t-1))] Where K is the adaptive convergence factor, rand() is the random number generation function, and X i (t-1) is a reference variable or position at time t-1, X best (t) is the optimal position or value at time t; The adaptive Gaussian-Cauchy hybrid mutation strategy that uses the advantages of both Cauchy mutation and Gaussian mutation is expressed as follows: Where, is the iterative position after integrating the adaptive Gaussian-Cauchy hybrid mutation strategy, W1 and W2 are weight coefficients, Gauss(σ) is the Gaussian random perturbation with σ as the standard deviation, and Cauchy(σ) is the Cauchy random perturbation with σ as the scale parameter.
6. The electrocardiogram classification method based on the improved Parrot algorithm 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, and the final loss function is obtained according to the calculated classification loss function and the waveform detection loss function; the final loss function is expressed as follows: Where S is the preprocessed ECG sequence, Y is the category label, X is the waveform position label, C is the confidence label, and X R is the label of the R wave position, C R is the confidence label of the R wave; L cla is the classification loss function, L dct-R is the R waveform loss function.
7. The electrocardiogram classification method based on the improved Parrot algorithm optimized residual network according to claim 6, characterized in that: The calculation formula of the classification loss function is: Where S is the preprocessed ECG sequence, Y is the category label, the P() function is to predict the probability that the current ECG belongs to a certain category, N is the number of categories, and y n is the nth category.
8. The electrocardiogram classification method based on the improved Parrot algorithm optimized residual network according to claim 6, characterized in that: The calculation formula of the loss function of the waveform detection is: Where S is the preprocessed ECG sequence, X represents the waveform position label, M is the total number of samples, C represents the confidence label, m represents the mth sample, and λ coord Indicates the coefficient of x-relative coordinate regression, λ noobj The coefficient representing the prediction result of the grid without objects is used to control the contribution ratio of positive and negative examples to the result; and The value is 1 when there is an object or no object, otherwise it is 0; and Represent the true relative position and true confidence of the predicted object, x m and c m They represent the relative position and confidence of the object predicted by the current model 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
Remote sensing shallow sea water depth inversion method and device, electronic equipment and storage medium
CN119832445A