A disease risk prediction method based on improved random forest similarity metric

By combining the three-layer intersection-union comparison method and AUC value, a decision tree with low similarity and high accuracy is selected to construct an improved random forest model. This solves the accuracy and efficiency problems of the random forest algorithm under medical data, and improves the accuracy and speed of disease risk prediction.

CN114091671BActive Publication Date: 2024-09-13SOUTHWEST PETROLEUM UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111447390.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-01
Publication Date
2024-09-13
Estimated Expiration
2041-12-01

AI Technical Summary

Technical Problem

Existing random forest algorithms lack sufficient classification accuracy for complex medical data, making it difficult to ensure the accuracy and efficiency of disease risk prediction. Furthermore, traditional methods may compromise the originality and integrity of the data.

Method used

A three-layer intersection-union (IUC) method is used to calculate the similarity between decision trees. The AUC value is then combined to select valuable decision trees, and an improved random forest model is constructed. This model retains decision trees with low similarity but high accuracy, reduces the impact of redundancy, and improves prediction speed and accuracy.

Benefits of technology

While ensuring the integrity of the original medical data, the accuracy of disease risk prediction has been improved, the impact of redundancy has been reduced, the diversity and efficiency of the model have been enhanced, and early diagnosis and timely treatment have been assisted.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114091671B
    Figure CN114091671B
Patent Text Reader

Abstract

The invention relates to a disease risk prediction method for improving random forest similarity measurement, belonging to the field of medical health analysis and machine learning; the invention solves the problem of low accuracy of a random forest algorithm in predicting disease risk based on complex medical data; the technical scheme is: constructing a disease risk prediction model based on an original random forest algorithm; retaining some decision trees with high AUC values; obtaining the value range of all disease characteristics after grouping decision paths; proposing a three-layer intersection-over-union method to calculate the similarity between decision trees; and obtaining a final disease risk prediction model after deleting redundant decision trees; the invention proposes a new method for measuring the similarity of decision trees in a random forest model, which ensures the integrity of original medical data while improving the prediction accuracy of disease risk, and provides a new idea for auxiliary medical health analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of medical health analysis and machine learning, and in particular to a disease risk prediction method based on an improved random forest similarity metric. Background Art

[0002] As the most representative algorithm in the bagging branch of ensemble learning, random forest is widely used in the field of medical health analysis for its excellent performance and flexibility. Mining effective information from medical data and making classification predictions can realize auxiliary diagnosis of human diseases. However, due to the common characteristics of sample class imbalance and high feature dimension in medical data, the ability of traditional random forest algorithm in classification tasks is seriously weakened. In this regard, researchers often use SMOTE and its extended algorithm to cluster medical data to make the data more balanced; at the same time, feature selection and parameter optimization are performed to select features with higher correlation with prediction results from high-dimensional features. However, these methods will modify the original data, and may delete some disease features or even multiple samples, losing the originality and integrity of the data. And because the characteristics of medical data for a certain disease are highly similar, the random forest model constructed by a large number of similar samples can easily generate a large number of redundant high-similarity decision trees, which affects the classification accuracy and training speed of the model.

[0003] In response to the above problems, some researchers have proposed that the data itself can be left unchanged, but the internal structure of the random forest model can be used to select high-precision and low-similarity decision trees to reorganize the forest, and the new random forest model can be used to train medical data to achieve optimization results. For classification accuracy, a high-precision sub-forest is usually selected from the original random forest, and for similarity, the similarity between decision trees is calculated based on a certain measurement method. There are two main types of measurement methods: one is based on the similarity of the structure of the disease prediction decision tree itself, such as Zhu Ying using the highest matching cost between branch nodes to evaluate the similarity between decision trees, but this method greatly increases the calculation time of node information and increases the complexity of the algorithm; the other is based on the consistency of disease prediction results, such as Wang Cheng selecting high-precision and low-similarity sub-forests based on the Kappa statistic, but this method is more sensitive to the test set, and the prediction results are prone to change with changes in sample distribution.

[0004] In general, the current random forest algorithm still has great limitations and deficiencies in the accuracy of classification under complex medical data, and it is difficult to ensure the accuracy and efficiency of disease prediction. In this regard, the present invention, under the premise of ensuring the integrity of the original medical data as much as possible, proposes a new method for measuring the similarity of decision trees in the random forest model based on the intersection over union ratio index in the semantic segmentation task, the three-layer intersection over union similarity method (TIOUSIM, three intersection over unionsimilarity), obtains the similarity of decision trees through iterative calculation of feature similarity and path similarity, and thus proposes a disease risk prediction method that improves the random forest similarity measurement. This method accurately and flexibly calculates the similarity between decision trees, and simultaneously prunes them by combining similarity and AUC values, ensuring the diversity of random forests while reducing the loss of effective decision trees, speeding up the prediction speed of the model, and improving the accuracy of disease risk prediction, thereby assisting doctors in early diagnosis and timely treatment of patients, contributing to intelligent diagnosis and disease prevention, and providing new ideas for auxiliary medical health analysis. Summary of the invention

[0005] In order to solve the problem of low accuracy of disease risk prediction based on complex medical data by random forest algorithm. Under the premise of ensuring the integrity of original medical data as much as possible, the present invention proposes a disease risk prediction method with improved random forest similarity measurement: the similarity between decision trees is calculated by three-layer intersection-over-union method to accurately and flexibly measure the similarity of decision trees in the random forest model, and then valuable decision trees are selected according to the similarity and AUC value, and finally the final disease risk prediction model is constructed based on the random forest algorithm with improved similarity measurement, which reduces the loss of effective decision trees while ensuring forest diversity, speeds up the prediction speed of the model and improves the prediction accuracy of disease risk, can help doctors to make early diagnosis and timely treatment of patients, contributes to intelligent diagnosis and disease prevention, and provides new ideas for auxiliary medical health analysis.

[0006] In order to solve the above problems, the technical solution adopted by the present invention is:

[0007] 1) Preprocess the acquired medical data and build a disease risk prediction model based on the original random forest algorithm;

[0008] 2) Calculate the AUC value of each decision tree in the model and only retain the top 80% decision trees with high AUC values;

[0009] 3) Group the paths in each decision tree to obtain the value range of all disease characteristics in each path;

[0010] 4) A three-layer intersection-combination method is proposed to calculate the similarity between every two decision trees;

[0011] 5) Redundant decision trees are deleted based on similarity and AUC values ​​to obtain the final disease risk prediction model.

[0012] Preferably, step 1) obtains a medical public data set from the UCI (University of California Irvine) data set, converts the categorical variables in the medical data into numerical variables through one-hot encoding, and fills the missing numerical variables with the average value, and constructs a disease risk prediction model based on the original random forest algorithm according to the preprocessed medical data.

[0013] Preferably, the detailed steps of step 3) include:

[0014] 3.1) Traverse all decision trees and group decision paths according to the diseased output categories of leaf nodes. Paths with the same output category belong to the same group;

[0015] 3.2) For each decision path, traverse all nodes to obtain the value range of its split feature. For the same disease feature, define the intersection of their values ​​as the value range of the disease feature.

[0016] Preferably, the detailed steps of step 4) TIOUSIM method include:

[0017] 4.1) Calculate the similarity of disease features. Define that in decision trees I and J, the decision paths under the same group are path K and path M respectively. Then the similarity of disease feature A is the ratio of the intersection and union of its value range:

[0018]

[0019] Where: IoU A is the similarity between disease feature A on path K and path M, ( X min , X max ) is the value range of the disease feature A in path K, ( Y min , Y max ) is the value range of the disease feature A in path M, if IoU A If the value is not less than the similarity threshold, it is determined that the symptom features A on the two paths are similar, thereby obtaining the number of similar symptom features in the two decision paths under the same group;

[0020] 4.2) Calculate the similarity of the two decision paths by calculating the ratio of the number of similar features of the disease to the total number of disease features in step 4.1):

[0021]

[0022] Where: IoU KM is the similarity between path K and path M, Sim_KM is the number of similar features of symptoms in the two paths, k is the total number of disease features in path K, m is the total number of disease features in path M, if IoU KM If the value is not less than the similarity threshold, path K is determined to be similar to path M, and the number of similar paths is obtained;

[0023] 4.3) Calculate the similarity between the two decision trees by the ratio of the number of similar paths to the total number of paths in step 4.2):

[0024]

[0025] Where: IoU IJ is the similarity between decision tree I and decision tree J, Sim_IJ is the number of similar paths in the two decision trees, i is the total number of paths in decision tree I, and j is the total number of paths in decision tree J. IoU IJ If the value is not less than the similarity threshold, then decision tree I and decision tree J are considered similar;

[0026] Preferably, step 5) is performed based on the similarity and AUC value to jointly judge and prune redundant decision trees to obtain the final disease risk prediction model, and the detailed steps include:

[0027] 5.1) If decision tree I and decision tree J are not similar, keep both decision trees, otherwise proceed to the next step;

[0028] 5.2) Compare the AUC values ​​of decision tree I and decision tree J. If the AUC value of decision tree I is lower, determine whether the AUC value of decision tree I is in the top 30%. If so, keep both decision trees. If not, keep decision tree J and delete decision tree I.

[0029] 5.3) Use the remaining decision trees to form the final disease risk prediction model.

[0030] The beneficial effects of adopting the above technical solution are: for the prediction of disease risk in medical health analysis, a new method for measuring the similarity of decision trees in the random forest model is proposed, and a low-similarity and high-precision decision tree reorganization model is selected under the premise of ensuring the integrity of the original medical data, which improves the prediction accuracy of disease risk and provides new ideas for auxiliary medical health analysis. Compared with the improved random forest algorithm commonly used in medical classification tasks, it ensures the originality and integrity of medical data, and the judgment of decision tree similarity is more accurate and flexible, avoiding the redundant effects caused by a large number of highly similar disease characteristics, while also ensuring the diversity and efficiency of random forests. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Other features, purposes and advantages of the present application will become more apparent by reading the detailed description made with reference to the following drawings:

[0032] Figure 1 It is a flowchart of disease risk prediction using improved random forest similarity metric.

[0033] Figure 2 It is a flowchart for calculating the similarity of decision trees using the three-layer intersection-and-union method.

[0034] Figure 3 It is a flowchart for deleting redundant decision trees.

[0035] Figure 4 This is a comparison chart of the prediction accuracy of the present invention and the original random forest model on the breast cancer data set.

[0036] Figure 5 This is a comparison chart of the prediction accuracy of the present invention and the original random forest model on the Indian diabetes data set. DETAILED DESCRIPTION

[0037] The present application is further described in detail below in conjunction with the accompanying drawings and implementation methods. It is understood that the specific implementation described herein is only used to explain the relevant method, rather than to limit the use of the method. It is also necessary to explain that, for ease of description, only the parts related to the method are shown in the accompanying drawings. The present application will be described in detail below with reference to the accompanying drawings.

[0038] First, refer to Figure 1 , the disease risk prediction model based on the original random forest algorithm is optimized, which specifically includes the following steps:

[0039] Step S100, obtain a medical public data set from the UCI (University of California Irvine) data set, convert the categorical variables in the medical data into numerical variables through one-hot encoding, and fill the missing numerical variables with the average value, and build a disease risk prediction model based on the original random forest algorithm according to the preprocessed medical data.

[0040] Step S200, calculating the AUC value of each decision tree in the random forest, sorting the decision trees in descending order according to the AUC value, obtaining the top 80% decision trees, and deleting the remaining decision trees;

[0041] Step S300, grouping the paths in each decision tree to obtain the value range of all disease characteristics in each path, the specific steps include:

[0042] Step S301, traverse all decision trees, group decision paths according to the disease output categories of leaf nodes, and the ones with the same output categories belong to the same group;

[0043] Step S302: for each decision path, after traversing all nodes, obtain the value range of its split feature. For the same disease feature, define the intersection of its values ​​as the value range of the disease feature.

[0044] Step S400, reference Figure 2 , the similarity between every two decision trees in the random forest is calculated using the three-layer intersection-over-union method, which specifically includes the following steps;

[0045] Step S401, calculate the similarity of symptom features. Define that in decision tree I and decision tree J, the decision paths under the same group are path K and path M respectively, then the similarity of symptom feature A is the ratio of the intersection and union of its value range:

[0046]

[0047] Where: IoU A is the similarity between disease feature A on path K and path M, ( X min , X max ) is the value range of the disease feature A in path K, ( Y min , Y max ) is the value range of the disease feature A in path M, if IoU A If the value is not less than the similarity threshold, it is determined that the symptom features A on the two paths are similar, thereby obtaining the number of similar symptom features in the two decision paths under the same group;

[0048] Step S402, calculating the similarity of the two decision paths by the ratio of the number of similar features of the symptoms to the total number of symptoms features in step S401:

[0049]

[0050] Where: IoU KM is the similarity between path K and path M, Sim_KM is the number of similar features of symptoms in the two paths, k is the total number of disease features in path K, m is the total number of disease features in path M, if IoU KM If the value is not less than the similarity threshold, path K is determined to be similar to path M, and the number of similar paths is obtained;

[0051] Step S403, calculating the similarity of the two decision trees by the ratio of the number of similar paths to the total number of paths in step S402:

[0052]

[0053] Where: IoU IJ is the similarity between decision tree I and decision tree J, Sim_IJ is the number of similar paths in the two decision trees, i is the total number of paths in decision tree I, and j is the total number of paths in decision tree J. IoU IJ If the value is not less than the similarity threshold, decision tree I and decision tree J are judged to be similar.

[0054] Step S500, reference Figure 3 , based on the joint judgment of similarity and AUC value, redundant decision trees are deleted to obtain the final disease risk prediction model. The detailed steps are as follows:

[0055] Step S501, if decision tree I and decision tree J are not similar, both decision trees are retained, otherwise the next step is executed;

[0056] Step S502, compare the AUC values ​​of decision tree I and decision tree J. If the AUC value of decision tree I is lower, determine whether the AUC value of decision tree I is in the top 30%. If so, retain both decision trees. If not, retain decision tree J and delete decision tree I.

[0057] Step S503, using the remaining decision trees to construct a final disease risk prediction model.

[0058] Furthermore, we used breast cancer data and Indian diabetes data from the UCI (University of Californialrvine) medical public dataset to establish a disease risk prediction model, and compared the impact of the original random forest model and the model after adding our improved similarity processing method on the prediction results. Figure 4 Predicting and controlling breast cancer Figure 5 To predict the prevalence of diabetes in Indians, please refer to Table 1:

[0059] Table 1

[0060]

[0061] The table shows the prediction results of breast cancer and diabetes among Indians under various random forest models. The higher the accuracy, the more accurate the model's prediction of the risk of disease; the higher the percentage of accuracy improvement, the better the improvement of the algorithm. It can be seen that the model prediction effect of this patent model has been best improved under the premise of ensuring a basically higher accuracy compared with other models, and the prediction results are better than those of the original random forest algorithm, which verifies the feasibility of the invention.

[0062] Compared with the prior art, the present invention has the following beneficial effects: (1) Under the premise of ensuring the integrity of the original medical data, a low-similarity and high-precision decision tree reconstruction model is selected, which improves the accuracy of disease risk prediction and provides a new idea for auxiliary medical health analysis; (2) The measurement of decision tree similarity in the random forest model is more flexible and accurate, and the selected low-similarity and high-precision decision tree avoids the redundant effect caused by a large number of highly similar medical features; (3) The loss of effective decision trees in the random forest algorithm is reduced, ensuring the diversity and efficiency of the forest.

[0063] Finally, it should be noted that the above description is only a preferred embodiment of the present application and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the present application is not limited to the technical solution formed by a specific combination of technical features, and any modification or partial replacement that does not deviate from the spirit and scope of the present invention should be included in the scope of the claims of the present invention.

Claims

1. A disease risk prediction method based on improved random forest similarity metric, It is characterized in that The following steps are involved: S100, preprocessing the acquired medical data and constructing a disease risk prediction model based on the original random forest algorithm; S200, calculating the AUC value of each decision tree in the model, and only retaining the top 80% decision trees with high AUC values; S300, grouping the paths in each decision tree to obtain the value range of all disease characteristics in each path; S400, propose a three-layer intersection-and-combination method to calculate the similarity between every two decision trees; S500, pruning redundant decision trees according to similarity and AUC values ​​to obtain a final disease risk prediction model; In step S100, the categorical variables in the medical data are converted into numerical variables through one-hot encoding, and the missing numerical variables are filled with the average value. The step S300 includes the following steps: S301, traverse all decision trees, group decision paths according to the disease output categories of leaf nodes, and the ones with the same output categories belong to the same group; S302: For each decision path, traverse all nodes to obtain the value range of its split feature. For the same disease feature, define the intersection of its values ​​as the value range of the disease feature. The step S400 includes the following steps: S401, calculating the similarity of symptom features, defining that in decision trees I and J, the decision paths under the same group are path K and path M respectively, then the similarity of symptom feature A is the ratio of the intersection and union of its value ranges: Where: IoU A is the similarity between disease feature A on path K and path M, (X min , X max ) is the value range of the disease feature A in path K, (Y min , Y max ) is the value range of the disease feature A in the path M. If IoU A If the value is not less than the similarity threshold, it is determined that the symptom features A on the two paths are similar, thereby obtaining the number of similar symptom features in the two decision paths under the same group; S402. Calculate the similarity of the two decision paths by the ratio of the number of similar features of the symptoms to the total number of symptoms features in step S401: Where: IoU KM is the similarity between path K and path M, Sim_KM is the number of similar disease features in the two paths, k is the total number of disease features in path K, and m is the total number of disease features in path M. If IoU KM If the value is not less than the similarity threshold, path K is determined to be similar to path M, and the number of similar paths is obtained; S403, calculating the similarity of the two decision trees by the ratio of the number of similar paths to the total number of paths in step S402: Where: IoU IJ is the similarity between decision tree I and decision tree J, Sim_IJ is the number of similar paths in the two decision trees, i is the total number of paths in decision tree I, j is the total number of paths in decision tree J, if IoU IJ If the value is not less than the similarity threshold, then decision tree I and decision tree J are considered similar. The step S500 includes the following steps: S501, if decision tree I and decision tree J are not similar, then both decision trees are retained, otherwise proceed to the next step; S502, comparing the AUC values ​​of decision tree I and decision tree J. If the AUC value of decision tree I is lower, determining whether the AUC value of decision tree I is in the top 30%. If so, retaining both decision trees. If not, retaining decision tree J and deleting decision tree I. S503. Use the remaining decision trees to form a final disease risk prediction model.