Diabetes prediction and interpretability analysis method and computer program product

By integrating SHAP and improving residual network methods, the characteristic self-attention module and improved residual network model are constructed, and the existing diabetes prediction methods are solved, and high accuracy and interpretability are achieved. Diabetes risk forecast.

CN119418954AActive Publication Date: 2025-02-11QINGDAO UNIV OF SCI & TECH

Patent Information

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

AI Technical Summary

Technical Problem

The existing diabetes prediction methods have low prediction accuracy and cannot meet the high requirements of clinical applications. They are black-box models, making it difficult to explain the prediction process, affecting clinicians' trust in the predicted results.

Method used

Using a method of fusing SHAP and improving residual network, the accurate prediction of diabetes risk is achieved by constructing a feature self-attention module and an improved residual network model, and interpretability analysis is provided through the SHAP model.

Benefits of technology

Improves the accuracy of diabetes risk prediction and interpretability of models, and enhances the transparency of predicted results and the trust of clinicians.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119418954A_ABST
    Figure CN119418954A_ABST
Patent Text Reader

Abstract

The invention discloses a diabetes prediction and interpretability analysis method and a computer program product, and belongs to the technical field of medical information.The diabetes prediction and interpretability analysis method comprises the steps that a sample data set is constructed; constructing a mathematical model of a feature self-attention module; constructing an improved residual network model of a fusion feature self-attention module; performing diabetes risk prediction on the sample data by using the improved residual network model; calculating an SHAP value of each input feature vector by using an SHAP model, and evaluating marginal contribution of the input feature vectors to model output; and generating a visual abstract graph of the SHAP value, and displaying the specific influence of each feature on a prediction result. According to the method, the self-attention mechanism and the deep residual idea are fused, and the prediction performance of the RAC model is remarkably improved. By introducing SHAP feature analysis, the contribution of each feature to prediction is quantified, the interpretability of the model is enhanced, and 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 explainability 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 the model through artificial intelligence algorithms can provide an effective tool for predicting the probability of diabetes, which is of great practical significance for assisting doctors in diagnosing diabetes.

[0003] At present, the methods for predicting diabetes using artificial intelligence algorithms 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, the research trend of diabetes prediction methods has gradually shifted to the development of high-performance and interpretable prediction models. For example, deep neural networks are applied to physical examination records to predict diabetes. In addition, the prediction model that combines the LightGBM and SHAP methods not only improves the prediction effect, but also enhances the interpretability of the model. These studies show that combining high prediction performance with enhanced interpretability is the core direction of current diabetes prediction model research and development.

[0005] Although new progress continues to emerge in the field of diabetes prediction, existing prediction methods, whether traditional machine learning algorithms or deep learning networks, still face multiple limitations. For example, due to the simple structure of the prediction model, the prediction accuracy is not high and cannot meet the high requirements of clinical applications; due to data imbalance, the model only performs well for most classes, that is, high specificity but low sensitivity; most prediction methods are black box machine learning models, and it is 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 the background technology is only used to increase the understanding of the background technology of the present application, and therefore, it may include information that does not constitute the prior art known to ordinary technicians in the 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 interpretable analysis method that integrates SHAP and 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 to achieve the above problems: In one aspect, the present invention provides a diabetes prediction and interpretability analysis method, comprising: Construct a sample data set, in which multiple groups of input feature vectors formed by sample data of diabetics and healthy people are recorded X ; Mathematical model for constructing 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 that maps 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 the batch normalization operation; It is with i The weights associated with each residual block; It is a feature self-attention mechanism layer, which is used to weight the feature vector; 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 result.

[0009] 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.

[0010] In some embodiments of the present application, three series-connected residual blocks may be configured in the improved residual network model, wherein: In the first residual block, the input feature vector can be configured to map the 32-dimensional features to 64 dimensions after passing through a fully connected layer to expand the feature space so that the model can capture more complex feature relationships; In the second residual block, the input feature vector can be configured to be mapped back to 32 dimensions after passing through a fully connected layer to compress the feature space, reduce the complexity of the model, and prevent overfitting. In the third residual block, the input feature vector can be configured to be further compressed from 32 dimensions to 16 dimensions after passing through a fully connected layer, so as to further compress the feature space and simplify the model.

[0011] 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 is convenient for judging the risk of disease.

[0012] 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.

[0013] In some embodiments of the present application, the Sigmoid The function can be expressed as: ; 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. p From small to large, the risk level of diabetes in the sample data is set from low to high. The increase in risk level reflects the corresponding increase in the individual's risk of disease.

[0014] 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 may be preprocessed first; then, the preprocessed sample data may be 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 the data format is unified X Substitute them into the improved residual network model together to predict diabetes risk.

[0015] 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 verification 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 verification set to obtain a high-performance diabetes risk prediction model; the high-performance diabetes risk prediction model can be performance evaluated using the sample data in the test set to demonstrate the advantages of the prediction model of the present application compared to other classic algorithms.

[0016] 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.

[0017] 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 explainability analysis method when executed by a processor.

[0018] Compared with the prior art, the advantages and positive effects of the present invention are mainly reflected in: (1) The present invention independently designs and embeds a feature self-attention module that conforms to the characteristics of the data set 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 sophisticated and dynamic feature processing within the model, thereby helping to improve the accuracy of the prediction results.

[0019] (2) The feature self-attention module designed in the present invention learns the correlation between input features and automatically assigns different weights to different 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.

[0020] (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.

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

[0022] (5) The present invention 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.

[0023] 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

[0024] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. 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 creative work.

[0025] Figure 1 This is an overall flow chart of an embodiment of the diabetes prediction and explainability analysis method proposed by the present invention; Figure 2 An overall architecture diagram of an embodiment of a diabetes prediction and explainable analysis model; Figure 3 An architecture diagram of an embodiment of a feature self-attention module; Figure 4 An architecture diagram of an embodiment of an improved residual network model; Figure 5 This is a comparison chart of the evaluation performance between different mathematical models based on public datasets; Figure 6 SHAP 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; Figure 7 A visual summary of the SHAP values. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. 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 creative work are within the scope of protection of the present invention.

[0027] 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 scheme 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 scheme of the present invention.

[0028] In order to solve the problems of simple structure and black box characteristics of mathematical models used in the traditional diabetes prediction field that affect understanding and trust, this embodiment introduces the idea of ​​residual network and a feature self-attention module designed for the diabetes dataset to solve the degradation and performance problems in diabetes prediction, and integrates the SHAP value to enhance the interpretability of the model, providing an intuitive decision-making reference for diabetes diagnosis.

[0029] Combine the following Figure 1 , Figure 2 The diabetes prediction and explainability analysis method of this embodiment is specifically described, which mainly includes the following processes: S101. Build a sample data set.

[0030] 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 risks.

[0031] In this embodiment, the desensitized data may be human body physical sign indicator data, and 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.

[0032] These input feature vectors XIt covers the physical signs and indicators data closely related to diabetes, such as blood sugar value, insulin level, blood pressure, BMI, age, number of pregnancies in women, and family history of diabetes. These characteristics have been identified as important influencing factors for the onset of diabetes through in-depth research, and the data comes from a large number of clinical tests and medical records. For example: blood sugar value and insulin level can directly reflect the body's sugar metabolism, and their abnormalities often indicate diabetes; aging leads to decreased function and increased insulin resistance, which increases the risk of disease; more pregnancies in women can affect sugar metabolism and increase the possibility of diabetes; hypertension and diabetes affect each other, and hypertensive patients have a higher risk of disease; abnormal BMI is related to body fat distribution and metabolic state, and is closely related to the risk of diabetes; family history of diabetes reflects the potential role of genetic factors. Comprehensive multi-dimensional feature data can more accurately predict the risk of diabetes.

[0033] The data preprocessing process of this embodiment mainly includes operations such as data filling and feature selection. Among them, the feature selection process can use the recursive feature elimination (RFE) method or the model-based feature importance evaluation method to select the feature subset with the most predictive value from the original feature set to reduce the risk of overfitting and improve the model's explanatory ability and computational efficiency.

[0034] The preprocessing stage fills and corrects missing values ​​or abnormal values ​​in the sample data set to ensure the integrity and consistency of the data. In some embodiments, the filling method can use median filling.

[0035] 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.

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

[0037] S102, dividing the sample data set into a training set, a validation set and a test set.

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

[0039] 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 a validation set.

[0040] 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.

[0041] 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 can asymptotically approximate a residual function F(x)=H(x)-x Therefore, the i The residual block performs the following computation: ; ; In the formula, , 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.

[0042] 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 of the layer is: ; in, Represents the residual network L The input data of the layer is obtained by summing the residual functions of the previous layers and adding them to the input The input of each layer in the residual network is not only the output of the previous layer, but also the cumulative sum of all residual function calculation results from the first layer to the current layer.

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

[0044] The above expression avoids the gradient vanishing or gradient exploding phenomenon commonly seen in traditional deep networks, thereby achieving effective updating and optimization of network parameters. This mechanism is the basis for the efficient learning and prediction of residual networks, and has shown significant advantages in the prediction and analysis of complex diseases such as diabetes.

[0045] In deep learning, the feature self-attention mechanism aims to enable the model to learn how to allocate attention in a given set of input features, thereby emphasizing features that are important to the prediction task and suppressing redundant information. In this embodiment, the feature self-attention mechanism is designed as follows: 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: .

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

[0047] In this embodiment, the attention weight matrix A can be calculated by the following formula: ; Here softmax The ( ) function is used to normalize the attention score to make it a probability distribution. In the formula, T is the matrix transpose symbol.

[0048] Next, the attention weight matrix A With value matrix V Multiply them together to get the weighted feature representation Z : .

[0049] Afterwards, the weighted features are expressed as Z With the original input feature vector X Fusion is performed to retain 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’ It is expressed as: .

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

[0051] In this process, , , , These are all weight parameters that need to be learned, and they can be optimized through the back-propagation algorithm to minimize the prediction error of the network. The weight parameters of these matrices are adjusted and optimized according to the characteristic distribution of the diabetes sample data during the training process. For example, the weight parameters related to key diabetes features such as blood sugar value and insulin will be given greater importance during the training process to enhance the model's attention to these features.

[0052] 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 for diabetes risk prediction.

[0053] 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.

[0054] Among them, the mathematical formula of the RAC model can be expressed as: ; ; 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 according to the model training results to ensure that important diabetes feature information is effectively transmitted between network layers; It is an activation function, which 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 batch normalization operation; It is with i The weights associated with the residual blocks are: 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 feature vectors and highlight key pathogenic factors in diabetes data processing, such as blood sugar control trends, age-related risk changes, etc. In this embodiment, .

[0055] 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 on the performance. The main function of the fully connected layer is to map the input data to the output space, and to achieve pattern recognition and feature extraction by learning weight parameters. Its input is a one-dimensional vector or a flattened multidimensional tensor, and its output is also a one-dimensional vector or tensor. There are documents proving 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.

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

[0057] like Figure 4As shown, in this embodiment, a feature self-attention module is added after the input layer and each residual block of the RAC model. The input data is first preprocessed with feature weights by a self-designed feature self-attention module, retaining the original information while enhancing the weight representation of important features, and then enters the main branch of the prediction network. The main branch part mainly includes three residual blocks connected in series, and the internal structure of each residual block is: two fully connected layers and a normalization layer (i.e., the first fully connected layer and the normalization layer, the second fully connected layer and the normalization layer), and also includes a feature self-attention module, and there is a residual link inside the residual block. In the first residual block, the input feature passes through a fully connected layer to map the 32-dimensional feature to 64 dimensions. This layer further expands the feature space, enabling the model to capture more complex feature relationships; the normalization layer is used to accelerate the training process and improve the generalization ability of the model. In the second residual block, the input feature passes through a fully connected layer to map the 64-dimensional feature back to 32 dimensions. The function of this layer is to compress the feature space, reduce the complexity of the model, prevent overfitting, and also perform normalization operations. The third residual block passes the input features through a fully connected layer, further compresses the 32-dimensional features to 16 dimensions, and then performs a normalization operation. 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 of diabetes.

[0058] In some embodiments, the 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.

[0059] Specifically, we can Sigmoid The function is expressed as: ; in, q 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's risk of developing diabetes.

[0060] 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 1 to 5 from low to high. For example, p <0.2 is low risk, and the 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.8High risk, risk level 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 diabetes.

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

[0062] In this embodiment, a cross-validation method, such as a K-fold cross-validation method, can be used to adjust the parameters in 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 a stable and reliable performance evaluation result can be obtained.

[0063] S105. Evaluate the performance of the RAC model and display the evaluation results.

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

[0065] Figure 5 An example of extracting samples from the test set for comparative evaluation was shown, highlighting the significant progress of the improved residual network RAC model in diabetes risk prediction. In the in-depth exploration of diabetes prediction tasks, the RAC model showed obvious advantages over other classic algorithms (Random Forest, SVM, logistic regression, naive Bayes, decision tree), which are reflected in the overall improvement of key performance indicators.

[0066] The experimental data of this embodiment comes 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.

[0067] On the Pima public dataset, the RAC model of this embodiment shows excellent performance, such as Figure 5 As shown in the figure, the classification accuracy is as high as 92.87%, the sensitivity is 93.45%, the specificity is 99.23%, and the F1 score is 93.37%, which is significantly better than the comparison model. These data not only reflect the significant reduction in prediction errors, but also demonstrate the high accuracy and reliability of the RAC model in distinguishing healthy people from diabetic patients.

[0068] On the private dataset, although the data size is smaller and the sample distribution is more complex, the RAC model of this embodiment still shows good generalization ability, and the performance indicators can reach 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.

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

[0070] 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.

[0071] In this embodiment, the feature self-attention module designed for the diabetes dataset is integrated with the improved residual network. The RAC model shows excellent prediction performance in the training phase. However, if a transparent explanation of the prediction results is not provided in clinical applications, it may trigger a trust barrier for medical workers. To this end, this embodiment integrates the SHAP (SHapley Additive exPlanations) model based on the RAC model, which is known for its high interpretability. For each individual prediction sample, the 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, that is, the mean of all marginal contributions of the feature.

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

[0073] 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: .

[0074] In the formula, That is i Samples Thes 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.

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

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

[0077] 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 prediction results.

[0078] Figure 6 This is a SHAP feature dependency analysis diagram, which shows the results of SHAP feature dependency analysis of preprocessed data. The straight line in the figure is the "best fit line", which usually represents the straight line that can best describe or predict the linear relationship of a set of data points. Figure 6 (a) is a graph showing the relationship between SHAP value and insulin value. The SHAP values ​​corresponding to different insulin values ​​are densely distributed. In actual medical scenarios, abnormal changes in insulin values ​​are often related to diabetes risk. This relationship graph can provide a reference for assessing diabetes risk. Figure 6 (b) is the relationship between SHAP value and blood glucose value. As the blood glucose value increases, the SHAP value gradually increases and the data points are distributed along the diagonal line. This is consistent with the fact that blood glucose value is an important diagnostic indicator for diabetes in clinical practice and can assist in determining the risk of diabetes. Figure 6 (c) is a graph showing the relationship between SHAP value and age. Different ages correspond to different SHAP values ​​and the data points are scattered. As age increases, the probability of developing diabetes increases. This graph helps to assess the risk of diabetes based on age factors. Figure 6 (d) is the relationship between SHAP value and family history of diabetes. Given that family history of diabetes is an important influencing factor for the disease, this figure is of great significance for comprehensively judging the risk of diabetes. These characteristics all show a significant negative impact relationship with the risk of diabetes, that is, the risk of disease gradually increases as the characteristic value increases, which is an important basis for judgment in the actual diagnosis of diabetes.

[0079] Figure 7A visual summary of the SHAP value is shown. It specifically presents the SHAP value of a confirmed diabetes case in the data set, as well as the local contribution of each feature to the disease risk prediction. The figure ranks each feature according to its importance in affecting the risk of diabetes, and the figure clearly reveals that indicators such as blood sugar level, age, number of pregnancies, and body mass index (BMI) have a significant impact on model decisions. In particular, the algorithm ranks blood sugar level, age, and number of pregnancies in the top three, clearly indicating that these factors are the main determining factors for determining that the patient suffers from gestational diabetes (GDM), while other variables need to be considered comprehensively in combination with specific circumstances.

[0080] 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.

[0081] This embodiment proposes a prediction algorithm based on an improved deep residual network to address the common problems of insufficient reliability and interpretability in diabetes prediction models. 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 a deep residual network, it is possible to automatically identify features in the data set 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".

[0082] 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 by 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 ; Mathematical model for constructing 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 that maps 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 the batch normalization operation; It is with i The weights associated with each residual block; It is a feature self-attention mechanism layer, which is used to weight the feature vector; 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 result.

2. The diabetes prediction and explainability analysis method according to claim 1, characterized in that: The improved residual network model is configured to use a fully connected layer to replace the convolutional layer in the original structure of the residual network, and the internal structure of each residual block is 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.

3. The diabetes prediction and explainability analysis method according to claim 2, 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.

4. The diabetes prediction and explainability analysis method according to claim 3, 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 .

5. The diabetes prediction and explainability analysis method according to claim 4, 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.

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

7. The diabetes prediction and explainability analysis method according to any one of claims 1 to 6, 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 the data format is unified X Substitute them into the improved residual network model together to predict diabetes risk.

8. The diabetes prediction and explainability analysis method according to any one of claims 1 to 6, 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 a 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 is evaluated using sample data in the test set.

9. The diabetes prediction and explainability analysis method according to claim 8, 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.

10. 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 9 are implemented.

Citation Information

Patent Citations

  • Remote sensing image scene classification method and device

    CN111582225A

  • Non-invasive risk prediction method for diabetes

    CN114038564A

  • U-type diabetes mellitus retinal exudate segmentation algorithm based on embedded residual convolution and attention module

    CN114882218A

  • Diabetic retinopathy grading method and system based on CNN and Transform

    CN116664928A

  • Palm print recognition method fusing attention mechanism and residual network

    CN116978075A

Cited By

  • Avian influenza virus overflow space risk assessment method based on interpretable machine learning and space weighted sampling

    CN120613152A