Liver function prediction method and device, electronic equipment and medium
By grouping and significant evaluation of the original clinical data of pneumonia patients, and building and optimizing machine learning models, the pain points of traditional liver function monitoring are solved, and rapid and accurate liver function prediction and personalized treatment plans are achieved, reducing patient pain and medical costs.
Patent Information
- Application Number
- CN202510972336.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-08-12
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the prior art, liver function monitoring of patients with pneumonia relies on traditional biochemical examinations, which leads to delayed conditions and causes physiological pain to patients. It is unable to provide results quickly and lacks standard, simplified and non-invasive monitoring solutions.
By obtaining the original clinical data of pneumonia patients, performing significance evaluation after grouping, selecting characteristic variables related to liver injury, building machine learning models, training and evaluation, selecting the optimal model for liver function prediction, and performing interpretability analysis, extracting the highest contribution feature variables to build a simplified model.
It achieves rapid and accurate prediction of liver function, reduces patient pain and costs, provides personalized treatment plans, and improves diagnostic accuracy and treatment efficiency.
Smart Images

Figure CN120473187A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of medical early warning technology, and in particular to a liver function prediction method, device, electronic equipment and medium. Background Art
[0002] Currently, clinical liver function monitoring for pneumonia patients is limited to traditional biochemical tests. Because liver lesions may not manifest clearly in the early stages, liver function monitoring relies on the clinician's judgment, which can lead to delayed treatment and delayed disease progression. Furthermore, traditional biochemical tests require procedures such as blood draws and laboratory tests, which cause physical pain and expense for patients, take time, and lack rapid results. Therefore, the development of a standardized, simplified, non-invasive, and low-cost liver function monitoring protocol has significant clinical application and promotion value. With the development of big data-based smart healthcare, the application of AI technologies based on target recognition and decision support systems has seen exponential growth. Machine learning, a core branch of AI, demonstrates significant advantages over traditional statistical methods in predicting disease progression by building data-driven predictive models. It also allows for human-computer interaction and is user-friendly. Currently, prognostic assessment systems based on machine learning have been incorporated into multiple international clinical practice guidelines, demonstrating their significant clinical translational value.
[0003] In the auxiliary diagnosis and treatment of pneumonia patients, the use of machine learning models to predict liver damage can not only improve the accuracy of liver damage diagnosis, but also adjust individualized treatment plans. The machine learning clinical prediction model can overcome the lack of individual experience of clinical physicians and provide a standard auxiliary decision-making tool to quickly and accurately provide prediction results for clinical decision-making reference. At the same time, the prediction model can infer whether liver damage has occurred based on the specific treatment plan, thereby reducing patient risks. For patients who have already developed liver damage, an individualized liver protection treatment plan can be determined based on the model's prediction results to promote recovery. In addition, the machine learning model does not require traditional blood drawing operations, which can reduce patient pain and expenses and replace traditional methods. Summary of the Invention
[0004] The present invention provides a liver function prediction method, device, electronic equipment and medium for quickly predicting the liver function of pneumonia patients.
[0005] According to one aspect of the present invention, a method for predicting liver function is provided, comprising: Obtaining original clinical data of several pneumonia patients, and grouping the original clinical database according to the degree of liver damage; Performing a significance assessment on the characteristic variables in the grouped original clinical data to find a first characteristic variable related to the degree of liver injury; Extracting the first characteristic variable from each of the original clinical data and constructing a first data set; Based on the first data set, multiple machine learning models are trained and evaluated respectively, and each machine learning model is comprehensively evaluated using multiple indicators, and the machine learning model with the best comprehensive evaluation result is selected as the liver function prediction model; Performing an interpretability analysis on the liver function prediction model to quantify the contribution of each of the first feature variables to the liver function prediction model; the top N first feature variables with the highest contribution are used as second feature variables; Extracting the second characteristic variable from each of the original clinical data to construct a second data set; training the liver function prediction model based on the second data set to obtain a trained liver function prediction model; The liver function of the target pneumonia patient is predicted based on the trained liver function prediction model. Optionally, the method further includes preprocessing the original clinical data, wherein the preprocessing includes at least outlier processing, missing value processing and data standardization processing.
[0006] Optionally, performing significance assessment on characteristic variables in the grouped original clinical data to find a first characteristic variable related to the degree of liver injury includes: Performing classification test on the characteristic variables in the classified original clinical data; The P value of each characteristic variable test was recorded to evaluate the significant difference of the characteristic variable between different liver injury groups; The characteristic variable with a P value less than the significance threshold is selected as the first characteristic variable.
[0007] Optionally, performing classification test on the characteristic variables in the classified original clinical data includes: According to the type of characteristic variables, the characteristic variables in the original clinical data are divided into measurement data and counting data; According to the distribution characteristics of the measurement data, the unpaired t-test or Mann-Whitney U test was used to compare the measurement data between groups; the chi-square test or Fisher's exact test was used to compare the count data between groups.
[0008] Optionally, the training and evaluating multiple machine learning models based on the first data set, and selecting the machine learning model with the best evaluation result as the liver function prediction model, includes: performing data balancing processing on the first data set; Dividing the first data set into a training set and a validation set according to a preset ratio; Each machine learning model was trained and evaluated using 5-fold cross-validation, and each machine learning model was evaluated using random independent validation. When conducting a comprehensive evaluation of each machine learning model, the values of the same indicator of each machine learning model were ranked, and each indicator was scored based on the ranking results. The scores of each indicator of each machine learning model were weighted and summed to obtain the comprehensive score of each machine learning model, that is, the comprehensive evaluation result. The evaluation results of the 5-fold cross-validation and the evaluation results of the random independent validation were combined, and the machine learning model with the best evaluation result was selected as the liver function prediction model.
[0009] Optionally, performing an interpretability analysis on the liver function prediction model to quantify the contribution of each first feature variable to the liver function prediction model includes: The machine learning interpretable tool SHAP was used to perform interpretability analysis on the liver function prediction model; The SHAP value distribution of each of the first characteristic variables is calculated, and the SHAP value reflects the contribution of the characteristic variable to the liver function prediction model.
[0010] Optionally, multiple machine learning models include: logistic regression, decision tree, random forest, K-nearest neighbor classifier, support vector machine, and gradient boosting.
[0011] According to another aspect of the present invention, there is provided a device for predicting liver function, comprising: a data acquisition unit, configured to acquire original clinical data of a number of pneumonia patients and group the original clinical data according to the degree of liver damage; an evaluation unit, configured to perform a significance evaluation on the characteristic variables in the grouped original clinical data to find a first characteristic variable related to the degree of liver injury; a first feature extraction unit, configured to extract the first feature variable from each of the original clinical data and construct a first data set; a first training unit, configured to train and evaluate multiple machine learning models based on the first data set, and perform a comprehensive evaluation on each machine learning model using multiple indicators, and select the machine learning model with the best comprehensive evaluation result as the liver function prediction model; an analysis unit, configured to perform an interpretability analysis on the liver function prediction model to quantify a contribution of each of the first feature variables to the liver function prediction model; the top N first feature variables with the highest contribution are used as second feature variables; A second feature extraction unit, configured to extract the second feature variable from each of the original clinical data to construct a second data set; a second training unit, configured to train the liver function prediction model based on the second data set to obtain a trained liver function prediction model; A prediction unit is used to predict the liver function of a target pneumonia patient based on the trained liver function prediction model. According to another aspect of the present invention, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can perform the liver function prediction method described in any embodiment of the present invention.
[0012] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the liver function prediction method according to any embodiment of the present invention when executed.
[0013] The technical solution of the embodiment of the present invention is to perform a significance evaluation on the characteristic variables in the original clinical data, find the first characteristic variable related to the degree of liver damage, and construct a first data set. Based on the first data set, multiple machine learning models are trained and evaluated, and the machine learning model with the best evaluation result is selected as the liver function prediction model; the liver function prediction model is subjected to an interpretability analysis to find the N characteristic variables with the highest correlation with the degree of liver damage as the second characteristic variables, and the liver function prediction model is used as a simplified model to predict the liver function of the target pneumonia patient. The present invention can make the prediction result more accurate by selecting the characteristic variable with the highest correlation with the degree of liver damage and the machine learning model with the best evaluation result as the simplified model, and this simplified model can greatly reduce the calculation time.
[0014] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0016] Figure 1 This is a flow chart of a method for predicting liver function according to the first embodiment of the present invention; Figure 2 This is a flow chart of a method for predicting liver function according to the second embodiment of the present invention; Figure 3 3. This is a receiver operating characteristic curve diagram of a 5-fold cross-validation model for predicting liver function in patients with pneumonia according to one embodiment of the present invention; Figure 4 Receiver operating characteristic curve for independent validation of the prediction model for liver function in patients with pneumonia in one embodiment of the present invention; Figure 5 SHAP feature importance diagram of the optimal machine learning model obtained in an embodiment of the present invention; Figure 6 SHAP scatter plot diagram of the optimal machine learning model obtained in an embodiment of the present invention; Figure 7 is a receiver operating characteristic curve diagram of a simplified model for predicting liver function in pneumonia patients in an embodiment of the present invention; Figure 8 This is a schematic structural diagram of a liver function prediction device provided according to a third embodiment of the present invention; Figure 9 It is a structural diagram of an electronic device for implementing the liver function prediction method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0017] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0018] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0019] Example 1 Figure 1 A flowchart of a method for predicting liver function is provided for the first embodiment of the present invention. Figure 1 As shown, the method includes: S101. Obtain original clinical data of several pneumonia patients, and group the original clinical database according to the degree of liver damage.
[0020] Among them, the original clinical data of pneumonia patients may include the patient's basic information, test data, hospitalization information and prognosis information.
[0021] Specifically, basic information includes the patient's age, gender, body temperature, heart rate, respiratory rate, blood pressure, past medical history, past medication history, allergy history, smoking history and drinking history; test data include blood routine, liver and kidney function indicators, coagulation function indicators and infection-related markers; hospitalization information includes records of the patient's treatment method and clinical medication; prognosis information includes the patient's discharge information and other relevant prognostic data.
[0022] In this embodiment, the original clinical database can also be grouped according to the degree of liver damage. For example, the patients with pneumonia can be divided into: no liver damage group, mild liver damage group, moderate liver damage group, severe liver damage group according to the degree of liver damage of each patient; or divided into moderate to severe liver damage group and non-moderate to severe liver damage group.
[0023] S102. Perform a significance assessment on the characteristic variables in the grouped original clinical data to find a first characteristic variable related to the degree of liver injury.
[0024] A common significance assessment can be used to determine whether there are significant differences in each characteristic variable between different liver injury groups, thereby selecting multiple characteristic variables related to the degree of liver injury as the first characteristic variable.
[0025] Specifically, statistical tests can be performed on the characteristic variables of different liver injury groups. For example, statistical tests such as mean comparison tests, analysis of variance, chi-square tests, nonparametric tests, and correlation analyses can be used. After statistical tests, significance assessment methods can be used to evaluate the significant differences between different variables in the different liver injury groups, thereby identifying multiple characteristic variables associated with the degree of liver injury. Methods for significance assessment include P-value methods, confidence interval methods, and critical value methods.
[0026] S103: Extract the first characteristic variables from each of the original clinical data and construct a first data set.
[0027] Based on the determined first characteristic variable associated with the degree of liver injury, the first characteristic variable is extracted from the original clinical data. The first characteristic variable of each patient's original clinical data constitutes a sample, thereby constructing a first data set. The first characteristic variable may include characteristic variables such as age, gender, transaminase, bilirubin, and coagulation function indicators.
[0028] S104. Based on the first data set, multiple machine learning models are trained and evaluated respectively, and each machine learning model is comprehensively evaluated using multiple indicators, and the machine learning model with the best comprehensive evaluation result is selected as the liver function prediction model.
[0029] In this embodiment, multiple machine learning models can be used for the first stage of training and evaluation. For example, machine learning models such as logistic regression, decision tree, random forest, K-Nearest Neighbors Classifier, support vector machine (SVM, RBF kernel), and gradient boosting can be used as training models. The first dataset is divided into a training set and a validation set to train and evaluate the machine learning model.
[0030] In this embodiment, multiple performance indicators can be selected to evaluate multiple machine learning models separately. By comprehensively comparing the performance indicators of each machine learning model, the machine learning model with the best comprehensive performance indicators is selected as the liver function prediction model for use in subsequent simplified model construction.
[0031] S105. Perform an interpretability analysis on the liver function prediction model to quantify the contribution of each of the first feature variables to the liver function prediction model; the top N first feature variables with the highest contribution are used as second feature variables.
[0032] Feature-based interpretation methods can be used to analyze the interpretability of liver function prediction models. For example, SHAP (SHapley Additive exPlanations) value analysis, PDP (Partial Dependence Plot), ALE (Cumulative Local Effects Plot), and feature interaction analysis methods can be used. By using interpretability analysis methods to analyze the liver function prediction model, the contribution of each feature variable to the model's prediction results can be determined. The top N contributing first feature variables can then be extracted as second feature variables for subsequent simplified model training.
[0033] S106: Extract the second characteristic variables from each of the original clinical data to construct a second data set.
[0034] The second characteristic variable that contributes most to the model prediction result is extracted from each original clinical data. The second characteristic variable of the original clinical data of each patient constitutes a sample, thereby constructing a second data set.
[0035] S107: Training the liver function prediction model based on the second data set to obtain a trained liver function prediction model.
[0036] S108. Predicting the liver function of the target pneumonia patient based on the trained liver function prediction model. The second data set can be divided into a training set and a validation set according to a preset ratio, and the liver function prediction model can be trained in the second stage. During the training process, the liver function prediction model can maintain the same parameter settings as in the first stage training to ensure the stability of the model performance.
[0037] The technical solution of the embodiment of the present invention is to perform a significance evaluation on the characteristic variables in the original clinical data, find the first characteristic variable related to the degree of liver damage, and construct a first data set. Based on the first data set, multiple machine learning models are trained and evaluated, and the machine learning model with the best evaluation result is selected as the liver function prediction model; the liver function prediction model is subjected to an interpretability analysis to find the N characteristic variables with the highest correlation with the degree of liver damage as the second characteristic variables, and the liver function prediction model is used as a simplified model to predict the liver function of the target pneumonia patient. The present invention can make the prediction result more accurate by selecting the characteristic variable with the highest correlation with the degree of liver damage and the machine learning model with the best evaluation result as the simplified model, and this simplified model can greatly reduce the calculation time.
[0038] Example 2 Figure 2 A schematic diagram of a method for predicting liver function provided in Example 2 of the present invention is shown in FIG. Figure 2 As shown, the method includes: S201. Obtain original clinical data of several pneumonia patients, and group the original clinical database according to the degree of liver damage.
[0039] Obtain the original clinical data of several pneumonia patients, including the patients' basic information, test data, hospitalization information, and prognosis information.
[0040] Among them, basic information includes the patient's age, gender, body temperature, heart rate, respiratory rate, blood pressure, past medical history, past medication history, allergy history, smoking history and drinking history; test data include blood routine, liver and kidney function indicators, coagulation function indicators and infection-related markers; hospitalization information includes records of the patient's treatment method and clinical medication; prognosis information includes the patient's discharge information and other relevant prognosis data.
[0041] S202: Preprocess the original clinical data, where the preprocessing includes at least outlier processing, missing value processing, and data normalization processing.
[0042] In this embodiment, the raw clinical data can also be preprocessed. The preprocessing can include duplicate value processing, outlier processing, missing value processing, and data standardization. Duplicate value processing: The raw clinical data is checked and, after confirmation, duplicate items are deleted to avoid the impact of data redundancy on model training; outlier value processing: Outliers are recollected and checked, and retained after confirmation to ensure the authenticity and reliability of the data; missing value processing: Missing data is first supplemented by recollecting and re-recording. For parts that cannot be re-recorded, multiple interpolation techniques are used to fill in the gaps to ensure data integrity; data standardization: The data is standardized to eliminate the potential impact of different dimensions and magnitudes on model training.
[0043] In this embodiment, the cases in the clinical database can be divided into two groups: a moderate or above liver injury group, which includes cases with a relatively severe liver injury; and a non-moderate or above liver injury group, which includes cases with a mild liver injury or no liver injury.
[0044] Data were categorized according to the Common Time-Delayed Adverse Event Assessment (CTCAE) version 5.0. Specifically, cases with liver enzyme levels exceeding three times the normal value were defined as moderate or severe liver injury, while the remaining cases were classified as non-moderate or above. Based on this standard, a clinical database of liver injury was constructed to provide structured, high-quality data support for subsequent machine learning model training.
[0045] S203. Perform a significance assessment on the characteristic variables in the grouped original clinical data to find a first characteristic variable related to the degree of liver injury.
[0046] In one embodiment, step S203 specifically includes: S2031. Perform classification test on the characteristic variables in the classified original clinical data.
[0047] Specifically, it includes: dividing the characteristic variables in the original clinical data into measurement data (continuous variables) and counting data (categorical variables) according to the types of characteristic variables.
[0048] According to the distribution characteristics of the measurement data, the unpaired t-test (for normally distributed data) or the Mann-Whitney U test (for non-normally distributed data) was used to compare the measurement data between groups; the chi-square test or Fisher's exact test (for small sample size) was used to compare the count data between groups.
[0049] S2032. Record the P value of each characteristic variable test to evaluate the significant difference of the characteristic variable between different liver injury groups.
[0050] S2033. Select a characteristic variable with a P value less than a significance threshold as the first characteristic variable.
[0051] When performing a significance assessment on the test results of the data, the P value of each test can be recorded, and the significance of different liver injury groups can be assessed based on the P value obtained from the test. Variables with a P value less than 0.05 can be selected as statistically significant characteristic variables for use in the subsequent data set construction of the machine learning model.
[0052] The P-value is a probability value used in hypothesis testing to determine whether there is a significant difference between sample data and the null hypothesis. The P-value represents the probability of the observed sample data, or a more extreme scenario, occurring, assuming the null hypothesis holds. Hypothesis testing typically begins with a null hypothesis and an alternative hypothesis. For example, the null hypothesis might be that the two population means are equal, while the alternative hypothesis is that they are unequal. The P-value is determined by calculating a statistic (such as the t-statistic or z-statistic) on the sample data and then applying it to the corresponding distribution (such as the t-distribution or the normal distribution). The P-value ranges from 0 to 1. A smaller P-value indicates a lower probability of the observed sample data, or a more extreme scenario, occurring, assuming the null hypothesis holds. This indicates greater evidence to reject the null hypothesis, concluding that the sample data differ significantly from the null hypothesis. A significance level (such as 0.05 or 0.01) is typically set. If the P-value is less than or equal to this significance level, the null hypothesis is rejected; if the P-value is greater than the significance level, the null hypothesis is not rejected.
[0053] Through the above-mentioned grouping and statistical analysis process, the present invention systematically screens out characteristic variables that are closely related to the degree of liver damage and have statistical significance, laying a solid foundation for building an efficient and reliable machine learning model.
[0054] S204: Extract the first characteristic variables from each of the original clinical data and construct a first data set.
[0055] S205. Based on the first data set, multiple machine learning models are trained and evaluated respectively, and each machine learning model is comprehensively evaluated using multiple indicators, and the machine learning model with the best comprehensive evaluation result is selected as the liver function prediction model.
[0056] In one embodiment, step S205 specifically includes: S2051. Perform data balancing processing on the first data set.
[0057] SMOTEENN (Synthetic Minority Over-sampling Technique with Edited Nearest Neighbors) can be used for this purpose. This technique combines synthetic minority over-sampling (SMOTE) and edited nearest neighbors (ENN), effectively balancing data distribution and improving the model's ability to identify minority classes.
[0058] S2052: Divide the first data set into a training set and a validation set according to a preset ratio.
[0059] The first data set can be divided into a training set and a validation set in a ratio of 8:2 for training and evaluating multiple machine learning models. Among them, the machine learning models selected in this embodiment can include logistic regression, decision tree, random forest, K nearest neighbor classifier, support vector machine and gradient boosting.
[0060] S2053. Train and evaluate each machine learning model using 5-fold cross-validation, and evaluate each machine learning model using randomized independent validation. When performing a comprehensive evaluation of each machine learning model, rank the values of the same indicator for each machine learning model, assign a score to each indicator based on the ranking results, and perform a weighted sum of the scores for each indicator for each machine learning model to obtain a comprehensive score for each machine learning model, i.e., the comprehensive evaluation result.
[0061] In this example, 5-fold cross-validation can be used to train and initially evaluate the model to ensure its stability and generalization ability on different data subsets. Five independent validations with random seeds can be used to assess whether the model is at risk of overfitting and ensure that the model's performance on unseen data is consistent with the training data.
[0062] S2054. Integrate the evaluation results of the 5-fold cross-validation and the evaluation results of the random independent validation, and select the machine learning model with the best evaluation result as the liver function prediction model.
[0063] When comprehensively evaluating each machine learning model, multiple metrics can be used. These metrics may include: AUC-ROC (area under the receiver operating characteristic curve), accuracy, precision, recall, and F1-score. AUC-ROC assesses the model's ability to distinguish between positive and negative samples at different thresholds; values closer to 1 indicate better model performance. Accuracy represents the proportion of samples correctly predicted by the model, reflecting the model's overall success rate. Precision represents the proportion of predicted positive samples that are actually positive, also known as the positive predictive value (PPV). Recall (sensitivity) represents the proportion of actually positive samples that are correctly predicted as positive, also known as the true positive rate (TPR). The F1-score is the harmonic mean of precision and recall, comprehensively considering the model's accuracy and recall. Each metric is presented as mean ± standard deviation to reflect the stability and reliability of model performance.
[0064] Model performance results: Through 5-fold cross-validation, the performance indicators of each model are shown in Table 1. The results show that the Random Forest model performs best in all indicators, with AUC-ROC, Accuracy, Precision, Recall and F1-score of 0.998±0.002, 0.977±0.006, 0.970±0.009, 0.992±0.007 and 0.981±0.005 respectively. The 5-fold cross-validation AUC-ROC curve of this model is shown in Figure 3 .
[0065] Table 1 Performance indicators of machine learning models using 5-fold cross validation
[0066] As shown in Table 1, during the comprehensive evaluation, the values of the same indicator of each machine learning model can be ranked separately. For example, for the AUC indicator, the order can be as follows: Random Forest > GradientBoosting > KNN > SVM (RBF Kernel) > Logistic Regression > Decision Tree. In this case, the AUC indicator of Random Forest can be assigned 6 points, the AUC indicator of Gradient Boosting can be assigned 5 points, the AUC indicator of KNN can be assigned 4 points, the AUC indicator of SVM (RBF Kernel) can be assigned 3 points, the AUC indicator of Logistic Regression can be assigned 2 points, and the AUC indicator of Decision Tree can be assigned 1 point. Similarly, the Accuracy, Precision, Recall, and F1-score indicators of each machine learning model can be assigned points separately. Finally, it can be calculated that the AUC index of the random forest is 6 points, the Accuracy index is 6 points, the Precision index is 5 points, the Recall index is 5 points, the F1-score index is 6 points, and the total score is 28 points, which is the highest score among all machine learning models. Therefore, the machine learning model with the best evaluation result in this embodiment is the random forest model.
[0067] To further verify the stability and generalization ability of the model, this example uses random independent validation to evaluate each machine learning model. The results are shown in Table 2. The Random Forest model also performs well in the independent validation, with AUC-ROC, Accuracy, Precision, Recall, and F1-score of 0.997±0.002, 0.972±0.012, 0.963±0.011, 0.990±0.010, and 0.976±0.010, respectively. The AUC-ROC curve of the independent validation of this model is shown in Table 2. Figure 4 .
[0068] Table 2 Performance indicators of random independent verification of machine learning models
[0069] From Table 1, Table 2 and Figure 3 , Figure 4 As can be seen, the Random Forest model in this example demonstrated excellent performance in both cross-validation and independent validation, and was selected as the optimal prediction model. This model not only excels across various performance indicators but also exhibits good stability and generalization capabilities, making it suitable for predicting liver function in pneumonia patients.
[0070] S206. Use the machine learning interpretable tool SHAP to perform interpretability analysis on the liver function prediction model.
[0071] In this example, the machine learning interpretability tool SHAP can be used to perform interpretability analysis on the liver function prediction model. The SHAP algorithm, based on Shapley value theory, can quantify the contribution of each feature variable to the model prediction, thereby providing an intuitive explanation for the model's decision-making.
[0072] S207 . Calculate and obtain the SHAP value distribution of each of the first feature variables. The SHAP value reflects the contribution of the feature variable to the liver function prediction model. The top N first feature variables with the highest contribution are the second feature variables.
[0073] Specifically, the SHAP value distribution of the characteristic factors is calculated using the SHAP algorithm, and the results are as follows: Figure 5 and Figure 6 shown. Figure 5 This chart demonstrates the importance of characteristic factors to model predictions. The horizontal axis represents the mean absolute value of the SHAP values (|SHAP value|) of the characteristic factors, reflecting the average strength of the characteristic's impact on model predictions. Analysis results indicate that the top 10 characteristic factors include: severity, ALT, AST, and GGT values at admission, neutrophil percentage, monocyte percentage, eosinophil count, concomitant use of low-molecular-weight heparin (LMWH), use of glycyrrhizin, and glutathione usage. These 10 characteristic variables contribute most significantly to model predictions and can be used as secondary characteristic variables.
[0074] Figure 6 The SHAP droplet plot for patient 248 is shown. Starting from the model's baseline value (0.499), the red and blue bars represent the positive (increasing risk) and negative (decreasing risk) contributions of the characteristic factors to the predicted outcome, respectively. After integrating the weights of all characteristic factors, the final prediction score for this patient was 0.755, exceeding the model's established risk threshold (0.5), resulting in a positive prediction, indicating a risk of liver injury. This prediction is consistent with the actual clinical prognosis, validating the model's accuracy and interpretability.
[0075] S208: Extract the second characteristic variables from each of the original clinical data to construct a second data set.
[0076] Ten second characteristic variables were extracted from each original clinical data, including whether the patient was a severe patient, ALT test value, AST test value, GGT test value at admission, neutrophil percentage, monocyte percentage, eosinophil count, whether low molecular weight heparin (LMWH) was used in combination, whether glycyrrhizin was used, and glutathione usage, to form a sample. The second data set was constructed with multiple samples. The second characteristic variables were extracted from the original clinical data, and the second characteristic variables of each patient's original clinical data constituted a sample, thereby constructing the second data set.
[0077] S209: Training the liver function prediction model based on the second data set to obtain a trained liver function prediction model.
[0078] The second dataset can be divided into a training set and a validation set in an 8:2 ratio. In one embodiment, the SMOTEENN technique can be used to balance the data in the dataset. The SMOTEENN technique effectively balances the data distribution by synthesizing minority class samples and editing neighboring samples, thereby improving the generalization ability of the liver function prediction model.
[0079] The liver function prediction model undergoes a second phase of training. During this training process, the model maintains the same parameter settings as during the first phase of training to ensure model performance stability. The input of the liver function prediction model is the second characteristic variable data, and the output is the degree of liver damage, such as moderate to severe liver damage and non-moderate to severe liver damage.
[0080] In a specific embodiment, the performance indicators of the liver function prediction model after the simplified processing are as follows: AUC-ROC is 0.996±0.002, Accuracy is 0.958±0.008, Precision is 0.936±0.017, Recall is 0.993±0.011, and F1-score is 0.963±0.007. The AUC-ROC curve is shown in the figure below. Figure 7 shown.
[0081] S210. Predicting the liver function of the target pneumonia patient based on the trained liver function prediction model. In a specific embodiment, a liver function prediction system can be constructed, comprising a processor, a memory, and a display. A trained liver function prediction model is deployed within the processor. The memory is used to store model files, clinical data, and executable instructions for the processor. A front-end web interface can be constructed to facilitate preliminary identification of a patient's liver function status via the display interface.
[0082] Clinical physicians can input patient-related data on the interface, including basic information (whether the condition is critical), test results (such as liver function indicators) and treatment plans (combination drugs), etc.; the data is uploaded to the liver function prediction system, which predicts the input data and outputs the prediction results, which are displayed through the front-end interface.
[0083] The technical solution of the embodiment of the present invention is to perform a significance evaluation on the characteristic variables in the original clinical data, find the first characteristic variable related to the degree of liver damage, and construct a first data set. Based on the first data set, multiple machine learning models are trained and evaluated, and the machine learning model with the best evaluation result is selected as the liver function prediction model; the liver function prediction model is subjected to an interpretability analysis to find the N characteristic variables with the highest correlation with the degree of liver damage as the second characteristic variable. The second characteristic variable and the liver function prediction model are used as a simplified model to predict the liver function of the target pneumonia patient. The present invention can make the prediction result more accurate by selecting the characteristic variable with the highest correlation with the degree of liver damage and the machine learning model with the best evaluation result as the simplified model, and this simplified model can greatly reduce the calculation time. And through the construction of the liver function prediction system, the present invention can efficiently support the real-time prediction needs in the clinical environment, provide accurate decision support for clinicians, thereby optimizing the liver function monitoring process of pneumonia patients, reducing medical costs, and improving patient prognosis.
[0084] Example 3 Figure 8 This is a schematic diagram of the structure of a liver function prediction device provided by Example 3 of the present invention. Figure 8 As shown, the device includes: The data acquisition unit 801 is used to acquire original clinical data of a number of pneumonia patients and group the original clinical data according to the degree of liver damage; An evaluation unit 802 is configured to perform a significance evaluation on the characteristic variables in the grouped original clinical data to find a first characteristic variable related to the degree of liver injury; A first feature extraction unit 803 is configured to extract the first feature variable from each of the original clinical data and construct a first data set; a first training unit 804 configured to train and evaluate multiple machine learning models based on the first data set, perform comprehensive evaluation on each machine learning model using multiple indicators, and select the machine learning model with the best comprehensive evaluation result as the liver function prediction model; An analyzing unit 805 is configured to perform an interpretability analysis on the liver function prediction model to quantify the contribution of each of the first feature variables to the liver function prediction model; the top N first feature variables with the highest contribution are used as second feature variables; A second feature extraction unit 806 is configured to extract the second feature variable from each of the original clinical data to construct a second data set; A second training unit 807 is configured to train the liver function prediction model based on the second data set to obtain a trained liver function prediction model; The prediction unit 808 is configured to predict the liver function of the target pneumonia patient based on the trained liver function prediction model. The liver function prediction device provided in the embodiment of the present invention can execute the liver function prediction device provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0085] Example 4 Figure 9 A schematic diagram of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices (such as helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0086] like Figure 9As shown, electronic device 10 includes at least one processor 11 and memory, such as read-only memory (ROM) 12 and random access memory (RAM) 13, communicatively connected to at least one processor 11. The memory stores computer programs executable by the at least one processor. Processor 11 can perform various appropriate actions and processes based on the computer programs stored in ROM 12 or loaded from storage unit 18 into RAM 13. RAM 13 can also store various programs and data required for the operation of electronic device 10. Processor 11, ROM 12, and RAM 13 are interconnected via bus 14. An input / output (I / O) interface 15 is also connected to bus 14.
[0087] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0088] Processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any other suitable processor, controller, microcontroller, etc. Processor 11 executes the various methods and processes described above, such as a method for predicting liver function.
[0089] In some embodiments, a method for predicting liver function can be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method for predicting liver function described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform a method for predicting liver function in any other appropriate manner (e.g., via firmware).
[0090] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0091] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0092] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or apparatus. A computer-readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or apparatus, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media may include an electrical connection based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0093] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device that has: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0094] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0095] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0096] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0097] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A method for predicting liver function, characterized in that: include: Obtaining original clinical data of several pneumonia patients, and grouping the original clinical database according to the degree of liver damage; Performing a significance assessment on the characteristic variables in the grouped original clinical data to find a first characteristic variable related to the degree of liver injury; Extracting the first characteristic variable from each of the original clinical data and constructing a first data set; Based on the first data set, multiple machine learning models are trained and evaluated respectively, and each machine learning model is comprehensively evaluated using multiple indicators, and the machine learning model with the best comprehensive evaluation result is selected as the liver function prediction model; Performing an interpretability analysis on the liver function prediction model to quantify the contribution of each of the first feature variables to the liver function prediction model; the top N first feature variables with the highest contribution are used as second feature variables; Extracting the second characteristic variable from each of the original clinical data to construct a second data set; training the liver function prediction model based on the second data set to obtain a trained liver function prediction model; The liver function of the target pneumonia patient is predicted based on the trained liver function prediction model.
2. The method for predicting liver function according to claim 1, wherein It also includes preprocessing the original clinical data, and the preprocessing at least includes abnormal value processing, missing value processing and data standardization processing.
3. The method for predicting liver function according to claim 1, wherein The significance evaluation of the characteristic variables in the grouped original clinical data to find the first characteristic variable related to the degree of liver injury includes: Performing classification test on the characteristic variables in the classified original clinical data; The P value of each characteristic variable test was recorded to evaluate the significant difference of the characteristic variable between different liver injury groups; The characteristic variable with a P value less than the significance threshold is selected as the first characteristic variable.
4. The method for predicting liver function according to claim 3, wherein: The step of performing classification test on the characteristic variables in the classified original clinical data comprises: According to the type of characteristic variables, the characteristic variables in the original clinical data are divided into measurement data and counting data; According to the distribution characteristics of the measurement data, the unpaired t-test or Mann-Whitney U test was used to compare the measurement data between groups; the chi-square test or Fisher's exact test was used to compare the count data between groups.
5. The method for predicting liver function according to claim 1, wherein The method of training and evaluating multiple machine learning models based on the first data set, comprehensively evaluating each machine learning model using multiple indicators, and selecting the machine learning model with the best comprehensive evaluation result as the liver function prediction model includes: performing data balancing processing on the first data set; Dividing the first data set into a training set and a validation set according to a preset ratio; Each machine learning model was trained and evaluated using 5-fold cross-validation, and each machine learning model was evaluated using random independent validation. When conducting a comprehensive evaluation of each machine learning model, the values of the same indicator of each machine learning model were ranked, and each indicator was scored based on the ranking results. The scores of each indicator of each machine learning model were weighted and summed to obtain the comprehensive score of each machine learning model, that is, the comprehensive evaluation result. The evaluation results of the 5-fold cross-validation and the evaluation results of the random independent validation were combined, and the machine learning model with the best evaluation result was selected as the liver function prediction model.
6. The method for predicting liver function according to claim 1, wherein: The performing an interpretability analysis on the liver function prediction model to quantify the contribution of each of the first feature variables to the liver function prediction model includes: The machine learning interpretable tool SHAP was used to perform interpretability analysis on the liver function prediction model; The SHAP value distribution of each of the first characteristic variables is calculated, and the SHAP value reflects the contribution of the characteristic variable to the liver function prediction model.
7. The method for predicting liver function according to claim 1, wherein Multiple machine learning models including: logistic regression, decision trees, random forests, K-nearest neighbors classifiers, support vector machines, and gradient boosting.
8. A liver function prediction device, characterized in that: include: a data acquisition unit, configured to acquire original clinical data of a number of pneumonia patients and group the original clinical data according to the degree of liver damage; an evaluation unit, configured to perform a significance evaluation on the characteristic variables in the grouped original clinical data to find a first characteristic variable related to the degree of liver injury; a first feature extraction unit, configured to extract the first feature variable from each of the original clinical data and construct a first data set; a first training unit, configured to train and evaluate multiple machine learning models based on the first data set, and perform a comprehensive evaluation on each machine learning model using multiple indicators, and select the machine learning model with the best comprehensive evaluation result as the liver function prediction model; an analysis unit, configured to perform an interpretability analysis on the liver function prediction model to quantify a contribution of each of the first feature variables to the liver function prediction model; the top N first feature variables with the highest contribution are used as second feature variables; A second feature extraction unit, configured to extract the second feature variable from each of the original clinical data to construct a second data set; a second training unit, configured to train the liver function prediction model based on the second data set to obtain a trained liver function prediction model; A prediction unit is used to predict the liver function of a target pneumonia patient based on the trained liver function prediction model.
9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the liver function prediction method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the liver function prediction method according to any one of claims 1 to 7 when executed.
Citation Information
Patent Citations
Ovarian cancer gradient drug-resistant cell rapid classification method based on digital holographic flow microscopic imaging and feature importance analysis
CN116630689A
Machine model construction system based on representation mining
CN119418946A
Cardiovascular disease prediction model interpretable method based on SHAP
CN119811643A
Prediction method, model and system for transformation from acute kidney injury to chronic kidney disease after operation
CN120072291A
Cited By
Prognosis evaluation method and device, electronic equipment, storage medium and computer program product
CN120833913A
Insomnia typing device
CN121545768A
Liver image data processing method and system based on Gd-EOB-DTPA enhanced MRI, and storage medium
CN122312452A