Diabetes condition prediction method and system based on deep learning
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-06
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]本发明的目的在于提供一种基于深度学习的糖尿病病情预测方法及系统,以解决现有技术中多模态健康数据融合缺乏临床语义针对性、无法有效利用跨时间片因果先验知识,以及预测结果可解释性不足的问题
动态异构图通过定义同一时间分片内不同模态数据间的语义边、不同时间分片间相同模态数据的时间邻接边以及不同时间分片间不同模态数据的临床因果先验边,将多模态数据的共时关联、历时演化与因果传导统一表征在同一图结构中。第一图卷积编码器设置多个并行的模态特异性卷积核,每个卷积核仅聚合具有相同临床语义标签的邻居节点特征向量,对不同邻居子集分别执行线性变换和特征聚合后再与目标节点融合。这种处理方式使得血糖调控类、药物干预类、生理波动类和检验证据类等不同临床语义信息在传递过程中保持各自的模态特性,避免了无差别聚合造成的特征混淆与信息抵消,从而提高了对血糖变化有差异化影响的各种病理生理因素的捕获能力。时序注意力解码器对第一隐状态矩阵中各时间分片隐状态向量计算注意力分数,归一化后获得权重系数,表征历史各时间片对当前解码时刻的贡献程度,并将上下文向量与上一解码时刻生成的血糖变化向量进行门控融合,生成输出向量作为本解码时刻预测的血糖变化趋势向量。该过程能够自适应地聚焦于对血糖未来走势有决定性影响的特定历史时期,抑制无关时间片的干扰,并通过门控机制平滑时序演变,使得生成的预测血糖变化趋势向量稳定地反映血糖均值、峰值、谷值和波动幅度等关键特征。将预测向量输入基于临床指南构建的决策树分类器后,各内部节点对应明确的并发症临床风险阈值判断条件,决策路径直接遵循指南中的分层判别逻辑,最终输出明确的并发症风险等级。这种方式使整个预测结果可追溯至具体的临床风险判据,医生可直接依据决策树路径理解模型判断依据,增强了模型在临床环境中的可信度和适用性。
Smart Images

Figure CN122552103A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of diabetes disease prediction technology, specifically to a method and system for predicting diabetes disease based on deep learning. Background Technology
[0002] Predicting diabetes disease progression is crucial for early intervention of complications. Current risk prediction strategies for diabetic patients often rely on single-modality data, such as extrapolating trends solely from continuous blood glucose monitoring curves or constructing static scoring models using only test indicators. These methods fail to fully utilize the widespread multimodal health data available in clinical practice, neglecting the complementary information and temporal evolution patterns inherent in different modalities, resulting in coarse prediction granularity and insufficient sensitivity. Some studies have attempted to introduce multi-source data fusion strategies, but these typically employ simple feature splicing or fully connected networks to treat all modalities equally. Such approaches fail to distinguish the interaction mechanisms between data under different clinical semantics, such as the delayed effects of drug intervention on blood glucose fluctuations, or the causal chain between vital sign fluctuations and metabolic abnormalities. These relationships are implicitly and indiscriminately mixed into the same aggregation process in traditional models, making it difficult for the model to capture causal transmission across time slices and effectively isolate intermodal interference, leading to information redundancy and prediction bias. Furthermore, existing deep learning prediction models are generally black-box structures, outputting continuous blood glucose values or single risk probability values. Doctors cannot directly correlate the prediction results with specific clinical risk assessments, hindering the adoption of these models in clinical decision-making. A key challenge is how to enable models to explicitly utilize prior clinical causal knowledge and output complication risk levels that can be interpreted in accordance with clinical guidelines, while simultaneously integrating heterogeneous multimodal time series data. Summary of the Invention
[0003] The purpose of this invention is to provide a method and system for predicting diabetes based on deep learning, in order to solve the problems in the existing technology of lack of clinical semantic specificity in multimodal health data fusion, inability to effectively utilize causal prior knowledge across time slices, and insufficient interpretability of prediction results.
[0004] To achieve the above objectives, the present invention provides the following technical solution: The present invention provides a method and system for predicting diabetes based on deep learning, which can collaboratively model the multimodal and temporal health data of the target patient, capture cross-modal semantic associations and causal priors on a dynamic heterogeneous graph structure, thereby accurately predicting the trend of blood glucose changes and outputting the risk level of complications.
[0005] This method acquires multimodal health data sequences of target patients, including continuous blood glucose monitoring data, medication record timestamps, vital sign time-series data, and a set of structured diagnostic indicators. Based on the temporal attributes and clinical semantic labels of each data point, a dynamic heterogeneous graph is constructed with time slices as nodes. The node feature vectors in this dynamic heterogeneous graph are jointly encoded by the numerical values and categories of all data points within the corresponding time slice. The edge set includes semantic edges between different modalities within the same time slice, temporal adjacency edges of the same modality between different time slices, and clinical causal prior edges between different modalities between different time slices. By explicitly introducing clinical causal prior edges, evidence-based causal inference relationships can be embedded into the graph topology, enabling the model to not only rely on statistical correlation but also capture directional and strong causal chains between multi-source clinical events.
[0006] In constructing the dynamic heterogeneous graph, the preferred approach is to divide the multimodal health data sequence into multiple continuous and non-overlapping time slices according to a fixed physiological rhythm time window, with each time slice corresponding to an independent graph node. For each time slice, the continuous blood glucose monitoring data is used to calculate blood glucose variability and average blood glucose fluctuation amplitude, which are then concatenated with the drug name, dosage, and route of administration from the medication record timestamps to obtain a metabolic feature sub-vector. For the vital signs time-series data, heart rate variability frequency domain features and body temperature change slope are extracted to obtain a physiological state sub-vector. For each test item in the structured test indicator set, the percentage difference between its result and the previous test result is calculated to obtain a test dynamic sub-vector. The metabolic feature sub-vector, physiological state sub-vector, and test dynamic sub-vector are then dimensionally aligned and concatenated to form the node feature vector for that time slice node. This multi-scale feature construction method preserves dynamic information from three aspects: blood glucose metabolism, physiological regulation, and test evidence, enabling the node representation to encompass both instantaneous states and short-term trends.
[0007] In constructing clinical causal prior edges, as a preferred embodiment of the present invention, a pre-constructed diabetes clinical knowledge graph is obtained. This knowledge graph uses clinical event types as nodes and evidence-based causal inference relationships as edges. For the first clinical event type corresponding to the first modality data within the first time segment node of the dynamic heterogeneous graph, and the second clinical event type corresponding to the second modality data within the second time segment node, if there is a directed edge in the knowledge graph pointing from the first clinical event type to the second clinical event type, a clinical causal prior edge pointing from the first time segment node to the second time segment node is established in the dynamic heterogeneous graph. Each clinical causal prior edge is assigned an initial weight coefficient that is positively correlated with the causal strength. Furthermore, each causal inference relationship in the diabetes clinical knowledge graph is accompanied by a confidence score, and the initial weight coefficient is the product of the confidence score and the time decay factor, so that the causal influence at a distance reasonably decays with the increase of time distance.
[0008] The first graph convolutional encoder performs cross-modal neighborhood aggregation on each time-slice node in the dynamic heterogeneous graph, generating the first hidden state matrix for each time-slice. This encoder contains multiple parallel modality-specific convolutional kernels, each of which aggregates only the feature vectors of neighboring nodes with the same clinical semantic labels, thereby avoiding blind mixing between features of different modalities and extracting purer intramodal semantic information.
[0009] As a further improvement of this invention, during neighborhood aggregation, for a target time-slice node, the set of all its neighboring nodes is determined and divided into multiple neighbor subsets according to clinical semantic labels, with each neighbor subset corresponding to a clinical data type. A modality-specific convolutional kernel matching the clinical data type is called to linearly transform and sum the feature vectors of all neighboring nodes within each subset, obtaining the modality aggregation feature corresponding to that subset. The modality aggregation features corresponding to all neighbor subsets are then weighted and fused with the node feature vector of the target time-slice node to obtain the updated node feature vector. The weight coefficients used in the weighted fusion can be dynamically calculated through a learnable attention mechanism, enabling the model to adaptively evaluate the importance of different modal information in the current prediction task. The updated feature vectors of all time-slice nodes are arranged in their original temporal order to form the first hidden state matrix.
[0010] When partitioning the data into subsets, the clinical semantic labels of the data points associated with each neighbor node are parsed. These semantic labels are categorized into blood glucose regulation, drug intervention, physiological fluctuation, and diagnostic evidence categories according to the clinical diagnosis and treatment pathway of diabetes, and corresponding neighbor subsets are formed accordingly. For neighbor nodes that do not belong to the categories of blood glucose regulation, drug intervention, physiological fluctuation, and diagnostic evidence, they are assigned to the general neighbor subset and processed using a pre-trained general convolutional kernel, thus ensuring the generality and robustness of the method.
[0011] After generating the first hidden state matrix, a temporal attention decoder performs a weighted recursive mapping in chronological order to generate the predicted blood glucose trend vector for the next time slice. During this decoding process, the first hidden state vector corresponding to the last time slice is used as the initial decoding state. For the current decoding moment, the attention score between its query vector and the first hidden state vectors of all time slices in the first hidden state matrix is calculated. After normalization, a set of weight coefficients is obtained to characterize the contribution of each historical time slice to the current decoding moment. This set of weight coefficients is used to weight and sum all the first hidden state vectors to obtain the context vector for the current moment. The context vector is then gated and fused with the blood glucose change vector generated at the previous decoding moment to obtain the output vector for the current decoding moment, i.e., the predicted blood glucose trend vector. This output vector is then used as the query vector for the next decoding moment and iterated cyclically until a predetermined number of predicted blood glucose trend vectors for future time slices are generated.
[0012] In the gating fusion stage, preferably, the context vector is compressed into a reset gating vector via linear mapping, and the blood glucose change vector generated at the previous decoding time is compressed into an update gating vector via linear mapping. The element-wise product of the reset gating vector and the blood glucose change vector at the previous decoding time is calculated as the first intermediate vector. The context vector and the first intermediate vector are concatenated and passed through a hyperbolic tangent activation function layer to obtain the candidate output vector. The second intermediate vector is obtained by subtracting the update gating vector from the unit vector. Finally, the element-wise product of the update gating vector and the blood glucose change vector at the previous decoding time is added to the element-wise product of the second intermediate vector and the candidate output vector to obtain the output vector at the current decoding time. This design can flexibly integrate the context information at the current time while transmitting historical blood glucose change trends, preventing information loss due to long-term dependencies.
[0013] The predicted blood glucose trend vector is input into a decision tree classifier built based on clinical guidelines, which outputs the complication risk level of the target patient in the next time segment. Each internal node in the decision tree classifier corresponds to a clinical risk threshold for diabetic complications, and each leaf node corresponds to a complication risk level. During classification, the components of the predicted blood glucose trend vector, such as the mean blood glucose, peak blood glucose, trough blood glucose, and blood glucose fluctuation amplitude, are sequentially substituted into the judgment conditions of the root node and subsequent branch nodes. The classification proceeds down the tree structure based on whether the conditions are met, until a leaf node is reached. The complication risk level pre-associated with that leaf node is then used as the final output. This structure fully follows the decision logic of clinical guidelines, and the output results are interpretable, facilitating review and adoption by clinicians.
[0014] In the model preparation phase, this invention also collects longitudinal historical medical record data from multiple sample patients, including blood glucose monitoring records, medication records, vital sign records, and laboratory reports across multiple consecutive time slices, and manually labels each time slice with a complication risk level. The above data is used to jointly train the first graph convolutional encoder, the temporal attention decoder, and the decision tree classifier built based on clinical guidelines. As a preferred training strategy, in each training iteration, the internal node parameters of the decision tree classifier are first fixed, and only the learnable weight parameters of the graph convolutional encoder and the temporal attention decoder are updated, performing the first stage of training. When the first convergence condition is met, the learnable parameters of all components are simultaneously unfrozen, especially the threshold parameters in the decision tree classifier, performing the second stage of joint fine-tuning training. In this stage, different learning rates are set for the node thresholds at different depth levels in the decision tree classifier, with the learning rate for thresholds near the root node being lower than that near the leaf nodes, to maintain stability near the root node in accordance with clinical guidelines, while giving the leaf node thresholds a certain data-driven fine-tuning capability. The training loss function is a weighted sum of cross-entropy loss and mean squared error loss, which balances classification accuracy and trend regression precision.
[0015] The present invention also includes a deep learning-based diabetes condition prediction system, comprising a memory, a processor, and a computer program stored in the memory and running on the processor. When the processor executes the computer program, it implements the steps of the aforementioned deep learning-based diabetes condition prediction method, automatically outputting high-precision predictions of blood glucose trends and risk classifications of complications through multimodal heterogeneous data fusion and joint reasoning guided by clinical knowledge.
[0016] The technical effects and advantages provided by the present invention in the above technical solution are as follows: Dynamic heterogeneous graphs unify the synchronic association, diachronic evolution, and causal transmission of multimodal data within a single graph structure by defining semantic edges between different modalities within the same time slice, temporal adjacency edges between the same modalities across different time slices, and clinical causal prior edges between different modalities across different time slices. The first graph convolutional encoder uses multiple parallel modality-specific convolutional kernels. Each kernel aggregates only the feature vectors of neighboring nodes with the same clinical semantic labels. Linear transformations and feature aggregations are performed on different neighbor subsets before merging with the target node. This approach ensures that different clinical semantic information, such as blood glucose regulation, drug intervention, physiological fluctuations, and evidence verification, maintains its modal characteristics during transmission, avoiding feature confusion and information cancellation caused by indiscriminate aggregation. This improves the ability to capture various pathophysiological factors that have differentiated effects on blood glucose changes. The temporal attention decoder calculates attention scores for the hidden state vectors of each time slice in the first hidden state matrix, normalizes them to obtain weight coefficients, and represents the contribution of each historical time slice to the current decoding moment. It then performs gating fusion with the blood glucose change vector generated at the previous decoding moment to generate an output vector as the predicted blood glucose change trend vector for the current decoding moment. This process adaptively focuses on specific historical periods that have a decisive impact on future blood glucose trends, suppresses interference from irrelevant time slices, and smooths temporal evolution through gating mechanisms, ensuring that the generated predicted blood glucose change trend vector stably reflects key features such as mean, peak, trough, and fluctuation amplitude of blood glucose. After inputting the predicted vector into a decision tree classifier built based on clinical guidelines, each internal node corresponds to a clear clinical risk threshold for complication judgment. The decision path directly follows the hierarchical discrimination logic in the guidelines, ultimately outputting a clear complication risk level. This approach makes the entire prediction result traceable to specific clinical risk criteria, allowing physicians to directly understand the model's judgment basis based on the decision tree path, enhancing the model's credibility and applicability in the clinical environment. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this invention. For those skilled in the art, other drawings can be obtained based on these drawings.
[0018] Figure 1 This is a flowchart of a deep learning-based method for predicting diabetes symptoms. Figure 2 This is a schematic diagram of the temporal attention decoder decoding process; Figure 3 It is the distribution curve of attention weights on historical time slices at different decoding moments in the temporal attention decoder; Figure 4 This is the loss change curve during the training process of the diabetes disease prediction model. Detailed Implementation
[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0020] See Figure 1 This invention provides a deep learning-based method for predicting diabetes symptoms. This method combines dynamic heterogeneous graph construction, graph convolutional coding, temporal attention decoding, and decision tree reasoning based on clinical guidelines to perform end-to-end processing of the target patient's multimodal health data and output the risk level of complications within future time slices.
[0021] A multimodal health data sequence for the target patient is acquired. This sequence comprises continuous blood glucose monitoring data, medication record timestamps, vital sign time-series data, and a set of structured diagnostic indicators. After obtaining this data sequence, a dynamic heterogeneous graph with time slices as nodes is constructed using the inherent temporal attributes of each data point and predefined clinical semantic labels. Each node in this dynamic heterogeneous graph corresponds to a discrete time slice, and the node's feature vector is jointly encoded by the information from all modalities within that time slice. The edge set in the dynamic heterogeneous graph includes semantic edges between different modalities within the same time slice, temporal adjacency edges between the same modality across different time slices, and clinical causal prior edges between different modalities across different time slices.
[0022] The constructed dynamic heterogeneous graph is input into the first graph convolutional encoder. The first graph convolutional encoder contains multiple parallel modality-specific convolutional kernels, each dedicated to processing neighborhood information from the same clinical semantic label. For each temporal slice node in the dynamic heterogeneous graph, the first graph convolutional encoder extracts features from its set of all neighboring nodes and performs neighborhood aggregation under cross-modal conditions to generate the first hidden state vector corresponding to that temporal slice node. The first hidden state vectors of all temporal slice nodes are arranged in their original temporal order to form the first hidden state matrix.
[0023] The first hidden state matrix is passed to the temporal attention decoder. The temporal attention decoder applies a weighted recursive mapping to the first hidden state vectors of each time segment in the first hidden state matrix according to their chronological order. Through an attention mechanism, it adaptively focuses on the degree of influence of different historical time segments on future blood glucose change trends, and gradually generates the predicted blood glucose change trend vector corresponding to the next time segment.
[0024] The predicted blood glucose trend vector is used as input and fed into a decision tree classifier built based on clinical guidelines. Each internal node in the decision tree classifier is configured with a clinical risk threshold for diabetic complications, and each leaf node is associated with a preset complication risk level. The predicted blood glucose trend vector is passed down the decision tree classifier along different branch paths based on the comparison results of each component value with the threshold conditions of each node, ultimately falling into a leaf node and outputting the complication risk level of the target patient in the next time segment.
[0025] In specific implementation, please refer to Figure 2 The temporal attention decoder receives the first hidden state matrix output by the first graph convolutional encoder as input, performs a weighted recursive mapping on the first hidden state matrix in temporal order, and generates the predicted blood glucose change trend vector for the next time slice. The temporal attention decoder adopts a structure combining attention mechanism and gated recursive mapping, and internally includes an attention calculation module and a gated fusion module.
[0026] The first hidden state matrix is composed of the first hidden state vectors of multiple time slices arranged in chronological order. Let the total number of time slices in the first hidden state matrix be... , No. The first hidden state vector of each time slice is denoted as . The temporal attention decoder will use the first hidden state vector corresponding to the last time slice in the first hidden state matrix. This serves as the initial decoding state.
[0027] The current decoding moment in the decoding process The attention calculation module of the temporal attention decoder obtains the current decoding time. Corresponding query vector For the first decoding moment, the query vector The value is directly taken as the initial decoding state. For subsequent decoding moments, the query vector The blood glucose change vector generated at the previous decoding time point is obtained through linear mapping.
[0028] The attention calculation module will use the query vector at the current decoding time. The first hidden state vector of all time slices in the first hidden state matrix Calculate the inner product separately to obtain a set of attention scores. Attention score corresponding to each time segment The calculation method is the query vector. With the first hidden state vector The dot product operation is performed. The resulting set of attention scores is then normalized using the softmax function to generate a set of attention weight coefficients. ,in In the first hidden state matrix, the th Each time segment corresponds to the current decoding moment. The degree of contribution, The value range is 1 to .
[0029] Attention weight coefficient The first hidden state vectors corresponding to the first hidden state matrix respectively Multiply the results and sum them to obtain the current decoding time. context vector Context vector The calculation expression is:
[0030] in, Indicates the current decoding time. Context vector; Represents the first hidden state matrix. The attention weight coefficients corresponding to each time slice are obtained by normalizing the attention scores using the softmax function. The value range is from 0 to 1, and all The sum is 1; Represents the first hidden state matrix. The first hidden state vector of each time slice; This represents the total number of time slices in the first hidden state matrix.
[0031] The context vector at the current decoding moment Compared with the blood glucose change vector generated at the previous decoding time point The input gated fusion module obtains the output vector at the current decoding moment through gated fusion operations, which is the predicted blood glucose change trend vector at this decoding moment. .when At that time, the blood glucose change vector generated at the previous decoding time step The value is the initial decoding state. The vector obtained after mapping through a fully connected layer.
[0032] The specific implementation steps of gating fusion are as follows: The context vector at the current decoding moment... The first linear mapping layer, which includes a weight matrix and a bias vector, compresses the output to a vector representing the blood glucose change generated at the previous decoding time step, with dimensions equal to or greater than the dimension of the vector representing the blood glucose change at the previous decoding time step. Same reset gate vector Reset the gating vector The activation function uses the sigmoid function, which makes... Each element in the vector is between 0 and 1. The blood glucose change vector generated at the previous decoding time step... The second linear mapping layer, which contains a weight matrix and a bias vector, compresses the output into an update gating vector of the same dimension. Update the gating vector. The activation function is also the sigmoid function.
[0033] Calculate the first intermediate vector First intermediate vector To reset the gate vector Compared with the blood glucose change vector generated at the previous decoding time point The element-wise product. The context vector at the current decoding moment. With the first intermediate vector The concatenated vectors are then input into a hyperbolic tangent activation function layer, which contains a learnable weight matrix and bias vectors. The output vector is a candidate output vector. .
[0034] Calculate the second intermediate vector ,in, Representing and updating the gating vector A vector of all 1s with the same dimension. The gate vector will be updated. Compared with the blood glucose change vector generated at the previous decoding time point The element-wise product, plus the second intermediate vector With candidate output vector The element-wise product of the two vectors is the output vector at the current decoding moment. , This is the predicted blood glucose trend vector at this decoding moment. (Predicted blood glucose trend vector) The dimensions are consistent with the blood glucose trend representation dimensions preset by the model. Each component in the vector corresponds to the change in mean blood glucose, the change in peak blood glucose, the change in trough blood glucose, and the change in blood glucose fluctuation amplitude, respectively.
[0035] The predicted blood glucose trend vector at this decoding moment As the query vector for the next decoding time step The source, specifically, will Transform it into a vector with the same dimension as the query vector through a linear mapping layer, and use it as... Repeat the attention calculation and gating fusion process described above until a predetermined number of predicted blood glucose trend vectors for future time slices are generated. The predetermined number is determined by clinical application needs, for example, set to 1, 3, or 6 future time slices.
[0036] The series of predicted blood glucose trend vectors output by the temporal attention decoder are arranged in the order of decoding time and fed into a decision tree classifier built based on clinical guidelines for subsequent risk level judgment.
[0037] See Figure 3 The horizontal axis in the graph represents historical time slices. The value ranges from 1 to 500, and the vertical axis represents the attention weight. The value ranges from 0 to 0.06. The figure shows the trend curves of attention weight changes in the temporal attention decoder at three different decoding times (decoding time 1, decoding time 2, and decoding time 3), represented by solid lines, dashed lines, and dotted lines, respectively. The attention weights reflect the contribution of each historical time slice in the first hidden state matrix to the predicted blood glucose trend vector at the current decoding time.
[0038] As shown in the figure, with the increase of historical time slice numbers, i.e., as the time gradually approaches the current prediction starting point, the attention weights of all three curves show a gradual upward trend. This is especially true in the historical time slice range of 450 to 500, where the attention weight increases significantly, reaching a maximum of approximately 0.06, indicating that the decoder assigns higher attention to information from the most recent time slice. The attention weight curves at different decoding times are relatively flat and close to zero in the early stages (historical time slices 1 to 400), showing that earlier historical time slices have a smaller impact on the current prediction.
[0039] Specifically, the attention weight curve at decoding time 1 exhibits a more pronounced peak shape in later historical time slices, indicating that the prediction at this time relies more on the latest time slice information. The overall trend of the attention weight curves at decoding times 2 and 3 is similar to that at decoding time 1, but the weight values are lower and the rise is smoother, reflecting that the model gradually adjusts the distribution of attention to historical information in multi-step recursive prediction.
[0040] The attention weight distribution aligns with the temporal attention decoder's design in this embodiment, which uses a weighted recursive mapping of the first hidden state matrix in chronological order. By dynamically calculating the attention weights, the model adaptively focuses on historical data at different times, prioritizing key time slices near the prediction time, thereby effectively capturing the short-term dynamic trends of blood glucose changes in the target patient. The curve variation details are consistent with the softmax normalization process and context vector generation process of the attention calculation module in this embodiment, demonstrating the temporal dependency modeling capability of the temporal attention decoder.
[0041] See Figure 4 In the graph, the horizontal axis represents the number of training iterations, ranging from 0 to 500, and the vertical axis represents the total loss value. The value ranges from approximately 0 to 3.2. The curve consists of two lines: the solid line represents the training set loss, and the dashed line represents the validation set loss. In the initial stage (the first 100 rounds), the training set loss rapidly decreases from approximately 2.7 to approximately 1.5, and the validation set loss decreases from approximately 3.1 to approximately 1.7, indicating that the model quickly fits the training data in the early stages of training. In subsequent training, both the training set loss and the validation set loss continue to decrease slowly, and their curve trends are basically consistent. The validation set loss is always slightly higher than the training set loss, indicating that the model does not exhibit significant overfitting. By the 400th round, the training set loss stabilizes in the range of approximately 0.2 to 0.3, and the validation set loss stabilizes in the range of approximately 0.4 to 0.6, indicating that the model training has tended to converge. The overall curve reflects the loss change process during the joint training stage described in this embodiment, where the parameters of the first graph convolutional encoder, the temporal attention decoder, and the decision tree classifier built based on clinical guidelines are optimized, effectively verifying the loss function during training. The gradual reduction of costs and the improvement of model performance.
[0042] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A method for predicting a diabetic condition based on deep learning, characterized by, Includes the following steps: The target patient acquires a multimodal health data sequence including continuous blood glucose monitoring data, medication record timestamps, vital sign time series data, and a set of structured test indicators. Based on the time attributes and clinical semantic labels of each data point in the multimodal health data sequence, a dynamic heterogeneous graph with time slices as nodes is constructed. The first graph convolutional encoder performs cross-modal neighborhood aggregation on each time slice node in the dynamic heterogeneous graph to generate the first hidden state matrix of each time slice. The first graph convolutional encoder contains multiple parallel modality-specific convolutional kernels, and each modality-specific convolutional kernel only aggregates the feature vectors of neighboring nodes with the same clinical semantic labels. The first hidden state matrix is weighted and recursively mapped in chronological order by a temporal attention decoder to generate a predicted blood glucose change trend vector for the next time slice. The predicted blood glucose trend vector is input into a decision tree classifier built based on clinical guidelines, which outputs the complication risk level of the target patient in the next time segment. 2.The deep learning-based diabetes condition prediction method of claim 1, wherein, The node feature vector in the dynamic heterogeneous graph is obtained by jointly encoding the numerical values and categories of all data points within the corresponding time slice. The edge set in the dynamic heterogeneous graph includes semantic edges between different modalities within the same time slice, temporal adjacency edges between the same modalities between different time slices, and clinical causal prior edges between different modalities between different time slices. 3.The deep learning-based diabetes condition prediction method of claim 2, wherein, Based on the temporal attributes and clinical semantic labels of each data point in the multimodal health data sequence, a dynamic heterogeneous graph is constructed with time slices as nodes, specifically including: The multimodal health data sequence is divided into multiple continuous and non-overlapping time slices according to a fixed physiological rhythm time window, and each time slice corresponds to an independent graph node. For each time segment, the blood glucose variability and average blood glucose fluctuation amplitude are calculated from the continuous blood glucose monitoring data. The calculation results are then combined with the drug name, dosage and administration route in the medication record timestamp to obtain the metabolic feature subvector of that time segment node. Extract the frequency domain features of heart rate variability and the slope of body temperature change from the time series data of vital signs within each time slice to obtain the physiological state sub-vector of that time slice node; For each test item in the structured test index set within each time segment, calculate the percentage difference between it and the previous test result to obtain the test dynamic sub-vector of that time segment node; The metabolic feature sub-vector, physiological state sub-vector, and test dynamic sub-vector are aligned in dimension and then concatenated end to end to form the node feature vector of the time slice node. 4.The deep learning-based diabetes condition prediction method of claim 3, wherein, The construction of clinical causal prior edges between different modalities of data in a dynamic heterogeneous graph with time slices as nodes specifically includes: Obtain a pre-constructed clinical knowledge graph of diabetes, wherein the nodes in the clinical knowledge graph are clinical event types and the edges are causal inference relationships verified by evidence-based medicine. For the first clinical event type corresponding to the first modal data in the first time segment node of the first dynamic heterogeneous graph, and the second clinical event type corresponding to the second modal data in the second time segment node, when there is a directed edge in the diabetes clinical knowledge graph pointing from the first clinical event type to the second clinical event type, a clinical causal prior edge pointing from the first time segment node to the second time segment node is established in the dynamic heterogeneous graph. Each of the aforementioned clinical causal prior edges is assigned an initial weight coefficient that is positively correlated with the causal strength in the aforementioned diabetes clinical knowledge graph. 5.The deep learning-based diabetes condition prediction method of claim 4, wherein, Each causal inference relationship in the diabetes clinical knowledge graph is accompanied by a confidence score, and the initial weight coefficient is the product of the confidence score and the time decay factor. 6.The deep learning-based diabetes condition prediction method of claim 4, wherein, The step of performing cross-modal neighborhood aggregation on each time-slice node in the dynamic heterogeneous graph using a first graph convolutional encoder to generate a first hidden state matrix for each time-slice specifically includes: For the target time slice node in the dynamic heterogeneous graph, determine the set of all its neighbor nodes, including other time slice nodes connected to the target time slice node through the semantic edge, the temporal adjacency edge or the clinical causal prior edge; The neighbor nodes of the target time segment node are divided into multiple neighbor subsets according to their clinical semantic labels, and each neighbor subset corresponds to a clinical data type. Each modality-specific convolution kernel that matches the clinical data type of each neighbor subset is called. The feature vectors of all neighbor nodes in each neighbor subset are linearly transformed and then summed to obtain the modality aggregation feature corresponding to that neighbor subset. The modal aggregation features corresponding to all neighbor subsets are weighted and fused with the node feature vector of the target time segment node to obtain the updated feature vector of the target time segment node; The updated feature vectors of all time-slice nodes in the dynamic heterogeneous graph are arranged in the original order of the time slices to form the first hidden state matrix. 7.The deep learning-based diabetes condition prediction method of claim 6, wherein, The weighting coefficients used when weighting and fusing the modal aggregation features corresponding to all neighbor subsets with the node feature vectors of the target time segment node are dynamically calculated through a learnable attention mechanism. 8.The deep learning-based diabetes condition prediction method of claim 6, wherein, The neighbor nodes of the target time-slice node are divided into multiple neighbor subsets according to their clinical semantic labels, specifically including: The clinical semantic labels of data points in the multimodal health data sequence associated with each neighbor node are analyzed. The clinical semantic labels are pre-classified into blood glucose regulation, drug intervention, physiological fluctuation and evidence verification categories according to the clinical diagnosis and treatment path of diabetes. All neighbor nodes with clinical semantic labels of blood glucose regulation are assigned to the first neighbor subset; All neighbor nodes with clinical semantic labels of drug intervention are assigned to the second neighbor subset; All neighbor nodes with clinical semantic labels belonging to the category of physiological fluctuations are assigned to the third neighbor subset; All neighbor nodes with clinical semantic labels of "test evidence" are assigned to the fourth neighbor subset; For neighbor nodes whose clinical semantic labels do not belong to the categories of blood glucose regulation, drug intervention, physiological fluctuation, and verification evidence, they are classified into a general neighbor subset and processed using a pre-trained general convolutional kernel. 9.The deep learning-based diabetes condition prediction method of claim 1, wherein, The step of generating a predicted blood glucose trend vector for the next time slice by performing a weighted recursive mapping of the first hidden state matrix in chronological order using a temporal attention decoder specifically includes: Use the first hidden state vector corresponding to the last time slice in the first hidden state matrix as the initial decoding state; For the current decoding moment in the decoding process, the inner product of the query vector corresponding to the current decoding moment and the first hidden state vector of all time slices in the first hidden state matrix is calculated to obtain a set of attention scores; The set of attention scores is normalized to obtain a set of attention weight coefficients, which respectively characterize the contribution of each time slice in the first hidden state matrix to the current decoding time. The context vector at the current decoding moment is obtained by multiplying the set of attention weight coefficients by the corresponding first hidden state vector in the first hidden state matrix and summing the results. The context vector at the current decoding moment is gated and fused with the blood glucose change vector generated at the previous decoding moment to obtain the output vector at the current decoding moment. The output vector at the current decoding moment is the blood glucose change trend vector predicted at this decoding moment. The predicted blood glucose trend vector at the current decoding time is used as the query vector for the next decoding time. The above process is repeated until a preset number of predicted blood glucose trend vectors for future time slices are generated. 10.A diabetes condition prediction system based on deep learning, comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the deep learning-based diabetes condition prediction method according to any one of claims 1 to 9.