Diabetes patient bowel preparation quality prediction method based on shap

By using an SHAP-based method to predict the quality of bowel preparation in diabetic patients, and leveraging ensemble learning algorithms and the SHAP framework, we have addressed the shortcomings of relying on physician experience and traditional models in predicting the quality of bowel preparation in diabetic patients. This method achieves more accurate, stable, and transparent predictions, enabling precise identification of key factors and the development of personalized solutions.

CN121122679BActive Publication Date: 2026-04-10THE FIRST AFFILIATED HOSPITAL OF XIAMEN UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-12
Publication Date
2026-04-10

AI Technical Summary

Technical Problem

Existing technologies for predicting bowel preparation quality in diabetic patients rely on physician experience and are easily affected by individual differences, resulting in insufficient consistency in judgment. Traditional machine learning models have limited accuracy and stability and cannot clearly present the impact of various clinical indicators on the prediction results.

Method used

A SHAP-based method for predicting bowel preparation quality in diabetic patients was adopted. By collecting multi-dimensional clinical feature data, an ensemble learning algorithm model was constructed, and the SHAP interpretable artificial intelligence framework was introduced for analysis and attribution, quantitatively outputting the degree of influence of each clinical feature on the prediction results.

Benefits of technology

It significantly improves the accuracy and stability of predictions, reduces inconsistencies in judgments, enhances the interpretability and transparency of the model, can accurately locate key influencing factors, and provides personalized optimization solutions for gut health preparation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121122679B_ABST
    Figure CN121122679B_ABST
Patent Text Reader

Abstract

The application discloses a SHAP-based quality prediction method for intestinal preparation of diabetes patients, relates to the technical field of medical artificial intelligence, and comprises the following steps: collecting clinical feature data of diabetes patients and preprocessing the clinical feature data; constructing a quality prediction model for intestinal preparation of diabetes patients, taking the preprocessed clinical feature data as model input and taking intestinal preparation qualification rate as output; and introducing a SHAP explainable artificial intelligence framework to analyze and attribute the prediction model. The quality prediction method for intestinal preparation of diabetes patients provided by the application integrates multidimensional clinical data, uses an ensemble learning algorithm to construct a prediction model, significantly improves the accuracy and stability of prediction, breaks through the limitations of traditional reliance on doctor experience, reduces the inconsistency of judgment caused by individual differences and treatment pressure, and displays the interaction between features through a visual tool, thereby enhancing the explainability and transparency of the model.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application relates to the technical field of medical artificial intelligence, in particular to a SHAP-based quality prediction method for intestinal preparation of a diabetic patient. BACKGROUND

[0002] When a diabetic patient receives a digestive tract diagnosis and treatment project such as a colonoscopy, the quality of intestinal preparation is a key prerequisite for affecting the accuracy of the examination and reducing the risk of missed diagnosis and misdiagnosis, and directly relates to the accurate formulation of the subsequent diagnosis and treatment plan. At present, the pre-judgment of the quality of intestinal preparation of a diabetic patient in the clinic is mainly based on the clinical experience of doctors, combined with the basic information such as the blood sugar level, medication, and disease duration of the patient, and a simple data statistics or a single machine learning model is introduced in some scenes to assist in judgment, aiming to improve the prediction efficiency through data support, but the overall still lacks a systematic quantitative analysis framework for the physiological characteristics and disease specificity of diabetic patients, and it is difficult to fully integrate multi-dimensional clinical data to realize stable prediction.

[0003] Although the existing prediction methods have played a certain role in clinical practice, there is still room for optimization: the evaluation relying on the experience of doctors is easily affected by individual experience differences, diagnosis and treatment scene pressure and other factors, resulting in insufficient consistency in the judgment of different medical personnel; although the traditional machine learning model can process part of the structured data, when facing the complex clinical characteristics of diabetic patients, the prediction accuracy and stability are limited due to unreasonable feature weight distribution, and the model has a "black box" attribute, which cannot clearly show the specific influence of each clinical indicator on the prediction result, making it difficult for clinicians to trace the decision basis, establish trust, and accurately locate the key influencing factors for targeted intervention. Therefore, we propose a SHAP-based quality prediction method for intestinal preparation of a diabetic patient. SUMMARY

[0004] To solve the above technical problems, the SHAP-based quality prediction method for intestinal preparation of a diabetic patient is provided, which solves the problems that the evaluation relying on the experience of doctors is easily affected by individual experience differences, diagnosis and treatment scene pressure and other factors, resulting in insufficient consistency in the judgment of different medical personnel; the prediction accuracy and stability of the traditional machine learning model are limited when processing the complex clinical characteristics of patients, and the "black box" attribute cannot clearly show the influence of each indicator on the prediction result, making it difficult for doctors to trace the decision basis and accurately locate the key factors for intervention.

[0005] To achieve the above purposes, the technical scheme adopted by the application is as follows:

[0006] The SHAP-based quality prediction method for intestinal preparation of a diabetic patient comprises the following steps:

[0007] Collecting the clinical characteristic data of a diabetic patient and preprocessing the clinical characteristic data;

[0008] A quality prediction model of intestinal preparation for diabetic patients is constructed, and preprocessed clinical feature data is used as the input of the model, and the intestinal preparation qualification rate is used as the output;

[0009] The SHAP explainable artificial intelligence framework is introduced to analyze and attribute the prediction model;

[0010] The quality prediction model outputs the qualified prediction result of the intestinal preparation for diabetic patients, and the SHAP framework quantitatively outputs the influence degree of each clinical feature on the individual prediction result.

[0011] Preferably, the clinical feature data includes physiological index data, medication-related data, disease course data, and intestinal preparation-related data of the patient;

[0012] The physiological index data includes blood glucose-related indicators, liver and kidney function indicators, electrolyte levels, and body mass index;

[0013] The medication-related data includes the type, dosage, duration of use of diabetes treatment drugs, and the use of intestinal preparation drugs;

[0014] The disease course data includes the duration of diabetes diagnosis, complication occurrence, and disease control;

[0015] The intestinal preparation-related data includes the start time of intestinal preparation, diet control during preparation, and defecation;

[0016] The above-mentioned clinical feature data is collected through the hospital electronic medical record system, laboratory test result entry, and patient-specific information collection form filling, and the patient's personal identity information is desensitized in the collection process in accordance with the relevant regulations of medical data privacy protection.

[0017] Preferably, the pre-processing of the clinical feature data specifically includes:

[0018] Data cleaning is performed on the repeated records and logically contradictory data in the clinical feature data, and the logically contradictory data refers to the mutually conflicting clinical feature data recorded at the same time point for the same patient;

[0019] At least 3 clinical features with the highest correlation coefficient are selected by calculating the correlation coefficient between the missing features and other complete clinical features to construct an interpolation model for filling the missing values;

[0020] Values that exceed the range set by the box plot and do not conform to clinical routines are determined as outliers, and the sliding average method of adjacent time point clinical feature data is used for outlier correction. For outliers without adjacent time point data, the clinical basic information and disease progression rules of the patient are combined for correction;

[0021] The data standardization adopts a Z-score standardization method to convert all the clinical feature data into standardized data with a mean of 0 and a standard deviation of 1.

[0022] Preferably, before constructing the quality prediction model, a clinical feature selection step is further included, which adopts a combination of filter selection and embedded selection;

[0023] The filter selection removes the clinical features with an absolute value of the correlation coefficient lower than a set threshold by calculating the correlation coefficient between each clinical feature and the intestinal preparation qualification rate, the correlation coefficient is calculated by using a Pearson correlation coefficient or a Spearman rank correlation coefficient, and the calculation method is selected according to the data type of the clinical feature;

[0024] The embedded selection is performed synchronously during the training process of the ensemble learning model, and the clinical features with a high contribution degree to the prediction result are automatically selected by the weight distribution of each clinical feature during the model training process, and the redundant features with a low contribution degree are removed;

[0025] After the feature selection is completed, a redundancy test is performed on the selected clinical features, a variance inflation factor between any two clinical features is calculated, and the clinical features with a variance inflation factor higher than a set threshold are removed.

[0026] Preferably, the quality prediction model is constructed by using an ensemble learning algorithm;

[0027] The ensemble learning algorithm includes a base learner and an ensemble strategy, the base learner is selected from a gradient boosting decision tree, a random forest and an extreme gradient boosting tree, and each base learner is independently trained;

[0028] During the training process of the gradient boosting decision tree, a weak learner is added step by step, each newly added weak learner is fitted to the residual error of the previous round of model training, and the learning rate is adjusted according to the accuracy of the validation set;

[0029] During the training process of the random forest, a bootstrap sampling method is used to extract multiple sub-datasets from the original clinical feature dataset, each sub-dataset corresponds to a decision tree, and during the construction process of the decision tree, only the optimal split feature is selected from the part of the clinical features randomly selected when each node is split;

[0030] During the training process of the extreme gradient boosting tree, a regularization term is introduced to suppress model overfitting, and a parallel computing method is used;

[0031] The ensemble strategy adopts a weighted voting method, the weight of each base learner is determined according to the prediction accuracy of the validation set, and the final prediction model output result is obtained by weighted summation.

[0032] Preferably, the mass prediction model, its training and verification process includes data set division, hyperparameter optimization and model performance evaluation;

[0033] The data set is divided into training set, validation set and test set according to the preset proportion, the training set is used for model parameter learning, the validation set is used for hyperparameter optimization and model selection, and the test set is used for final model performance evaluation;

[0034] The hyperparameter optimization adopts the way of grid search combined with cross validation, sets the search range of the hyperparameters of each basic learner, traverses all hyperparameter combinations through cross validation, and selects the hyperparameter combination with the highest validation set accuracy as the optimal hyperparameter;

[0035] The model performance evaluation adopts accuracy, precision, recall, F1 score and area under ROC curve as indexes.

[0036] Preferably, the SHAP explainable artificial intelligence framework includes model global analysis and individual prediction attribution in the analysis and attribution process;

[0037] The model global analysis determines the global importance ranking of each clinical feature on the prediction result by calculating the mean of the absolute value of the SHAP value of all clinical features;

[0038] The individual prediction attribution calculates the SHAP value of each clinical feature of a single patient, the positive and negative of the SHAP value represent the promotion or inhibition effect of the clinical feature on the intestinal preparation qualified prediction result of the patient, and the absolute value of the SHAP value represents the strength of the effect;

[0039] In the analysis process, the SHAP framework shows the nonlinear relationship between a single clinical feature and the prediction result through the construction of feature dependence graph, and analyzes the influence of the synergistic effect between two clinical features on the prediction result through the interaction effect graph.

[0040] Preferably, the influence degree of each clinical feature on the individual prediction result quantitatively output by the SHAP framework is presented in a visual way, and the visual way includes SHAP summary graph, dependence graph, waterfall chart and force-directed graph;

[0041] The SHAP summary graph shows the SHAP value distribution of each clinical feature of all patients in the form of scatter plot;

[0042] The dependence graph shows the relationship between the value of a single clinical feature and the corresponding SHAP value in the form of curve graph;

[0043] The waterfall chart shows the SHAP value accumulation process of each clinical feature in order according to the influence degree of the clinical feature on the prediction result for a single patient;

[0044] The force guide map shows the interaction relationship between various clinical features and the comprehensive influence on the prediction result.

[0045] Preferably, after the prediction model is established, a model optimization iteration step is further included, by continuously collecting the clinical feature data and the intestinal preparation quality result of the newly added diabetes patients, the model is incrementally trained.

[0046] In the incremental training process, a sliding window mechanism is adopted, and the latest historical data and the newly added data are jointly used to form a training set.

[0047] The prediction performance of the model is re-evaluated regularly, and if the evaluation index decreases, the model is updated by re-optimizing the hyperparameters or adjusting the combination of the basic learners.

[0048] Combined with the changes of the key clinical features obtained by the SHAP framework analysis, if new features affecting the intestinal preparation quality appear in the newly added clinical data, they are included in the clinical feature data set, and the model is re-trained.

[0049] Preferably, the clinical application process of the prediction result and the SHAP framework analysis result includes result interpretation, scheme development and effect feedback.

[0050] The result interpretation is performed by the clinician combining the specific clinical situation of the patient to professionally interpret the intestinal preparation qualified probability output by the prediction model and the influence degree of each clinical feature.

[0051] The scheme development is based on the interpretation result, and an optimization scheme is developed for the key clinical features affecting the intestinal preparation quality of the patient, including adjusting the use scheme of the intestinal preparation drug, optimizing the diet control suggestion, and adjusting the blood glucose control target.

[0052] The effect feedback is obtained by tracking the actual intestinal preparation result of the patient, comparing the difference between the prediction result and the actual result, analyzing the implementation effect of the scheme, and if the actual intestinal preparation quality does not meet the expectation, the optimization scheme is further adjusted combined with the attribution analysis result of the SHAP framework.

[0053] Compared with the prior art, the beneficial effects of the present application are:

[0054] The diabetes patient intestinal tract preparation quality prediction method provided by the application, by integrating multi-dimensional clinical data, using an integrated learning algorithm to construct a prediction model, significantly improves the accuracy and stability of the prediction, breaks through the limitations of traditional reliance on doctor experience, reduces the inconsistency of judgment due to individual differences and diagnosis and treatment pressure, introduces the SHAP explainability framework, not only reveals the specific influence degree of each clinical feature on the prediction result, but also intuitively displays the interaction between the features through the visualization tool, enhances the explainability and transparency of the model, can more clearly understand the prediction basis, accurately locate the key influencing factors, and develop individualized intestinal tract preparation optimization scheme, the model can adapt to the changes of clinical data in time, ensure the long-term stability and reliability of the prediction effect, and provide more scientific and accurate intestinal tract preparation guidance for diabetes patients. BRIEF DESCRIPTION OF DRAWINGS

[0055] Figure 1 The method flowchart of the application. DETAILED DESCRIPTION

[0056] The following description is used to disclose the application so that those skilled in the art can implement the application. The preferred embodiments in the following description are only as examples, and other obvious variants can be thought of by those skilled in the art.

[0057] Referring to Figure 1 As shown, the SHAP-based diabetes patient intestinal tract preparation quality prediction method comprises the following steps:

[0058] Collecting clinical feature data of diabetes patients and pre-processing the clinical feature data;

[0059] Constructing a diabetes patient intestinal tract preparation quality prediction model, using the pre-processed clinical feature data as the model input and the intestinal tract preparation pass rate as the output;

[0060] Introducing a SHAP explainability artificial intelligence framework to analyze and attribute the prediction model;

[0061] Outputting the diabetes patient intestinal tract preparation pass prediction result through the quality prediction model, and quantitatively outputting the influence degree of each clinical feature on the individual prediction result through the SHAP framework.

[0062] The clinical feature data includes physiological index data, medication related data, disease course data and intestinal tract preparation related data of the patient;

[0063] The physiological index data includes blood glucose related indicators, liver and kidney function indicators, electrolyte levels and body mass index;

[0064] The medication-related data includes: the type of diabetes treatment drugs, the medication dose, the medication duration, and the use of bowel preparation drugs;

[0065] The disease course data includes: the duration of diabetes diagnosis, the occurrence of complications, and the disease control situation;

[0066] The bowel preparation-related data includes: the start time of bowel preparation, the diet control situation during preparation, and the defecation situation;

[0067] The above clinical feature data is extracted through a hospital electronic medical record system, laboratory test result entry, and patient special information collection form filling. The hospital electronic medical record system mainly extracts the patient's basic demographic information, diabetes diagnosis time, complication diagnosis record, and past medication history. Laboratory test results are entered into the system by laboratory personnel within 24 hours after completing the test, including the original test values and reference ranges of blood glucose, liver and kidney function, electrolyte, etc. The patient special information collection form is filled out by nursing staff three days before bowel preparation, covering diet control execution, defecation habits, and bowel preparation drug allergy history, etc. All collection processes are arranged for special personnel to check data accuracy to ensure that each data point is traceable. The collection process complies with relevant regulations for medical data privacy protection and desensitizes patient personal information.

[0068] The pre-processing of the clinical feature data specifically includes:

[0069] Data cleaning is performed on repeated records and logically contradictory data in the clinical feature data. The logically contradictory data are mutually conflicting clinical feature data recorded for the same patient at the same time point. The identification criteria for logically contradictory data include: there is no reasonable difference between fasting blood glucose and 2-hour postprandial blood glucose values recorded at the same time point, creatinine and estimated glomerular filtration rate in liver and kidney function indicators are positively correlated, and the same test item appears multiple identical test results within the same time period but with different report times. The identified logically contradictory data need to be reviewed by a clinician, and after confirmation, the authoritative test report or re-collected data is used for correction. Those that cannot be corrected are marked and excluded.

[0070] The missing features are filled by constructing an interpolation model with at least 3 clinical features having the highest correlation coefficients. The specific construction steps are as follows: calculate the pairwise correlation coefficients of all clinical features, exclude self-correlation and meaningless features; then sort the correlation coefficients in descending order of absolute value, select the top 3 features as input variables, use the complete samples of the missing features as training data, and construct an interpolation model using linear regression or random forest algorithm, wherein the linear regression model is selected for continuous missing features, and the random forest model is selected for discrete missing features; after the model is constructed, it is tested on the complete sample subset to ensure that the prediction error is below the set threshold, such as the mean square error being less than 10% of the standard deviation of the feature, and then the qualified model is used to predict and fill the missing values, and the consistency of the filled values with other clinical indicators of the patient is verified to avoid unreasonable clinical values;

[0071] Values beyond the range of the box plot and not consistent with clinical routine are determined as outliers. The range of the box plot is set as Q1 minus 1.5 times the interquartile range to Q3 plus 1.5 times the interquartile range. Q1 is the 25th percentile of all samples of the feature, Q3 is the 75th percentile, and the interquartile range is the difference between Q3 and Q1. The determination standard of not consistent with clinical routine refers to the clinical diagnosis and treatment guidelines. Special cases are excluded by combining patient medical history, such as high blood sugar in diabetic ketoacidosis patients, which is within the clinical reasonable range and is not determined as an outlier. The outlier correction uses the moving average method of adjacent time point clinical feature data. The specific application of the moving average method is as follows: determine the time point corresponding to the outlier, extract the data of the adjacent time points before and after the time point, if there are less than 3 adjacent time points, take all the existing data, calculate the arithmetic mean of these data, and replace the outlier with the average value. If there is no adjacent time point data for the outlier, such as the first admission of a patient without prior examination records, the outlier is corrected by combining the patient's age, gender, diabetes duration, and complications, and referring to the normal range of the same type of patients. For example, the abnormal value of serum creatinine in elderly patients with diabetic nephropathy can be adjusted according to the reference range of serum creatinine corresponding to the kidney function stage. The corrected value needs to be confirmed by a clinical pharmacist or a physician. For outliers without adjacent time point data, the corrected value is combined with the patient's clinical basic information and disease progression rules.

[0072] The data standardization adopts the Z-score standardization method to convert all the clinical feature data into standardized data with a mean of 0 and a standard deviation of 1. The calculation of the Z-score is based on all the sample data of the clinical feature, the mean is the arithmetic mean of all the sample values of the feature, and the standard deviation is the overall standard deviation of all the sample values of the feature. The standardized value of each sample is obtained by subtracting the mean from the original value and then dividing by the standard deviation. The original data is backed up during the conversion process so that the standardized data can be restored to the original index value that can be understood clinically for subsequent model interpretation.

[0073] Before constructing the quality prediction model, a clinical feature selection step is also included, which adopts a combination of filter selection and embedded selection.

[0074] The filter selection removes the clinical features with an absolute correlation coefficient below a set threshold by calculating the correlation coefficient between each clinical feature and the intestinal preparation qualification rate. The threshold setting of the correlation coefficient includes: referring to the threshold range used in the relevant research on intestinal preparation of diabetic patients published in the past five years, combining the feature quantity and distribution characteristics of the data set, and selecting the value that makes the number of retained features account for 50-70% of the total number of initial features and has no obvious low correlation features as the threshold by drawing a correlation coefficient distribution histogram. Usually, it is set to 0.1. If there is a cluster of high correlation features in the data set, the threshold can be appropriately reduced to 0.08 to avoid early removal of potentially useful features. After the threshold is determined, the prediction effectiveness of the retained features needs to be verified through cross-validation to ensure that the model performance does not decrease significantly after removing low-threshold features. The correlation coefficient is calculated using Pearson correlation coefficient or Spearman rank correlation coefficient, and the calculation method is selected according to the data type of the clinical feature. The specific selection conditions are: for continuous clinical features, first determine whether they conform to the normal distribution through Shapiro-Wilk test. If the P value is greater than 0.05, it is considered to conform to the normal distribution, and the Pearson correlation coefficient is used to calculate the linear correlation. If the P value is less than or equal to 0.05 or the feature is discrete such as drug type, complication occurrence, and ordinal categorical variable such as disease control classification, the Spearman rank correlation coefficient is used to calculate the monotonic correlation. Both coefficients are judged for significance through two-sided test. The correlation coefficient with a P value less than 0.05 is included in the threshold judgment;

[0075] The embedded selection is performed synchronously in the integrated learning model training process. Through the weight distribution of each clinical feature in the model training process, the clinical features with high contribution to the prediction result are automatically screened out, and the redundant features with low contribution are removed. The specific calculation mechanism varies with the type of the basic learning machine. In the random forest, the feature weight is obtained by calculating the information gain such as the Gini coefficient reduction amount of each feature at all decision tree splits, and then dividing the sum by the total number of decision trees to obtain the average information gain of the feature as the weight value. In the extreme gradient boosting tree, the feature weight considers the split gain, the loss function reduction amount brought by each split, and the coverage, which is the proportion of the number of samples involved in the split to the total number of samples. The calculation method is to multiply the split gain by the coverage and then perform normalization processing. In the gradient boosting decision tree, the feature weight is obtained by calculating the split importance of the feature in all weak learning machines, and then the total weight is obtained by accumulation. The feature weight of all basic learning machines is averaged, and the feature weight of the feature whose weight value is less than 50% of the average weight of all features is determined to be low and is removed.

[0076] After the feature selection is completed, the selected clinical features are subjected to redundancy test, the variance inflation factor between any two clinical features is calculated, the clinical features with a variance inflation factor higher than a set threshold are removed, and the determination principle of the variance inflation factor threshold is referred to statistical standards and clinical practice. Generally, the threshold is set to 10. When the variance inflation factor is greater than 10, it indicates that there is serious multicollinearity between the two features, which will affect the stability of the model parameter estimation. If multiple features have high variance inflation factors with each other, a step-by-step removal strategy is adopted, the feature with the largest variance inflation factor is removed first, the variance inflation factors of the remaining features are recalculated, and the process is repeated until the variance inflation factors of all features are less than or equal to 10. For features closely related in clinical significance, such as fasting blood glucose and glycosylated hemoglobin, if the variance inflation factor is slightly higher than 10 but lower than 15, and both have important contribution to the prediction result, the ratio of the two can be calculated by feature combination to reduce redundancy, rather than being directly removed.

[0077] The quality prediction model is constructed by using an integrated learning algorithm;

[0078] The integrated learning algorithm includes a basic learning machine and an integrated strategy. The basic learning machine is selected from a gradient boosting decision tree, a random forest, and an extreme gradient boosting tree. Each basic learning machine is independently trained.

[0079] In the training process of the gradient boosting decision tree, weak learners are added step by step, and the specific adding strategy is as follows: an initial stage constructs a decision tree with a depth of 1 as the first weak learner, uses the learner to predict the training set, and calculates the residual error between the predicted value and the actual value; then a second weak learner is constructed to fit the residual error as the target variable, and the prediction result of the second learner is multiplied by the learning rate and added to the prediction result of the first learner to obtain the new model prediction value; the above process is repeated, and the accuracy of the validation set is calculated after adding a weak learner each time. When the accuracy of the validation set does not improve or decreases for 5 consecutive times after adding weak learners, the addition of weak learners is stopped, and the total number of weak learners at this time is the optimal number; the learning rate is initially set to 0.1, and if the accuracy of the validation set is less than 80%, the learning rate is reduced to 0.05, and if there is still no improvement, the learning rate is further reduced to 0.01, and the number of weak learners is increased accordingly, to ensure that the model reduces the risk of overfitting while maintaining high performance. Each new weak learner is fitted to the residual error of the previous model training, and the learning rate is adjusted according to the accuracy of the validation set;

[0080] In the training process of the random forest, bootstrap sampling method is used to extract multiple sub-datasets from the original clinical feature dataset, and the specific sampling details are as follows: the bootstrap sampling ratio is set to 70% of the sample size of the original dataset, and the sample size of each sub-dataset is the same as that of the original dataset. When sampling, repeated sampling is allowed, that is, sampling with replacement, to ensure that the sample distribution of each sub-dataset is similar to that of the original dataset; when constructing each decision tree, the number of candidate features randomly selected in the node splitting stage is 1 / 3 of the total number of features, and if the total number of features is small, such as less than 20, 1 / 2 of the total number of features is selected. The selection of candidate features is realized by randomly shuffling the feature order and cutting the first N features; no pruning operation is performed during the construction of the decision tree, and the tree is allowed to grow naturally until the sample size of each leaf node is less than or equal to 5 or cannot be further split, in order to retain sufficient model complexity, while reducing the risk of overfitting through the integration of multiple trees. Each sub-dataset corresponds to a trained decision tree, and during the construction of the decision tree, only the optimal splitting feature is selected from the randomly selected part of the clinical features at each node splitting stage;

[0081] In the training process of the extreme gradient boosting tree, a regularization term is introduced to inhibit model overfitting. The specific regularization term settings include: adding a tree complexity regularization term, which consists of two parts. One is a leaf node number penalty term, which is controlled by the hyperparameter gamma. The larger the gamma value, the heavier the penalty on the leaf node number. The other is an L2 penalty term for leaf node weights, which is controlled by the hyperparameter lambda. The larger the lambda value, the heavier the penalty on the square of the leaf node weight. At the same time, a learning rate decay factor is set. As the number of weak learners increases, the learning rate is gradually reduced by a fixed proportion. The initial learning rate is set to 0.1, and the learning rate is reduced by 10% for every 100 weak learners. In addition, the maximum depth of the decision tree is limited by the hyperparameter max_depth, which is usually set to 3-10 to avoid excessive complexity of a single tree. The specific parameter values of the regularization term are determined by grid search combined with cross-validation to ensure that the overfitting indicators on the validation set, such as the difference between the training set and the validation set accuracy, are less than 5%. Parallel computing is also used.

[0082] The integration strategy uses a weighted voting method. The weight of each base learner is determined based on its prediction accuracy on the validation set. The specific weight calculation method is as follows: First, calculate the prediction accuracy of gradient boosting decision trees, random forests, and extreme gradient boosting trees on the validation set, denoted as A1, A2, and A3, respectively. The accuracy is calculated as the number of correctly predicted samples divided by the total number of samples in the validation set. Then, calculate the weight of each base learner. The weight value is equal to the accuracy of the learner divided by the sum of the accuracies of the three learners, ensuring that the sum of the three weights is 1. The final prediction result is calculated as follows: the prediction probability output by each base learner is the probability of intestinal preparation being qualified multiplied by the corresponding weight. Then, add the three products to obtain the final prediction probability of the integrated model. When the final prediction probability is greater than 0.5, it is determined that the intestinal preparation is qualified, otherwise it is determined to be unqualified. The final prediction model output result is obtained by weighted summation.

[0083] The quality prediction model, its training and verification process includes data set division, hyperparameter optimization and model performance evaluation;

[0084] The data set is divided into a training set, a validation set and a test set according to a preset ratio. The specific division ratio is that the training set accounts for 70%, the validation set accounts for 20%, and the test set accounts for 10%. Before division, all patient data is sorted according to admission time, and then a stratified random sampling method is used to ensure that the proportion of qualified and unqualified patients in the training set, the validation set and the test set is consistent with the original data set, so as to avoid model bias caused by uneven sample distribution. A fixed random seed such as 2024 is used in the sampling process to ensure that the division result is repeatable, facilitating comparison during subsequent model optimization and verification. At the same time, the patient data of the test set should not overlap with the training set and the validation set, and the admission time of the patients in the test set should be later than that of the patients in the training set and the validation set, simulating the model application scenario in real clinical practice. The training set is used for model parameter learning, the validation set is used for hyperparameter optimization and model selection, and the test set is used for final model performance evaluation.

[0085] The hyperparameter optimization adopts a grid search combined with cross-validation method. The search range of the hyperparameters of each basic learner is set. The specific grid search range is as follows: the hyperparameters of gradient boosting decision tree include weak learner number 100, 200, 300, 400, 500, learning rate 0.01, 0.05, 0.1, 0.15, 0.2, decision tree maximum depth 3, 5, 7, 10, minimum sample size for each node splitting 2, 5, 10; the hyperparameters of random forest include decision tree number 100, 150, 200, 250, 300, decision tree maximum depth 5, 8, 10, 12, 15, node splitting candidate feature number total feature number 1 / 4, 1 / 3, 1 / 2, minimum sample size for each leaf node 1, 3, 5; the hyperparameters of extreme gradient boosting tree include weak learner number 200, 300, 400, 500, 600, learning rate 0.01, 0.05, 0.1, regularization penalty coefficient lambda 0.1, 1, 5, 10, leaf node penalty term gamma 0, 0.1, 0.5, 1, decision tree maximum depth 3, 5, 7, 10. The number of folds for cross-validation is set to 5, that is, the training set is evenly divided into 5 non-overlapping subsets. Each time, 4 subsets are selected as training subsets and 1 subset is selected as a validation subset. The model is trained and the validation accuracy is calculated. After 5 repetitions, the average validation accuracy of the hyperparameter combination is obtained. All hyperparameter combinations are traversed through cross-validation. The combination with the highest validation set accuracy and the smallest difference between the training set and the validation set is selected as the optimal hyperparameter.

[0086] The model performance evaluation adopts accuracy, precision, recall, F1 score and area under ROC curve as indexes, and the calculation formulas of the indexes are as follows: the accuracy is the number of samples predicted correctly by the model divided by the total number of samples in the verification set or test set, wherein the samples predicted correctly include the samples predicted as qualified and actually qualified and the samples predicted as unqualified and actually unqualified; the precision is the number of samples predicted as qualified and actually qualified divided by the number of all samples predicted as qualified, reflecting the accuracy of the model prediction qualified result; the recall is the number of samples predicted as qualified and actually qualified divided by the number of all actually qualified samples, reflecting the comprehensiveness of the model in identifying qualified samples; the F1 score is the harmonic mean of the precision and the recall, which is calculated by 2 times the precision times the recall, divided by the sum of the precision and the recall, and is used to comprehensively measure the accuracy and comprehensiveness of the model; the area under the ROC curve is obtained by plotting the ROC curve with the false positive rate as the horizontal axis and the true positive rate as the vertical axis, and the area under the curve is calculated, the closer the area is to 1, the stronger the distinguishing ability of the model, and the calculation of all indexes is based on the prediction results of the model on the test set, to ensure the objectivity and reliability of the evaluation.

[0087] The analysis and attribution process of the SHAP explainable artificial intelligence framework includes model global analysis and individual prediction attribution. The specific mathematical principle of SHAP value calculation is based on the Shapley value concept in game theory, and the prediction result of the model for a single sample is regarded as the 'game' result of all clinical features participating together. The SHAP value of each feature represents the average marginal contribution of the feature to the prediction result in all possible feature subset combinations. In the calculation process, first, all possible feature subsets containing the feature are enumerated, and for each subset, the difference between the model prediction value when the feature is included and the model prediction value when the feature is not included, i.e. the marginal contribution, is calculated; then the weight is determined according to the subset size, and when the subset size is k, k is the number of features in the subset, and the weight is (k!*(n-k)!) / n!, wherein n is the total number of features, and the weight reflects the probability of occurrence of the subset; finally, the marginal contributions corresponding to all subsets containing the feature are multiplied by their respective weights, and the sum is taken to obtain the SHAP value of the feature, ensuring that the sum of the SHAP values of all features is equal to the difference between the model prediction value and the average prediction value of all samples;

[0088] The model global analysis determines the global importance ranking of each clinical feature to the prediction result by calculating the mean of the absolute values of the SHAP values of all clinical features;

[0089] The individual prediction attribution is achieved by calculating the SHAP value of each clinical feature of a single patient, and the positive and negative of the SHAP value represent the promotion or inhibition of the clinical feature to the intestinal preparation qualified prediction result of the patient, and the absolute value of the SHAP value represents the strength of the action;

[0090] In the analysis process, the SHAP framework shows the nonlinear relationship between a single clinical feature and the prediction result by constructing a feature dependence graph. The generation steps of the feature dependence graph are as follows: first, select a target feature from all clinical features, extract the value of the feature in all samples and the corresponding SHAP value; then sort the values of the target feature in ascending order, and draw a scatter plot with the sorted feature values as the horizontal axis and the corresponding SHAP values as the vertical axis, each scatter point representing a sample; then use a local weighted regression algorithm such as LOESS to fit the scatter points to generate a smooth curve, the trend of the curve reflects the nonlinear relationship between the value of the target feature and the SHAP value, if the curve shows an upward trend, it means that the larger the value of the feature, the stronger the promoting effect on the qualified bowel preparation, otherwise the stronger the inhibitory effect, at the same time, the synergistic effect of two clinical features on the prediction result is analyzed through the interaction effect diagram, the generation steps of the interaction effect diagram are as follows: select two clinical features with potential interaction, such as blood glucose level and bowel preparation drug dose, denoted as feature X and feature Y; divide the values of feature Y into high, medium and low three groups according to the tertiles, and mark them with different colors; draw a curve with the value of feature X as the horizontal axis and the corresponding SHAP value as the vertical axis for each group of data; by comparing the trend differences of the three curves, the synergistic effect of features X and Y is analyzed, for example, when feature Y is at a high level, the increase of the value of feature X makes the SHAP value rise significantly, while when feature Y is at a low level, the increase of the value of feature X has little effect on the SHAP value, indicating that there is a positive synergistic effect between the two, which promotes the qualified bowel preparation together.

[0091] The influence degree of each clinical feature on the individual prediction result output by the SHAP framework is presented in a visual manner, which includes a SHAP summary chart, a dependence chart, a waterfall chart and a force-directed chart, and the drawing method and technical implementation of each chart are as follows: the SHAP summary chart is drawn using the matplotlib or seaborn library of Python, the vertical axis is the clinical feature name, the horizontal axis is the SHAP value, and each feature corresponds to multiple scatter points, the scatter point color represents the value size of the feature, the deeper the color, the larger the value, and the influence direction and dispersion degree of the feature on the prediction result can be observed through the distribution of the scatter points; the dependence chart is also realized based on matplotlib, first, a scatter chart of feature value and SHAP value is drawn, then the LocalOutlierFactor model of the scikit-learn library is used to remove abnormal scatter points, and then the lowess function of the statsmodels library is used to fit a locally weighted regression curve, the smoothness of the curve is controlled by adjusting the span parameter, which is usually set to 0.8; the waterfall chart is generated by the waterfall_plot function of the SHAP library, taking the average prediction value of all samples of the baseline prediction value as the starting point, and sequentially showing the SHAP value of each feature in order of the absolute value of the feature SHAP value from large to small, the red bar represents that the feature promotes the SHAP value of the prediction result, and the blue bar represents that the feature inhibits the SHAP value of the prediction result, and finally the actual prediction value of the sample is obtained by accumulation, and the feature name and value are labeled below the bar; the force-directed chart is drawn using the force plot function of the SHAP library, and is presented in the form of a horizontal bar chart, with the baseline prediction value on the left, the final prediction value on the right, and the SHAP value bar of each feature in the middle, the red bar represents positive influence, and the blue bar represents negative influence, the bar length is proportional to the absolute value of the SHAP value, and the feature name and specific value are labeled beside the bar, supporting interactive viewing, and more detailed numerical information can be obtained by mouse hovering, and all visual charts are saved as high-resolution pictures with a resolution of 300 dpi, which is convenient for clinical report display and academic paper publication;

[0092] The SHAP summary chart displays the SHAP value distribution of each clinical feature of all patients in the form of a scatter chart;

[0093] The dependence chart displays the relationship between the value of a single clinical feature and the corresponding SHAP value in the form of a curve chart;

[0094] The waterfall chart sequentially displays the SHAP value accumulation process of each clinical feature for a single patient, sorted by the influence degree of the clinical feature on the prediction result;

[0095] The force-directed chart displays the interaction between each clinical feature and the comprehensive influence on the prediction result.

[0096] After the establishment of the prediction model, an iterative step of model optimization is further included, by continuously collecting the clinical feature data and the intestinal preparation quality results of newly added diabetic patients, the model is incrementally trained, wherein the size of the sliding window mechanism is determined according to the accumulation speed of the clinical data, and is usually set to contain the complete data of the latest 1000 diabetic patients, when the newly added data reaches 200, the window update is triggered, the earliest 200 data in the window is removed, and the latest 1000 data is retained to form a new training set, ensuring that the training data always reflects the changes in the clinical features of recent patients, avoiding the decline of the model performance due to the lack of data timeliness; the frequency of re-evaluation is arranged once every 3 months, and each evaluation uses the patient data in the last 3 months which has not participated in the model training to construct a new test set with a sample size of not less than 100, and calculates the accuracy, F1 score, area under ROC curve and other indicators, compares them with the indicators of the last evaluation and the baseline indicators at the time of model establishment, and judges the performance change trend of the model; the specific strategy of hyperparameter adjustment is divided into two cases: if the evaluation index decreases by less than 5% compared with the last time, the search range is narrowed around the original optimal hyperparameters for fine-tuning, for example, the learning rate is adjusted in the range of 0.8-1.2 times of the original value, the number of weak learners is adjusted in the range of ±10% of the original value, and the number of cross-validation folds remains 5; if the index decreases by more than or equal to 5%, the full-range grid search is performed again, and the adjustment of the basic learner combination is considered, such as replacing the gradient boosting decision tree with the lightweight gradient boosting machine LightGBM, or adding Naive Bayes as a new basic learner, and then retraining the model and performing 5-fold cross-validation to select the model with the best performance on the validation set as the updated model, and record the reasons and effects of the hyperparameter adjustment to form a model iteration log for subsequent tracing and analysis;

[0097] In the incremental training process, a sliding window mechanism is used to retain the latest historical data and newly added data to form a training set;

[0098] The prediction performance of the model is periodically re-evaluated, and if the evaluation index decreases, the model is updated by re-optimizing the hyperparameters or adjusting the basic learner combination;

[0099] Combined with the changes in key clinical features obtained by SHAP framework analysis, if new features that affect intestinal preparation quality appear in the newly added clinical data, they are included in the clinical feature data set and the model is retrained.

[0100] The clinical application process of the prediction results and the SHAP framework analysis results includes result interpretation, scheme development and effect feedback;

[0101] The result interpretation is performed by a clinician in combination with the specific clinical condition of the patient to interpret the probability of intestinal preparation qualification output by the prediction model and the influence degree of each clinical feature.

[0102] The scheme is formulated based on the interpretation result, and an optimization scheme is formulated for the key clinical features affecting the quality of intestinal preparation of the patient, including adjusting the use scheme of intestinal preparation drugs, optimizing the diet control suggestion, and adjusting the blood glucose control target.

[0103] The effect feedback is obtained by tracking the actual intestinal preparation result of the patient, comparing the difference between the predicted result and the actual result, analyzing the implementation effect of the scheme, and if the actual intestinal preparation quality does not reach the expectation, the optimization scheme is further adjusted in combination with the attribution analysis result of the SHAP framework.

[0104] In this embodiment, 50 diabetic patients in the endocrinology department and the gastroenterology department of a certain tertiary hospital who are intended to receive colonoscopy are taken as the research objects, including the clinical data of the first 20 patients recorded, all patients sign the informed consent form, the data collection complies with the medical privacy protection regulations, the identity information such as name and ID number is desensitized, and only the medical record number is reserved for data tracing.

[0105] The clinical feature data is collected by extracting the patient's gender, age, diabetes complications, gastrointestinal surgery history, chemotherapy history, smoking and drinking history, and medication records such as anticholinergic drugs, iron agents, and metformin from the hospital electronic medical record system, obtaining BMI, hemoglobin, electrolyte potassium, sodium, calcium, magnesium, serum triglyceride, and cholesterol levels from the laboratory examination system, and recording the patient's intestinal obstruction, indigestion, constipation history, and other symptoms and the time interval from the laxative to the examination through a special information collection form. The time interval from the laxative to the examination is recorded in three intervals: ≤2 hours, 2-4 hours, and ≥5 hours. The intestinal preparation quality result is determined by the colonoscopy physician according to the Boston intestinal preparation scoring scale, and a score of ≥6 points is qualified corresponding to "yes" in document 1, and a score of <6 points is unqualified corresponding to "no" in document 1.

[0106] The collected 50 data are preprocessed, first data cleaning is performed, and it is found that 2 patients have logical contradictory data, 1 patient has "hypokalemia" recorded at the same time point, which conflicts with the blood potassium value 3.8 mmol / L in the "electrolyte examination report" normal range 3.5-5.5 mmol / L, and after reviewing the electronic medical record, it is confirmed that it is an input error, which is corrected to "no hypokalemia";

[0107] Another patient was recorded as having a history of chemotherapy and no history of malignant tumor. Combined with the oncology consultation record, it was confirmed that there was no history of chemotherapy, and the error record was deleted. For missing value processing, it was found that 8 patients had missing hemoglobin data. The correlation coefficients of this feature with age, BMI, and hypoalbuminemia were calculated, with the highest correlation coefficient with hypoalbuminemia being 0.62, followed by BMI 0.45 and age 0.38.

[0108] The three features were selected to build a random forest interpolation model to fill in the missing values. The verification after filling in the missing values showed that the filled values were not contradictory to other clinical indicators of the patients. For example, the hemoglobin value of 125 g / L filled in the 72-year-old patient with a BMI of 22.5 in document 1 line 11 was consistent with the regular level of elderly diabetic patients.

[0109] The box plot method was used to determine the outliers. The interquartile range of all continuous features was calculated. It was found that one patient had a BMI of 18.75 in document 1 line 9, which was lower than Q1-1.5IQR, i.e., 19.2, but combined with the patient's 82-year-old age and no history of gastrointestinal disease, it was determined to be physiologically thin and not an outlier. One patient had a triglyceride value of 4.8 mmol / L, which exceeded Q3+1.5IQR, i.e., 4.5. The laboratory report was reviewed and confirmed to be correct, and the patient had a history of alcohol consumption, which was consistent with the diagnosis of hypertriglyceridemia. The original data was retained. Finally, the continuous features such as BMI, age, and hemoglobin were converted to standardized data with a mean of 0 and a standard deviation of 1 using Z-score standardization, which facilitated model training.

[0110] The feature selection stage used a combination of filtering and embedded methods. The filtering method calculated the correlation coefficients of each feature with the quality of bowel preparation results. The absolute values of the correlation coefficients of laxative to examination time 0.35, intestinal obstruction 0.32, indigestion 0.29, and hypoalbuminemia 0.27 were all higher than the threshold value 0.1, and were retained. The correlation coefficients of education level 0.08 and drinking history 0.06 were lower than the threshold value and were temporarily excluded. The embedded selection was performed simultaneously during the training of the ensemble learning model. For example, in the random forest, the average information gain of each feature was calculated during the training process. The results showed that the information gain of intestinal obstruction 0.42, laxative to examination time 0.38, indigestion 0.35, and BMI 0.28 were higher, while the information gain of hypoalbuminemia 0.09 was lower than the average level 0.21, and was excluded. The redundancy test calculated the variance inflation factor between the remaining features, and found that the variance inflation factor of intestinal obstruction and indigestion was 7.8, which was less than 10, and there was no serious multicollinearity. Finally, intestinal obstruction, indigestion, laxative to examination time, BMI, age, constipation history, chemotherapy history, and anticholinergic drug use were determined as the input variables of the model.

[0111] Gradient boosting decision tree, random forest and extreme gradient boosting tree were selected as the base learners for the ensemble learning prediction model. For gradient boosting decision tree, the initial settings were 200 weak learners and 0.1 learning rate. The accuracy of the validation set was adjusted. When the number of weak learners increased to 300 and the learning rate decreased to 0.05, the accuracy of the validation set reached the highest 86%, and the model residual converged. Random forest used bootstrap sampling to extract 70% of the total data from the training set. Among the 35 cases, 5 small subsets were extracted. Each subset trained 30 decision trees. When the node split, 4 features were randomly selected from 50% of the total number of features. Finally, a random forest model of 150 decision trees was constructed.

[0112] The extreme gradient boosting tree introduced a regularization term, set lambda = 1, i.e. L2 penalty, gamma = 0.1, i.e. leaf node penalty, decision tree maximum depth 7, parallel computing was used to accelerate the training, the training time was shortened by 40% compared with gradient boosting decision tree. The ensemble strategy used weighted voting method. According to the accuracy of 10 cases in the validation set, the weights of each base learner were determined. The accuracy of gradient boosting decision tree was 88%, the weight was 0.35, the accuracy of random forest was 85%, the weight was 0.3, and the accuracy of extreme gradient boosting tree was 89%, the weight was 0.35. The final prediction result was obtained by weighted summation. The performance evaluation of the model on the test set of 5 cases showed that the accuracy was 88%, the precision was 87%, the recall was 89%, the F1 score was 0.86, and the area under the ROC curve was 0.91, which met the clinical prediction requirements.

[0113] The SHAP framework was introduced to analyze the model. The global importance analysis was performed by calculating the mean of the absolute value of the SHAP value of each feature of all patients, and the feature importance ranking was obtained: the mean of laxative to examination time was 0.32, intestinal obstruction was 0.28, indigestion was 0.25, BMI was 0.21, age was 0.18, constipation history was 0.15, anticholinergic drug use was 0.12, chemotherapy history was 0.09. Taking the patient in the 3rd row of document 1 as an example, the patient was 81 years old, with a BMI of 21.5, an education level of primary school or below, no complications of diabetes, no history of gastrointestinal surgery, no intestinal obstruction, indigestion, no constipation history, no chemotherapy, smoking, no history of alcohol consumption, laxative to examination time ≥ 5 hours, no hypoproteinemia and electrolyte abnormalities, no anticholinergic drug use, iron agent use, no hypoglycemic drug use, and intestinal preparation result was "yes". Individual attribution was performed, and the SHAP value of each feature of the patient was calculated: laxative to examination time ≥ 5 hours SHAP value 0.42, positive promotion, indicating that the extension of the time interval increases the probability of passing intestinal preparation, indigestion 0.21, positive promotion, which may be due to the increased sensitivity of the patient to intestinal preparation drugs, iron agent use-0.18, negative inhibition, iron agent may affect intestinal peristalsis, age 81 years-0.15, negative inhibition, and the intestinal motility of elderly patients is weakened. The absolute value of the SHAP value of other features is less than 0.1. Through the SHAP waterfall chart, it can be directly seen that the average qualified probability of all patients in the model baseline prediction value is 0.52, and the final prediction value is 0.78 after accumulating the SHAP value of each feature, which is determined as intestinal preparation qualified, which is consistent with the actual examination result;

[0114] The dependence graph shows that laxative to examination time is positively correlated with SHAP value. When the time interval increases from ≤ 2 hours to ≥ 5 hours, the SHAP value increases from-0.25 to 0.45, indicating that the longer the time interval, the stronger the promotion effect on the qualified result; the interaction effect graph shows that intestinal obstruction and indigestion have a synergistic effect. When a patient has intestinal obstruction and indigestion at the same time, the SHAP value of the two is superimposed 0.28+0.25=0.53, which is much higher than the influence when they exist alone.

[0115] In the clinical application stage, the attending physician of the department of gastroenterology interprets the prediction results in combination with the patient's clinical situation, and believes that the laxative to the examination time is the key influencing factor, and the use of iron agent and advanced age are the secondary inhibiting factors. Based on this, an optimized scheme is formulated: the starting time of intestinal preparation is advanced by 1 hour to ensure that the laxative arrives at the examination time within 2-4 hours; Patients taking iron agents due to anemia are adjusted to oral vitamin B12 instead after communication with the department of hematology; Patients are guided to perform abdominal massage 2 times a day for 15 minutes each for 3 days before intestinal preparation to promote intestinal motility. After the patient performs the scheme, the intestinal preparation score is 7 points for qualified in the colonoscopy, and the actual result is consistent with the prediction. The effect feedback shows that after adjusting the laxative time and suspending the iron agent, the patient does not have constipation or abdominal distension and other discomforts, and there is no aggravation of anemia symptoms in the subsequent 1-month follow-up, and the safety and effectiveness of the scheme are verified.

[0116] Select 60 cases of diabetic patients undergoing colonoscopy in the hospital from July to December 2023 as the second group of research objects, which includes the data of the last 10 patients in document 1, and adds 40 new patients to supplement the fasting blood glucose mmol / L, glycosylated hemoglobin % and other blood glucose related index data mentioned in document 2. The physiological index data, all data collection processes are consistent with the first embodiment, and the intestinal preparation quality determination standards are the same. In the data preprocessing stage, it is found that 5 patients have repeated records, of which 3 patients have their clinical data before the second examination reserved because the first intestinal preparation is unqualified and cancelled; 2 patients have BMI input errors of 29.14 misrecorded as 291.4 and 22.60 misrecorded as 2.26, which are corrected according to the medical examination report. In terms of missing value processing, 12 patients have missing "glycosylated hemoglobin" data, and the correlation coefficients of 0.71, 0.43 and 0.39 are calculated between fasting blood glucose, diabetes complications and metformin use, respectively. A linear regression interpolation model is constructed to fill in the missing values. After filling in, the glycosylated hemoglobin value of a 69-year-old patient in document 1 line 17 is 6.8%, which is consistent with the control level of his fasting blood glucose 7.2 mmol / L. In the abnormal value processing, 1 patient has fasting blood glucose 13.5 mmol / L, which is higher than the Q3+1.5IQR of 11.2 in the box plot, and it is found that the patient has type 1 diabetes and has not injected insulin on time before the examination. Combined with the suggestion of the department of endocrinology, the value is corrected to 8.9 mmol / L, which is the blood glucose value after adjustment before the examination, to ensure that the data conforms to the actual situation after clinical intervention; 1 patient has cholesterol value 6.2 mmol / L, which is higher than the normal range, but the patient has a family history of hypercholesterolemia, and it is determined as a reasonable data and retained. Data standardization also uses the Z-score method to cover the newly added blood glucose related indicators.

[0117] During feature selection, the correlation coefficients of each feature with the quality of bowel preparation were calculated. The absolute values of the correlation coefficients of fasting blood glucose 0.38, glycosylated hemoglobin 0.35, time from laxative to examination 0.33, and constipation history 0.30 were higher than the threshold value 0.12. Due to the increase in the number of new features, the threshold value was appropriately increased, and the features were retained. The correlation coefficients of smoking history 0.07 and sulfonylurea drug use 0.09 were lower, and the features were removed. During embedded selection, through feature weight calculation in extreme gradient boosting tree training, it was found that the contribution of fasting blood glucose weight 0.45, glycosylated hemoglobin 0.39, time from laxative to examination 0.36, constipation history 0.32, and hypocalcemia 0.25 was significantly higher than that of other features, while the weight of age 0.11 was lower than the average level 0.28, and was removed. Redundancy test showed that the variance inflation factor of fasting blood glucose and glycosylated hemoglobin was 9.2, which was less than 10, and there was no serious multicollinearity. The variance inflation factor of hypocalcemia and hypomagnesemia was 8.5, and both were retained. Finally, fasting blood glucose, glycosylated hemoglobin, time from laxative to examination, constipation history, hypocalcemia, intestinal obstruction, indigestion, and sodium-glucose cotransporter 2 inhibitor use were determined as the input features of the model.

[0118] During integrated learning model construction, the parameters of the basic learning machine were adjusted to adapt to the new features. The gradient boosting decision tree set the number of weak learning machines to 400, the learning rate to 0.04, and through 5-fold cross-validation, it was found that when the maximum depth of the decision tree was 7, the validation set accuracy was the highest 89%; the random forest used bootstrap sampling to generate 6 subsets, each subset trained 40 decision trees, and when the node split, 5 features were randomly selected from the total number of features 62.5%, and a model of 240 decision trees was constructed; the extreme gradient boosting tree optimized the regularization parameter, set lambda=0.8, gamma=0.2, the maximum depth of the decision tree was 8, and the parallel computing time was shortened by 25% compared with the first embodiment. The integrated weight was determined according to the accuracy of the validation set 12 cases, the gradient boosting decision tree accuracy 91% weight 0.38, the random forest 88% weight 0.27, the extreme gradient boosting tree 92% weight 0.35, and the final prediction result was obtained by weighted summation. The evaluation indicators of the model on the test set 6 cases were: accuracy 90%, precision 92%, recall 88%, F1 score 0.89, and area under ROC curve 0.93. The performance was improved compared with the first embodiment, which was related to the new blood glucose related features.

[0119] The SHAP framework analysis shows that the global importance ranking is fasting blood glucose, glycosylated hemoglobin, laxative to examination time, constipation history, hypocalcemia. Taking the patient in document 1 line 10 as an example, 82 years old, BMI 22.66, intestinal obstruction, indigestion, laxative to examination time 2-4 hours, no hypoproteinemia, anticholinergic drug use yes, intestinal preparation result yes, supplemented with fasting blood glucose 8.3 mmol / L, glycosylated hemoglobin 7.1% new data, calculate the SHAP value of each feature: fasting blood glucose 8.3 mmol / L SHAP value 0.35, positive promotion, because the blood sugar is controlled in a reasonable range, it does not affect the intestinal motility, glycosylated hemoglobin 7.1% 0.28, positive promotion, long-term blood glucose control meets the standard, laxative to examination time 2-4 hours 0.22, positive promotion, intestinal obstruction-0.19, negative inhibition, anticholinergic drug use-0.16, negative inhibition, may weaken intestinal peristalsis. SHAP force guide map clearly shows the interaction of each feature, the synergistic effect of fasting blood glucose and glycosylated hemoglobin makes the SHAP value superimposed 0.35+0.28=0.63, offsetting the inhibitory effect of intestinal obstruction and anticholinergic drugs, the final prediction value 0.81, the baseline prediction value 0.55, determine qualified, consistent with the actual result; dependence graph shows that when fasting blood glucose is in the interval of 4.4-7.0 mmol / L, SHAP value increases with the increase of blood glucose, and when it exceeds 7.0 mmol / L, SHAP value gradually decreases, indicating that both too high or too low blood glucose may affect the quality of intestinal preparation.

[0120] In clinical application, the digestive department and the endocrinology department jointly interpret the prediction results, and believe that the patient's fasting blood glucose and glycosylated hemoglobin control well is the key to promote qualified, and intestinal obstruction and anticholinergic drugs are the main restricting factors. The optimization scheme includes: adjusting the anticholinergic drug dose from 3 times a day to 1 time a day 3 days before intestinal preparation, and stopping on the examination day to avoid excessive inhibition of intestinal peristalsis; for the history of intestinal obstruction, increase the dose of intestinal preparation drug polyethylene glycol 4000 from 2000 ml to 2500 ml, take 1 time every 6 hours, 4 times a day, and guide the patient to walk appropriately after taking the medicine, 15 minutes each time, 3 times a day; the blood glucose control target maintains fasting blood glucose <8 mmol / L and glycosylated hemoglobin <7.5%, and blood glucose is monitored 3 times a day before examination to ensure no large fluctuations. After the patient executes the scheme, the intestinal preparation score of colonoscopy is 8 points qualified, and no adverse reactions such as abdominal pain and abdominal distension occur. Effect feedback shows that after adjusting the dose of anticholinergic drugs, the patient's intestinal peristalsis frequency increases from 1 time a day to 2 times a day, and the discomfort symptoms related to intestinal obstruction do not recur; the blood glucose monitoring result is stable at 7.2-7.8 mmol / L, and the safety of the scheme is confirmed.

[0121] The above shows and describes the basic principles, main features and advantages of the present application. Those skilled in the art should understand that the present application is not limited to the above-mentioned embodiments, and the above-mentioned embodiments and descriptions in the specification are only the principles of the present application. Various changes and improvements can be made without departing from the spirit and scope of the present application, and these changes and improvements all fall within the scope of the claimed present application. The scope of protection of the present application is defined by the appended claims and their equivalents.

Claims

1. A method for predicting the quality of bowel preparation in diabetic patients based on SHAP, characterized by, The method comprises the following steps: Collecting clinical feature data of a diabetic patient and preprocessing the clinical feature data; Building a quality prediction model for intestinal preparation of the diabetic patient, using the preprocessed clinical feature data as input of the model and using the intestinal preparation qualification rate as output; The quality prediction model is built using an ensemble learning algorithm; The ensemble learning algorithm comprises a base learner and an ensemble strategy, and the base learner selects gradient boosting decision tree, random forest and extreme gradient boosting tree, and each base learner is trained independently; In the training process of the gradient boosting decision tree, a weak learner is added step by step, each newly added weak learner is fitted to the residual of the previous round of model training, and the learning rate is adjusted according to the accuracy of the validation set; In the training process of the random forest, a bootstrap sampling method is used to extract multiple sub-datasets from the original clinical feature dataset, and each sub-dataset corresponds to a decision tree, and in the construction process of the decision tree, only part of the clinical features selected at random are selected as the optimal split feature when each node is split; In the training process of the extreme gradient boosting tree, a regularization term is introduced to suppress model overfitting, and a parallel computing method is used; The ensemble strategy adopts a weighted voting method, the weight of each base learner is determined according to its prediction accuracy on the validation set, and the final prediction model output result is obtained by weighted summation; The SHAP explainable artificial intelligence framework is introduced to analyze and attribute the quality prediction model; The analysis and attribution process of the SHAP explainable artificial intelligence framework comprises model global analysis and individual prediction attribution; The model global analysis determines the global importance ranking of each clinical feature on the prediction result by calculating the mean of the absolute values of the SHAP values of all clinical features; The individual prediction attribution calculates the SHAP value of each clinical feature of a single patient, the positive and negative of the SHAP value represent the promotion or inhibition effect of the clinical feature on the intestinal preparation qualification prediction result of the patient, and the absolute value of the SHAP value represents the strength of the effect; In the analysis process, the SHAP framework displays the nonlinear relationship between a single clinical feature and the prediction result through a feature dependence graph, and analyzes the influence of the synergistic effect between two clinical features on the prediction result through an interaction effect graph; The quality prediction model outputs the intestinal preparation qualification prediction result of the diabetic patient, and the SHAP framework quantitatively outputs the influence degree of each clinical feature on the individual prediction result; The clinical feature data comprises physiological index data, medication related data, disease course data and intestinal preparation related data of the patient; The physiological index data comprises blood glucose related indicators, liver and kidney function indicators, electrolyte levels and body mass index; The medication related data comprises the types of diabetes treatment drugs, the medication dosage, the medication duration and the use of intestinal preparation drugs; The disease course data comprises the duration of diabetes diagnosis, the occurrence of complications and the disease control situation; The intestinal preparation related data comprises the starting time of intestinal preparation, the diet control situation and the defecation situation during the preparation process.

2. The SHAP-based quality of bowel preparation for diabetes patients prediction method of claim 1, wherein, The clinical feature data is collected by a hospital electronic medical record system, laboratory test result entry and patient-specific information collection form filling, and patient personal identity information is desensitized during the collection process in accordance with relevant medical data privacy protection regulations.

3. The SHAP-based quality of bowel preparation for diabetes patients prediction method of claim 1, wherein, The preprocessing of the clinical feature data specifically includes: data cleaning of repeated records and logically contradictory data in the clinical feature data, the logically contradictory data being mutually conflicting clinical feature data recorded at the same time point for the same patient; at least three clinical features with the highest correlation coefficients are selected to construct an interpolation model for filling in missing values by calculating the correlation coefficients of missing features and other complete clinical features; values outside the range of a box plot and not conforming to clinical routines are determined as abnormal values, and the abnormal values are corrected using a sliding average method of adjacent time point clinical feature data, and for abnormal values without adjacent time point data, the abnormal values are corrected in combination with the patient's clinical basic information and disease progression rules; Z-score standardization method is used for data standardization to convert all clinical feature data into standardized data with a mean of 0 and a standard deviation of 1.

4. The SHAP-based quality of bowel preparation for diabetes patients prediction method of claim 1, wherein, Before constructing the quality prediction model, a clinical feature selection step is further included, and a combination of filter selection and embedded selection is used; filter selection removes clinical features with an absolute value of the correlation coefficient between the clinical features and the intestinal preparation qualification rate below a set threshold by calculating the correlation coefficient, the correlation coefficient is calculated using Pearson correlation coefficient or Spearman rank correlation coefficient, and the calculation method is selected according to the data type of the clinical feature; embedded selection is performed simultaneously during the training of the integrated learning model, and the clinical features with high contribution to the prediction results are automatically selected by the weight distribution of each clinical feature during the model training process, and the redundant features with low contribution are removed; after the feature selection is completed, a redundancy test is performed on the selected clinical features, a variance inflation factor between any two clinical features is calculated, and the clinical features with a variance inflation factor higher than a set threshold are removed.

5. The SHAP-based quality of bowel preparation for diabetes patients prediction method of claim 1, wherein, The training and verification process of the quality prediction model includes data set division, hyperparameter optimization and model performance evaluation; the data set is divided into a training set, a validation set and a test set according to a preset ratio, the training set is used for model parameter learning, the validation set is used for hyperparameter optimization and model selection, and the test set is used for final model performance evaluation; hyperparameter optimization uses a grid search combined with cross-validation method, sets the search range of the hyperparameters of each basic learner, traverses all hyperparameter combinations through cross-validation, and selects the hyperparameter combination with the highest validation set accuracy as the optimal hyperparameter; the model performance evaluation uses accuracy, precision, recall, F1 score and area under ROC curve.

6. The SHAP-based quality of bowel preparation for diabetes patients prediction method of claim 1, wherein, The influence degree of each clinical feature on the individual prediction result quantitatively output by the SHAP framework is presented by a visualization method, and the visualization method includes a SHAP summary chart, a dependence chart, a waterfall chart and a force-directed chart. The SHAP summary chart displays the SHAP value distribution of all patients in the form of a scatter chart. The dependency graph shows the relationship between the value of a single clinical feature and the corresponding SHAP value in the form of a curve graph; The waterfall chart sorts the clinical features according to the degree of influence on the prediction result for a single patient, and sequentially shows the SHAP value accumulation process of each clinical feature; The force-directed graph shows the interaction between clinical features and the comprehensive influence on the prediction result.

7. The SHAP-based quality of bowel preparation for diabetes patients prediction method of claim 1, wherein, After the establishment of the prediction model, the model optimization iteration step is further included, which involves continuously collecting the clinical feature data and the intestinal preparation quality results of newly added diabetic patients to perform incremental training on the model; During the incremental training process, a sliding window mechanism is used to retain the latest historical data and newly added data to form a training set; The prediction performance of the model is periodically re-evaluated, and if the evaluation indicators decline, the model is updated by re-optimizing the hyperparameters or adjusting the combination of basic learners. Based on the changes in key clinical features obtained through the SHAP framework analysis, if new features that affect intestinal preparation quality appear in the newly added clinical data, they are included in the clinical feature data set, and the model is re-trained.

8. The SHAP-based quality of bowel preparation for diabetes patients prediction method of claim 1, wherein, The clinical application process of the prediction result and the SHAP framework analysis result includes result interpretation, scheme development, and effect feedback; The result interpretation is performed by clinical doctors based on the specific clinical situation of the patient, and the intestinal preparation qualification probability output by the prediction model and the influence degree of each clinical feature are interpreted professionally; The scheme development is based on the interpretation result, and an optimization scheme is developed for the key clinical features that affect the intestinal preparation quality of the patient, including adjusting the use scheme of intestinal preparation drugs, optimizing dietary control suggestions, and adjusting blood glucose control targets; The effect feedback is obtained by tracking the actual intestinal preparation result of the patient, comparing the difference between the prediction result and the actual result, analyzing the implementation effect of the scheme, and if the actual intestinal preparation quality does not meet the expectation, the optimization scheme is further adjusted based on the attribution analysis result of the SHAP framework.

Citation Information

Patent Citations

  • Diabetes classification prediction method based on improved Stacking strategy

    CN118609795A

  • Prediction method for intestinal preparation of patient before colonoscopy based on machine learning

    CN119541856A

  • Muscle fatty degeneration risk assessment method based on machine learning

    CN120600307A