An optimization method and system for predicting diabetic complications

By constructing a diabetes complication prediction system based on a multi-level model, and utilizing an ensemble learning framework and a logistic regression model for weighted integration, the hyperparameters of the base classifier are optimized. This addresses the shortcomings in feature selection and model optimization in existing technologies, achieving high-precision prediction of diabetes complications and cost optimization, and providing real-time clinical decision support.

CN121768690BActive Publication Date: 2026-05-26NANJING MEDICAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING MEDICAL UNIV
Filing Date
2026-03-02
Publication Date
2026-05-26

AI Technical Summary

Technical Problem

Existing models for predicting diabetic complications have limitations in feature selection and model optimization. Traditional machine learning algorithms are insufficient in terms of prediction accuracy, feature selection, and computational efficiency, and do not fully utilize the potential value of basic laboratory test indicators.

Method used

This study employs multiple machine learning methods to jointly calculate the average importance of various diabetes detection indicators. A stacked ensemble learning model is constructed using an ensemble learning framework, and a logistic regression model is combined for weighted integration. The hyperparameters of the base classifier are optimized, missing values ​​are handled using interpolation, and the dataset is balanced using the SMOTE algorithm. Easily obtainable and low-cost clinical laboratory detection indicators are selected to build a prediction system based on a multi-level model.

Benefits of technology

It significantly improves the prediction accuracy of diabetic complications. The model achieves an accuracy of up to 98.5% and an AUC value of 99.76% when predicting diabetic nephropathy complications. It also reduces testing costs and is embedded into the hospital laboratory information management system through API services, providing clinicians with real-time risk prediction functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121768690B_ABST
    Figure CN121768690B_ABST
Patent Text Reader

Abstract

This invention discloses an optimization method and system for a predictive model of diabetic complications. It involves collecting routine laboratory test data from diabetic patients, performing preprocessing such as missing value removal, label merging, and SMOTE resampling to construct a balanced dataset. The average importance of indicators is evaluated using multiple machine learning models to select a subset of key features. Random forest, XGBoost, support vector machine, and multilayer perceptron are selected as base classifiers, and after hyperparameter optimization, a stacked ensemble learning model is constructed to further improve predictive performance. Finally, the model is packaged as an API service and embedded into a hospital information system to achieve high-precision, low-cost, and real-time risk prediction of diabetic complications. Experimental results show that this invention achieves an accuracy of 98.5% and an AUC of 99.76% in predicting diabetic nephropathy complications, outperforming single models.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of optimization methods for predicting diabetic complications, and particularly relates to an optimization method and system for predicting diabetic complications. Background Technology

[0002] In modern medicine, diabetes, as a common chronic metabolic disease, has seen its incidence rise year by year, becoming a significant global public health issue. Diabetic patients often face the risk of various complications, including cardiovascular disease, retinopathy, nephropathy, and neuropathy. These complications not only severely impact patients' quality of life but also increase medical costs and the social burden; therefore, early prediction and intervention of diabetic complications are particularly important.

[0003] Current technologies for predicting diabetic complications primarily rely on clinical indicators such as blood glucose, blood pressure, and lipid levels. However, traditional prediction methods often overlook the potential value of basic laboratory test indicators, which are usually the first tests patients encounter during their hospital visits. Although some studies have attempted to use clinical indicators for predicting diabetic complications, there remains a significant research gap in utilizing basic laboratory test indicators. Furthermore, existing diabetic complication prediction models have limitations in feature selection and model optimization: traditional machine learning algorithms, such as Random Forest, Support Vector Machine (SVM), and Multilayer Perceptron (MLP), while showing good performance in certain scenarios, are insufficient in terms of prediction accuracy, feature selection, and computational efficiency for diabetic complications. Summary of the Invention

[0004] Purpose of the invention: This invention provides an optimization method and system for a diabetes complication prediction model, aiming to address the limitations of existing diabetes complication prediction models in feature selection and model optimization, and improve the prediction accuracy of the prediction model for diabetes complications.

[0005] Technical solution: This invention provides an optimization method for a predictive model of diabetic complications, comprising:

[0006] S1. Obtain diabetes detection indicators; obtain an initial dataset based on the diabetes detection indicators, the initial dataset including diabetes detection indicator data and corresponding clinically diagnosed complication labels; preprocess the initial dataset to obtain a preprocessed dataset.

[0007] S2. Use multiple machine learning methods to jointly calculate the average importance of each diabetes detection indicator, and iteratively filter out diabetes detection indicators with lower ranking based on the average importance to dynamically generate indicator feature sets; filter the preprocessed dataset according to the indicator feature sets to obtain a comprehensive dataset.

[0008] S3. Select an ensemble learning framework, adopt a multi-level model construction method, optimize the parameters of the base classifiers, and finally determine the optimal hyperparameter configuration of each base classifier to obtain the optimized base classifier layer.

[0009] S4. Based on the ensemble learning framework, design a stacked ensemble learning model: The stacked ensemble learning model includes several optimized base classifier layers and a meta-classifier based on a logistic regression model. The base classifier layers include random forest, XGBoost, support vector machine and multilayer perceptron. The base classifier performs preliminary prediction on the input data, and the meta-classifier performs weighted integration of the results of all base classifiers to output the final prediction result.

[0010] S5. Initialize an optimal stacked ensemble learning model and preset an optimal prediction performance threshold. Evaluate the prediction performance value of the current stacked ensemble learning model based on the final prediction results. Compare the prediction performance value of the current stacked ensemble learning model with the optimal prediction performance threshold. If the prediction performance value of the current stacked ensemble learning model is better, update the optimal prediction performance threshold to the prediction performance value of the current stacked ensemble learning model. Update the optimal stacked ensemble learning model to the current stacked ensemble learning model and return to S2 to iterate and filter out the diabetes detection indicators that are ranked lower. The iteration ends when the prediction performance value of the current stacked ensemble learning model is lower than the optimal prediction performance threshold.

[0011] S6. Encapsulate the optimal stacked ensemble learning model at the end of the iteration as an API service.

[0012] Furthermore, the preprocessing steps include: imputing missing values ​​in the diabetes detection index data and filling data gaps using interpolation methods; merging clinical diagnosis complication labels and removing invalid labels through data cleaning; and applying adaptive resampling technology to balance the imbalanced dataset to enhance the model's generalization ability.

[0013] Furthermore, the method of jointly calculating the average importance of each diabetes detection indicator using multiple machine learning methods includes: evaluating the importance of each diabetes detection indicator on the preprocessed dataset based on random forest, XGBoost, support vector machine, and multilayer perceptron models respectively; obtaining the indicator importance ratio of each model through the permutation importance evaluation method; and averaging the indicator importance ratios of each model to obtain the average importance of each indicator.

[0014] Furthermore, the step of optimizing the parameters of the base classifiers includes: setting a corresponding hyperparameter range for each base classifier, constructing a hyperparameter search space for each base classifier, wherein the hyperparameter search space includes several hyperparameter configurations; for each base classifier, training the model for each hyperparameter configuration using the K-fold cross-validation method, and calculating the prediction performance value of the trained base classifier on the validation set under each hyperparameter configuration, thereby calculating the evaluation score of each hyperparameter configuration; by traversing the hyperparameter search space of each base classifier, using an optimization algorithm to select the optimal hyperparameter configuration for each base classifier, so as to ensure that the performance of each base classifier on different datasets reaches its best.

[0015] Furthermore, the evaluation includes a comprehensive analysis of the performance of the stacked ensemble learning model under multiple evaluation criteria to fully assess the classification effect and generalization ability of the stacked ensemble learning model; the evaluation criteria include accuracy, recall, F1 score, and area under the ROC curve (AUC).

[0016] Furthermore, the initialization of an optimal stacked ensemble learning model and the preset of an optimal prediction performance threshold include: the initialized optimal stacked ensemble learning model is a stacked ensemble learning model constructed based on all diabetes detection indicators; the initial optimal prediction performance threshold is set as the accuracy of the various complications predicted by the stacked ensemble learning model when all diabetes detection indicators are not removed.

[0017] Furthermore, the evaluation obtains the prediction performance value of the current stacked ensemble learning model and compares it with the optimal prediction performance threshold. This includes: comparing the accuracy of the current stacked ensemble learning model in predicting various complications with the optimal prediction performance threshold, evaluating the accuracy of the current stacked ensemble learning model and the optimal stacked ensemble learning model in predicting different diabetic complications, and updating the optimal stacked ensemble learning model based on the prediction effect of the current stacked ensemble learning model. This process is continuously iterated, with each round deleting the diabetes detection indicator with the lowest average importance among the diabetes detection indicators, rebuilding the stacked ensemble learning model on the updated indicator feature set, and performing model training and evaluation until the prediction performance value of the stacked ensemble learning model no longer improves.

[0018] This invention also provides an optimization system for a predictive model of diabetic complications, comprising:

[0019] The data acquisition module is used to acquire diabetes detection indicators, acquire an initial dataset based on the diabetes detection indicators, the initial dataset including diabetes detection indicator data and corresponding clinically diagnosed complication labels; and preprocess the initial dataset to obtain a preprocessed dataset.

[0020] The feature selection module is used to jointly calculate the average importance of each diabetes detection indicator using multiple machine learning methods, iteratively filter out diabetes detection indicators with lower ranking based on the average importance, and dynamically generate indicator feature sets; the preprocessed dataset is then filtered based on the indicator feature sets to obtain a comprehensive dataset.

[0021] The parameter optimization unit is used to select the ensemble learning framework, adopt a multi-level model construction method, optimize the parameters of the base classifier, and finally determine the optimal hyperparameter configuration of each base classifier to obtain the optimized base classifier layer.

[0022] An ensemble learning module is used to design a stacked ensemble learning model based on the ensemble learning framework. The stacked ensemble learning model includes several optimized base classifier layers and a meta-classifier based on a logistic regression model. The base classifier layers include random forest, XGBoost, support vector machine, and multilayer perceptron. The base classifiers make preliminary predictions on the input data, and the meta-classifier performs weighted integration of the results of all base classifiers to output the final prediction result.

[0023] The performance monitoring and iteration control unit is used to initialize an optimal stacked ensemble learning model and preset an optimal prediction performance threshold. It evaluates the prediction performance value of the current stacked ensemble learning model based on the final prediction results and compares the prediction performance value of the current stacked ensemble learning model with the optimal prediction performance threshold. If the prediction performance value of the current stacked ensemble learning model is better, it updates the optimal prediction performance threshold to the prediction performance value of the current stacked ensemble learning model, updates the optimal stacked ensemble learning model to the current stacked ensemble learning model, and returns to the feature filtering module to iteratively filter out diabetes detection indicators that are ranked lower, until the iteration terminates when the prediction performance value of the current stacked ensemble learning model is lower than the optimal prediction performance threshold.

[0024] The encapsulation module is used to encapsulate the optimal stacked ensemble learning model at the end of the iteration as an API service.

[0025] The present invention also provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above method.

[0026] The present invention also provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described method.

[0027] Beneficial Effects: This invention provides an optimization method and system for a predictive model of diabetic complications. Compared with existing technologies, in the data preprocessing stage, this invention uses the SMOTE algorithm combined with oversampling and undersampling techniques to balance the class distribution in the dataset, solving the common class imbalance problem in diabetic complication data. Simultaneously, the data is standardized to ensure the stability of model training and the accuracy of prediction. Twelve routine clinical laboratory test indicators are selected as features, as these indicators are easy to obtain and have low cost. By calculating the Pearson correlation coefficient matrix between features, highly redundant features are identified and eliminated. Based on the feature importance ranking of multi-model weighted evaluation, the subset of features that contribute most to complication prediction is selected, optimizing the model's input features and improving the model's efficiency and accuracy. By constructing an ensemble model based on multiple machine learning algorithms, using a stacked ensemble method, the prediction results of base classifiers such as Random Forest, XGBoost, and SVM are used as meta-features and input into meta-classifiers such as Logistic Regression for fusion. Cross-validation is used to optimize the weights of the meta-classifiers, leveraging the advantages of each base model, improving the generalization ability and predictive stability of the ensemble model, and achieving high-precision prediction of diabetic complications. Experimental results show that the model has an accuracy of 98.5% and an AUC of 99.76% in predicting diabetic nephropathy complications, which is significantly better than single models (such as random forest, XGBoost, SVM, etc.).

[0028] Furthermore, this invention encapsulates the optimized prediction model as an API service and embeds it into a hospital laboratory information management system (LIS), providing clinicians with real-time complication risk prediction capabilities. The system outputs visualized reports including ROC curves and risk levels, assisting clinical decision-making and improving the efficiency of early diagnosis and intervention for diabetic complications. Attached Figure Description

[0029] Figure 1 This is a flowchart of the method of the present invention.

[0030] Figure 2 This is a graph showing the change in loss value of the Multilayer Perceptron (MLP) in the base classifier of this invention during the training process with the number of iterations.

[0031] Figure 3 The following are the ROC curves of the base classifiers of this invention: (a) is the ROC curve of Random Forest, (b) is the ROC curve of XGBoost, (c) is the ROC curve of Support Vector Machine, and (d) is the ROC curve of Multilayer Perceptron.

[0032] Figure 4 This is the ROC curve of the stacked ensemble learning model used in this invention.

[0033] Figure 5This is a heatmap showing the standard correlation between different detection indicators of the present invention. Detailed Implementation

[0034] The optimization method for a diabetes complication prediction model according to the present invention includes:

[0035] S1. Obtain diabetes detection indicators; obtain an initial dataset based on the diabetes detection indicators, the initial dataset including diabetes detection indicator data and corresponding clinically diagnosed complication labels; preprocess the initial dataset to obtain a preprocessed dataset.

[0036] S2. Use multiple machine learning methods to jointly calculate the average importance of each diabetes detection indicator, and iteratively filter out diabetes detection indicators with lower ranking based on the average importance to dynamically generate indicator feature sets; filter the preprocessed dataset according to the indicator feature sets to obtain a comprehensive dataset.

[0037] S3. Select an ensemble learning framework, adopt a multi-level model construction method, optimize the parameters of the base classifiers, and finally determine the optimal hyperparameter configuration of each base classifier to obtain the optimized base classifier layer.

[0038] S4. Based on the ensemble learning framework, design a stacked ensemble learning model: The stacked ensemble learning model includes several optimized base classifier layers and a meta-classifier based on a logistic regression model. The base classifier layers include random forest, XGBoost, support vector machine and multilayer perceptron. The base classifier performs preliminary prediction on the input data, and the meta-classifier performs weighted integration of the results of all base classifiers to output the final prediction result.

[0039] S5. Initialize an optimal stacked ensemble learning model and preset an optimal prediction performance threshold. Evaluate the prediction performance value of the current stacked ensemble learning model based on the final prediction results. Compare the prediction performance value of the current stacked ensemble learning model with the optimal prediction performance threshold. If the prediction performance value of the current stacked ensemble learning model is better, update the optimal prediction performance threshold to the prediction performance value of the current stacked ensemble learning model. Update the optimal stacked ensemble learning model to the current stacked ensemble learning model and return to S2 to iterate and filter out the diabetes detection indicators that are ranked lower. The iteration ends when the prediction performance value of the current stacked ensemble learning model is lower than the optimal prediction performance threshold.

[0040] S6. Encapsulate the optimal stacked ensemble learning model at the end of the iteration as an API service.

[0041] like Figure 1As shown, S1 obtains 12 high-frequency laboratory test indicators for diabetes detection, including blood glucose, uric acid, 24-hour urine protein, high-density lipoprotein cholesterol (HDL-C), low-density lipoprotein cholesterol (LDL-C), total cholesterol, cystatin C, creatinine, urine microalbumin, urine albumin / creatinine ratio, glycated hemoglobin, and postprandial blood glucose. An initial dataset is obtained based on these diabetes detection indicators. The data comes from the laboratory information system of the Second Affiliated Hospital of Nanjing Medical University and covers routine laboratory test data and clinical diagnostic complication labels of diabetic patients from October 2020 to June 2024.

[0042] The detection index data were preprocessed, and missing values ​​in the diabetes detection index data were imputed using interpolation methods to fill data gaps. Next, based on the unified clinical diagnostic label rules, various specific complication labels (such as different types of diabetic nephropathy, retinopathy, etc.) were merged into six standardized complication classification labels: no complications, ocular complications, neurological complications, renal complications, vascular complications, and foot complications. The clinical diagnostic complication labels in the detection index data after removing missing values ​​were updated to these six standardized complication classification labels. Finally, the SMOTE algorithm, combined with oversampling and undersampling techniques, was used to balance the sample size of each complication classification label, thereby generating a balanced DCD dataset, i.e., the preprocessed dataset.

[0043] S2 calculates the Pearson correlation arithmetic matrix in the DCD dataset and performs eigencorrelation distribution analysis. The results are as follows: Figure 5 As shown in the figure, the highest correlation coefficient among the features is only 0.6, indicating that there are no highly redundant features.

[0044] To more comprehensively, objectively, and stably evaluate the actual contribution of each indicator (i.e., feature) to the prediction of diabetic complications, this invention selects a representative method from various categories of machine learning, namely Random Forest, XGBoost, Support Vector Machine (SVM), and Multilayer Perceptron (MLP), to evaluate the importance of each feature. The importance ratio of each model is obtained by permutation importance assessment (a model-independent importance assessment method). The average importance ratio of each model is then averaged to obtain the average importance of each indicator. The results are shown in Table 1. As can be seen from Table 1, among the features, creatinine has the highest average importance at 6.31%, while postprandial blood glucose has the lowest average importance at only 3.92%.

[0045] Table 1. Average Importance of Indicators

[0046]

[0047] Based on the average importance ranking, iterative filtering removes diabetes detection indicators that rank lower, dynamically generating indicator feature sets. The preprocessed dataset is then filtered according to these feature sets to obtain a comprehensive dataset, which is divided into training and testing sets in a 4:1 ratio. Furthermore, this invention also statistically analyzes the detection cost of each indicator, as shown in Table 2. By selecting features, the aim is to improve prediction accuracy while minimizing detection costs.

[0048] Table 2 Economic Costs of Indicators

[0049]

[0050] S3 employs Random Forest, XGBoost, Support Vector Machine (SVM), and Multilayer Perceptron (MLP) as base classifiers. Cross-validation and grid search are performed on each base classifier in the training set to define a corresponding hyperparameter range for each classifier, constructing a hyperparameter search space for each classifier. This hyperparameter search space includes several hyperparameter configurations. For each base classifier, K-fold cross-validation is used to train the model on each hyperparameter configuration, and the prediction performance of the trained classifier on the validation set under each hyperparameter configuration is calculated, such as the average accuracy for each complication. This is used to calculate the evaluation score for each hyperparameter configuration. By traversing the hyperparameter search space of each base classifier, an optimization algorithm is used to select the optimal hyperparameter configuration for each classifier, ensuring that each base classifier performs best on different datasets.

[0051] S4 constructs a stacking ensemble learning model, which consists of two layers. The first layer is composed of optimized base classifiers, which take the comprehensive dataset as input and output the prediction results of each optimized base classifier. The second layer is a meta-classifier that uses a logistic regression model, which takes the prediction results of each optimized base classifier as input and outputs the prediction results of the stacking ensemble learning model.

[0052] Specifically, the first layer of the stacked ensemble learning model includes optimized random forest, XGBoost, SVM, and MLP. K-fold cross-validation is performed on each first-layer model using the training set. The training set is divided into K parts, with K-1 parts used alternately as temporary training sets and one part as a temporary test set. Each first-layer model is trained on the temporary training set, resulting in temporarily trained first-layer models. These temporarily trained models are then used to make predictions on the temporary test set, yielding K-fold prediction results for each first-layer model. For example, when K is 5, the training set is divided into 5 parts. Four of the five parts are used alternately as temporary training sets and one part as a temporary test set for each of the optimized random forest, XGBoost, SVM, and MLP models. Predictions are then made on the temporary training sets, yielding five first-layer prediction results for each model. The K-fold prediction results of each first-layer model are stacked as meta-features, which form the training set for the second layer. Next, the training set is used to fit each of the first-layer models, obtaining the fitted base classifiers. These fitted base classifiers are then used to make predictions on the test set, yielding the test prediction results. The average of these test prediction results is used as the test set for the second layer. Finally, a logistic regression model is used as the meta-classifier, fitted to the training set of the second layer. This fitted meta-classifier is then used to make predictions on the test set of the second layer, resulting in the prediction results of the stacked ensemble learning model.

[0053] The training mechanisms of each model also differ: Random Forest achieves feature partitioning by maximizing information gain; XGBoost is based on an additive model and gradually builds a strong classifier by minimizing the loss function; SVM builds the optimal hyperplane by maximizing the classification margin; MLP relies on forward propagation to calculate the output error and updates the weight parameters through backpropagation. Figure 2 The graph shows how the loss value of the MLP changes with the number of iterations during training. As can be seen from the graph, the MLP gradually converges as the number of training rounds increases, and the training process is stable and effective.

[0054] The optimal stacked ensemble learning model initialized in S5 is a stacked ensemble learning model built based on all diabetes detection indicators; the initial optimal prediction performance threshold is set as the accuracy of the various complications predicted by the stacked ensemble learning model when all diabetes detection indicators are not removed.

[0055] The prediction performance of the current stacked ensemble learning model is evaluated based on its prediction results. The evaluation metrics include accuracy, recall, F1 score, and AUC.

[0056] The prediction performance value obtained by the current stacked ensemble learning model is compared with the optimal prediction performance threshold. For example, the average accuracy obtained by the current stacked ensemble learning model in each complication is compared with the average of the optimal accuracy in each complication. If the prediction performance value of the current stacked ensemble learning model is better, the optimal prediction performance threshold is updated to the prediction performance value of the current stacked ensemble learning model, the optimal stacked ensemble learning model is updated to the current stacked ensemble learning model, and the process returns to S2 to perform a new round of screening for diabetes detection indicators. The screening process removes the diabetes detection indicators with the lowest importance in each round according to the average importance of each diabetes detection indicator from low to high. In each round, the next diabetes detection indicator with the lowest importance is removed from the remaining diabetes detection indicator set after the previous removal of the lowest importance diabetes detection indicator, until the prediction performance value of the current stacked ensemble learning model is lower than the optimal prediction performance threshold, at which point the iteration terminates.

[0057] S6. Encapsulate the optimal stacked ensemble learning model at the end of the iteration as an API service and embed it into the hospital laboratory information management system (LIS) to provide doctors and patients with real-time complication risk prediction functions. Output visualized reports containing ROC curves, risk levels, and other information to assist clinical decision-making and improve the efficiency of early diagnosis and intervention of diabetic complications.

[0058] The optimization system for a diabetes complication prediction model according to the present invention includes:

[0059] The data acquisition module is used to acquire diabetes detection indicators, acquire an initial dataset based on the diabetes detection indicators, the initial dataset including diabetes detection indicator data and corresponding clinically diagnosed complication labels; and preprocess the initial dataset to obtain a preprocessed dataset.

[0060] The feature selection module is used to jointly calculate the average importance of each diabetes detection indicator using multiple machine learning methods, iteratively filter out diabetes detection indicators with lower ranking based on the average importance, and dynamically generate indicator feature sets; the preprocessed dataset is then filtered based on the indicator feature sets to obtain a comprehensive dataset.

[0061] The parameter optimization unit is used to select the ensemble learning framework, adopt a multi-level model construction method, optimize the parameters of the base classifier, and finally determine the optimal hyperparameter configuration of each base classifier to obtain the optimized base classifier layer.

[0062] An ensemble learning module is used to design a stacked ensemble learning model based on the ensemble learning framework. The stacked ensemble learning model includes several optimized base classifier layers and a meta-classifier based on a logistic regression model. The base classifier layers include random forest, XGBoost, support vector machine, and multilayer perceptron. The base classifiers make preliminary predictions on the input data, and the meta-classifier performs weighted integration of the results of all base classifiers to output the final prediction result.

[0063] The performance monitoring and iteration control unit is used to initialize an optimal stacked ensemble learning model and preset an optimal prediction performance threshold. It evaluates the prediction performance value of the current stacked ensemble learning model based on the final prediction results and compares the prediction performance value of the current stacked ensemble learning model with the optimal prediction performance threshold. If the prediction performance value of the current stacked ensemble learning model is better, it updates the optimal prediction performance threshold to the prediction performance value of the current stacked ensemble learning model, updates the optimal stacked ensemble learning model to the current stacked ensemble learning model, and returns to the feature filtering module to iteratively filter out diabetes detection indicators that are ranked lower, until the iteration terminates when the prediction performance value of the current stacked ensemble learning model is lower than the optimal prediction performance threshold.

[0064] The encapsulation module is used to encapsulate the optimal stacked ensemble learning model at the end of the iteration as an API service.

[0065] The computer device of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the above method.

[0066] The computer-readable storage medium of the present invention stores a computer program thereon, which, when executed by a processor, implements the steps of the above-described method.

[0067] In this embodiment, by removing the least important diabetes detection indicator "postprandial blood glucose" in S2, the detection cost was reduced, resulting in Table 3 and... Figure 4 The performance evaluation results are shown in Table 3. Figure 4 As can be seen, the stacked ensemble learning model achieved an accuracy of 87.83% and an AUC of 90% when predicting no complications; and an accuracy of over 90% and an AUC of over 95% when predicting various complications; for example, the accuracy reached 98.5% and the AUC was as high as 99.76% when predicting diabetic nephropathy complications.

[0068] Table 3 Performance of Stacked Ensemble Learning Models

[0069]

[0070] In S2, after removing "postprandial blood glucose", the feature with the lowest importance among the remaining diabetes detection indicators, "low-density lipoprotein cholesterol", was further removed, which further reduced the detection cost. The performance evaluation results in Table 4 show that the accuracy of predicting no complications increased from 87.83% to 88.67%, but the prediction accuracy of other complications generally decreased. Therefore, the optimal feature to be deleted in this embodiment is "postprandial blood glucose", which optimizes the cost while ensuring the high predictive performance of the stacked ensemble learning model.

[0071] Table 4 Performance of the stacked ensemble learning model after removing postprandial blood glucose and LDL cholesterol

[0072]

[0073] To evaluate the predictive performance of the stacked ensemble learning model constructed in this invention, the predictive performance of the stacked ensemble model and other single base classifiers was verified. Accuracy, precision, recall, F1 score, AUC, and other metrics were calculated, and the results are shown in Tables 3 and 5. Figure 3 , Figure 4 As shown in Table 3, the performance evaluation results of the stacked ensemble learning model after removing "postprandial blood glucose" are presented. Table 5 shows the performance evaluation results of the stacked ensemble learning model and other single base classifiers without removing the feature. Figure 3 ROC curves for four baseline classifiers—random forest, XGBoost, SVM, and MLP—are presented to illustrate the performance of each model in predicting diabetic complications. Figure 4 The ROC curve of the stacked ensemble learning model after removing "postprandial blood glucose" is shown.

[0074] Table 5 Experimental Results

[0075]

[0076] The results show that the stacked ensemble model outperforms or approaches single-base classifiers in all performance metrics when predicting various diabetic complications. For example, it achieves an accuracy of 98.5% and an AUC of 99.76% when predicting diabetic nephropathy complications.

[0077] This invention achieves significant performance improvements and cost optimizations in the prediction of diabetic complications through feature engineering and multi-model ensemble learning methods. Compared with traditional methods, this invention demonstrates higher prediction accuracy and efficiency on large-scale clinical datasets while reducing detection costs. For example, by removing the low-contribution feature "postprandial blood glucose," the model's accuracy in predicting diabetic nephropathy complications increased from 98.17% to 98.50%, and the AUC value increased from 99.68% to 99.76%, while the detection cost decreased by 2.5%. Furthermore, the accuracy in predicting "no diabetic complications" increased from 87.67% to 87.83%, further demonstrating its optimization capabilities. Through a stacked ensemble learning strategy, this invention exhibits over 90% accuracy and nearly 100% AUC values ​​in predicting various types of diabetic complications, outperforming single-model methods and providing an efficient and reliable solution for the early prediction of diabetic complications and precision medicine.

Claims

1. An optimization method for a predictive model of diabetic complications, characterized in that, include: S1. Obtain diabetes detection indicators, and obtain an initial dataset based on the diabetes detection indicators. The initial dataset includes diabetes detection indicator data and corresponding clinical diagnostic complication labels. The initial dataset is preprocessed to obtain a preprocessed dataset; S2. The average importance of each diabetes detection indicator is calculated using multiple machine learning methods. Based on the ranking of average importance, indicators with lower rankings are iteratively removed, and an indicator feature set is dynamically generated. The preprocessed dataset is then filtered according to the indicator feature set to obtain a comprehensive dataset. The calculation of the average importance of each diabetes detection indicator using multiple machine learning methods includes: evaluating the importance of each diabetes detection indicator on the preprocessed dataset using random forest, XGBoost, support vector machine, and multilayer perceptron models respectively; obtaining the indicator importance ratio of each model through a permutation importance evaluation method; and averaging the indicator importance ratios of each model to obtain the average importance of each indicator. S3. Select an ensemble learning framework, adopt a multi-level model construction method, optimize the parameters of the base classifiers, and finally determine the optimal hyperparameter configuration of each base classifier to obtain the optimized base classifier layer. S4. Based on the aforementioned ensemble learning framework, a stacked ensemble learning model is designed: The stacked ensemble learning model includes several optimized base classifier layers and a meta-classifier based on a logistic regression model. The base classifier layers include random forest, XGBoost, support vector machine, and multilayer perceptron. The base classifiers perform preliminary predictions on the input data, and the meta-classifier performs weighted integration of the results of all base classifiers to output the final prediction result. The preliminary prediction involves K-fold cross-validation training of each base classifier, using the trained base classifiers to generate meta-features as the training set for the meta-classifier, which then performs fitting and prediction. The training of each base classifier includes: random forest achieves feature partitioning by maximizing information gain; XGBoost, based on an additive model, gradually builds a strong classifier by minimizing the loss function; support vector machine constructs the optimal hyperplane by maximizing the classification margin; and multilayer perceptron relies on forward propagation to calculate the output error and updates the weight parameters through backpropagation. S5. Initialize an optimal stacked ensemble learning model and preset an optimal prediction performance threshold. Evaluate the prediction performance value of the current stacked ensemble learning model based on the final prediction results. Compare the prediction performance value of the current stacked ensemble learning model with the optimal prediction performance threshold. If the prediction performance value of the current stacked ensemble learning model is better, update the optimal prediction performance threshold to the prediction performance value of the current stacked ensemble learning model. Update the optimal stacked ensemble learning model to the current stacked ensemble learning model and return to S2 to iterate and filter out the diabetes detection indicators that are ranked lower. The iteration ends when the prediction performance value of the current stacked ensemble learning model is lower than the optimal prediction performance threshold. S6. Encapsulate the optimal stacked ensemble learning model at the end of the iteration as an API service.

2. The optimization method for the diabetic complication prediction model according to claim 1, characterized in that, The preprocessing steps include: imputing missing values ​​in the diabetes detection index data and filling data gaps using interpolation methods; merging clinical diagnosis complication labels and removing invalid labels through data cleaning; and applying adaptive resampling technology to balance the imbalanced dataset to enhance the model's generalization ability.

3. The optimization method for the diabetic complication prediction model according to claim 2, characterized in that, The steps for optimizing the parameters of the base classifiers include: setting a corresponding hyperparameter range for each base classifier, constructing a hyperparameter search space for each base classifier, wherein the hyperparameter search space includes several hyperparameter configurations; for each base classifier, training the model for each hyperparameter configuration using the K-fold cross-validation method, and calculating the prediction performance value of the trained base classifier on the validation set under each hyperparameter configuration, thereby calculating the evaluation score of each hyperparameter configuration; by traversing the hyperparameter search space of each base classifier, using an optimization algorithm to select the optimal hyperparameter configuration for each base classifier, to ensure that each base classifier performs optimally on different datasets.

4. The optimization method for the diabetic complication prediction model according to claim 3, characterized in that, The evaluation includes a comprehensive analysis of the performance of the stacked ensemble learning model under multiple evaluation criteria to fully assess the classification effect and generalization ability of the stacked ensemble learning model; the evaluation criteria include accuracy, recall, F1 score, and area under the ROC curve (AUC).

5. The optimization method for the diabetic complication prediction model according to claim 4, characterized in that, The initialization of an optimal stacked ensemble learning model and the preset of an optimal prediction performance threshold include: the initial optimal stacked ensemble learning model is a stacked ensemble learning model constructed based on all diabetes detection indicators; the initial optimal prediction performance threshold is the accuracy of the various complications predicted by the stacked ensemble learning model when all diabetes detection indicators are not removed.

6. The optimization method for the diabetic complication prediction model according to claim 5, characterized in that, The evaluation obtains the prediction performance value of the current stacked ensemble learning model and compares it with the optimal prediction performance threshold. This includes: comparing the accuracy of the current stacked ensemble learning model in predicting various complications with the optimal stacked ensemble learning model, evaluating the accuracy of the current stacked ensemble learning model and the optimal stacked ensemble learning model in predicting different diabetic complications, and updating the optimal stacked ensemble learning model based on the prediction effect of the current stacked ensemble learning model. This process is continuously iterated. In each round, the diabetes detection indicator with the lowest average importance among the diabetes detection indicators is deleted, and the stacked ensemble learning model is rebuilt on the updated indicator feature set. The model is then trained and evaluated until the prediction performance value of the stacked ensemble learning model no longer improves.

7. An optimization system for a predictive model of diabetic complications, characterized in that, include: The data acquisition module is used to acquire diabetes detection indicators, acquire an initial dataset based on the diabetes detection indicators, the initial dataset including diabetes detection indicator data and corresponding clinically diagnosed complication labels; and preprocess the initial dataset to obtain a preprocessed dataset. The feature selection module is used to jointly calculate the average importance of each diabetes detection indicator using multiple machine learning methods, and iteratively filter out diabetes detection indicators that rank lower based on the average importance, dynamically generating indicator feature sets. The preprocessed dataset is filtered based on the indicator feature set to obtain a comprehensive dataset. The method of jointly calculating the average importance of each diabetes detection indicator using multiple machine learning methods includes: evaluating the importance of each diabetes detection indicator on the preprocessed dataset based on random forest, XGBoost, support vector machine, and multilayer perceptron models respectively; obtaining the indicator importance ratio of each model through the permutation importance evaluation method; and averaging the indicator importance ratios of each model to obtain the average importance of each indicator. The parameter optimization unit is used to select the ensemble learning framework, adopt a multi-level model construction method, optimize the parameters of the base classifier, and finally determine the optimal hyperparameter configuration of each base classifier to obtain the optimized base classifier layer. An ensemble learning module is used to design a stacked ensemble learning model based on the ensemble learning framework. The stacked ensemble learning model includes several optimized base classifier layers and a meta-classifier based on a logistic regression model. The base classifier layers include random forest, XGBoost, support vector machine, and multilayer perceptron. The base classifiers perform preliminary predictions on the input data, and the meta-classifier performs weighted integration of the results from all base classifiers to output the final prediction result. The preliminary prediction involves K-fold cross-validation training of each base classifier. The trained base classifiers generate meta-features as the training set for the meta-classifier, which then performs fitting and prediction. The training of each base classifier includes: random forest achieving feature partitioning by maximizing information gain; XGBoost, based on an additive model, gradually building a strong classifier by minimizing the loss function; support vector machine constructing the optimal hyperplane by maximizing the classification margin; and multilayer perceptron relying on forward propagation to calculate the output error and updating the weight parameters through backpropagation. The performance monitoring and iteration control unit is used to initialize an optimal stacked ensemble learning model and preset an optimal prediction performance threshold. It evaluates the prediction performance value of the current stacked ensemble learning model based on the final prediction results and compares the prediction performance value of the current stacked ensemble learning model with the optimal prediction performance threshold. If the prediction performance value of the current stacked ensemble learning model is better, it updates the optimal prediction performance threshold to the prediction performance value of the current stacked ensemble learning model, updates the optimal stacked ensemble learning model to the current stacked ensemble learning model, and returns to the feature filtering module to iteratively filter out diabetes detection indicators that are ranked lower, until the iteration terminates when the prediction performance value of the current stacked ensemble learning model is lower than the optimal prediction performance threshold. The encapsulation module is used to encapsulate the optimal stacked ensemble learning model at the end of the iteration as an API service.

8. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.