A diabetes prediction and interpretability analysis method and computer program product

By integrating SHAP and improving residual network, a diabetes prediction model with characteristic self-attention module and fully connected layer was constructed, which solved the problem of insufficient prediction accuracy and interpretability of existing models, and achieved high accuracy and transparency of diabetes risk prediction.

CN119418954BActive Publication Date: 2025-08-12QINGDAO UNIV OF SCI & TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510031053.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-09
Publication Date
2025-08-12
Estimated Expiration
2045-01-09

AI Technical Summary

Technical Problem

The existing diabetes prediction model has shortcomings in prediction accuracy and interpretability, which cannot meet the high requirements of clinical applications. The traditional model is black box machine learning, making it difficult to build doctors' trust.

Method used

Using a method of fusing SHAP and improving residual network, a mathematical model of feature self-attention module is constructed, and a fully connected layer is used to replace the convolutional layer in the model, and visual analysis is combined with the SHAP model to improve the transparency and prediction accuracy of the model.

Benefits of technology

The accuracy of diabetes risk prediction and the interpretability of the model are improved, key feature capture is enhanced through the feature self-attention module, the noise impact is reduced, and the intuitive visual analysis of predictive factors is achieved through the SHAP model.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119418954B_ABST
    Figure CN119418954B_ABST
Patent Text Reader

Abstract

The present invention discloses a diabetes prediction and interpretability analysis method and a computer program product, which belong to the field of medical informatics technology, including: constructing a sample data set; constructing a mathematical model of a feature self-attention module; constructing an improved residual network model that integrates the feature self-attention module; using the improved residual network model to predict diabetes risk for sample data; using the SHAP model to calculate the SHAP value of each input feature vector and evaluate the marginal contribution of the input feature vector to the model output; generating a visual summary graph of the SHAP value to show the specific impact of each feature on the prediction result. The present invention integrates the self-attention mechanism and the deep residual idea, significantly improving the prediction performance of the RAC model. By introducing SHAP feature analysis, the contribution of each feature to the prediction is quantified, the interpretability of the model is enhanced, and a systematic evaluation can be provided for diabetes prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of medical informatics, and in particular, relates to a diabetes prediction and interpretability analysis method and a computer program product. Background Art

[0002] Diabetes is a global metabolic disease, and its prediction and monitoring are crucial for early intervention and treatment. Improving the accuracy of diabetes prediction and the interpretability of models through artificial intelligence algorithms can provide an effective tool for predicting the probability of diabetes onset, which has important practical significance for assisting doctors in diabetes diagnosis.

[0003] At present, the methods for using artificial intelligence algorithms to predict diabetes mainly include decision trees, naive Bayesian models, multivariate Bayesian logistic regression models, and prediction models based on support vector machines. However, the key performance indicators of most models have not yet met the standards and are still far from the high requirements of clinical applications.

[0004] In recent years, research on diabetes prediction methods has gradually shifted towards developing high-performance and interpretable prediction models. For example, deep neural networks have been applied to medical examination records to predict diabetes. Furthermore, a prediction model combining LightGBM and the SHAP method not only improved prediction results but also enhanced model interpretability. These studies demonstrate that combining high predictive performance with enhanced interpretability is a core direction in the current development of diabetes prediction models.

[0005] Despite continued progress in diabetes prediction, existing prediction methods, whether traditional machine learning algorithms or deep learning networks, still face multiple limitations. For example, the simple structure of the prediction model results in low prediction accuracy, which cannot meet the high requirements of clinical application. Data imbalance means that the model only performs well for the majority class, that is, it has high specificity but low sensitivity. Most prediction methods are black-box machine learning models, making it difficult for clinicians to understand the entire prediction process, which is not conducive to building trust in the prediction results.

[0006] The above information disclosed in this background technology is only used to increase the understanding of the background technology of this application. Therefore, it may contain information that does not constitute the prior art known to ordinary technicians in this field. Summary of the Invention

[0007] In response to at least one of the above-mentioned technical problems existing in the background technology, the present invention proposes a diabetes prediction and interpretability analysis method that integrates SHAP and an improved residual network, which can accurately predict diabetes risk and visualize the key factors affecting the prediction. By deconstructing the black box operation of the mathematical model during prediction, the transparency of the prediction logic and the credibility of the prediction results are improved.

[0008] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0009] In one aspect, the present invention provides a diabetes prediction and interpretability analysis method, comprising:

[0010] Construct a sample data set, in which multiple sets of input feature vectors formed by sample data of diabetic patients and healthy patients are recorded X ;

[0011] Constructing the mathematical model of the feature self-attention module:

[0012] ;

[0013] in, Represents the fused input feature vector; is the learnable parameter matrix; 、 、 The input feature vectors are X A weight matrix mapping to the query space, key space, and value space; is the dimension of the key space; softmax ( ) is the normalized exponential function; T is the matrix transpose symbol;

[0014] Construct an improved residual network model that integrates feature self-attention modules:

[0015] ;

[0016] ;

[0017] in, Y To improve the output vector of each residual block in the residual network; is a learnable scalar used to adjust the strength of the residual connection; is the activation function; and is the bias of the fully connected layer; BN represents the batch normalization operation; It is with i The weights associated with the residual blocks; It is a feature self-attention mechanism layer, which is used to weight the feature vector;

[0018] According to the output value of the improved residual network model, the disease risk of the sample data is predicted;

[0019] Use the SHAP model to calculate the SHAP value of each input feature vector and evaluate the marginal contribution of the input feature vector to the model output;

[0020] Generate a visual summary of the SHAP value to show the specific impact of each feature on the prediction results.

[0021] In some embodiments of the present application, in order to solve the problem of negative optimization of the performance of the prediction model caused by the convolution operation, the improved residual network model can be configured to use a fully connected layer to replace the convolution layer in the original structure of the residual network, and the internal structure of each residual block can be configured to include a first fully connected layer and a normalization layer, a second fully connected layer and a normalization layer, and a feature self-attention module, so as to better adapt to the characteristics of the sample data set.

[0022] In some embodiments of the present application, three series-connected residual blocks may be configured in the improved residual network model, wherein:

[0023] In the first residual block, the input feature vector can be configured to pass through a fully connected layer and map the 32-dimensional features to 64 dimensions to expand the feature space so that the model can capture more complex feature relationships;

[0024] In the second residual block, the input feature vector can be configured to pass through a fully connected layer and then map the 64-dimensional features back to 32 dimensions to compress the feature space, reduce the complexity of the model, and prevent overfitting.

[0025] In the third residual block, the input feature vector can be configured to be further compressed to 16 dimensions after passing through a fully connected layer to further compress the feature space and simplify the model.

[0026] In some embodiments of the present application, the output layer of the improved residual network model can be configured to map the 16-dimensional features output by the third residual block to 1 dimension to generate a scalar value representing the diabetes risk prediction q , which facilitates the judgment of disease risk.

[0027] In some embodiments of the present application, the scalar value output by the improved residual network model can be q ,use Sigmoid The function generates the probability value of the risk of having diabetes for the sample data.

[0028] In some embodiments of the present application, the Sigmoid The function can be expressed as:

[0029] ;

[0030] in, p is a probability value between 0 and 1. p It can accurately represent the probability of the individual corresponding to the sample data suffering from diabetes risk. pThe risk level of diabetes in the sample data is set from low to high, from small to large. The increase in risk level reflects the corresponding increase in the individual's risk of disease.

[0031] In some embodiments of the present application, in order to improve the computational efficiency and generalization ability of the model, the sample data in the sample data set can be preprocessed first; then, the preprocessed sample data is standardized to form a unified data format, and then input into the feature self-attention module to calculate the fused input feature vector X’ After that, the original input feature vector after data format unification X Substitute them into the improved residual network model to predict diabetes risk.

[0032] In some embodiments of the present application, in order to train, verify and test the improved residual network model, the sample data set can be divided into a training set, a validation set and a test set; wherein, the improved residual network model can be trained using the sample data in the training set; the trained improved residual network model can be adjusted using the sample data in the validation set to obtain a high-performance diabetes risk prediction model; the performance of the high-performance diabetes risk prediction model can be evaluated using the sample data in the test set to demonstrate the advantages of the prediction model of the present application compared with other classic algorithms.

[0033] In some embodiments of the present application, when constructing a training set, a validation set, and a test set, the sample data set can be divided into m mutually exclusive subsets of similar size. In each iteration, the union of m-1 subsets is used to form a training set, and the remaining subset is used as a test set. At the same time, 50% of the sample data in the test set is divided to form a validation set to meet the training, testing, and verification requirements of the improved residual network model.

[0034] In another aspect, the present invention also proposes a computer program product, comprising a computer program / instruction, which implements the steps of the above-mentioned diabetes prediction and interpretability analysis method when executed by a processor.

[0035] Compared with the prior art, the advantages and positive effects of the present invention are mainly reflected in:

[0036] (1) The present invention independently designs and embeds a feature self-attention module that conforms to the characteristics of the dataset into the improved residual network. This module can enhance the residual network model's ability to capture and adjust the key features of diabetes, and achieve more refined and dynamic feature processing within the model, thereby helping to improve the accuracy of the prediction results.

[0037] (2) The feature self-attention module designed in the present invention automatically assigns different weights to different features by learning the correlation between input features, thereby focusing on those features that are more critical to diabetes prediction during the model training process, while reducing the impact of noise features, thereby improving the accuracy and robustness of model prediction.

[0038] (3) In view of the characteristics of the diabetes dataset, the present invention specifically improves the deep residual network model architecture, and improves the convolutional layer in the original structure of the residual network into a fully connected layer that is more adapted to the characteristics of the dataset, thereby improving the model's ability to capture diabetes characteristics.

[0039] (4) The present invention adds a normalization layer to the improved residual block, which can ensure a smoother learning process and enhance the generalization performance of the model.

[0040] (5) This paper enhances the interpretability of diabetes risk prediction by integrating the SHAP model, which not only significantly improves the transparency of the prediction model but also successfully realizes the intuitive visualization analysis of diabetes influencing factors.

[0041] Other features and advantages of the present invention will become more apparent after reading the detailed description of the embodiments of the present invention in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0043] Figure 1 This is an overall flow chart of an embodiment of the diabetes prediction and explainability analysis method proposed in the present invention;

[0044] Figure 2 An overall architecture diagram of an embodiment of a diabetes prediction and explainable analysis model;

[0045] Figure 3 An architectural diagram of an embodiment of a feature self-attention module;

[0046] Figure 4 An architectural diagram of an embodiment of an improved residual network model;

[0047] Figure 5 This is a comparison chart of the evaluation performance between different mathematical models based on public datasets;

[0048] Figure 6SHAP feature dependency analysis diagram, where (a) is the relationship between SHAP value and insulin value, (b) is the relationship between SHAP value and blood glucose value, (c) is the relationship between SHAP value and age, and (d) is the relationship between SHAP value and family history of diabetes.

[0049] Figure 7 A visual summary of the SHAP values. DETAILED DESCRIPTION

[0050] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0051] In the description of the present invention, the consecutive numbering of the method steps is for the convenience of review and understanding. Combined with the overall technical solution of the present invention and the logical relationship between the various steps, adjusting the implementation order between the steps will not affect the technical effect achieved by the technical solution of the present invention.

[0052] To address the issues of simple mathematical models used in traditional diabetes prediction and their black-box nature that hinder understanding and trust, this embodiment introduces the concept of residual networks and a feature self-attention module designed for diabetes datasets to address degradation and performance issues in diabetes prediction. The SHAP value is integrated to enhance the interpretability of the model, providing an intuitive decision-making reference for diabetes diagnosis.

[0053] The following combination Figure 1 、 Figure 2 The diabetes prediction and interpretability analysis method of this embodiment is specifically described, which mainly includes the following steps:

[0054] S101. Build a sample data set.

[0055] Obtain desensitized data including diabetic patients and healthy people, and after preprocessing the desensitized data, label the data of diabetic patients to obtain a labeled sample data set, so that the model can better learn the relationship between diabetes-related features and disease risk.

[0056] In this embodiment, the desensitized data can be the body's physical sign indicator data, with the input feature vector X The sample data set is stored in the form of ;in, , d is the feature dimension, and N is the number of samples.

[0057] These input feature vectorsX This data covers vital signs and indicators closely related to diabetes, such as blood sugar levels, insulin levels, blood pressure, BMI, age, number of pregnancies in women, and family history of diabetes. These characteristics have been identified through in-depth research as important influencing factors for the development of diabetes, and the data is derived from a large number of clinical tests and medical records. For example: blood sugar and insulin levels directly reflect the body's glucose metabolism, and abnormalities often indicate diabetes; aging leads to decreased function and increased insulin resistance, increasing the risk of developing the disease; multiple pregnancies in women affect glucose metabolism and increase the likelihood of diabetes; hypertension and diabetes affect each other, and those with hypertension have a higher risk of developing the disease; abnormal BMI is associated with body fat distribution and metabolic status, and is closely related to diabetes risk; and a family history of diabetes reflects the potential role of genetic factors. By integrating multi-dimensional characteristic data, diabetes risk can be more accurately predicted.

[0058] The data preprocessing process in this embodiment mainly includes operations such as data filling and feature selection. The feature selection process can use recursive feature elimination (RFE) or model-based feature importance evaluation to screen out the most predictive feature subset from the original feature set, thereby reducing the risk of overfitting and improving the model's explanatory power and computational efficiency.

[0059] The pre-processing stage fills and corrects missing values or outliers in the sample data set to ensure the integrity and consistency of the data. In some embodiments, the filling method can use median filling.

[0060] At the same time, selecting features with high correlation with the target variable (diabetes diagnosis) from the original data and removing redundant or irrelevant features can reduce the complexity of the model and improve its generalization ability.

[0061] The preprocessed sample data is standardized, such as data normalization, to form a unified data format, laying the foundation for subsequent network model training.

[0062] S102. Divide the sample data set into a training set, a validation set, and a test set.

[0063] The labeled sample data set is randomly divided into training set, validation set and test set.

[0064] In some embodiments, the sample data set can be divided into m mutually exclusive subsets of similar size. In each iteration of model training, the union of m-1 subsets is used as the training set, and the remaining subset is used as the test set. At the same time, 50% of the data samples in the test set can be divided as the validation set.

[0065] S103. Construct an improved residual network model that integrates a feature self-attention module, and train the parameters in the model on the diabetes dataset.

[0066] The residual network formally represents the required underlying mapping as H(x) , assuming that multiple nonlinear layers can asymptotically approximate a complex function, this is equivalent to multiple nonlinear layers asymptotically approximating a residual function F(x)=H(x)-x Therefore, the i The residual block performs the following computation:

[0067] ;

[0068] ;

[0069] Where, , Respectively i The input data and output data of the residual block; It is with i The weights associated with the residual blocks, N is the number of layers in the residual block; is the residual function to be learned; is the identity mapping function: ; is the activation function, which indicates the operation to be performed after the data is added.

[0070] when When the same identity mapping is used, By recursively merging the calculations of each layer, we can get i +1 residual block L The input to the layer is:

[0071] ;

[0072] in, Represents the residual network L The input data of the layer is obtained by summing the residual functions of the previous layers and The input of each layer in the residual network is not only the output of the previous layer, but also the cumulative sum of the results of all residual function calculations from the first layer to the current layer.

[0073] Setting the loss function J , according to the chain derivation rule of the back-propagation algorithm, we get:

[0074] .

[0075] The above expression avoids the vanishing and exploding gradients common in traditional deep networks, thereby enabling efficient updating and optimization of network parameters. This mechanism underlies the efficient learning and prediction capabilities of residual networks, and demonstrates significant advantages in predictive analysis of complex diseases such as diabetes.

[0076] In deep learning, the feature self-attention mechanism aims to enable the model to learn how to allocate attention among a given set of input features, thereby emphasizing features that are important to the prediction task and suppressing redundant information. This embodiment designs the feature self-attention mechanism as follows:

[0077] like Figure 3 As shown, the feature self-attention mechanism first passes through three learnable weight matrices 、 、 The input feature vector X Mapping to query space Q , key space K Sum value space V , the dimensions of these three spaces are 、 、 , which can be specifically expressed as:

[0078]

[0079]

[0080] .

[0081] Then, the dot-product attention function is used to calculate the correlation score between the features, which will be used as the attention weight.

[0082] In this embodiment, the attention weight matrix A can be calculated using the following formula:

[0083] ;

[0084] Here softmax The ( ) function is used to normalize the attention score to make it a probability distribution. T is the matrix transpose symbol.

[0085] Next, the attention weight matrix A and value matrix V Multiply to get the weighted feature representation Z :

[0086] .

[0087] Afterwards, the weighted features are represented as ZWith the original input feature vector X Fusion is performed to preserve the original information while enhancing the representation of important features. This process can be done by simple element-wise addition or through an additional learnable parameter matrix For example, the fused input feature vector X’ Expressed as:

[0088] .

[0089] Combining the above steps, the complete computational process of the feature self-attention mechanism (i.e., the mathematical model of the feature self-attention module) is finally defined as:

[0090] .

[0091] In this process, 、 、 、 These are all weight parameters that need to be learned and can be optimized using the backpropagation algorithm to minimize the network's prediction error. The weight parameters of these matrices are adjusted and optimized during training based on the characteristic distribution of the diabetes sample data. For example, weight parameters related to key diabetes features such as blood sugar levels and insulin levels are given greater importance during training to increase the model's focus on these features.

[0092] The feature attention mechanism automatically assigns different weights to different features by learning the correlation between input features. Especially in diabetes datasets, it can more effectively focus on key features such as blood sugar fluctuations and insulin resistance trends, while reducing the impact of noise features such as some accidental measurement errors, thereby improving the accuracy and robustness of the model in predicting diabetes risk.

[0093] The above-mentioned feature self-attention mechanism is used to improve the residual network to generate an improved residual network RAC (ResFCNet Attention Classifier) model that integrates the feature self-attention module.

[0094] Among them, the mathematical formula of the RAC model can be expressed as:

[0095] ;

[0096] ;

[0097] in, Y Represents the output vector of each residual block in the RAC model. The output of each residual block is superimposed on its input, which ensures that information can be directly passed from the previous layer to the next layer without losing important features; It is a learnable scalar used to adjust the strength of the residual connection. When processing diabetes data, this parameter is optimized based on the model training results to ensure that important diabetes feature information is effectively transmitted between network layers. It is an activation function that can be selected according to the characteristics of diabetes data to enhance the model's ability to fit nonlinear relationships; and is the bias of the fully connected layer, where is the bias of the fully connected layer of the first residual block, is the bias of the fully connected layer of the second residual block; BN represents the batch normalization operation; It is with i The weights associated with the residual blocks, where is the weight associated with the first residual block, is the weight associated with the second residual block; It is a feature self-attention mechanism layer, which is used to weight the feature vector and highlight key pathogenic factors in diabetes data processing, such as blood sugar control trends, age-related risk changes, etc. In this embodiment, .

[0098] Since most diabetes datasets are in CSV format, which is different from the meaning of each feature in the image dataset, applying convolution operations will have a negative optimization effect on performance. The main function of the fully connected layer is to map the input data to the output space and realize pattern recognition and feature extraction by learning weight parameters. Its input is a one-dimensional vector or a flattened multi-dimensional tensor, and its output is also a one-dimensional vector or tensor. There are documents that prove that it is feasible to perform the operation of the fully connected layer in the residual block. Therefore, this embodiment uses a fully connected layer to improve the convolution layer in the original structure of the residual network, so as to optimize the prediction performance for the diabetes dataset and improve the model's ability to capture diabetes features.

[0099] In the actual diagnosis of diabetes, various physical examination indicators are interrelated. The integration of feature self-attention mechanism can make the model diagnosis more consistent with the actual medical diagnosis experience, while paying more attention to the features related to the prediction of diabetes condition, so that each physical examination indicator can obtain global information, effectively enhancing the model's ability to capture the intrinsic connections of the data.

[0100] like Figure 4As shown, this embodiment adds feature self-attention modules to the input layer of the RAC model and after each residual block. Input data first undergoes feature weight preprocessing by the independently designed feature self-attention module, preserving the original information while enhancing the weight representation of important features. The data then enters the main branch of the prediction network. The main branch primarily consists of three residual blocks connected in series. Each residual block has an internal structure consisting of two fully connected layers and a normalization layer (i.e., the first fully connected layer and a normalization layer, and the second fully connected layer and a normalization layer). It also includes a feature self-attention module, and residual links are internally implemented within each residual block. In the first residual block, input features pass through a fully connected layer, mapping 32-dimensional features to 64-dimensional features. This layer further expands the feature space, enabling the model to capture more complex feature relationships. The normalization layer accelerates training and improves the model's generalization. In the second residual block, input features pass through a fully connected layer, mapping 64-dimensional features back to 32-dimensional features. This layer compresses the feature space, reduces model complexity, and prevents overfitting. It also performs normalization. The third residual block passes the input features through a fully connected layer, further compressing the 32-dimensional features to 16 dimensions, and then performing normalization. The final output layer maps the 16-dimensional features to 1 dimension. The output of this layer is a scalar value representing the risk prediction for diabetes.

[0101] In some embodiments, you can use Sigmoid The function connects the fully connected layer at the end of the residual network to perform sample classification. Sigmoid The function can transform the abstract feature vector into a concrete probability value between 0 and 1, indicating the probability of diabetes risk.

[0102] Specifically, you can Sigmoid The function is expressed as:

[0103] ;

[0104] in, q is the input feature vector X After a series of complex operations are performed by multiple network layers in the residual network, the output scalar value is calculated through the output layer; p is a probability value between 0 and 1, that is, the probability of the sample data suffering from diabetes risk. p It can accurately indicate the likelihood of an individual developing diabetes.

[0105] In some embodiments, the probability value output by the model can be p (between 0 and 1) to classify the risk level of diabetes. For example, first set the risk level threshold based on clinical data and expert experience, and set the risk level from low to high to 1 to 5. For example, p<0.2 is low risk, risk level is level 1; 0.2≤ p <0.4 is a lower risk, and the risk level is level 2; 0.4≤ p <0.6 is medium risk, risk level is level 3; 0.6≤ p <0.8 is a high risk, with a risk level of 4; 0.8≤ p ≤1 is high risk, and the risk level is 5. The increasing risk level reflects the corresponding increase in the individual's risk of developing diabetes.

[0106] S104. Use the sample data in the validation set to adjust the model parameters to obtain a high-performance diabetes risk prediction model.

[0107] In this embodiment, cross-validation methods, such as K-fold cross-validation, can be used to adjust the parameters of the improved residual network model to ensure the generalization ability of the model. By training and testing on different data subsets, a higher-performance diabetes risk prediction model can be obtained, and stable and reliable performance evaluation results can be obtained.

[0108] S105. Evaluate the performance of the RAC model and present the evaluation results.

[0109] In this embodiment, a performance evaluation model can be designed to demonstrate the advantages of the RAC model over other models in diabetes prediction.

[0110] Figure 5 An example of comparative evaluation using samples extracted from the test set was presented, highlighting the significant progress of the improved residual network RAC model in diabetes risk prediction. In an in-depth exploration of diabetes prediction tasks, the RAC model demonstrated clear advantages over other classic algorithms (Random Forest, SVM, logistic regression, Naive Bayes, and decision trees), as evidenced by comprehensive improvements in key performance indicators.

[0111] The experimental data of this example are derived from two different datasets: one is the widely used Pima Indian diabetes public dataset, and the second is a private dataset collected from clinical practice.

[0112] On the Pima public dataset, the RAC model of this embodiment showed excellent performance, such as Figure 5 As shown in Figure 2, the classification accuracy reached 92.87%, sensitivity reached 93.45%, specificity reached 99.23%, and the F1 score reached 93.37%, significantly outperforming the comparison model. These data not only reflect a significant reduction in prediction error but also demonstrate the high accuracy and reliability of the RAC model in distinguishing healthy individuals from diabetic patients.

[0113] On the private dataset, despite the smaller data size and more complex sample distribution, the RAC model of this embodiment still demonstrated good generalization capabilities, with performance indicators reaching 91%, 89%, 98%, and 91%, respectively. These results fully demonstrate the efficiency and practicality of the RAC model of this embodiment in the field of diabetes prediction.

[0114] The performance evaluation results of various mathematical models can be displayed through interpretable models.

[0115] S106. Use the SHAP model to calculate the SHAP value of each feature and evaluate the marginal contribution of the feature to the model output.

[0116] This example integrates a feature self-attention module designed for a diabetes dataset with an improved residual network. The RAC model demonstrates excellent predictive performance during training. However, if a transparent explanation of the prediction results is not provided in clinical applications, this may trigger a trust barrier among medical professionals. To this end, this example integrates the SHAP (SHapley Additive exPlanations) model, known for its high interpretability, based on the RAC model. For each individual prediction sample, the model generates a prediction value, then calculates the different marginal contributions of that feature in all feature sequences, and finally calculates the SHAP value of the feature, which is the average of all marginal contributions of that feature.

[0117] Specifically, assuming that i The samples are , No. i The first sample j The feature is , the marginal contribution of the feature is , the edge weight is , for SHAP value, then i The first sample j The SHAP value of a feature is calculated as follows:

[0118] .

[0119] Assume that the SHAP model has The predicted value is , the baseline of the entire model (usually the mean of the target variable for all samples) is , then the SHAP value obeys the following equation:

[0120] .

[0121] Where, That is thei samples The s The final predicted value of the feature The SHAP value of each feature represents the change in model prediction when the feature is used as a condition.

[0122] The experimental results show that the SHAP model effectively deconstructs the black box operation of the model during prediction and provides transparency to the prediction logic. This not only enhances the credibility of the model but also provides strong support for medical professionals to accelerate the decision-making process in clinical diagnosis.

[0123] S107. Generate a visual summary graph of the SHAP value to show the specific impact of each feature on the prediction result.

[0124] This embodiment introduces the SHAP feature analysis model to quantitatively analyze the contribution of each feature to the prediction, thereby enhancing the interpretability of the model. The visual summary graph of the SHAP value displayed by the interpretable model can help medical personnel understand which features are most influential for diabetes prediction and enhance the trust of medical personnel and patients in the model's prediction results.

[0125] Figure 6 This is a SHAP feature dependency analysis diagram, which shows the results of SHAP feature dependency analysis on preprocessed data. The straight line in the figure is the "best fit line", which usually represents the line that can best describe or predict the linear relationship between a set of data points. Figure 6 (a) is a graph showing the relationship between SHAP values and insulin levels. The SHAP values corresponding to different insulin levels are densely distributed. In actual medical scenarios, abnormal changes in insulin levels are often associated with diabetes risk. This relationship graph can provide a reference for assessing diabetes risk. Figure 6 Middle (b) is a graph showing the relationship between SHAP value and blood glucose level. As blood glucose level increases, SHAP value gradually increases and the data points are distributed along the diagonal line. This is consistent with the clinical fact that blood glucose level is an important diagnostic indicator for diabetes and can help determine the risk of diabetes. Figure 6 Middle (c) is a graph showing the relationship between SHAP values and age. Different ages correspond to different SHAP values, and the data points are scattered. Increasing age corresponds to an increased risk of diabetes. This graph helps assess the risk of diabetes based on age. Figure 6 Figure (d) shows the relationship between SHAP values and family history of diabetes. Given that family history of diabetes is a significant risk factor, this graph is crucial for comprehensively assessing diabetes risk. These characteristics all exhibit a significant negative correlation with diabetes risk, meaning that as the characteristic value increases, the risk gradually increases. This serves as a crucial basis for diagnosing diabetes.

[0126] Figure 7A visual summary of the SHAP values is presented. It specifically displays the SHAP value for a confirmed diabetes case in the dataset, as well as the local contribution of each feature to disease risk prediction. The graph ranks each feature by its importance in affecting diabetes risk, clearly revealing that blood glucose, age, number of pregnancies, and body mass index (BMI) significantly influence the model's decision-making. Notably, the algorithm ranks blood glucose, age, and number of pregnancies in the top three, clearly indicating that these factors are the primary determinants of gestational diabetes mellitus (GDM) in this patient, while other variables require a comprehensive consideration based on the specific circumstances.

[0127] For each individual prediction sample, the SHAP model generates a prediction value, then calculates the different marginal contributions of the feature in all feature sequences, and finally calculates the SHAP value of the feature, which is the mean of all marginal contributions of the feature.

[0128] This embodiment addresses the common problems of insufficient reliability and interpretability in diabetes prediction models and proposes a prediction algorithm based on an improved deep residual network. This algorithm not only improves the prediction accuracy of the model by introducing a feature self-attention mechanism, but also significantly enhances the interpretability of the model with the help of the SHAP model. By adding a feature self-attention module on the basis of the deep residual network, it can automatically identify features in the dataset that are highly correlated with the onset of diabetes, thereby improving the prediction ability of the model. In addition, by integrating the SHAP model, the algorithm can intuitively display the importance of each feature for diabetes prediction, thereby achieving transparent processing of the model prediction logic, effectively solving the problem of traditional deep learning models as "black boxes".

[0129] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for a person skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to replace some of the technical features therein with equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions claimed to be protected by the present invention.

Claims

1. A diabetes prediction and interpretability analysis method, characterized in that: include: Construct a sample data set that records multiple sets of input feature vectors formed by sample data of diabetic patients and healthy patients X , the input feature vector X Covers diabetes-related physical indicators, including blood sugar levels, insulin levels, blood pressure, BMI, age, number of pregnancies, and family history of diabetes, in CSV format. Constructing the mathematical model of the feature self-attention module: ; in, Represents the fused input feature vector; is the learnable parameter matrix; 、 、 The input feature vectors are X A weight matrix mapping to the query space, key space, and value space; is the dimension of the key space; softmax ( ) is the normalized exponential function; T is the matrix transpose symbol; Construct an improved residual network model that integrates feature self-attention modules: ; ; in, Y To improve the output vector of each residual block in the residual network; is a learnable scalar used to adjust the strength of the residual connection; is the activation function; and is the bias of the fully connected layer; BN Represents batch normalization operation; It is with i The weights associated with the residual blocks; It is a feature self-attention mechanism layer, which is used to weight the feature vector; Configuring the improved residual network model to use a fully connected layer to replace the convolutional layer in the original residual network structure, and configuring the internal structure of each residual block to include a first fully connected layer and a normalization layer, a second fully connected layer and a normalization layer, and a feature self-attention module; According to the output value of the improved residual network model, the disease risk of the sample data is predicted; Use the SHAP model to calculate the SHAP value of each input feature vector and evaluate the marginal contribution of the input feature vector to the model output; Generate a visual summary of the SHAP value to show the specific impact of each feature on the prediction results.

2. The diabetes prediction and interpretability analysis method according to claim 1, characterized in that: The improved residual network model includes three residual blocks connected in series, where: In the first residual block, the input feature vector passes through a fully connected layer to map the 32-dimensional features to 64 dimensions; In the second residual block, the input feature vector passes through a fully connected layer to map the 64-dimensional features back to 32 dimensions; In the third residual block, the input feature vector passes through a fully connected layer to further compress the 32-dimensional features to 16 dimensions.

3. The diabetes prediction and interpretability analysis method according to claim 2, characterized in that: The output layer of the improved residual network model is configured to map the 16-dimensional features output by the third residual block to 1 dimension, generating a scalar value representing the diabetes risk prediction q .

4. The diabetes prediction and interpretability analysis method according to claim 3, characterized in that: The scalar value output by the improved residual network model q ,use Sigmoid The function generates the probability value of the risk of having diabetes for the sample data.

5. The diabetes prediction and interpretability analysis method according to claim 4, characterized in that: described Sigmoid The function is expressed as: ; in, p The probability value is between 0 and 1; according to the probability value p From small to large, set the level of diabetes risk of the sample data from low to high.

6. The diabetes prediction and explainability analysis method according to any one of claims 1 to 5, characterized in that: Also includes: Preprocessing the sample data in the sample data set; After the preprocessed sample data is standardized to form a unified data format, it is input into the feature self-attention module to calculate the fused input feature vector X’ After that, the original input feature vector after data format unification X Substitute them into the improved residual network model to predict diabetes risk.

7. The diabetes prediction and interpretability analysis method according to any one of claims 1 to 5, characterized in that: Also includes: Dividing the sample data set into a training set, a validation set, and a test set; Using sample data in the training set to train the improved residual network model; The sample data in the validation set was used to adjust the parameters of the trained improved residual network model to obtain a high-performance diabetes risk prediction model; The performance of the high-performance diabetes risk prediction model was evaluated using sample data in the test set.

8. The diabetes prediction and interpretability analysis method according to claim 7, characterized in that: The sample data set is divided into m mutually exclusive subsets of similar size. In each iteration, the union of m-1 subsets is used to form a training set, and the remaining subset is used as a test set. At the same time, 50% of the sample data in the test set is divided to form a validation set.

9. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the steps of the diabetes prediction and interpretability analysis method according to any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Non-invasive risk prediction method for diabetes

    CN114038564A

  • Multi-scale convolutional neural network diabetes risk assessment method based on feature fusion

    CN117476226A