A method for predicting electrocardiogram in children in plateau areas

Through Stacking integrated model and improved genetic algorithm screening basic learner, the problem of automatic diagnosis of electrocardiogram in children in plateau areas is solved, and the accurate identification of electrocardiogram abnormalities and heart rhythm types is achieved, which improves diagnostic efficiency and accuracy.

CN116602688BActive Publication Date: 2025-08-19YUNNAN UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310631763.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-31
Publication Date
2025-08-19
Estimated Expiration
2043-05-31

AI Technical Summary

Technical Problem

The prior art lacks efficient automatic diagnosis methods for children in plateau areas, especially in the difficulty of collecting ECG data and privacy protection requirements, it is difficult to accurately identify ECG abnormalities and heart rhythm types.

Method used

The Stacking ensemble model is used combined with improved genetic algorithms to screen out the optimal base classifier combination, and the selection of base learners is optimized through the genetic algorithm to build a high-performance Stacking ensemble model for prediction of electrocardiograms in children in plateau areas.

Benefits of technology

Automatic diagnosis of electrocardiograms in children in plateau areas is achieved, and normal and abnormal electrocardiograms can be identified, and the cardiac rhythm types are classified, including normal heart rhythm, sinus bradycardia, sinus bradycardia and other arrhythmia, which improves the accuracy and efficiency of diagnosis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116602688B_ABST
    Figure CN116602688B_ABST
Patent Text Reader

Abstract

The present invention discloses a method for predicting electrocardiograms of children in plateau areas, which belongs to the field of electrocardiogram prediction technology. The method comprises: inputting the electrocardiogram of a child in the plateau area to be tested into a pre-trained Stacking integration model, and outputting a prediction result corresponding to the electrocardiogram of the child in the plateau area to be tested; wherein the prediction result corresponding to the electrocardiogram of the child in the plateau area to be tested includes a normal electrocardiogram, sinus tachycardia, sinus bradycardia, and other arrhythmias; pre-training to obtain the Stacking integration model comprises: obtaining a mainstream machine learning model; using a genetic algorithm to screen the mainstream machine learning model to obtain a base classifier combination; using the base classifier combination and a meta-classifier to construct a Stacking integration model; and iteratively training the Stacking integration model using a training set to obtain a trained Stacking integration model. The present invention uses an improved genetic algorithm to solve the difficulty of selecting a base learner in stacking, thereby obtaining a model with better performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a method for predicting electrocardiograms of children in plateau areas, and belongs to the technical field of electrocardiogram prediction. Background Art

[0002] As the most common diagnostic tool for heart disease in clinical practice, the electrocardiogram (ECG) plays a crucial role in the diagnosis and treatment of various heart diseases. Studies have shown that the incidence of heart disease in children living in plateau areas is significantly higher than in low-altitude areas. Therefore, there is a significant demand for ECG examinations among children in these areas. However, research and technology for automated ECG diagnosis in children living in these areas are currently lacking.

[0003] Most deep learning methods used in ECG research are based on convolutional neural networks, which have been highly successful in image processing. Deep learning methods can automatically learn inherent features in data without requiring feature extraction and processing. However, machine learning relies on extracting features from the ECG as input and then learning from a training set. Today, many hospitals' ECG machines are equipped with software that digitally processes ECGs, capable of measuring intervals, amplitudes, and other complex features. The systematic collection of electronic diagnostic records in hospitals generates large amounts of data, creating opportunities for the application of machine learning methods.

[0004] Sharma performed wavelet decomposition on the ECG signal to extract features and then input them into a weighted K-NN classifier, which was able to accurately classify five types of arrhythmias. Mondéjar-Guerra trained a specific support vector machine model for each type of feature. This method based on support vector machine clustering showed satisfactory performance in ECG classification. Elsayyad used a boosting ensemble method on the C5.0 decision tree to classify normal and abnormal heart rhythms based on the ECG feature diagnostic dataset, with excellent classification results. Mohapatra input 13 ECG feature attributes into the constructed random forest model, and this method performed well in diagnosing tachycardia. The stacking algorithm uses multilayer perceptron and random forest as base learners and linear regression as a meta-learner, achieving an accuracy rate of 99.88% in classifying and identifying arrhythmias in ECG signals.

[0005] In recent years, an increasing number of electrocardiogram (ECG) diagnostic methods have been proposed. However, the vast majority of these studies are based on a few authoritative international ECG databases, such as the MIT-BIH. Almost no research has examined the ECGs of children living in high-altitude areas. This may be due to the difficulty of collecting ECG data and the need to protect privacy, which makes it difficult to obtain and share many ECG datasets. Even some datasets that are publicly available may be subject to usage and access restrictions. The incidence of coronary heart disease in children living in high-altitude areas is nearly 20 times higher than in low-altitude areas, resulting in a significant demand for ECG diagnostics in these areas. Surveys have shown that the incidence of high-altitude heart disease is significantly higher in children born at high altitude than in those born at low altitude. Chun et al., using a large-scale data-based survey, demonstrated for the first time that high altitude is a significant environmental risk factor for coronary heart disease. Children living in high-altitude areas are more susceptible to heart disease and require extensive ECG diagnostic work for screening. In addition, since the electrocardiograms of children during their growth and development are different from those of adults, certain characteristics that appear at each age stage will bring difficulties to electrocardiogram diagnosis. Therefore, it is necessary to study technologies specifically for automatic electrocardiogram diagnosis of children in plateau areas. This can assist doctors in electrocardiogram analysis, effectively improve diagnostic efficiency and accuracy, and provide practical value for electrocardiogram diagnosis of children in plateau areas. It is of great significance to improving the medical level in plateau areas and improving the health of children.

[0006] In addition, stacking model fusion is a machine learning technique that uses a meta-learner to fuse the predictions of multiple base learners, thereby improving the overall performance of the model. Ting et al. demonstrated early on that using stacking technology can achieve better results than a single learner. In recent years, stacking has been widely used in big data analysis and industrial applications due to its outstanding performance. For model fusion, selecting a suitable combination of base learners is a very important issue. The goal of the base learner is to establish a hypothesis between the original data and the label. The choice of base learner will directly affect the performance of the final model. Generally speaking, when selecting base learners, the principles of high performance and diversity should be followed, and multiple factors need to be considered, including the accuracy, stability and computational efficiency of each learner. These factors are not only related to the learner itself, but also affected by the data set. Summary of the Invention

[0007] The technical problem to be solved by the present invention is to overcome the defects of the existing technology and provide an electrocardiogram prediction method for children in plateau areas to identify normal and abnormal electrocardiograms, and to classify heart rhythm types, including normal heart rhythm, sinus tachycardia, sinus bradycardia and other arrhythmias; an improved genetic algorithm is used to solve the difficulty of selecting base learners in stacking, thereby obtaining a model with better performance.

[0008] In a first aspect, the present invention provides a method for predicting electrocardiograms in children in plateau areas, comprising:

[0009] The pre-trained Stacking ensemble model is fed with the ECGs of children in the plateau region to be tested, and the model outputs prediction results corresponding to the ECGs of children in the plateau region. The prediction results for the ECGs of children in the plateau region include normal ECG, sinus tachycardia, sinus bradycardia, and other arrhythmias.

[0010] Pre-trained Stacking ensemble model, including:

[0011] Obtain mainstream machine learning models;

[0012] Use genetic algorithms to screen mainstream machine learning models and obtain base classifier combinations;

[0013] Utilize base classifier combination and meta-classifier to build Stacking ensemble model;

[0014] The Stacking ensemble model is iteratively trained using the training set to obtain a trained Stacking ensemble model.

[0015] Combined with the first aspect, the genetic algorithm is used to screen the mainstream machine learning models to obtain the base classifier combination, including:

[0016] Initialize the i-th population, randomly generate a preset number of individuals in the i-th population, assign crossover rate and mutation rate, i is an integer;

[0017] Based on the probability weight of the base classifier combination, a mainstream machine learning model in the base classifier combination is randomly selected to obtain the binary code of the base classifier combination;

[0018] The binary encoding of the combination of base classifiers is used as the chromosome of the individual;

[0019] Calculate the five-fold cross-validation score of the base classifier combination corresponding to each individual;

[0020] The five-fold cross-validation score is used as the individual fitness score threshold;

[0021] Based on the individual fitness score threshold, the tournament method is used to screen individuals in the i-th population to obtain individuals whose fitness is higher than the fitness score threshold;

[0022] Adjust the crossover rate and mutation rate, perform crossover and mutation operations on individuals whose fitness is higher than the fitness score threshold, and generate individuals in the i+1th population;

[0023] Replace the individuals of the i-th population with the individuals of the i+1-th population to obtain the i+1-th population;

[0024] Determine whether i+1 reaches the preset threshold R. If i+1 does not reach the preset threshold, replace the i-th population with the i+1-th population and enter the step of "based on the probability weight of the base classifier combination, randomly select the mainstream machine learning model in the base classifier combination and obtain the binary code of the base classifier combination";

[0025] Calculate the fitness of all individuals in the i+1th population, screen out the individual with the highest fitness, and output the base classifier combination corresponding to the individual with the highest fitness.

[0026] Combined with the first aspect, the five-fold cross-validation score of the base classifier combination corresponding to each individual is calculated, including:

[0027] Obtain a base classifier data set, wherein the base classifier data set includes electrocardiograms of children in historical plateau areas, and normal electrocardiograms or abnormal electrocardiograms;

[0028] The dataset is divided into 5 equal subsets, 1 subset is selected as the base classifier validation set, and the remaining 4 subsets are used as the base classifier training set;

[0029] Iteratively train the base classifier combination using the base classifier training set to obtain a trained base classifier combination;

[0030] The base classifier validation set is input into the trained base classifier combination, and the output is normal or abnormal electrocardiogram;

[0031] The number of correct predictions of normal ECG, the number of incorrect predictions of normal ECG, the number of correct predictions of abnormal ECG, and the number of incorrect predictions of abnormal ECG were calculated;

[0032] The F1 value was calculated based on the number of correct predictions of normal ECG, the number of incorrect predictions of normal ECG, the number of correct predictions of abnormal ECG, and the number of incorrect predictions of abnormal ECG;

[0033] Determine whether all five subsets have been used as base classifier validation sets. If not, select a subset from the five subsets that has not been used as the base classifier validation set, and use this subset as the base classifier validation set. Enter the step of "Iteratively training the base classifier combination using the base classifier training set to obtain the trained base classifier combination". If so, output the five F1 values.

[0034] The average of the five F1 values is calculated and used as the five-fold cross-validation score of the base classifier combination corresponding to each individual.

[0035] Combined with the first aspect, the Stacking ensemble model is iteratively trained using the training set to obtain a trained Stacking ensemble model, including:

[0036] The data set is divided into training set and test set in a ratio of 4:1;

[0037] The training set and test set include historical ECGs of children in the plateau region, as well as normal or abnormal ECGs. ECG abnormalities include sinus tachycardia, sinus bradycardia, and other arrhythmias. The ratio of normal and abnormal ECGs in the training set equals the ratio of normal and abnormal ECGs in the test set.

[0038] Use the five-fold cross-validation method to train the mainstream machine learning model in the base classifier combination and obtain cross-validation results;

[0039] All cross-validation results of each mainstream machine learning model are stacked vertically to form the prediction results of the mainstream machine learning model;

[0040] The prediction results of all mainstream machine learning models are horizontally spliced together to form a secondary training set, which is then used to iteratively train the meta-classifier to obtain a trained Stacking integration model.

[0041] Combined with the first aspect, the crossover rate and mutation rate are adjusted, including:

[0042] If (i+1) / 2 is less than the preset threshold R, and the average fitness of the i+1th population is higher than the average fitness of the i-th population, the adaptive dynamic adjustment method is used to reduce the crossover rate and mutation rate;

[0043] If (i+1) / 2 is less than the preset threshold R, and the average fitness score of the i+1th population is lower than the average fitness score of the i-th population, the adaptive dynamic adjustment method is used to increase the crossover rate and mutation rate;

[0044] If (i+1) / 2 is greater than or equal to the preset threshold R, the linear reduction method is used to gradually reduce the crossover rate and mutation rate to the minimum value;

[0045] If (i+1) / 2 is greater than or equal to the preset threshold R, and the difference between the average fitness score of the i+1th population and the average fitness score of the i-th population is greater than the set decline threshold, then when the average fitness of the i+1th population is higher than the average fitness of the i-th population, the adaptive dynamic adjustment method is used to lower the crossover rate and mutation rate; when the average fitness score of the i+1th population is lower than the average fitness of the i-th population, the adaptive dynamic adjustment method is used to increase the crossover rate and mutation rate.

[0046] In combination with the first aspect, the base classifier combination includes the XGBoost method, the LightGBM method and the CatBoost method.

[0047] In combination with the first aspect, based on the probability weight of the base classifier combination, the mainstream machine learning model in the base classifier combination is randomly selected, and the selected mainstream machine learning model is represented as 1 and the unselected mainstream machine learning model is represented as 0, or the selected mainstream machine learning model is represented as 0 and the unselected mainstream machine learning model is represented as 1.

[0048] Combined with the first aspect, the stacking integration model is pre-trained, including:

[0049] The test set is input into the trained Stacking ensemble model, which then outputs the prediction results for the test set. The prediction results for the test set include normal electrocardiogram, sinus tachycardia, sinus bradycardia, and other arrhythmias. If the accuracy of the prediction results for the test set is higher than the set accuracy threshold, the trained Stacking ensemble model is considered qualified.

[0050] In combination with the first aspect, the F1 value of the base classifier is used as the probability weight of the base classifier combination.

[0051] Combined with the first aspect, mainstream machine learning models include K-NN method, LR method, SVM method, DT method, RF method, ET method, GNB method, AdaBoost method, GBDT method, XGBoost method, LightGBM method and CatBoost method.

[0052] In a second aspect, the present invention provides an electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any one of the methods described in the first aspect when executing the program.

[0053] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any one of the methods described in the first aspect.

[0054] Combined with the first aspect, the prediction results corresponding to the electrocardiograms of children in the plateau area to be tested include the probability of normal electrocardiogram, the probability of sinus tachycardia, the probability of sinus bradycardia, and the probability of other arrhythmias.

[0055] The beneficial effects achieved by the present invention are:

[0056] The present invention studies the automatic diagnosis of electrocardiograms in children in plateau areas and invents an automatic electrocardiogram diagnosis model for children in plateau areas. The model can identify normal and abnormal electrocardiograms and classify heart rhythm types, including normal rhythm, sinus tachycardia, sinus bradycardia and other arrhythmias.

[0057] The present invention uses stacking model fusion technology and an improved genetic algorithm to solve the difficulty of selecting base learners in stacking, so as to find the optimal base classifier combination and improve the performance of the stacking ensemble model. The model of the present invention has an accuracy of 0.8710, a precision of 0.9371, a recall rate of 0.8137, and an F1 value of 0.8710 in the binary classification task of electrocardiogram abnormality recognition. The accuracy of the model of the present invention is 0.8637, the precision of 0.8635, the recall rate of 0.8637, and the F1 value of 0.8459 in the multi-classification task of heart rhythm type recognition. Compared with conventional methods, the model of the present invention achieves the best accuracy, recall rate, and F1 value in both binary classification and multi-classification tasks. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solution of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0059] Figure 1 is a schematic diagram of some embodiments of the present application;

[0060] Figure 2 This is a flowchart of using a genetic algorithm to select a base classifier combination in some embodiments of the present application. DETAILED DESCRIPTION

[0061] To facilitate the technical solution of the application, some concepts involved in this application are first explained below.

[0062] After building the Stacking ensemble model, the model is fed with electrocardiograms of children from plateau regions. The base classifiers in the first layer of the model then perform inference and output the results to the meta-classifiers in the second layer. The meta-classifiers fuse the outputs of the base classifiers to produce the final prediction results. This paper studies the automatic diagnosis of electrocardiograms in children from plateau regions and develops an automatic electrocardiogram diagnosis model for children from plateau regions. This model can identify normal and abnormal electrocardiograms and classify heart rhythm types into four categories: normal rhythm, sinus tachycardia, sinus bradycardia, and other arrhythmias.

[0063] Genetic algorithm is an optimization algorithm that simulates natural evolution. Its basic idea is to represent the solution of the problem as chromosomes, and to evolve and optimize the population through genetic operations such as selection, crossover, and mutation to find the optimal solution. Due to its strong parallelism and no prior knowledge of the search space, genetic algorithms are widely used in practical problems. In the present invention, the process of selecting the base classifier combination using the improved genetic algorithm is shown in the following figure. Figure 2 shown.

[0064] The F1 value of the base classifier is used as the probability weight for selecting the base classifier during initialization. The present invention represents the selection of each candidate base classifier as 1 and the non-selection as 0. The binary code of the obtained base classifier combination is represented as the chromosome of the individual.

[0065] First, the population is initialized, and a certain number of initial individuals are randomly generated. In each round of evolutionary iteration, the default meta-classifier is logistic regression, and the five-fold cross-validation score of the base classifier combination corresponding to each individual is calculated. The F1 value is used as the fitness score threshold of the individual to provide an objective measure of its performance. The tournament method is used to select other individuals in the population, eliminate some individuals with lower fitness, and retain individuals with fitness higher than the fitness score threshold. Then, according to the strategy, the crossover rate and mutation rate are adjusted, and the individuals with fitness higher than the fitness score threshold are crossover and mutation operations are performed to generate new individuals, increase the diversity of the population, and replace the original individuals with the new generation of individuals to form a new population. Repeat this process until the termination condition is met (such as a pre-set number of iterations). Finally, after calculating the fitness of all individuals in the final population, the individual with the best fitness is obtained. The present invention uses an improved genetic algorithm to find the optimal solution in the combination space of candidate base classifiers, thereby building a stacking ensemble model with better performance. As Figure 1 As shown, the present application utilizes a genetic algorithm to continuously search for potential base classifier combinations through operations such as selection, crossover, and mutation, thereby improving the performance of the stacking ensemble model.

[0066] Calculating the five-fold cross-validation score of the base classifier combination includes: cross-validation is a technique that divides a data set into a base classifier training set and a base classifier validation set, and repeatedly uses these divisions to perform multiple model training and evaluations, and takes the average value to obtain the final cross-validation score. Five-fold cross-validation is used in the present invention, and the scoring indicator is the F1 value. In cross-validation, the data set is first divided into 5 equal subsets. Then, 4 subsets are used as base classifier training sets to train the model, and the remaining 1 subset is used as the base classifier validation set to evaluate the performance of the model. This process is repeated 5 times, each time using a different subset as the base classifier validation set. Finally, the F1 values of the 5 verifications are averaged to obtain the five-fold cross-validation score. In particular, the present invention has made some improvements to the genetic algorithm to make it more suitable for the task of base classifier selection.

[0067] Weighted population initialization: Generally speaking, the base classifiers used for model fusion are required to have strong learning capabilities. The present invention conducts experimental evaluations on all base classifiers and uses the performance score of the base classifier (the F1 value of the base classifier) as the probability weight for selecting the base classifier during initialization. This makes it more likely that base classifiers with better performance will be selected during population initialization, thereby improving the average fitness score of the population. At the same time, this will not abandon base classifiers with relatively low performance, as they also have the potential to form the optimal base classifier combination.

[0068] Adjusting the crossover rate and mutation rate: The present invention combines the linear decline method and the adaptive dynamic adjustment method to propose a new dynamic adjustment strategy for the crossover rate and mutation rate. Specifically, the crossover rate and mutation rate are set to higher values during initialization. In the early stage of evolution, the adaptive dynamic adjustment method is used to adjust the crossover rate and mutation rate according to the performance of the population. If the average fitness score of the population increases, the crossover rate and mutation rate are lowered. If the average fitness score of the population decreases, the crossover rate and mutation rate are increased. That is, if (i+1) / 2 is less than the preset threshold R and the average fitness of the i-th population is higher than the average fitness of the i-1-th population, the crossover rate and mutation rate are lowered; if (i+1) / 2 is less than the preset threshold R and the average fitness score of the i-th population is lower than the average fitness of the i-1-th population, the crossover rate and mutation rate are increased.

[0069] In the middle and late stages of evolution, a linear decrease method is used to gradually reduce the crossover rate and mutation rate to a minimum. At the same time, the performance of the population still needs to be monitored. If the difference in the decrease in the average fitness score of the population exceeds a set threshold, the linear decrease method is suspended in this round, and the adaptive dynamic adjustment method is used again to adjust the crossover rate and mutation rate. The adjustment strategy for the crossover rate and mutation rate proposed in the present invention can make full use of the advantages of the adaptive dynamic adjustment method in exerting excellent performance in the early stages of evolution, while adopting the linear decrease method in the late stages of evolution to ensure that the population converges to the optimal solution. If the population performance declines, the adaptive dynamic adjustment method is returned to avoid premature convergence caused by too low crossover rate and mutation rate.

[0070] The present invention uses the aforementioned genetic algorithm to find the optimal combination of base classifiers: XGBoost (Extreme Gradient Boosting), LightGBM (Light Gradient Boosting Machine), and CatBoost (Categorical Boosting). The output of the base classifier is a class prediction probability vector, which represents the probability that the base classifier believes the sample belongs to each class (normal ECG and abnormal ECG). The meta-classifier uses these class probabilities as input features to make the final classification prediction, obtaining the probability of normal ECG, sinus tachycardia, sinus bradycardia, and other arrhythmia probabilities.

[0071] First, the present invention divides the data set into a training set and a test set in a ratio of 4:1. The training set and the test set include normal or abnormal electrocardiograms. Electrocardiogram abnormalities include sinus tachycardia, sinus bradycardia and other arrhythmias, while ensuring that the category ratio of the training set labels is equal to the category ratio of the test set labels. Yunnan Province is located in the Yunnan-Guizhou Plateau region of China, providing a unique environment for studying the automatic diagnosis of electrocardiograms of children in high-altitude areas. Among them, the data set uses electronic medical records of children's electrocardiograms collected in Yunnan Province from 2016 to 2020.

[0072] During the model training phase, each mainstream machine learning model in each base classifier combination is trained using a five-fold cross-validation approach. All cross-validation results (a total of five class prediction probability vectors for the training and test sets, such as the probability of a normal ECG and the probability of an abnormal ECG) are stacked vertically to form the prediction results of the mainstream machine learning model. The prediction results of the three mainstream machine learning models are then concatenated horizontally to form a secondary training set, which serves as training data for the meta-classifier. Simultaneously, all the training data is used to train each base classifier separately to obtain a complete trained model.

[0073] During the model testing phase, the test set is fed into the first-layer base classifiers to obtain predictions from each base classifier. These predictions are then concatenated to form a secondary test set, which is then fed into the meta-classifier to generate the final predictions. This cross-training approach reduces the risk of overfitting in the base classifiers and improves the overall performance of stacking.

[0074] The present invention demonstrates the technical effect through two experimental tasks, one is a binary classification task of identifying abnormalities in electrocardiograms, and the other is a multi-classification task of identifying heart rhythm types. The present invention not only incorporates 12 mainstream machine learning models, including K-NN method (K-Nearest Neighbors), LR method (Logistic Regression), SVM method (Support Vector Machine), DT method (Decision Tree), RF method (Random Forest), ET method (Extra-Tree), GNB method (Gaussian Naive Bayes), AdaBoost method (Adaptive Boosting), GBDT method (Gradient Boosting Decision Tree), XGBoost method (Extreme GradientBoosting), LightGBM method (Light Gradient Boosting Machine) and CatBoost method (Categorical Boosting), but also adds four deep learning models that have performed best on tabular data tasks in recent years to the comparative experiment, namely TabNet method, NODE method (Neural Oblivious Decision Ensembles), TabTransformer method and FT-Transformer method. By evaluating the performance of the model on various classification indicators, the advantages of the model of the present invention in the automatic diagnosis of children's electrocardiogram are verified. When evaluating the performance of a model for a classification task, the accuracy, precision, recall, and F1 value indicators are usually used to comprehensively test the performance of the model. The calculation formulas are shown in (1), (2), (3), and (4):

[0075]

[0076]

[0077]

[0078]

[0079] Where TP is the number of correctly predicted positive classes (positive class refers to normal ECG), TN is the number of correctly predicted negative classes (negative class refers to abnormal ECG), FP is the number of incorrectly predicted positive classes, and FN is the number of incorrectly detected negative classes. Specifically, the number of correctly predicted normal ECGs is TP, the number of incorrectly predicted normal ECGs is TN, the number of correctly predicted abnormal ECGs is FP, and the number of incorrectly predicted abnormal ECGs is FN. Tables 1 and 2 show the performance of each method on the binary classification task of ECG abnormality identification and the multi-classification task of rhythm type identification, respectively.

[0080] Table 1. Performance of each method in the binary classification task of ECG abnormality recognition

[0081]

[0082]

[0083] Table 2. Performance of each method in the multi-classification task of heart rhythm type recognition

[0084]

[0085] From the experimental results, the accuracy of the model of the present invention in the two-classification task of electrocardiogram abnormality recognition is 0.8710, the precision is 0.9371, the recall rate is 0.8137, and the F1 value is 0.8710. In the multi-classification task of rhythm type recognition, the accuracy is 0.8637, the precision is 0.8635, the recall rate is 0.8637, and the F1 value is 0.8459. The model of the present invention has achieved the best accuracy, recall rate and F1 value in both the two-classification and multi-classification tasks. Compared with the three single models of XGBoost, LightGBM and CatBoost, although the accuracy is sacrificed after the model fusion, the recall rate is greatly improved, which is the result expected to be observed by the present invention. The improvement in the recall rate means that the model's ability to identify abnormal electrocardiograms has become stronger. Precision and recall are mutually exclusive. The F1 value is a reconciling indicator of precision and recall. Many researchers recommend using the F1 value to measure the performance of a classifier. The model of the present invention achieves the best score in the F1 value, which proves that the model of the present invention has obvious advantages in the two tasks of electrocardiogram abnormality recognition and rhythm type recognition.

[0086] In addition, the present invention also compares the operating efficiency of each method, as shown in Table 3.

[0087] Table 3. Training and prediction time of each method on binary classification and multi-classification tasks (unit: seconds)

[0088]

[0089] The results show that the model of the present invention took 56.06 seconds and 171.82 seconds to train in binary and multi-classification tasks, respectively, using 166,299 training samples. When tested with 41,575 test samples, the model's inference time was 0.06 seconds and 0.27 seconds, respectively, with an average inference time of 1.44μs and 6.49μs. These results demonstrate that the model of the present invention has efficient computing power and excellent performance, meeting the needs of real-time electrocardiogram analysis.

[0090] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on the differences from other embodiments.

[0091] Other embodiments of the present invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not invented herein. The description and examples are to be considered as exemplary only, with the true scope and spirit of the invention being indicated by the following claims.

[0092] The above specific implementation methods further illustrate the purpose, technical solutions and beneficial effects of this application in detail. It should be understood that the above are only specific implementation methods of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solutions of this application should be included in the scope of protection of this application.

Claims

1. A method for predicting electrocardiograms of children in plateau areas, characterized in that: include: The pre-trained Stacking ensemble model is fed with the ECGs of children in the plateau region to be tested, and the model outputs prediction results corresponding to the ECGs of children in the plateau region. The prediction results for the ECGs of children in the plateau region include normal ECG, sinus tachycardia, sinus bradycardia, and other arrhythmias. Pre-trained Stacking ensemble model, including: Obtain mainstream machine learning models; Genetic algorithms are used to screen mainstream machine learning models and obtain base classifier combinations, including: Initialize the i-th population, randomly generate a preset number of individuals in the i-th population, assign crossover rate and mutation rate, i is an integer; Based on the probability weight of the base classifier combination, a mainstream machine learning model in the base classifier combination is randomly selected to obtain the binary code of the base classifier combination; The binary encoding of the combination of base classifiers is used as the chromosome of the individual; Calculate the five-fold cross-validation score of the base classifier combination corresponding to each individual, including: Obtain a base classifier data set, wherein the base classifier data set includes electrocardiograms of children in historical plateau areas, and normal electrocardiograms or abnormal electrocardiograms; The dataset is divided into 5 equal subsets, 1 subset is selected as the base classifier validation set, and the remaining 4 subsets are used as the base classifier training set; Iteratively train the base classifier combination using the base classifier training set to obtain a trained base classifier combination; The base classifier validation set is input into the trained base classifier combination, and the output is normal or abnormal electrocardiogram; The number of correct predictions of normal ECG, the number of incorrect predictions of normal ECG, the number of correct predictions of abnormal ECG, and the number of incorrect predictions of abnormal ECG were calculated; The F1 value was calculated based on the number of correct predictions of normal ECG, the number of incorrect predictions of normal ECG, the number of correct predictions of abnormal ECG, and the number of incorrect predictions of abnormal ECG; Determine whether all five subsets have been used as base classifier validation sets. If not, select a subset from the five subsets that has not been used as the base classifier validation set and use this subset as the base classifier validation set. Then proceed to the step of "Iteratively training the base classifier combination using the base classifier training set to obtain a trained base classifier combination." If so, output the five F1 values obtained. Calculate the average of the five F1 values and use it as the five-fold cross-validation score of the base classifier combination corresponding to each individual; The five-fold cross-validation score is used as the individual fitness score threshold; Based on the individual fitness score threshold, the tournament method is used to screen individuals in the i-th population to obtain individuals whose fitness is higher than the fitness score threshold; Adjust the crossover rate and mutation rate, perform crossover and mutation operations on individuals whose fitness is higher than the fitness score threshold, and generate individuals in the i+1th population; Replace the individuals of the i-th population with the individuals of the i+1-th population to obtain the i+1-th population; Determine whether i+1 reaches the preset threshold R. If i+1 does not reach the preset threshold, replace the i-th population with the i+1-th population and proceed to the step of "Based on the probability weight of the base classifier combination, randomly select the mainstream machine learning model in the base classifier combination and obtain the binary code of the base classifier combination"; Calculate the fitness of all individuals in the i+1th population, screen the individual with the highest fitness, and output the base classifier combination corresponding to the individual with the highest fitness; Adjustments to crossover and mutation rates, including: If (i+1) / 2 is less than the preset threshold R, and the average fitness of the i+1th population is higher than the average fitness of the i-th population, the adaptive dynamic adjustment method is used to reduce the crossover rate and mutation rate; If (i+1) / 2 is less than the preset threshold R, and the average fitness score of the i+1th population is lower than the average fitness of the i-th population, the adaptive dynamic adjustment method is used to increase the crossover rate and mutation rate; If (i+1) / 2 is greater than or equal to the preset threshold R, the linear reduction method is used to gradually reduce the crossover rate and mutation rate to the minimum value; If (i+1) / 2 is greater than or equal to the preset threshold R, and the difference between the average fitness score of the i+1th population and the average fitness score of the i-th population is greater than the set decline threshold, then when the average fitness of the i+1th population is higher than the average fitness of the i-th population, the adaptive dynamic adjustment method is used to reduce the crossover rate and mutation rate; when the average fitness score of the i+1th population is lower than the average fitness of the i-th population, the adaptive dynamic adjustment method is used to increase the crossover rate and mutation rate; Utilize base classifier combination and meta-classifier to build Stacking ensemble model; Iteratively train the Stacking ensemble model using the training set to obtain a trained Stacking ensemble model; Mainstream machine learning models, including K-NN method, LR method, SVM method, DT method, RF method, ET method, GNB method, AdaBoost method, GBDT method, XGBoost method, LightGBM method and CatBoost method.

2. A method for predicting electrocardiograms of children in plateau areas according to claim 1, characterized in that: Use the training set to iteratively train the Stacking ensemble model to obtain the trained Stacking ensemble model, including: The data set is divided into training set and test set in a ratio of 4:1; The training set and test set include historical ECGs of children in the plateau region, as well as normal or abnormal ECGs. ECG abnormalities include sinus tachycardia, sinus bradycardia, and other arrhythmias. The ratio of normal and abnormal ECGs in the training set equals the ratio of normal and abnormal ECGs in the test set. Use the five-fold cross-validation method to train the mainstream machine learning model in the base classifier combination and obtain cross-validation results; All cross-validation results of each mainstream machine learning model are stacked vertically to form the prediction results of the mainstream machine learning model; The prediction results of all mainstream machine learning models are horizontally spliced together to form a secondary training set, which is then used to iteratively train the meta-classifier to obtain a trained Stacking integration model.

3. The electrocardiogram prediction method for children in plateau areas according to claim 1, characterized in that: The base classifier combinations include the XGBoost method, the LightGBM method, and the CatBoost method.

4. The electrocardiogram prediction method for children in plateau areas according to claim 1, characterized in that: Based on the probability weight of the base classifier combination, the mainstream machine learning model in the base classifier combination is randomly selected, and the selected mainstream machine learning model is represented as 1 and the unselected mainstream machine learning model is represented as 0, or the selected mainstream machine learning model is represented as 0 and the unselected mainstream machine learning model is represented as 1.

5. A method for predicting electrocardiograms of children in plateau areas according to claim 2, characterized in that: Pre-trained Stacking ensemble model, including: The test set is input into the trained Stacking ensemble model, which then outputs the prediction results for the test set. The prediction results for the test set include normal electrocardiogram, sinus tachycardia, sinus bradycardia, and other arrhythmias. If the accuracy of the prediction results for the test set is higher than the set accuracy threshold, the trained Stacking ensemble model is considered qualified.

6. The electrocardiogram prediction method for children in plateau areas according to claim 1, characterized in that: The F1 value of the base classifier is used as the probability weight of the base classifier combination.

Citation Information

Patent Citations

  • Automatic classification method of support vector machine based on selection of self-adapting kernel function

    CN102567742A

  • LIBS quantitative analysis method based on integrated learning

    CN110763660A

  • Health condition prediction method based on genetic algorithm and decision tree

    CN113160990A