Complication prediction method and system based on SHAP-random forest

By using a SHAP-random forest-based complication prediction method, combined with CT images and puncture path data, dynamically adjusting risk thresholds and quantifying feature contribution, the method solves the problems of insufficient individualization and uninterpretable black-box models in existing technologies, achieving high-precision personalized risk grading and operable prediction results.

CN121601237APending Publication Date: 2026-03-03LAIAN COUNTY PEOPLES HOSPITAL
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511785575.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-01
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

The lack of individualized complication risk prediction models in existing technologies, coupled with the inability to dynamically adjust static thresholds, leads to an underestimation of the risk for patients with coagulation disorders. Furthermore, the inability to interpret black-box models reduces doctors' confidence in the prediction results.

Method used

A complication prediction method based on SHAP-random forest was adopted. By acquiring preoperative CT images and puncture path planning data, risk factors were calculated, numerical standardization and nonlinear transformation were performed to generate feature vectors, Shapley values ​​were used to quantify feature contribution, and risk thresholds were dynamically adjusted according to clinical indicators to achieve personalized risk grading.

Benefits of technology

It improves the accuracy and interpretability of complication prediction, generates clinically actionable decision-making basis, realizes personalized risk stratification, and enhances the credibility and clinical trust of the prediction model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121601237A_ABST
    Figure CN121601237A_ABST
Patent Text Reader

Abstract

The invention discloses a complication prediction method and system based on an SHAP-random forest, and relates to the technical field of medical data mining. The method comprises the following steps: acquiring preoperative CT images and puncture path planning data, and calculating risk factors; performing numerical value standardization, nonlinear transformation and interactive feature generation on the risk factors to obtain feature vectors, calculating mutual information scores of feature values in the feature vectors, if the mutual information scores are greater than an experience threshold, retaining the feature values, and after traversal is finished, obtaining updated feature vectors; on the basis of a random forest model, taking the updated feature vector as an input value, and calculating a complication probability; quantizing the contribution degree of the characteristic value based on a Shapley value; according to clinical indexes, the risk threshold is dynamically corrected, the complication risk level is divided, and complication prediction is completed, the problems that a static threshold ignores the blood coagulation state difference of a patient and a black box model cannot provide a decision basis are solved, and the complication misjudgment probability is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of medical data mining technology, specifically to a complication prediction method and system based on SHAP-random forest. Background Technology

[0002] Preoperative pathway planning for puncture biopsy has a decisive impact on complication risk control. In thoracic and abdominal tumor puncture biopsies, the geometric parameters of the surgical path, such as chest wall thickness, intrapulmonary length, and distance from vital organs, directly determine the probability of complications such as pneumothorax and hemorrhage. Clinical studies have shown that inappropriate needle insertion angles or depths can increase the complication rate to as high as 20%-35%. Currently, clinical practice relies on physician experience to assess risk, lacking quantitative tools to accurately predict the likelihood of complications.

[0003] In the process of developing this application, the inventors discovered the following problems in the prior art: First, the static threshold lacks individualization; traditional prediction models use fixed risk thresholds without dynamically adjusting them in conjunction with the patient's coagulation function, resulting in the underestimation of the risk of patients with coagulation abnormalities, while low-risk patients may receive excessive intervention; Second, the black-box model is uninterpretable; conventional machine learning algorithms, such as random forests, cannot quantify the specific contribution of each factor to complications, making it difficult for doctors to understand the prediction logic, thus reducing clinical trust and adoption rate. Summary of the Invention

[0004] The purpose of this application is to provide a complication prediction method and system based on SHAP-random forest to solve the problems mentioned in the background art.

[0005] In a first aspect, one embodiment of this application provides a complication prediction method based on SHAP-random forest. The method includes: acquiring preoperative computed tomography (CT) images and puncture path planning data; calculating risk factors, including chest wall thickness, intrapulmonary length, minimum organ distance, minimum distance between extended line segments and organs, skin entry angle, and pleural entry angle; performing numerical standardization, nonlinear transformation, and interactive feature generation on the risk factors to obtain a feature vector; calculating the mutual information score of the feature values ​​in the feature vector; if the mutual information score is greater than an empirical threshold, retaining the feature values; after traversal, obtaining an updated feature vector; and applying the updated feature vector to a pre-trained random forest model. The system uses quantitative data as input to calculate the probability of complications. Based on the probability of complications, it calculates the confidence level. It quantifies the contribution of feature values ​​based on Shapley values. If the contribution of a feature value is greater than the risk-driven threshold, the feature value is used as the primary risk driver. If the contribution of a feature value is less than the protection-driven threshold, the feature value is used as the protection driver. Based on clinical indicators, the risk threshold is dynamically adjusted. If the probability of complications is less than the first risk threshold, the complication risk level is classified as low. If the probability of complications is greater than or equal to the first risk threshold and less than the second risk threshold, the complication risk level is classified as medium. If the probability of complications is greater than or equal to the second risk threshold, the complication risk level is classified as high, thus completing the complication prediction.

[0006] In conjunction with the first aspect, in some implementations of the first aspect, based on a pre-trained random forest model, the updated feature vector is used as the input value to calculate the complication probability, including: loading the random forest model and verifying the dimension of the updated feature vector; calculating the leaf node probability of a single decision tree in the random forest model based on the feature value and the split threshold; collecting the leaf node probabilities of all decision trees and obtaining the complication probability by solving the average value.

[0007] In conjunction with the first aspect, in some implementations of the first aspect, the contribution of feature values ​​is quantified based on Shapley values, including: for feature values ​​J in the updated feature vector, calculating the complication prediction probability when feature value J is included and when feature value J is excluded, respectively, according to the random forest model; calculating the Shapley value of feature value J based on the complication prediction probability when feature value J is included and when feature value J is excluded; and standardizing the Shapley value of feature value J to obtain the standardized contribution.

[0008] In conjunction with the first aspect, in certain implementations of the first aspect, the risk threshold is dynamically corrected based on clinical indicators, including: obtaining the coagulation ratio and platelet count from clinical indicators; if the coagulation ratio range meets the first interval and the platelet count range meets the second interval, the patient's coagulation function is determined to be normal; if the coagulation ratio range does not meet the first interval or the platelet count range does not meet the second interval, the patient's coagulation function is determined to be abnormal; for patients with normal coagulation function, a baseline risk threshold is calculated; for patients with abnormal coagulation function, a coagulation penalty value is calculated based on the coagulation ratio, a platelet compensation value is calculated based on the platelet count, and the corrected threshold is obtained by combining the baseline risk threshold.

[0009] In conjunction with the first aspect, in certain implementations of the first aspect, preoperative computed tomography (CT) images, puncture path planning data, and clinical indicators are acquired, and risk factors are calculated, including: obtaining the CT sequence of the puncture path through preoperative CT images; obtaining the puncture path based on the puncture path planning data; advancing along the puncture path from the skin entry point; taking the coordinates of the position where the CT value in the first CT sequence is greater than a preset CT threshold as the pleural surface; calculating the chest wall thickness based on the pleural surface; calculating the intrapulmonary length based on the coordinates of the point where the puncture path enters and leaves the lung tissue; for each organ, calculating the shortest distance from the organ surface point to the puncture path as the organ minimum distance; extending the puncture path to the extension point and calculating the minimum distance between the extended line segment and the organ; extracting the skin surface normal vector from the preoperative CT images and calculating the skin entry angle; extracting the pleural surface normal vector from the preoperative CT images and calculating the pleural entry angle; and combining the chest wall thickness, intrapulmonary length, organ minimum distance, minimum distance between the extended line segment and the organ, skin entry angle, and pleural entry angle as risk factors.

[0010] In conjunction with the first aspect, in certain implementations of the first aspect, numerical standardization, nonlinear transformation, and interactive feature generation are performed on risk factors to obtain a feature vector, including: obtaining weight indicators and tumor volume from clinical indicators; obtaining standardized chest wall thickness based on weight indicators; obtaining standardized intrapulmonary length based on tumor volume; performing logarithmic transformation on minimum organ distance to obtain transformed minimum organ distance; performing triangular decomposition on skin puncture angle to obtain transformed minimum organ distance; calculating chest wall-pleura risk coefficient based on chest wall thickness and pleural puncture angle; calculating intrapulmonary-coagulation risk index based on intrapulmonary length and platelet count; calculating tumor invasiveness index based on minimum organ distance and tumor volume; and combining the risk factors, standardized chest wall thickness, standardized intrapulmonary length, transformed minimum organ distance, transformed minimum organ distance, chest wall-pleura risk coefficient, intrapulmonary-coagulation risk index, and tumor invasiveness index into a feature vector.

[0011] In conjunction with the first aspect, in some implementations of the first aspect, the probability of a leaf node in a single decision tree in a random forest model is calculated based on the eigenvalue and the split threshold. This includes: for each decision tree in the random forest model, assigning the root node to the current node; if the current node is not a leaf node, assigning the split feature of the current node to the feature index; extracting the corresponding eigenvalue from the updated eigenvector input; if the eigenvalue is less than or equal to the split threshold, continuing to traverse downwards along the left child node; if the eigenvalue is greater than the split threshold, continuing to traverse along the right child node; repeatedly performing the eigenvalue determination process until the current node is a leaf node; and returning the probability estimate of the complications belonging to the positive class in the leaf node as the probability of a leaf node in a single decision tree in the random forest model.

[0012] Secondly, this application provides a complication prediction system based on SHAP-random forest, comprising: a data input module for acquiring preoperative computed tomography CT images and puncture path planning data, calculating risk factors including chest wall thickness, intrapulmonary length, minimum organ distance, minimum distance between extended line segments and organs, skin entry angle, and pleural entry angle; a feature engineering module for performing numerical standardization, nonlinear transformation, and interactive feature generation on the risk factors to obtain feature vectors, calculating the mutual information score of the feature values ​​in the feature vectors, retaining the feature values ​​if the mutual information score is greater than an empirical threshold, and obtaining the updated feature vectors after traversal; and a model prediction module for predicting the updated feature vectors based on a pre-trained random forest model. The system uses a quantitative parameter as input to calculate the probability of complications, and then calculates the confidence level based on the probability of complications. The contribution quantification module quantifies the contribution of feature values ​​based on Shapley values. If the contribution of a feature value is greater than the risk-driven threshold, it is used as the primary risk driver; if the contribution is less than the protection-driven threshold, it is used as the protection driver. The dynamic threshold module dynamically adjusts the risk threshold based on clinical indicators. If the probability of complications is less than the first risk threshold, the complication risk level is classified as low; if the probability is greater than or equal to the first risk threshold but less than the second risk threshold, the complication risk level is classified as medium; if the probability is greater than or equal to the second risk threshold, the complication risk level is classified as high, thus completing the complication prediction.

[0013] Thirdly, this application provides an electronic device, including: a processor; and a memory storing computer program instructions, which, when executed by the processor, implement the steps in the SHAP-random forest-based complication prediction method mentioned in the first aspect above.

[0014] Fourthly, this application provides a computer-readable storage medium storing computer program instructions, which, when executed by a processor, cause the processor to perform the steps in the SHAP-random forest-based complication prediction method mentioned in the first aspect.

[0015] The complication prediction method based on SHAP-random forest provided in this application solves the problems of existing complication prediction models, such as difficulty in data integration, weak feature representation ability, uninterpretable prediction results, and static risk stratification, by integrating automatic collection of multi-source medical data, high-dimensional feature engineering to optimize multi-dimensional feature values, Shapley value quantification of feature value contribution, and dynamic threshold mechanism that adapts to coagulation function. It achieves the effects of improving prediction accuracy, generating clinically operable decision-making basis, and realizing personalized risk stratification. Attached Figure Description

[0016] Figure 1 The diagram shown is a flowchart of a complication prediction method based on SHAP-random forest provided in an exemplary embodiment of this application.

[0017] Figure 2 The diagram shown is a flowchart of a complication prediction method based on SHAP-random forest provided in another exemplary embodiment of this application.

[0018] Figure 3 The diagram shown is a flowchart of a complication prediction method based on SHAP-random forest provided in another exemplary embodiment of this application.

[0019] Figure 4 The diagram shown is a flowchart of a complication prediction method based on SHAP-random forest provided in another exemplary embodiment of this application.

[0020] Figure 5 The diagram shown is a flowchart of a complication prediction method based on SHAP-random forest provided in another exemplary embodiment of this application.

[0021] Figure 6 The diagram shown is a flowchart of a complication prediction method based on SHAP-random forest provided in another exemplary embodiment of this application.

[0022] Figure 7 The diagram shown is a flowchart of a complication prediction method based on SHAP-random forest provided in another exemplary embodiment of this application.

[0023] Figure 8 The diagram shown is an architectural schematic of a complication prediction system based on SHAP-random forest provided in an exemplary embodiment of this application.

[0024] Figure 9 The diagram shown is a structural schematic of an electronic device provided in an exemplary embodiment of this application.

[0025] Figure 10 The diagram shown is a schematic diagram of a derivative risk label provided in an exemplary embodiment of this application. Detailed Implementation

[0026] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0027] The following is combined Figures 1 to 7 This application provides a detailed description of a complication prediction method based on SHAP-random forest.

[0028] Figure 1 The diagram shown is a flowchart illustrating a complication prediction method based on SHAP-random forest provided in an exemplary embodiment of this application. Figure 1 As shown in the embodiments of this application, the complication prediction method based on SHAP-random forest includes the following steps.

[0029] Step 100: Obtain preoperative computed tomography (CT) images and puncture path planning data, and calculate risk factors.

[0030] For example, preoperative CT images refer to preoperative chest / abdomen CT sequences of patients obtained through a Picture Archiving and Communication System (PACS), used to analyze the spatial parameters of the puncture path.

[0031] For example, puncture path planning data refers to key parameters extracted by the surgical navigation system. These key parameters include the skin puncture point, tumor target coordinates, and a set of vertex coordinates of important organs, which are used to define the vector and linear equations of the puncture path.

[0032] For example, clinical indicators refer to four-dimensional physiological parameters (body weight, tumor volume, coagulation ratio, and platelet count) extracted from the Hospital Information System (HIS), which are used to generate derived features, trigger coagulation abnormality judgment, and participate in threshold correction formula calculation.

[0033] For example, risk factors refer to the six-dimensional puncture-related parameters (chest wall thickness, lung length, minimum distance to the organ, minimum distance between the extended line segment and the organ, skin entry angle, and pleural entry angle) calculated through CT images and puncture path planning data. These parameters are used to constitute the original input for feature engineering, characterize the physical risk dimension of the puncture surgery, and are the basic variables for generating derived features.

[0034] Step 102: Perform numerical standardization, nonlinear transformation and interactive feature generation on the risk factors to obtain feature vectors. Calculate the mutual information score of each feature value in the feature vector. If the mutual information score is greater than the empirical threshold, retain the feature value. After the traversal is completed, the updated feature vector is obtained.

[0035] For example, the feature vector refers to a 23-dimensional structured vector containing risk factors (6 dimensions), standardized features (2 dimensions), nonlinear transformation features (3 dimensions), interaction features (3 dimensions), clinical indicators (4 dimensions), and derived risk labels (5 dimensions). It is used to output 16-20 dimension optimized feature values ​​after screening by mutual information scores, which are then used by the random forest model.

[0036] For example, mutual information score refers to an indicator that quantifies the correlation between each feature value in the feature vector and the statistical correlation of complications.

[0037] Step 104: Based on the pre-trained random forest model, the updated feature vector is used as the input value to calculate the probability of complications, and the confidence level is calculated based on the probability of complications.

[0038] For example, confidence level is an indicator that characterizes the predictive stability of a random forest model. It reflects the standard deviation of the output probabilities of each decision tree. The lower the confidence level, the greater the discrepancy in the model's predictions, suggesting that doctors should be cautious in accepting the results.

[0039] Step 106: Quantify the contribution of the feature value based on the Shapley value. If the contribution of the feature value is greater than the risk-driven threshold, the feature value is used as the main risk driver. If the contribution of the feature value is less than the protection-driven threshold, the feature value is used as the protection driver.

[0040] For example, the Shapley value is a game-theoretic measure of marginal contribution that calculates the average impact of an feature value on the prediction result across all combinations of feature subsets.

[0041] For example, contribution refers to the clinically interpretable measure of the Shapley value after standardization, which represents the strength of the influence of the feature value as a percentage.

[0042] Step 108: Dynamically adjust the risk threshold based on clinical indicators. If the probability of a complication is less than the first risk threshold, the complication risk level is classified as low; if the probability of a complication is greater than or equal to the first risk threshold but less than the second risk threshold, the complication risk level is classified as medium; if the probability of a complication is greater than or equal to the second risk threshold, the complication risk level is classified as high, thus completing the complication prediction.

[0043] For example, the first risk threshold refers to the condition for distinguishing between low and medium risk of complications. In this embodiment, the first risk threshold is set to be equal to half of the corrected threshold. The second risk threshold refers to the condition for distinguishing between medium and high risk of complications. In this embodiment, the second risk threshold is set to be equal to the corrected threshold.

[0044] The complication prediction method based on SHAP-random forest provided in this application solves the problems of existing complication prediction models, such as difficulty in data integration, weak feature representation ability, uninterpretable prediction results, and static risk stratification, by integrating automatic collection of multi-source medical data, high-dimensional feature engineering to optimize multi-dimensional feature values, Shapley value quantification of feature value contribution, and dynamic threshold mechanism based on clinical indicators. It achieves the effects of improving prediction accuracy, generating clinically operable decision-making basis, and realizing personalized risk stratification.

[0045] Figure 2 The diagram shown is a flowchart illustrating a complication prediction method based on SHAP-random forest provided in another exemplary embodiment of this application. Figure 1 This application extends from the embodiments shown. Figure 2 The illustrated embodiment will be described in detail below. Figure 2 The illustrated embodiments and Figure 1 The differences between the embodiments shown are not repeated here, and the similarities are not repeated here.

[0046] like Figure 2 As shown in the embodiment of this application, the complication prediction method based on SHAP-random forest calculates the complication probability based on the pre-trained random forest model, using the updated feature vector as the input value, including the following steps.

[0047] Step 200: Load the random forest model and verify the dimension of the updated feature vector.

[0048] Specifically, a pre-trained random forest model is input into the model storage system. The model parameters include: number of trees, maximum depth, and class weights (ratio of negative to positive samples). The node information of each decision tree is read to construct the forest storage structure. Node information includes: split feature index, split threshold, left / right child node pointers, and leaf node class distribution. The updated feature vector is x = [x1, x2, ..., x...]. m ]T In the expression, m ∈ [16, 20]; x1, x2, ..., x m This represents the feature value. Verify that the dimension of the updated feature vector matches the number of features during model training. If it exceeds the number, discard features starting from the lowest digit of the mutual information score; otherwise, fill with the median of the updated feature vector. Output the updated feature vector x.

[0049] Step 202: Calculate the probability of a leaf node in a single decision tree in the random forest model based on the feature values ​​and the splitting threshold.

[0050] For example, the split threshold refers to the critical value used to divide the data space at each non-leaf node in a single decision tree of a random forest model. The input feature value is compared with the preset split threshold of the node to achieve recursive segmentation of the feature space.

[0051] Step 204: Collect the leaf node probabilities of all decision trees, and obtain the complication probability by calculating the average value.

[0052] Specifically, collect the output probabilities P of all M trees. total = {P1, P2, ..., P M}, where M ranges from [20, 200]. Calculate the forest mean probability, i.e., the complication prediction probability P. avg : Based on the predicted probability P of complications avg Calculate the confidence score of M trees: Confidence score Q = 1 - std(P) total ) / 0.5; where std(P total Let P represent the standard deviation of the M probability values. tree_i The set of tree identifiers with a value greater than 0.7 is used as the dominant tree identifier. The feature value x that triggers the most "yes / no" decisions in each tree is recorded. m As a splitting feature x d Retrieve feature values ​​x from the leaf nodes of the dominant tree that have similar historical cases. his Take 3 eigenvalues ​​x his Calculate the similarity sim respectively: sim = 1 / (1 + ||x - x) his ||). The metadata includes the dominant tree identifier (Flag) and the splitting feature (x). d And similarity score sim.

[0053] The complication prediction method based on SHAP-random forest provided in this application integrates the probability outputs and confidence indices of multiple decision trees through a random forest model. This solves the problems of poor prediction stability and opaque results of single models, and achieves the technical effect of generating probabilistic complication risk values ​​and quantifying prediction reliability to assist doctors in assessing decision risks.

[0054] Figure 3 The diagram shown is a flowchart illustrating a complication prediction method based on SHAP-random forest provided in another exemplary embodiment of this application. Figure 1 This application extends from the embodiments shown. Figure 3 The illustrated embodiment will be described in detail below. Figure 3 The illustrated embodiments and Figure 1 The differences between the embodiments shown are not repeated here, and the similarities are not repeated here.

[0055] like Figure 3 As shown in the embodiments of this application, the complication prediction method based on SHAP-random forest quantifies the contribution of feature values ​​based on Shapley values, including the following steps.

[0056] Multiple background samples are randomly sampled from the random forest model, and the average predicted probability of these background samples is calculated as the baseline predicted value. Specifically, the updated feature vector, the dominant tree identifier Flag, and the split feature x are received. d And the similarity sim. N background samples {z1, z2, ..., z} are randomly sampled from the random forest model. N}, where z N Let represent the Nth updated feature vector. The SHAP calculation engine calculates the average predicted probability Φ0 of the N background samples: ; where the function f(z) i ) represents the probability of complication prediction in the random forest model.

[0057] Step 300: For each feature value J in the updated feature vector, calculate the predicted probability of complications when there is feature value J and when there is no feature value J, respectively, according to the random forest model.

[0058] Specifically, for each eigenvalue J in the updated eigenvector x, the following steps are performed: Generate a subset S of all features that do not contain eigenvalue J. {1, 2, ..., m}\{J}. Retain the feature values ​​in the feature subset S, and replace other feature values ​​with random values ​​to construct a mixed sample: x_S = {x1, x2, ..., x J , ..., x m}; where x JReplace with random values. Calculate the complication prediction probability f(x_S ∪ J) when there is an eigenvalue J, based on the random forest model. Calculate the complication prediction probability f(x_S) when there is no eigenvalue J, based on the random forest model.

[0059] Step 302: Calculate the Shapley value of feature J based on the predicted probability of complications when feature J is included and when feature J is excluded.

[0060] Calculate the Shapley value φ of eigenvalue J. J : ; Where F is the set of all eigenvalues, |F| = m; φ J This represents the mean marginal contribution of the eigenvalue J across all combinations.

[0061] Step 304: Standardize the Shapley value of eigenvalue J to obtain the standardized contribution.

[0062] The Shapley values ​​are converted into clinically understandable contribution values, resulting in a standardized contribution vector s = [s1, s2, ..., s]. m The standardized formula is as follows: ; Based on the baseline prediction value Φ0, if the standardized contribution s of the eigenvalue J J >0.1 × (P avg If -Φ0), then the eigenvalue J is taken as the main risk driver; where J ∈ {1, 2, ..., m}. If the standardized contribution s of eigenvalue J... J <- 0.05× (P avg If -Φ0), then the eigenvalue J is used as the protection driver, where 0.1 × (P avg -Φ0) represents the risk-driven threshold, -0.05 × (P avg - Φ0) represents the protection drive threshold.

[0063] Based on the standardized contribution s of eigenvalue J J The standardized contribution of eigenvalue K K Calculate the contribution of features to the combination I JK = |s J + s K - s{J, K}|; where s{J, K} represents the joint contribution when eigenvalues ​​J and K are both present. If the combined contribution of the eigenvalue pair is I... JKA value >0.15 indicates a significant interaction effect. A structured analysis report is generated, which includes the baseline value Φ0, eigenvalues, Shapley values ​​of the eigenvalues, and standardized contribution values ​​(Shapley). J Characteristic effect analysis; Characteristic effect analysis includes main risk drivers, protection drivers, and interaction effects.

[0064] If the confidence score Q of the decision tree with the dominant tree identifier Flag is less than 0.7, or the maximum similarity max(sim) of the decision tree with the dominant tree identifier Flag is less than 0.8, then the update process of the random forest model is triggered, including: Traverse all decision trees with a dominant tree identifier (Flag) and select the decision tree that meets any of the following conditions: leaf node sample size n0 + n1 < 50 or split feature x d If the mutual information score MI(X, Y) < λ, then the set of decision trees to be optimized is obtained.

[0065] For each decision tree in the optimized decision tree set, retrieve three decision trees with similar historical cases and extract the splitting features x of the three decision trees. d {v1, v2, v3}, update the split threshold to the median of {v1, v2, v3}.

[0066] It should be understood that the primary risk driver refers to the most important characteristic value that may lead to an increased probability of complications, while the protective driver refers to the most important characteristic value that may lead to a decreased probability of complications.

[0067] The complication prediction method based on SHAP-random forest provided in this application solves the problems of uninterpretable prediction logic and low clinical trust in black-box models by quantifying the marginal contribution of features and detecting interaction effects through the Shapley value calculation submodule. It achieves the technical effect of visualizing key risk drivers, such as high bleeding risk markers, and generating traceable clinical decision-making basis.

[0068] Figure 4 The diagram shown is a flowchart illustrating a complication prediction method based on SHAP-random forest provided in another exemplary embodiment of this application. Figure 1 This application extends from the embodiments shown. Figure 4 The illustrated embodiment will be described in detail below. Figure 4 The illustrated embodiments and Figure 1 The differences between the embodiments shown are not repeated here, and the similarities are not repeated here.

[0069] like Figure 4 As shown in the embodiments of this application, the complication prediction method based on SHAP-random forest dynamically corrects the risk threshold according to clinical indicators, including the following steps.

[0070] Step 400: Obtain the coagulation ratio and platelet count from clinical indicators. If the coagulation ratio range meets the first interval and the platelet count range meets the second interval, the patient's coagulation function is determined to be normal. If the coagulation ratio range does not meet the first interval or the platelet count range does not meet the second interval, the patient's coagulation function is determined to be abnormal.

[0071] The probability P of receiving complications from the random forest module avg Standardized data packets for data input modules.

[0072] If the coagulation ratio INR ∈ [0.8, 10] and the platelet count ∈ [10, 600] × 10 9 If the INR is less than 0.8, then the patient is classified as having normal coagulation function. If the INR is not within the range of [0.8, 10] or the platelet count is not within the range of [10, 600] × 10⁻¹⁰, then the patient is classified as having normal coagulation function. 9 If the blood volume is / L, the patient is classified as having abnormal coagulation function.

[0073] Step 402: For patients with normal coagulation function, calculate the baseline risk threshold.

[0074] Specifically, for patients with normal coagulation function, the threshold calculation engine calculates the baseline risk threshold T. base :T base = α + 0.05 × I A (V tumor ); where α is an empirical threshold, and in this embodiment, α = 0.25 by default; function I A () is an indicator function, A = [20, ∞], which determines the tumor volume V. tumor If the element belongs to set A, return 1; otherwise, return 0.

[0075] Step 404: For patients with abnormal coagulation function, calculate the coagulation penalty value based on the coagulation ratio, calculate the platelet compensation value based on the platelet count, and combine it with the baseline risk threshold to obtain the corrected threshold.

[0076] Calculate the platelet compensation value for patients with coagulation disorders: C p = 1 - β + β × Platelet / 150; where β is the platelet compensation coefficient, and the larger the value, the greater the influence of platelets.

[0077] Calculate the coagulation penalty value for patients with coagulation dysfunction: C i = γ × max(0, INR - 1.2); where γ is the INR penalty coefficient, used to measure the degree of influence of INR on the risk of complications.

[0078] Calculate the correction formula: Corrected threshold T final = T base × min(1, 1 - β + β × Platelet / 150 - γ × max(0,INR - 1.2)).

[0079] Define the risk level for complications: ; Among them, 0.5T final This represents the first risk threshold, and the corrected threshold T. final This represents the second risk threshold. To avoid frequent changes in the critical value, a buffer mechanism is established, classifying the ±0.02 boundary range as a higher level. Then: when |P avg - 0.5T final When | < 0.02, it is classified as a medium-risk level; when | P avg - T final When |<0.02, it is classified as a medium-risk level.

[0080] The intervention suggestion generator generates intervention strategies: When the risk level is low, routine monitoring and additional coagulation function re-examination should be performed.

[0081] When the risk level is medium, prepare rescue equipment and blood in advance.

[0082] When the risk level is high, the procedure is paused for replanning and intravenous administration of clotting factors is performed.

[0083] The output threshold decision package is transmitted to the report generation module. The threshold decision package includes the complication prediction probability P. avg Experience threshold α, basic risk threshold T base Corrected threshold T final Risk level, platelet compensation value C p INR penalty value C i And intervention strategies.

[0084] The complication prediction method based on SHAP-random forest provided in this application solves the problems of fixed threshold ignoring individual differences in patients' coagulation function and frequent jumps in critical values ​​by dynamically adjusting thresholds based on clinical indicators and setting a buffer mechanism (the ±0.02 range is classified as high-risk). This achieves the technical effect of accurately stratifying risk levels based on coagulation ratio / platelet index and generating targeted intervention strategies.

[0085] Figure 5The diagram shown is a flowchart illustrating a complication prediction method based on SHAP-random forest provided in another exemplary embodiment of this application. Figure 1 This application extends from the embodiments shown. Figure 5 The illustrated embodiment will be described in detail below. Figure 5 The illustrated embodiments and Figure 1 The differences between the embodiments shown are not repeated here, and the similarities are not repeated here.

[0086] like Figure 5 As shown in the embodiments of this application, the complication prediction method based on SHAP-random forest involves acquiring preoperative computed tomography CT images, puncture path planning data, and clinical indicators, and calculating risk factors, including the following steps.

[0087] Step 500: Obtain the CT sequence of the puncture path through preoperative CT images, obtain the puncture path according to the puncture path planning data, advance along the puncture path from the skin entry point, take the coordinates of the first location in the CT sequence where the CT value is greater than the preset CT threshold as the pleural surface, and calculate the chest wall thickness based on the pleural surface.

[0088] The system receives a prediction request, which includes the patient ID and surgery ID. It connects to the Picture Archiving System (PACS) via the Digital Imaging and Communications in Medicine (DICOM) protocol, to the Hospital Information System (HIS) via the HL7 protocol, and to the electronic medical record database via the Application Programming Interface (API).

[0089] Based on the patient ID and surgery ID, the latest preoperative chest / abdominal CT sequence was retrieved from the PACS system. Raw DICOM pixel data was extracted, comprising a 512 × 512 × N matrix, where N is the number of prediction requests received. Metadata from the DICOM header file was extracted, including spatial resolution: (Δ... x , Δ y , Δ z Origin of coordinate system: (O) x O y O z It outputs 3D CT volume data and spatial parameter set, and transmits them to the geometry calculation engine.

[0090] Key parameters were extracted from the surgical navigation system, including the skin puncture point P. skin = (x s , y s , z s), tumor target coordinates P target = (x t , y t , z t The set of vertex coordinates of important organs {O1, O2, ..., O k}

[0091] Calculate the puncture path vector: V = P target - P skin .

[0092] Calculate the equation of the straight path: .

[0093] Input CT body data and path geometry parameters, and proceed along the puncture path from the skin entry point P. skin Proceeding inward, detect the coordinates of the location where the first CT value > -200 HU is encountered, i.e., P on the pleural surface. pleura .

[0094] Calculate chest wall thickness d cw Euclidean distance: d cw = || P pleura - P skin ||;where d cw This indicates the physical length of the puncture needle that passes through the chest wall.

[0095] Step 502: Calculate the length of the lung based on the coordinates of the point where the path enters the lung tissue and the coordinates of the point where the path leaves the lung tissue.

[0096] Location path to lung tissue point coordinates P in = P pleura The coordinates of the point P where the path leaves the lung tissue out .

[0097] Calculate the length of the lung l lung Euclidean distance: l lung =|| P out - P in ||;where, l lung This indicates the length of the puncture path exposed within the lung parenchyma.

[0098] Step 504: For each organ, calculate the shortest distance from a point on the organ surface to the straight line of the path as the organ's minimum distance.

[0099] For each important organ O i The shortest distance from a point on the surface to the straight line along the path is calculated as the minimum distance d of the organ. min The calculation formula is as follows: The function dist() represents the distance function from a point to a line.

[0100] Step 506: Extend the puncture path to the extension point and calculate the minimum distance between the extended line segment and the organ.

[0101] Extend the puncture path to the extension point P ext = P skin + 2 × V, calculate the minimum distance d between the extended line segment and the organ. ext : .

[0102] Step 508: Extract the skin surface normal vector from the preoperative CT image and calculate the skin entry angle.

[0103] Extract the skin surface normal vector N using CT gradient calculation. skin .

[0104] Calculate the skin penetration angle θ skin The included angle: , where θ skin This indicates the angle between the needle insertion direction and the skin surface.

[0105] Step 510: Extract the pleural surface normal vector from the preoperative CT image and calculate the pleural entry angle.

[0106] The pleural surface normal vector N is extracted using CT gradient calculation. pleura .

[0107] Calculate the pleural entry angle θ pleura The included angle: ; where θ skin This indicates the angle between the needle insertion direction and the pleural surface.

[0108] Patient data returned by the HIS system is integrated into clinical indicators, from which key indicators are extracted, including body mass index (BMI) and tumor volume (V). tumor Coagulation ratio (INR) and platelet count (Platelet).

[0109] Detecting coagulation function abnormalities directly impacts subsequent risk threshold adjustments. Specifically, coagulation function abnormality assessment includes: INR > 0.5 or Platelet < 20 × 10⁻⁶. 9 If / L is selected, a clinical alert will be triggered, but the process will not be interrupted; otherwise, the original value will be retained.

[0110] Measure chest wall thickness d cw , pleural insertion angle θ pleura The range of the platelet count, where d cw ∈[5, 50mm];θ pleura ∈ [0, 90°]; Platelet ∈ [10, 600]× 10 9 / L.

[0111] Output a standardized data package, which includes data on 6 factors and 4 clinical indicators.

[0112] The complication prediction method based on SHAP-random forest provided in this application solves the problems of low efficiency and large error in surgical parameter extraction caused by the reliance on manual measurement in traditional systems by automatically parsing puncture path parameters through multi-protocol data channel integration and geometric calculation engine. It achieves the technical effect of standardizing input surgical planning data and clinical indicators, and providing high-precision spatial parameters for feature engineering.

[0113] Figure 6 The diagram shown is a flowchart illustrating a complication prediction method based on SHAP-random forest provided in another exemplary embodiment of this application. Figure 1 This application extends from the embodiments shown. Figure 6 The illustrated embodiment will be described in detail below. Figure 6 The illustrated embodiments and Figure 1 The differences between the embodiments shown are not repeated here, and the similarities are not repeated here.

[0114] like Figure 6 As shown in the embodiments of this application, the complication prediction method based on SHAP-random forest performs numerical standardization, nonlinear transformation and interactive feature generation on risk factors to obtain feature vectors, including the following steps.

[0115] Step 600: Obtain weight and tumor volume from clinical indicators. Based on the weight, obtain the standardized chest wall thickness. Based on the tumor volume, obtain the standardized intrapulmonary length.

[0116] The system receives standardized data packets from the data input module, structures them in memory, and verifies their integrity.

[0117] To correct chest wall thickness values ​​using the body mass index (BMI) and avoid misjudgment in obese patients, chest wall thickness is standardized as: d cw 1 =d cw / BMI.

[0118] Based on tumor volume V tumor To quantify the relative relationship between pathway exposure and tumor size, the intrapulmonary length is standardized as: l lung 1 = l lung 2 / V tumor .

[0119] Output normalized feature d cw 1 l lung 1Transferred to the feature pool for temporary storage.

[0120] Step 602: Perform a logarithmic transformation on the minimum distance of the organ to obtain the transformed minimum distance of the organ, and perform trigonometric decomposition on the skin entry angle to obtain the transformed minimum distance of the organ.

[0121] To compress the large numerical range and highlight the importance of critical distances (<5mm), a logarithmic transformation is applied to the minimum organ distance: The transformed minimum organ distance d min 1 = log 10 (d min + 1).

[0122] skin penetration angle θ skin Perform trigonometric decomposition to transform the periodicity of angles into linearly separable orthogonal components: Skin_sin = sin(θ) skin × π / 180), Skin_cos = cos(θ skin × π / 180).

[0123] Output transformation feature d min 1 Skin_sin and Skin_cos are transferred to the feature pool for temporary storage.

[0124] Step 604: Calculate the chest wall-pleura risk coefficient based on chest wall thickness and pleural entry angle; calculate the lung-coagulation risk index based on lung length and platelet count; and calculate the tumor invasiveness index based on minimum organ distance and tumor volume.

[0125] Quantifying the combined risks of "thick chest wall" and "large angle," the chest wall-pleura risk coefficient is calculated: f cw_pleura = (d cw ×θ pleura ) / 100.

[0126] The longer the intrapulmonary pathway and the lower the platelet count, the higher the risk of bleeding; therefore, the intrapulmonary coagulation risk index is: f lung_coag =l lung × (2 - Platelet / 150).

[0127] Calculate the tumor invasiveness index f tumor_inv Assess the erosive effect of tumor size on the safety distance. tumor_inv : .

[0128] Output interaction features f cw_pleura f lung_coag f tumor_inv Transferred to the feature pool for temporary storage.

[0129] Step 606: The risk factors, standardized chest wall thickness, standardized intrapulmonary length, transformed organ minimum distance, transformed organ minimum distance, chest wall-pleura risk coefficient, intrapulmonary-coagulation risk index, and tumor invasion index are combined into a feature vector.

[0130] It should be understood that features in the feature pool are stored in the form of feature vectors, where features in the feature vectors include the original 6 factors (6 dimensions), normalized features (2 dimensions), nonlinear transformation features (3 dimensions), interaction features (3 dimensions), clinical indicators (4 dimensions), and derived risk labels (5 dimensions). Figure 10 The diagram shown illustrates a derived risk labeling system provided in an exemplary embodiment of this application. The derived risk labels include high bleeding risk, low platelet count, obese patient status, large tumor status, and acute needle angle. If the INR (infusion rate) > 1.5, a high bleeding risk is identified; if the platelet count < 100, a low platelet count is identified; if the BMI (body mass index) > 30, an obese patient status is identified; and if the tumor volume V... tumor If the angle of penetration into the pleura is greater than 20, it is marked as a large tumor. pleura If the angle is greater than 45, it is marked as a sharp needle angle.

[0131] To quantify the statistical correlation between eigenvalue X and complication Y, the mutual information (MI) score for each eigenvalue in the eigenvector is calculated: ; If the mutual information score MI(X, Y) > λ, then the feature value X is retained; otherwise, it is removed from the feature vector. Here, λ is an empirical threshold, which is defaulted to λ = 0.05 in this embodiment of the invention.

[0132] After the traversal is complete, the updated feature vector is obtained. The updated feature vector (16-20 dimensions) is output and transmitted to the random forest prediction module and the contribution metric module.

[0133] The complication prediction method based on SHAP-random forest provided in this application corrects chest wall thickness by weight index, standardizes lung length by tumor volume, decomposes triangular angle features, and generates interactive features (such as chest wall-pleura risk coefficient). This solves the problem that the original features have weak medical relevance and cannot represent complex pathological interactions. It achieves the technical effect of enhancing the model's ability to represent special cases such as obese patients / large tumors and improving the density of feature information.

[0134] Figure 7 The diagram shown is a flowchart illustrating a complication prediction method based on SHAP-random forest provided in another exemplary embodiment of this application. Figure 2This application extends from the embodiments shown. Figure 7 The illustrated embodiment will be described in detail below. Figure 7 The illustrated embodiments and Figure 2 The differences between the embodiments shown are not repeated here, and the similarities are not repeated here.

[0135] like Figure 7 As shown in the embodiment of this application, the complication prediction method based on SHAP-random forest calculates the probability of a leaf node in a single decision tree in the random forest model according to the eigenvalue and the splitting threshold, including the following steps.

[0136] Step 700: For each decision tree in the random forest model, assign the root node to the current node.

[0137] For example, a decision tree is a tree structure consisting of split nodes and leaf nodes in a random forest model, used for recursive partitioning of the feature space and generation of individual prediction probabilities.

[0138] Step 702: If the current node is not a leaf node, then assign the splitting feature of the current node to the feature index.

[0139] For example, a leaf node is the terminal node of a decision tree, which does not contain a split threshold or child node pointers, but only stores the category distribution and a set of historical case feature values.

[0140] Step 704: Extract the corresponding feature value from the updated feature vector. If the feature value is less than or equal to the split threshold, continue traversing downwards along the left child node. If the feature value is greater than the split threshold, continue traversing along the right child node.

[0141] For example, the left child node refers to one of the two branches that a non-leaf node in a decision tree is divided into according to the splitting rules. When the value of a specified dimension in the input feature value is less than or equal to the splitting threshold of the current node, the data flows to the left child node of that node.

[0142] For example, the right child node refers to the branch node that is equivalent to the left child node, and is used to direct data flow to the right child node of the current node when the value of a specified dimension in the input feature value is greater than the split threshold of the current node.

[0143] For example, in this embodiment of the application, an initial empirical value is set for the split threshold, and then the random forest model updates the split threshold.

[0144] Step 706: Repeat the feature value determination process continuously until the current node is a leaf node.

[0145] Step 708: Return the probability estimate of the complication belonging to the positive class in the leaf node, as the probability of the leaf node of a single decision tree in the random forest model.

[0146] It should be understood that the formula for calculating the probability of a leaf node is: P tree_i (y = 1) = n1 / (n0+ n1); n0 represents the number of complication cases that reached this leaf during training; n1 represents the number of non-complication cases that reached this leaf during training.

[0147] Leaf node probability P tree_i (y = 1) represents the positive sample probability P for each tree. tree_i ∈ [0, 1] are transmitted to the forest aggregation submodule.

[0148] The complication prediction method based on SHAP-random forest provided in this application solves the problem of poor prediction stability of a single model by using the probability estimate of the complication belonging to the positive class contained in the leaf nodes of each decision tree in the random forest model as the leaf node probability of a single decision tree in the random forest model. This achieves the effect of generating probabilistic complication risk values ​​and quantifying the reliability of prediction.

[0149] In another embodiment, after dynamically adjusting the risk threshold based on clinical indicators to complete the complication risk level classification, the method further includes: The received data is a standardized data packet from the data input module, and the complication prediction probability P from the random forest module is also received. avg Confidence level, the feature contribution list s = [s1, s2, ..., s] of the receive contribution metric module. m ], receive the corrected threshold T from the dynamic threshold module final Risk level and intervention strategy.

[0150] A core reporting framework was constructed, with tags including basic patient information, risk overview, feature contribution analysis, and clinical recommendations. Patient ID, gender, and age were obtained from the HIS system, and surgery number and scheduled time were obtained from the surgical system and populated into the patient's basic information.

[0151] The data mapper calculates the risk matrix: RiskMatix = [P avg , T final , P avg / T final ]; where P avg / T final This indicates the extent to which the quantified risk has exceeded the acceptable level.

[0152] Populate the RiskMatix risk matrix into the Risk Overview and filter by risk. J max(0.1P) avg The eigenvalues ​​of (, 0.05).

[0153] For the eigenvalue J with positive contribution, the clinical description is: "The value of eigenvalue J is s". J Increased risk J %".

[0154] For the eigenvalue J with negative contribution, the clinical description is: "The value of eigenvalue J is s..." J Reduce risk. J %".

[0155] Sort the feature values ​​J, prioritizing features that exceed the clinical normal range: sorting weight = |s J | × I A (s J ), where A is the normal range of values ​​for the eigenvalue J.

[0156] The clinical language of each sorted feature value J is used to populate the feature contribution analysis, and a suggestion rule base is established. Some of the rules are as follows: If the risk level is high and the pleural insertion angle is >35°, the output recommendation is: "Immediately adjust the insertion angle to <30° and prepare a closed pleural drainage kit."

[0157] If the risk level is moderate and platelet count is <100 × 10⁻⁶ 9 If / L, the output suggestion is: "Prepare 400ml of blood before surgery and monitor hemoglobin 24h after surgery".

[0158] If the distance between organs is <5mm and the tumor volume is >20cm 3 The output suggestion is: "It is recommended to use real-time ultrasound guidance to avoid the danger zone and reduce the size of the puncture needle."

[0159] Assign a priority to each rule in the suggestion rule base: Priority = μ × RiskLevel + ν × max(|s J |); where μ is the risk level weight; ν is the maximum feature contribution weight, μ + ν = 1.

[0160] Each rule is prioritized and populated into clinical recommendations, and the core reporting framework is output to the user interface.

[0161] Figure 8 The diagram shows the architecture of a complication prediction system based on SHAP-random forest provided in an exemplary embodiment of this application. Figure 8 As shown, the complication prediction system based on SHAP-random forest provided in this application includes: a data input module 800, a feature engineering module 802, a model prediction module 804, a contribution quantification module 806, and a dynamic threshold module 808.

[0162] The data input module 800 is used to acquire preoperative computed tomography (CT) images and puncture path planning data, and calculate risk factors, including chest wall thickness, intrapulmonary length, minimum distance to organs, minimum distance between extended line segments and organs, skin entry angle, and pleural entry angle. The feature engineering module 802 is used to perform numerical standardization, nonlinear transformation, and interactive feature generation on the risk factors to obtain feature vectors. It calculates the mutual information score of the feature values ​​in the feature vectors; if the mutual information score is greater than an empirical threshold, the feature value is retained. After traversal, the updated feature vector is obtained. The model prediction module 804 is used to calculate the probability of complications based on a pre-trained random forest model, using the updated feature vector as input. Based on the complication probability, the confidence level is calculated; the contribution quantification module 806 is used to quantify the contribution of the feature value based on the Shapley value. If the contribution of the feature value is greater than the risk-driven threshold, the feature value is used as the main risk driver; if the contribution of the feature value is less than the protection-driven threshold, the feature value is used as the protection driver; the dynamic threshold module 808 is used to dynamically adjust the risk threshold according to clinical indicators. If the complication probability is less than the first risk threshold, the complication risk level is classified as low; if the complication probability is greater than or equal to the first risk threshold and less than the second risk threshold, the complication risk level is classified as medium; if the complication probability is greater than or equal to the second risk threshold, the complication risk level is classified as high, thus completing the complication prediction.

[0163] It should be understood that the operation and functions of the relevant modules mentioned in the SHAP-Random Forest-based complication prediction system can be referenced above. Figures 1 to 7 The complication prediction method based on SHAP-random forest provided will not be elaborated here to avoid repetition.

[0164] Figure 9 The diagram shown is a structural schematic of an electronic device provided in an exemplary embodiment of this application. Figure 9 As shown, the electronic device 90 includes one or more processors 901 and memory 902.

[0165] The processor 901 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 90 to perform desired functions.

[0166] The memory 902 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 901 may execute the program instructions to implement the calculation of risk factors, combination of feature vectors, and / or other desired functions as described in the various embodiments of this application above. The computer-readable storage medium may also store information such as the standardized intrapulmonary length l. lung 1 Minimum distance d between organs after transformation min 1 Various other content.

[0167] In one example, the electronic device 90 may also include an input device 903 and an output device 904, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).

[0168] The input device 903 may include, for example, a keyboard, a mouse, etc.

[0169] The output device 904 can output various information to the outside, including the probability of complication prediction. The output device 904 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.

[0170] Of course, for the sake of simplicity, Figure 9 Only some of the components of the electronic device 90 relevant to this application are shown in this illustration; components such as buses, input / output interfaces, etc., are omitted. In addition, the electronic device 90 may include any other suitable components depending on the specific application.

[0171] In addition to the methods and apparatus described above, embodiments of this application may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the SHAP-random forest-based complication prediction method according to various embodiments of this application described above.

[0172] Computer program products can be written in any combination of one or more programming languages ​​to perform the operations of the embodiments of this application. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.

[0173] Furthermore, embodiments of this application may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps of the SHAP-random forest-based complication prediction method according to various embodiments of this application described above.

[0174] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may, for example, include, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0175] The basic principles of this application have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in this application are merely examples and not limitations, and should not be considered as essential features of each embodiment of this application. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the application to the necessity of employing the aforementioned specific details for implementation.

[0176] The block diagrams of devices, apparatuses, devices, and systems involved in this application are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, apparatuses, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.

[0177] It should also be noted that in the apparatus, equipment, and methods of this application, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered as equivalent solutions of this application.

[0178] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use this application. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of this application. Therefore, this application is not intended to be limited to the aspects shown herein, but rather to be accorded the widest scope consistent with the principles and novel features disclosed herein.

[0179] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of this application to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.

Claims

1. A complication prediction method based on SHAP-random forest, characterized in that, include: Acquire preoperative computed tomography (CT) images and puncture path planning data, and calculate risk factors, including chest wall thickness, intrapulmonary length, minimum distance to organs, minimum distance between extended line segments and organs, skin entry angle, and pleural entry angle. Numerical standardization, nonlinear transformation, and interactive feature generation are performed on the risk factors to obtain feature vectors. The mutual information score of the feature values ​​in the feature vectors is calculated. If the mutual information score is greater than an empirical threshold, the feature value is retained. After the traversal is completed, the updated feature vector is obtained. Based on the pre-trained random forest model, the updated feature vector is used as the input value to calculate the probability of complications, and the confidence level is calculated based on the probability of complications. The contribution of the feature value is quantified based on the Shapley value. If the contribution of the feature value is greater than the risk-driven threshold, the feature value is used as the main risk driver. If the contribution of the feature value is less than the protection-driven threshold, the feature value is used as the protection driver. Based on clinical indicators, the risk threshold is dynamically adjusted. If the probability of a complication is less than the first risk threshold, the complication risk level is classified as low. If the probability of a complication is greater than or equal to the first risk threshold and less than the second risk threshold, the complication risk level is classified as medium. If the probability of a complication is greater than or equal to the second risk threshold, the complication risk level is classified as high, thus completing the complication prediction.

2. The complication prediction method based on SHAP-random forest according to claim 1, characterized in that, The pre-trained random forest model uses the updated feature vector as input to calculate the probability of complications, including: Load the random forest model and verify the dimension of the updated feature vector; Based on the eigenvalues ​​and the splitting threshold, the probability of a leaf node in a single decision tree in the random forest model is calculated. Collect the leaf node probabilities of all decision trees, and obtain the complication probability by averaging the results.

3. The complication prediction method based on SHAP-random forest according to claim 1, characterized in that, The quantification of the contribution of the feature value based on the Shapley value includes: For the feature value J in the updated feature vector, the complication prediction probability is calculated according to the random forest model when the feature value J is included and when the feature value J is excluded. The Shapley value of the feature value J is calculated based on the predicted probability of complications when the feature value J is included and when the feature value J is excluded. The Shapley value of the eigenvalue J is standardized to obtain the standardized contribution.

4. The complication prediction method based on SHAP-random forest according to any one of claims 1-3, characterized in that, The dynamic adjustment of risk thresholds based on clinical indicators includes: The coagulation ratio and platelet count are obtained from the clinical indicators. If the coagulation ratio range meets the first interval and the platelet count range meets the second interval, the patient's coagulation function is determined to be normal. If the coagulation ratio range does not meet the first interval or the platelet count range does not meet the second interval, the patient's coagulation function is determined to be abnormal. For patients with normal coagulation function, calculate the baseline risk threshold; For patients with abnormal coagulation function, a coagulation penalty value is calculated based on the coagulation ratio, a platelet compensation value is calculated based on the platelet count, and a corrected threshold is obtained by combining the baseline risk threshold.

5. The complication prediction method based on SHAP-random forest according to any one of claims 1-3, characterized in that, The acquisition of preoperative computed tomography (CT) images and puncture path planning data, and the calculation of risk factors, include: The CT sequence of the puncture path is obtained through the preoperative CT images. The puncture path is obtained according to the puncture path planning data. The puncture path is advanced from the skin entry point. The coordinates of the position where the CT value of the first encounter in the CT sequence is greater than the preset CT threshold are taken as the pleural surface. The chest wall thickness is calculated based on the pleural surface. The length of the lung is calculated based on the coordinates of the point of entry into and exit from the lung tissue along the puncture path. For each organ, the shortest distance from a point on the organ surface to the puncture path is calculated as the minimum distance to the organ; Extend the puncture path to the extension point, and calculate the minimum distance between the extended line segment and the organ; The skin surface normal vector is extracted from the preoperative CT images, and the skin entry angle is calculated. The pleural surface normal vector is extracted from the preoperative CT images, and the pleural entry angle is calculated. The chest wall thickness, the lung length, the minimum distance to the organ, the minimum distance between the extended line segment and the organ, the skin entry angle, and the pleural entry angle together constitute the risk factors.

6. The complication prediction method based on SHAP-random forest according to any one of claims 1-3, characterized in that, The process of performing numerical standardization, nonlinear transformation, and interactive feature generation on the risk factors to obtain feature vectors includes: The body weight and tumor volume are obtained from the clinical indicators. Based on the body weight, the standardized chest wall thickness is obtained, and based on the tumor volume, the standardized intrapulmonary length is obtained. Logarithmic transformation is applied to the minimum distance of the organ to obtain the transformed minimum distance of the organ; trigonometric decomposition is applied to the skin insertion angle to obtain the transformed minimum distance of the organ. The chest wall-pleura risk coefficient is calculated based on the chest wall thickness and the pleural entry angle; the lung-coagulation risk index is calculated based on the lung length and platelet count; and the tumor invasiveness index is calculated based on the minimum distance between the organs and the tumor volume. The feature vector is composed of the risk factors, the standardized chest wall thickness, the standardized intrapulmonary length, the transformed minimum organ distance, the transformed minimum organ distance, the chest wall-pleura risk coefficient, the intrapulmonary-coagulation risk index, and the tumor invasiveness index.

7. The complication prediction method based on SHAP-random forest according to claim 2, characterized in that, The step of calculating the probability of a leaf node in a single decision tree in the random forest model based on the feature value and the splitting threshold includes: For each decision tree in the random forest model, the root node is assigned to the current node; If the current node is not a leaf node, then the splitting feature of the current node is assigned to the feature index; Extract the corresponding feature value from the updated feature vector. If the feature value is less than or equal to the split threshold, continue traversing downwards along the left child node. If the feature value is greater than the split threshold, continue traversing along the right child node. The feature value determination process is repeated continuously until the current node is the leaf node; Return the probability estimate of the complication belonging to the positive class in the leaf node, as the leaf node probability of a single decision tree in the random forest model.

8. A complication prediction system based on SHAP-random forest, characterized in that, include: The data input module is used to acquire preoperative computed tomography (CT) images and puncture path planning data, and to calculate risk factors, including chest wall thickness, intrapulmonary length, minimum distance to organs, minimum distance between the extended line segment and the organ, skin entry angle, and pleural entry angle. The feature engineering module is used to perform numerical standardization, nonlinear transformation and interactive feature generation on the risk factors to obtain feature vectors, calculate the mutual information score of the feature values ​​in the feature vectors, and retain the feature values ​​if the mutual information score is greater than an empirical threshold. After the traversal is completed, the updated feature vector is obtained. The model prediction module is used to calculate the probability of complications based on the updated feature vector as input value, and calculate the confidence level based on the probability of complications, using the pre-trained random forest model. The contribution quantification module is used to quantify the contribution of the feature value based on the Shapley value. If the contribution of the feature value is greater than the risk-driven threshold, the feature value is used as the main risk driver. If the contribution of the feature value is less than the protection-driven threshold, the feature value is used as the protection driver. The dynamic threshold module is used to dynamically adjust the risk threshold based on clinical indicators. If the probability of a complication is less than the first risk threshold, the complication risk level is classified as low. If the probability of a complication is greater than or equal to the first risk threshold and less than the second risk threshold, the complication risk level is classified as medium. If the probability of a complication is greater than or equal to the second risk threshold, the complication risk level is classified as high, thus completing the complication prediction.

9. An electronic device, characterized in that, include: Processor; and A memory that stores computer program instructions, which, when executed by a processor, cause the processor to perform the steps of the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, A computer-readable storage medium stores computer program instructions that, when executed by a processor, cause the processor to perform the steps of the method as described in any one of claims 1 to 7.

Citation Information

Cited By

  • Integrated structure intelligent design system and method for building industry field

    CN121808921A