A deep learning-based dynamic risk prediction method for chronic diseases

CN122991619APending Publication Date: 2026-10-27BEIJING INTELLIGENT DECISION MEDICAL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611227867.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-13
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0003]慢性疾病具有长期演化、阶段切换和风险累积的特点,现有模型通常采用固定时间窗口或固定拓扑结构处理健康时间序列,难以根据目标对象病程阶段变化调整模型内部连接关系,容易将稳定阶段、波动阶段和恶化阶段混合编码

Benefits of technology

[0061](1)本发明通过病程相位边界将健康时间序列划分为病程相位片段,将Pyraformer基础模型的固定金字塔拓扑转换为随病程相位片段变化的金字塔拓扑,使模型能够按照目标对象的实际病程阶段执行编码,减少稳定阶段、波动阶段和恶化阶段被混合处理的问题。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122991619A_ABST
    Figure CN122991619A_ABST
Patent Text Reader

Abstract

The application discloses a chronic disease dynamic risk prediction method based on deep learning, comprising the following steps: acquiring health-related data and follow-up outcome data and preprocessing, generating health time series and training sample set; constructing a Pyraformer basic model; generating a health state hidden vector sequence and dividing a disease course phase segment, and constructing a disease course phase variable topology; performing intra-phase coding and inter-phase transition coding to generate a phase topology coding state; establishing a risk account book and updating the account book state; generating a bifurcation disease course trajectory set based on the account book state; and outputting a chronic disease dynamic risk value and training a prediction model according to the bifurcation disease course trajectory set. The application realizes dynamic evaluation of chronic disease risk, improves disease course recognition, risk accumulation expression and prediction adaptability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of health data processing technology, and in particular to a method for dynamic risk prediction of chronic diseases based on deep learning. Background Technology

[0002] With the development of medical informatization and chronic disease management platforms, medical institutions can continuously collect health-related data and follow-up outcome data of target subjects, and use machine learning or deep learning models to predict the risk of chronic disease occurrence, progression, and complications. Existing methods typically organize health-related data into fixed-length time series, then input them into recurrent neural networks, convolutional neural networks, or Transformer models to extract time series features and output risk prediction results.

[0003] Chronic diseases are characterized by long-term evolution, stage transitions, and risk accumulation. Existing models typically use fixed time windows or fixed topological structures to process healthy time series, making it difficult to adjust the internal connectivity of the model according to changes in the disease progression of the target population. This often results in the mixed encoding of stable, fluctuating, and worsening stages. Existing risk prediction methods mostly rely on the final hidden state to generate risk outcomes, lacking explicit records of the formation, continuation, decay, and termination of historical risk loads, and thus failing to reflect the long-term residual characteristics of chronic disease risk.

[0004] Existing methods typically output a single risk value directly, without fully considering the multiple subsequent developmental pathways that may exist in the same current disease state, resulting in insufficient expression of dynamic risk changes in chronic diseases.

[0005] Therefore, how to provide a method for dynamic risk prediction of chronic diseases based on deep learning is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0006] One objective of this invention is to propose a method for predicting the dynamic risk of chronic diseases based on deep learning. This invention uses an improved Pyraformer model to perform disease phase segmentation, risk ledger updating, and bifurcation disease progression extrapolation on health-related data, thereby achieving dynamic risk value prediction for chronic diseases. It has the advantages of accurate identification of disease stages, clear expression of risk accumulation, and strong dynamics of prediction results.

[0007] A method for predicting the dynamic risk of chronic diseases based on deep learning according to an embodiment of the present invention includes the following steps:

[0008] Acquire health-related data and follow-up outcome data of the target subjects, perform preprocessing, and generate health time series and training sample set;

[0009] Build the basic Pyraformer model and complete the model parameter initialization;

[0010] The health time series is input into the embedding layer to generate a health state latent vector sequence. The disease course phase boundary is generated according to the change relationship between adjacent health state latent vectors. The health state latent vector sequence is divided into disease course phase segments according to the disease course phase boundary. The fixed pyramid topology of the Pyraformer base model is transformed into a pyramid topology that changes with the disease course phase segments.

[0011] Based on the disease course phase-variable topology, intra-phase coding and inter-phase transition coding are performed to generate phase topology coding states;

[0012] A risk ledger is established during the phase topology coding state generation process. The intra-phase coding results and inter-phase transition coding results are written into the risk ledger. The risk ledger is updated according to the state transition chain from the formation to the termination of the risk load, and the ledger state is generated.

[0013] Based on the phase topology coding state and ledger state, the pathological ground state is generated. A preset number of bifurcation starting points are generated from the pathological ground state. Recursive evolution is performed on the bifurcation starting points to generate a set of bifurcation pathological trajectories.

[0014] The dynamic risk value of chronic disease is generated based on the set of bifurcation disease trajectories. The model parameters are trained based on the training sample set to form a dynamic risk prediction model for chronic disease.

[0015] Optionally, the preprocessing procedure specifically includes:

[0016] Obtain health-related data and follow-up outcome data of the target subjects, and associate the health-related data and follow-up outcome data according to the target subject identifier;

[0017] The associated health-related data were sorted according to the collection time. The sorted health-related data were then processed to correct abnormal records, fill in missing records, and standardize numerical fields to obtain standardized health data.

[0018] Standardized health data is organized into a sequence of health status nodes according to adjacent collection times to generate a health time series.

[0019] Based on follow-up outcome data, determine the dynamic risk value label of chronic diseases corresponding to the health time series, and combine the health time series with the dynamic risk value label of chronic diseases to generate a training sample set.

[0020] Optionally, generating the disease progression phase boundary based on the change relationship between the latent vectors of adjacent healthy states specifically includes:

[0021] The health status nodes in the health time series are input into the embedding layer according to the collection time order to generate a health status latent vector sequence.

[0022] The current disease phase segment is established starting from the first health state hidden vector in the health state hidden vector sequence, and the adjacent previous and next health state hidden vectors are read in sequence.

[0023] The vector difference calculation, vector angle calculation, and acquisition interval normalization are performed on the latent vectors of the previous and next health states to generate adjacent state change features.

[0024] The adjacent state change features are sequentially subjected to linear mapping, nonlinear activation, and normalization mapping to generate phase switching values;

[0025] When the phase switching value is greater than or equal to the preset phase switching threshold, a disease course phase boundary is set between the previous health state latent vector and the next health state latent vector, and a new disease course phase segment is established starting from the next health state latent vector.

[0026] When the phase switching value is less than the preset phase switching threshold, the hidden vector of the next healthy state is merged into the current disease phase segment until the healthy state hidden vector sequence is read and the disease phase segment is generated.

[0027] Optionally, the conversion of the fixed pyramid topology of the Pyraformer base model to a pyramid topology that varies with the phase segments of the disease progression specifically includes:

[0028] Read the initial health state latent vector, the final health state latent vector, and the segment number of the disease course phase segment, and establish the attribution index between the health state latent vector and the disease course phase segment;

[0029] Remove fixed pyramid connections that cross disease phase boundaries in the Pyraformer base model based on the attribution index;

[0030] Within each disease stage segment, a pyramid connection is established according to the arrangement order of the hidden vectors of the healthy state within the segment, and each disease stage segment is encoded to generate a phase root node.

[0031] Read the latent vectors of the terminated and start-up health states of adjacent disease phase segments, generate inter-phase transition nodes, and establish connections between the phase root node and the inter-phase transition nodes.

[0032] Write the intra-phase pyramid connections, phase root nodes, inter-phase transition nodes, and connection relationships into the topology index table. Replace the fixed pyramid topology of the Pyraformer basic model with the topology index table to obtain the pyramid topology that changes with the phase segments of the disease progression.

[0033] Optionally, the execution of intra-phase coding and inter-phase transition coding based on the disease course phase-variable topology specifically includes:

[0034] Read the disease progression phase segments according to the pyramid topology that changes with the phase segments of the disease progression;

[0035] Perform in-phase encoding on the hidden vectors of health status arranged continuously according to the acquisition time within each disease course phase segment;

[0036] Intraphase coding is a staged coding representation of the disease process phase segment by transmitting the hidden vector of health status layer by layer along the intraphase pyramid connection within the same disease process phase segment;

[0037] The stage-based coding representation of two adjacent disease course phase segments is read in chronological order of acquisition time;

[0038] Perform inter-phase transition coding on the disease stage transition process between two adjacent disease stage segments;

[0039] Phase transition coding involves encoding the stage-based coding representation of the previous disease stage segment, the stage-based coding representation of the next disease stage segment, and the state change representation between the two, and generating a transition coding representation.

[0040] The phase coding representation and transition coding representation are input into the upper-level coding structure of Pyraformer in the order of acquisition time to generate the phase topology coding state.

[0041] Optionally, establishing a risk ledger during the phase topology coding state generation process specifically includes:

[0042] The intra-phase encoding results and inter-phase transition encoding results are mapped separately to generate risk loads;

[0043] The risk loads are written into the risk ledger in chronological order of collection time, recording the source location, load representation, residual value, and status flag of the risk loads;

[0044] The newly written risk loads are compared with the non-terminated risk loads in the risk ledger in terms of load representation similarity and source location continuity. If they are similar and continuous, the newly written risk loads are merged into the existing risk loads. If they are not similar and continuous, the newly written risk loads are registered as formed.

[0045] When the merged risk load continues to exist, it is registered as a continuing state; when the residual value of the merged risk load decreases, it is registered as a decaying state; when the residual value of the merged risk load decreases to the termination threshold, it is registered as a terminated state.

[0046] The risk ledger is updated according to the state migration chain consisting of formation, continuation, decay, and termination, generating the ledger state.

[0047] Optionally, the generation of the disease course ground state based on the phase topology coding state and the ledger state specifically includes:

[0048] Read the end-code representation of the phase topology encoding state, read the risk loads that are not in the termination state in the ledger state, arrange the risk loads that are not in the termination state in the order of collection time, scale the load representation according to the residual value and then sum them up to obtain the ledger summary representation;

[0049] The terminal encoding representation is concatenated with the ledger summary representation and then input into a fully connected computation to obtain the disease course ground state;

[0050] The disease course ground state is replicated according to the preset number of bifurcations. Each disease course ground state is added to a trainable branch direction vector and normalized to obtain the corresponding bifurcation starting point.

[0051] Each fork start point is taken as the current branch state. The current branch state is concatenated with the ledger summary representation and then input into the shared recursive calculation to obtain the next branch state.

[0052] The next branch state is then used as the current branch state to continue the shared recursive calculation until the preset number of recursive steps is reached.

[0053] The branch states corresponding to the same bifurcation starting point are arranged in a recursive order to form a bifurcation pathology trajectory, and all bifurcation pathology trajectories are combined into a set of bifurcation pathology trajectories.

[0054] Optionally, generating dynamic risk values ​​for chronic diseases based on the set of bifurcation disease trajectories specifically includes:

[0055] Read the final branch state of each bifurcation path trajectory in the set of bifurcation path trajectories, calculate the state change between adjacent recursive steps in each bifurcation path trajectory, and obtain the branch risk representation;

[0056] All branch risk representations are concatenated and normalized to generate dynamic risk values ​​for chronic diseases.

[0057] The training loss is obtained by calculating the error between the dynamic risk value of chronic diseases and the corresponding dynamic risk value label of chronic diseases in the training sample set.

[0058] Backpropagation is performed based on the training loss to update the model parameters;

[0059] The training sample set is input repeatedly for training until the loss on the validation set reaches the convergence condition. The current model parameters are then saved to form a dynamic risk prediction model for chronic diseases.

[0060] The beneficial effects of this invention are:

[0061] (1) This invention divides the healthy time series into disease phase segments by disease phase boundaries, and transforms the fixed pyramid topology of the Pyraformer basic model into a pyramid topology that changes with the disease phase segments, so that the model can perform coding according to the actual disease stage of the target object, reducing the problem of mixed processing of stable stage, fluctuating stage and deterioration stage.

[0062] (2) In the process of generating phase topology coding state, the present invention establishes a risk ledger, converts the intra-phase coding result and inter-phase transition coding result into risk load, and updates the ledger state according to the state migration chain of formation, continuation, decay and termination, so that the historical accumulation, continuous residue and gradual decline of chronic disease risk can be explicitly recorded.

[0063] (3) The present invention generates the disease course ground state based on the phase topology coding state and the ledger state, generates a set of bifurcated disease course trajectories from the disease course ground state, and generates a dynamic risk value of chronic disease based on the set of bifurcated disease course trajectories. The prediction process can express multiple subsequent evolution paths under the same current disease course state, thereby improving the continuity and adaptability of the generation of dynamic risk value of chronic disease. Attached Figure Description

[0064] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:

[0065] Figure 1 This is a flowchart of a deep learning-based method for dynamic risk prediction of chronic diseases proposed in this invention.

[0066] Figure 2 This is a schematic diagram of the disease course phase-variable topology construction of a deep learning-based dynamic risk prediction method for chronic diseases proposed in this invention.

[0067] Figure 3 This diagram illustrates the establishment and updating of a risk ledger for a deep learning-based dynamic risk prediction method for chronic diseases proposed in this invention. Detailed Implementation

[0068] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.

[0069] refer to Figures 1-3 A deep learning-based method for dynamic risk prediction of chronic diseases includes the following steps:

[0070] Acquire health-related data and follow-up outcome data of the target subjects, perform preprocessing, and generate health time series and training sample set;

[0071] Build the basic Pyraformer model and complete the model parameter initialization;

[0072] The health time series is input into the embedding layer to generate a health state latent vector sequence. The disease course phase boundary is generated according to the change relationship between adjacent health state latent vectors. The health state latent vector sequence is divided into disease course phase segments according to the disease course phase boundary. The fixed pyramid topology of the Pyraformer base model is transformed into a pyramid topology that changes with the disease course phase segments.

[0073] Based on the disease course phase-variable topology, intra-phase coding and inter-phase transition coding are performed to generate phase topology coding states;

[0074] A risk ledger is established during the phase topology coding state generation process. The intra-phase coding results and inter-phase transition coding results are written into the risk ledger. The risk ledger is updated according to the state transition chain from the formation to the termination of the risk load, and the ledger state is generated.

[0075] Based on the phase topology coding state and ledger state, the pathological ground state is generated. A preset number of bifurcation starting points are generated from the pathological ground state. Recursive evolution is performed on the bifurcation starting points to generate a set of bifurcation pathological trajectories.

[0076] The dynamic risk value of chronic disease is generated based on the set of bifurcation disease trajectories. The model parameters are trained based on the training sample set to form a dynamic risk prediction model for chronic disease.

[0077] In this embodiment, the preprocessing process specifically includes:

[0078] The system acquires health-related data and follow-up outcome data of the target individuals, and associates these data with the target individual's identifier. The target individual identifier serves as a unique identifier for proving identity; for example, a medical card number or ID card number is hashed and anonymized to form a unique code for the target individual. Data records in the health-related data table that match the unique code of the target individual in the follow-up outcome data table are matched. The matching time range is set to health-related data records within 5 years prior to the occurrence of the follow-up outcome. Health-related data records that do not match follow-up outcome data are not included in the training sample set. Health-related data includes outpatient records, inpatient records, and physical examination records. Follow-up outcome data originates from the target individual's treatment outcome records, follow-up outcome records, chronic disease management outcome records, and inpatient outcome records generated within a preset follow-up period. Both health-related data and follow-up outcome data are acquired with the authorization of the target individual.

[0079] The associated health-related data were sorted according to the collection time. The sorted data underwent anomaly correction, missing record imputation, and numerical field standardization to obtain standardized health data. Collection time was accurate to the day; when multiple health-related data records existed from the same day, they were arranged in chronological order of generation. Anomaly correction combined medical value range validation and statistical outlier validation. Data records outside the medical value range were marked as missing values. Statistical outlier validation used the interquartile range method, marking numerical fields smaller than the first quartile minus 1.5 times the interquartile range or larger than the third quartile plus 1.5 times the interquartile range as outliers, replacing them with linear interpolation results from two adjacent valid collection time points. For missing record imputation, numerical fields with consecutive missing lengths of no more than three collection time points were imputed using linear interpolation; those with consecutive missing lengths exceeding three collection time points were imputed using the historical median of the same target object; if no historical median existed for the target object, the median of the corresponding field in the training sample set was used. Numerical field standardization used Z-score standardization, subtracting the mean of the corresponding field in the training sample set from the numerical field and then dividing by the standard deviation of the corresponding field.

[0080] Standardized health data are organized into a sequence of health status nodes according to adjacent collection times to generate a health time series; standardized health data corresponding to the same target object at the same collection time are merged into one health status node; the time interval between adjacent collection times is recorded in days and used as the time interval field between health status nodes; when the number of health status nodes of the target object is less than 3, no training samples are generated; when the number of health status nodes of the target object is greater than 36, the 36 health status nodes closest to the follow-up outcome time are retained.

[0081] Based on follow-up outcome data, the dynamic risk value label for chronic diseases corresponding to the healthy time series is determined, and the healthy time series and the dynamic risk value label for chronic diseases are combined to generate a training sample set; the score of the outcome event is determined based on the abnormal re-examination results in the follow-up outcome data, and the score of the outcome event is normalized and used as the dynamic risk value label for chronic diseases; the healthy time series is used as the training input, and the dynamic risk value label for chronic diseases is used as the training output.

[0082] When constructing the Pyraformer base model, the input length of the healthy time series, the feature dimension of the healthy state nodes, the embedding layer dimension, the number of pyramid encoding layers, and the output dimension of the risk value are set. The healthy state nodes are input into the embedding layer to obtain node representations consistent with the model dimensions. The connection relationship between the bottom time nodes and the upper aggregation nodes is established according to the Pyraformer pyramid attention structure. The embedding layer parameters, encoding layer parameters, and output layer parameters are initialized using a random initialization method to obtain a trainable Pyraformer base model.

[0083] In this embodiment, generating the disease progression phase boundary based on the changing relationship between the latent vectors of adjacent healthy states specifically includes:

[0084] The health status nodes in the health time series are input into the embedding layer according to the collection time order to generate a health status latent vector sequence. The numerical fields in the health status nodes are mapped by a fully connected layer to obtain numerical embeddings, and the category fields are mapped by an embedding layer to obtain category embeddings. The numerical embeddings and category embeddings are concatenated and input into the linear projection layer to generate health status latent vectors.

[0085] The current disease progression phase segment is established starting from the first healthy state hidden vector in the healthy state hidden vector sequence. The adjacent previous and next healthy state hidden vectors are read sequentially. The first healthy state hidden vector is taken as the starting node of the current disease progression phase segment. The reading pointer is moved sequentially starting from the second healthy state hidden vector in the healthy state hidden vector sequence. Each time the reading pointer is read, the next healthy state hidden vector and the previous healthy state hidden vector corresponding to the previous position of the reading pointer form an adjacent hidden vector pair.

[0086] The vector difference, vector angle, and acquisition interval normalization processes are performed on the latent vectors of the previous and subsequent health states to generate adjacent state change features. The angle relationship between the latent vectors of the previous and subsequent health states in the vector space is calculated to obtain the angle representation used to characterize the degree of shift in the overall direction of health state change. The time interval between the acquisition time corresponding to the latent vector of the previous health state and the acquisition time corresponding to the latent vector of the subsequent health state is read and normalized according to the maximum acquisition time interval in the training sample set to obtain the time interval representation.

[0087] The adjacent state change features are sequentially linearly mapped, nonlinearly activated, and normalized to generate phase switching values. The adjacent state change features are input into the linear mapping layer to obtain intermediate vectors. The intermediate vectors are input into the ReLU activation function to obtain activation vectors. The activation vectors are input into the Sigmoid function to obtain phase switching values, which range from 0 to 1. The closer the phase switching value is to 1, the greater the degree of disease-related phase switching between the latent vectors of adjacent healthy states.

[0088] When the phase switching value is greater than or equal to the preset phase switching threshold, a disease course phase boundary is set between the previous healthy state latent vector and the next healthy state latent vector, and a new disease course phase segment is established starting from the next healthy state latent vector; the preset phase switching threshold is 0.7; when the phase switching value is greater than or equal to the preset phase switching threshold, the previous healthy state latent vector is used as the termination node of the current disease course phase segment, and the next healthy state latent vector is used as the starting node of the next disease course phase segment.

[0089] When the phase switching value is less than the preset phase switching threshold, the hidden vector of the next healthy state is merged into the current disease phase segment until the sequence of hidden vectors of healthy states is read and a disease phase segment is generated; keeping the starting node of the current disease phase segment unchanged, the hidden vector of the next healthy state is appended to the end of the current disease phase segment; when the sequence of hidden vectors of healthy states is read, the last hidden vector of healthy states is used as the ending node of the current disease phase segment.

[0090] In this embodiment, the conversion of the fixed pyramid topology of the Pyraformer base model to a pyramid topology that varies with the phase segments of the disease progression specifically includes:

[0091] Read the initial and final health state latent vectors and the segment number of the disease progression phase segment, and establish an attribution index between the health state latent vectors and the disease progression phase segment; record the segment number, start position, end position, and position within the segment for each disease progression phase segment, and register the health state latent vectors located between the start and end positions as belonging to the same disease progression phase segment, generating an attribution index; the attribution index is used to identify the disease progression phase segment to which each health state latent vector belongs and its arrangement position within the disease progression phase segment;

[0092] Based on the attribution index, delete fixed pyramid connections that cross disease phase boundaries in the Pyraformer base model; read the original fixed pyramid connections in the Pyraformer base model, and determine whether the latent health state vectors at both ends of each connection belong to the same disease phase segment; when the latent health state vectors at both ends belong to different disease phase segments, the connection is determined to be a fixed pyramid connection that crosses the disease phase boundary and is deleted from the original fixed pyramid connection; when the latent health state vectors at both ends belong to the same disease phase segment, the connection is retained.

[0093] Within each disease stage segment, a pyramid connection is established according to the order of the hidden vectors of the health status within the segment. Each disease stage segment is encoded to generate a phase root node. For each disease stage segment, the hidden vectors of the health status within the segment are arranged according to the acquisition time. Starting from the bottom layer, two adjacent hidden vectors of the health status are connected to the same upper-level node. Connections are then established for adjacent nodes in the upper layer until a node at the top layer of the disease stage segment is generated. This top-level node is used as the phase root node. When the number of nodes in a certain layer is odd, the node at the end of the sequence is directly passed to the upper layer to participate in subsequent connections.

[0094] Read the latent vectors of the terminated and start of the healthy state of adjacent disease phase segments, generate inter-phase transition nodes, and establish connections between the phase root node and the inter-phase transition nodes; for any two disease phase segments with consecutive acquisition times, read the latent vector of the terminated healthy state of the previous disease phase segment and the latent vector of the start of the healthy state of the next disease phase segment, map the state change representation between the two to the acquisition time interval representation, and generate inter-phase transition nodes; connect the phase root node of the previous disease phase segment to the inter-phase transition node, and connect the inter-phase transition node to the phase root node of the next disease phase segment;

[0095] Write the intra-phase pyramid connections, phase root nodes, inter-phase transition nodes, and connection relationships into the topology index table. Replace the fixed pyramid topology of the Pyraformer basic model with the topology index table to obtain the pyramid topology that changes with the phase segments of the disease progression.

[0096] The topology index table records connections one by one, with each record corresponding to one inter-node information transfer. Each record contains at least the connection start point, connection end point, the disease phase segment to which the connection belongs, and the connection level. The connection start point is the lower-level node participating in the current information transfer, and the connection end point is the upper-level node receiving the result of the current information transfer. The disease phase segment to which the connection belongs is the disease phase segment where the connection start point is located. The connection level is the level of the current information transfer in the pyramid structure. When writing a pyramid connection within a phase, adjacent lower-level nodes within the same disease phase segment are registered as connection start points, and upper-level nodes generated by adjacent lower-level nodes are registered as connection end points. When writing a transition connection between phases, the top-level node of the previous disease phase segment is registered as the connection start point, and nodes generated from the transition from the previous disease phase segment to the next disease phase segment are registered as connection end points. The nodes generated from this transition to the top-level node of the next disease phase segment are then registered as the next connection relationship. During model forward propagation, inter-node information transfer is executed according to the record order of the connection relationships in the topology index table to complete the pyramid topology calculation that changes with the disease phase segment.

[0097] In this embodiment, performing intra-phase coding and inter-phase transition coding based on the disease course phase-variable topology specifically includes:

[0098] Read the disease phase segments according to the pyramid topology that changes with the disease phase segments; according to the disease phase segments, connection start point, connection end point and level recorded in the topology index table, read the health status hidden vector in each disease phase segment in sequence, keeping the acquisition time order of the health status hidden vector in the segment unchanged.

[0099] For each disease stage segment, the health status latent vectors arranged continuously according to the acquisition time are encoded within the phase. During the phase encoding, the two health status latent vectors corresponding to adjacent acquisition times within the same disease stage segment are concatenated and input into a linear transformation layer and an activation function to obtain the coded representation of adjacent nodes. Then, the coded representation of adjacent nodes is passed to the next layer according to the phase pyramid connection until the stage coded representation corresponding to the disease stage segment is obtained. The stage coded representation is consistent with the dimension of the health status latent vector.

[0100] Intra-phase encoding involves passing the health status latent vector layer by layer along the intra-phase pyramid within the same disease course phase segment to generate a stage-wise encoded representation of that disease course phase segment. The layer-wise passing within the same disease course phase segment is performed in a bottom-up order, with the bottom layer being the health status latent vector and the next layer being the encoded representation of the composite of adjacent health status latent vectors. When there is an unpaired last node in a certain layer, the last node is directly passed to the next layer to participate in the next layer's encoding. When the disease course phase segment contains only one health status latent vector, the health status latent vector is linearly transformed and used as the stage-wise encoded representation.

[0101] The stage-based coding representation of two adjacent disease course phase segments is read in chronological order of acquisition time;

[0102] Perform phase transition coding on the disease stage transition process between two adjacent disease stage segments;

[0103] The phase transition encoding involves encoding the stage-based encoding representations of the preceding and following disease stage segments, as well as the state change representations between them, to generate a transition encoding representation. The state change representation is generated by the dimensional differences, overall directional offset, and acquisition time interval between the stage-based encoding representations of the preceding and following disease stage segments. The transition encoding representation is used to represent the disease stage transition process when moving from the preceding to the following disease stage segment, and the vector dimension of the transition encoding representation is consistent with the vector dimension of the stage encoding representation.

[0104] The phase coding representation and transition coding representation are input into the Pyraformer upper-level coding structure in the order of acquisition time to generate the phase topology coding state; the phase coding representation is arranged in the order of acquisition time of the disease phase segment, and the transition coding representation is inserted between the corresponding two adjacent phase coding representations to form the phase-level coding sequence; the phase-level coding sequence is input into the Pyraformer upper-level coding structure, and the upper-level node is passed according to the connection relationship in the topology index table to obtain the phase topology coding state.

[0105] In this embodiment, establishing a risk ledger during the phase topology coding state generation process specifically includes:

[0106] The intra-phase encoding results and inter-phase transition encoding results are respectively mapped to generate risk loads. The mapping process uses a shared fully connected transformation, activation function, and normalization function in sequence. The intra-phase encoding results are input into the mapping process to generate the risk load of the corresponding disease stage segment. The inter-phase transition encoding results are input into the same mapping process to generate the risk load of the corresponding disease stage transition process. The risk load consists of a load representation and a residual value. The load representation is used to record the direction of the risk load in the latent vector space. The residual value is obtained by averaging the values ​​of each dimension of the normalized load representation and mapping it to 0 to 100.

[0107] The risk load is written into the risk ledger in chronological order of collection time, recording the source location, load representation, residual value, and status flag of the risk load; the risk ledger is a set of records arranged in chronological order of collection time; the source location is the sequence number of the disease phase segment corresponding to the risk load or the position between adjacent disease phase segments; the status flag is used to record the current position of the risk load in the state transition chain, and the status flag is empty when initially written;

[0108] The newly written risk load is compared with the unterminated risk loads in the risk ledger using load representation similarity and source location continuity. If they are similar and continuous, the newly written risk load is merged into the existing risk loads. If they are not similar and continuous, the newly written risk load is registered as a formed state. The load representation similarity is calculated using cosine similarity. The load representation of the newly written risk load is compared with the load representation of the unterminated risk load. If the similarity is greater than or equal to 0.70, they are considered similar. The source location continuity is used to determine whether the disease course phase segment numbers corresponding to two risk loads are adjacent, or whether one risk load comes from the previous disease course phase segment and the other risk load comes from the adjacent inter-phase transition process. If they are similar and continuous, the load representation of the newly written risk load is merged and spliced ​​with the load representation of the existing risk load to form a new load representation. The larger of the two residual values ​​is used as the updated residual value.

[0109] When the merged risk load persists, it is registered as a continuing state; when the residual value of the merged risk load decreases, it is registered as a decaying state; when the residual value of the merged risk load decreases to the termination threshold, it is registered as a terminated state. The forming state indicates a newly created risk load in the risk ledger; the continuing state indicates that the risk load is matched and merged again during subsequent adjacent disease phase segments or phase transitions; the decaying state indicates that the updated residual value is lower than the original residual value but still greater than the termination threshold; the terminated state indicates that the residual value is less than or equal to the termination threshold, which is 5; risk loads in the terminated state no longer participate in subsequent risk load merging.

[0110] The risk ledger is updated according to the state migration chain consisting of formation, continuation, decay, and termination, generating the ledger state.

[0111] In this embodiment, generating the pathological ground state based on the phase topology coding state and the ledger state specifically includes:

[0112] The process involves reading the end-of-phase topology coding status, reading the risk loads that are not in the terminated state in the ledger status, arranging the risk loads that are not in the terminated state in the order of collection time, scaling the load representations according to the residual values, and then summing them up to obtain the ledger summary representation. The end-of-phase coding status is the coding result corresponding to the last collection time position in the phase topology coding status. During scaling, the residual value of each risk load is divided by one hundred to obtain the scaling factor. The scaling factor is multiplied by the corresponding load representation, and the scaled load representations are added one by one according to the collection time order.

[0113] The terminal encoding representation and the ledger summary representation are concatenated and then input into the fully connected computation to obtain the disease course ground state. The fully connected computation is used to convert the terminal encoding representation and the ledger summary representation into a disease course ground state of the same dimension. The dimension of the disease course ground state is consistent with the dimension of the phase topology encoding state. The disease course ground state serves as the unified initial representation for the generation of subsequent bifurcation starting points.

[0114] The disease course ground state is replicated according to a preset number of bifurcations. Each disease course ground state is added to a trainable branch direction vector, and normalization is performed to obtain the corresponding bifurcation starting point. Each trainable branch direction vector corresponds to a potential disease course evolution direction, which is updated along with the model parameters during model training. The normalization process uses layer normalization, maintaining the same numerical scale for different bifurcation starting points. During the training phase, the training samples are first clustered according to the changing trend of the dynamic risk value labels of chronic diseases over time, resulting in disease course evolution clusters consistent with the preset number of bifurcations. The disease course ground state center corresponding to each disease course evolution cluster is used as the basis for calculating the initial branch direction vector, so that different branch direction vectors correspond to different follow-up outcome change trends during initialization. During model training, the branch direction vector is updated along with backpropagation as a trainable parameter. The trend is obtained based on the follow-up outcome change trend corresponding to the vector closest to the cluster center. The follow-up outcome change trend includes risk decrease, risk stabilization, risk slow increase, and risk rapid increase, which are assessed by humans and are part of the training sample set.

[0115] Each bifurcation starting point is taken as the current branch state. The current branch state is concatenated with the ledger summary representation and then input into the shared recursive calculation to obtain the next branch state. The shared recursive calculation uses the same set of recursive parameters to process all bifurcation starting points. In each step of recursion, the current branch state is used to represent the disease status of the current step of the deduction, and the ledger summary representation is used to carry the impact of the unterminated risk load on the subsequent disease. After the two are concatenated, they are processed by fully connected calculation, activation calculation and normalization to obtain the next branch state.

[0116] The next branch state is used as the current branch state to continue the shared recursive calculation until the preset number of recursive steps is reached; the preset number of recursive steps corresponds to the number of risk value prediction time windows, and the preset number of recursive steps is 10; after each recursion, the branch state obtained in the current step is saved, and the branch state obtained in the current step is used as the input state for the next recursion.

[0117] The branch states corresponding to the same bifurcation starting point are arranged in a recursive order to form a bifurcation pathology trajectory. All bifurcation pathology trajectories are combined to form a set of bifurcation pathology trajectories. Each bifurcation pathology trajectory consists of multiple branch states obtained by continuous recursion from the same bifurcation starting point. The set of bifurcation pathology trajectories consists of all bifurcation pathology trajectories corresponding to the bifurcation starting point.

[0118] In this embodiment, generating dynamic risk values ​​for chronic diseases based on the set of bifurcation disease trajectories specifically includes:

[0119] The final branch state of each bifurcation pathology trajectory in the set of bifurcation pathology trajectories is read, and the state change between adjacent recursive steps in each bifurcation pathology trajectory is calculated to obtain the branch risk representation. The final branch state is the branch state obtained after the last recursion of each bifurcation pathology trajectory. The state change is obtained by comparing the branch states of two consecutive recursive steps in the same bifurcation pathology trajectory. The state change results of each recursive step are summarized in the recursive order and together with the final branch state, they form the branch risk representation corresponding to the bifurcation pathology trajectory. The branch risk representation is used to characterize the direction and magnitude of risk change of the bifurcation pathology trajectory in the future recursion process.

[0120] All branch risk representations are concatenated and normalized to generate dynamic risk values ​​for chronic diseases; all branch risk representations are concatenated according to the bifurcation starting point numbering order to obtain a comprehensive branch risk representation; the comprehensive branch risk representation is input into the fully connected layer to obtain the original risk value, and then normalized to obtain the dynamic risk value for chronic diseases; the larger the dynamic risk value for chronic diseases, the higher the risk of chronic disease occurrence, progression, or complications within the corresponding time window for the target object;

[0121] The training loss is obtained by calculating the error between the dynamic risk value of chronic diseases and the corresponding dynamic risk value label of chronic diseases in the training sample set. Each health time series in the training sample set is bound to a dynamic risk value label of chronic diseases. The error calculation adopts mean squared error, mean absolute error or a weighted combination of the two. The dynamic risk value of chronic diseases is the model prediction output, and the dynamic risk value label of chronic diseases is the supervised training target. When the dynamic risk values ​​of chronic diseases for multiple time windows are output at the same time, the error of each time window is calculated separately and then summed to obtain the training loss.

[0122] Backpropagation is performed based on the training loss to update the model parameters;

[0123] The training sample set is input repeatedly for training until the validation set loss reaches the convergence condition. The current model parameters are saved to form a dynamic risk prediction model for chronic diseases. The training sample set is divided into training set and validation set in an 8:2 ratio. After each round of training, the validation set loss is calculated. When the validation set loss decreases by less than 0.001 for 5 consecutive rounds, the validation set loss is determined to have reached the convergence condition.

[0124] The output dynamic risk values ​​for chronic diseases are used to provide supplementary reference for chronic disease risk management, follow-up arrangements, and health interventions. Risk values ​​should not be used as the basis for disease diagnosis, treatment plan determination, or medical treatment decisions. Actual diagnosis, medication adjustments, and treatment decisions should be made by qualified medical personnel based on a comprehensive assessment of the target individual's clinical manifestations, examination results, and treatment guidelines.

[0125] Example 1: To verify the feasibility of this invention in practice, it was applied to a real-world scenario of dynamic risk prediction for chronic diseases. In this scenario, the target group is chronic disease patients undergoing long-term follow-up. Their health-related data includes continuously monitored indicators such as blood pressure, blood glucose, blood lipids, weight, and heart rate, as well as clinical events recorded in the follow-up outcomes, such as disease deterioration, number of hospitalizations, and abnormal re-examination results. Traditional methods often directly input a fixed window or the entire sequence into a deep learning model for prediction. However, this method cannot distinguish disease stages and cannot record the risk accumulation process, resulting in insufficient continuity and accuracy of dynamic risk prediction results. This invention addresses this problem by achieving multidimensional modeling and dynamic risk prediction of the chronic disease development process through disease stage segmentation, risk ledger updating, and bifurcation disease progression extrapolation.

[0126] In practical applications, the health-related data and follow-up outcome data of the target subjects are first preprocessed to generate standardized health time series and training sample sets. Then, a Pyraformer base model is constructed and its parameters are initialized. The health time series is input into the embedding layer to generate a sequence of latent vectors representing health states. The disease progression phase boundaries are determined by calculating the changes in adjacent latent vectors, dividing the sequence into disease progression phase segments. Simultaneously, the fixed pyramid topology is converted to a variable disease progression phase topology. Intra-phase encoding is performed within each disease progression phase segment, and inter-phase transition encoding is performed between adjacent disease progression segments. During the encoding process, a risk ledger is established to record the formation, continuation, decay, and termination of the risk load. Next, the disease progression ground state is generated by combining the phase topology encoding state and the ledger state. Three bifurcation starting points are then generated from the disease progression ground state. Recursive evolution is performed on each bifurcation starting point to obtain multiple bifurcation disease progression trajectories. Finally, a dynamic risk value for chronic diseases is generated based on the set of bifurcation disease progression trajectories. The model parameters are then trained using the training sample set to form a complete prediction model.

[0127] Table 1: Comparison Results of Methods for Predicting Dynamic Risk of Chronic Diseases

[0128] Risk prediction accuracy (%) 92 77 79 78 Risk continuity score 0.86 0.65 0.70 0.68 Consistent risk accumulation (%) 88 68 72 70 Multi-bifurcation trajectory deviation 0.09 0.22 0.20 0.21 Disease stage differentiation ability (F1 score) 0.90 0.72 0.73 0.71 Predictive stability (standard deviation) 0.06 0.11 0.10 0.11 Average error (dynamic risk value) 3.8 8.0 7.6 7.9

[0129] The results show that the method of this invention can significantly improve predictive performance. In terms of risk prediction accuracy, the method of this invention achieves 92%, while the traditional fixed-window method achieves 77%, recurrent neural networks achieve 79%, and the standard Transformer achieves 78%. Regarding risk continuity scoring, the method of this invention achieves 0.86, while the traditional method only ranges from 0.64 to 0.70. The model's ability to distinguish different disease stages (F1 score) is 0.90, while the traditional method only ranges from 0.71 to 0.74. The consistency of cumulative risk expression reaches 88%, a significant improvement over the 68% of the traditional method. Furthermore, multi-branch trajectory simulation results show that the prediction bias of different branches is less than 0.09, capable of covering multiple potential disease progression paths.

[0130] The method of this invention outperforms existing technologies in all general evaluation metrics. Significantly improved risk prediction accuracy and risk accumulation consistency indicate that the model can more accurately predict future risks of the target population and maintain effective memory of historical risks. The improved risk continuity score shows that the bifurcation disease trajectory simulation can generate continuous and smooth dynamic risk change curves, reflecting the true development trend of chronic diseases. The ability to distinguish disease stages and the multi-bifurcation trajectory deviation index demonstrate that the method of this invention can identify different disease stages and cover multiple potential development paths, enhancing the interpretability and reliability of the model. Prediction stability and average error indices show that the model output is stable with small errors, proving that the method of this invention can provide highly reliable risk prediction results in practical applications. Overall, this invention achieves the beneficial effects of clear stage distinction, visualized risk accumulation, strong prediction continuity, and outstanding multi-path simulation capabilities in the dynamic risk prediction of chronic diseases.

[0131] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A method for dynamic risk prediction of chronic diseases based on deep learning, characterized in that, Includes the following steps: Acquire health-related data and follow-up outcome data of the target subjects, perform preprocessing, and generate health time series and training sample set; Build the basic Pyraformer model and complete the model parameter initialization; The health time series is input into the embedding layer to generate a health state latent vector sequence. The disease course phase boundary is generated according to the change relationship between adjacent health state latent vectors. The health state latent vector sequence is divided into disease course phase segments according to the disease course phase boundary. The fixed pyramid topology of the Pyraformer base model is transformed into a pyramid topology that changes with the disease course phase segments. Based on the disease course phase-variable topology, intra-phase coding and inter-phase transition coding are performed to generate phase topology coding states; A risk ledger is established during the phase topology coding state generation process. The intra-phase coding results and inter-phase transition coding results are written into the risk ledger. The risk ledger is updated according to the state transition chain from the formation to the termination of the risk load, and the ledger state is generated. Based on the phase topology coding state and ledger state, the pathological ground state is generated. A preset number of bifurcation starting points are generated from the pathological ground state. Recursive evolution is performed on the bifurcation starting points to generate a set of bifurcation pathological trajectories. The dynamic risk value of chronic disease is generated based on the set of bifurcation disease trajectories. The model parameters are trained based on the training sample set to form a dynamic risk prediction model for chronic disease.

2. The method for dynamic risk prediction of chronic diseases based on deep learning according to claim 1, characterized in that, The preprocessing process specifically includes: Obtain health-related data and follow-up outcome data of the target subjects, and associate the health-related data and follow-up outcome data according to the target subject identifier; The associated health-related data were sorted according to the collection time. The sorted health-related data were then processed to correct abnormal records, fill in missing records, and standardize numerical fields to obtain standardized health data. Standardized health data is organized into a sequence of health status nodes according to adjacent collection times to generate a health time series. Based on follow-up outcome data, determine the dynamic risk value label of chronic diseases corresponding to the health time series, and combine the health time series with the dynamic risk value label of chronic diseases to generate a training sample set.

3. The method for dynamic risk prediction of chronic diseases based on deep learning according to claim 2, characterized in that, The specific steps of generating the disease progression phase boundary based on the change relationship between the latent vectors of adjacent healthy states include: The health status nodes in the health time series are input into the embedding layer according to the collection time order to generate a health status latent vector sequence. The current disease phase segment is established starting from the first health state hidden vector in the health state hidden vector sequence, and the adjacent previous and next health state hidden vectors are read in sequence. The vector difference calculation, vector angle calculation, and acquisition interval normalization are performed on the latent vectors of the previous and next health states to generate adjacent state change features. The adjacent state change features are sequentially subjected to linear mapping, nonlinear activation, and normalization mapping to generate phase switching values; When the phase switching value is greater than or equal to the preset phase switching threshold, a disease course phase boundary is set between the previous health state latent vector and the next health state latent vector, and a new disease course phase segment is established starting from the next health state latent vector. When the phase switching value is less than the preset phase switching threshold, the hidden vector of the next healthy state is merged into the current disease phase segment until the healthy state hidden vector sequence is read and the disease phase segment is generated.

4. The method for dynamic risk prediction of chronic diseases based on deep learning according to claim 3, characterized in that, The conversion of the fixed pyramid topology of the Pyraformer base model to a pyramid topology that varies with disease progression phase segments specifically includes: Read the initial health state latent vector, the final health state latent vector, and the segment number of the disease course phase segment, and establish the attribution index between the health state latent vector and the disease course phase segment; Remove fixed pyramid connections that cross disease phase boundaries in the Pyraformer base model based on the attribution index; Within each disease stage segment, a pyramid connection is established according to the arrangement order of the hidden vectors of the healthy state within the segment, and each disease stage segment is encoded to generate a phase root node. Read the latent vectors of the terminated and start-up health states of adjacent disease phase segments, generate inter-phase transition nodes, and establish connections between the phase root node and the inter-phase transition nodes. Write the intra-phase pyramid connections, phase root nodes, inter-phase transition nodes, and connection relationships into the topology index table. Replace the fixed pyramid topology of the Pyraformer basic model with the topology index table to obtain the pyramid topology that changes with the phase segments of the disease progression.

5. The method for dynamic risk prediction of chronic diseases based on deep learning according to claim 4, characterized in that, The specific implementation of intra-phase coding and inter-phase transition coding based on disease-pathology-phase-variable topology includes: Read the disease progression phase segments according to the pyramid topology that changes with the phase segments of the disease progression; Perform in-phase encoding on the hidden vectors of health status arranged continuously according to the acquisition time within each disease course phase segment; Intraphase coding is a staged coding representation of the disease process phase segment by transmitting the hidden vector of health status layer by layer along the intraphase pyramid connection within the same disease process phase segment; The stage-based coding representation of two adjacent disease course phase segments is read in chronological order of acquisition time; Perform inter-phase transition coding on the disease stage transition process between two adjacent disease stage segments; Phase transition coding involves encoding the stage-based coding representation of the previous disease stage segment, the stage-based coding representation of the next disease stage segment, and the state change representation between the two, and generating a transition coding representation. The phase coding representation and transition coding representation are input into the upper-level coding structure of Pyraformer in the order of acquisition time to generate the phase topology coding state.

6. The method for dynamic risk prediction of chronic diseases based on deep learning according to claim 5, characterized in that, The establishment of a risk ledger during the phase topology coding state generation process specifically includes: The intra-phase encoding results and inter-phase transition encoding results are mapped separately to generate risk loads; The risk loads are written into the risk ledger in chronological order of collection time, recording the source location, load representation, residual value, and status flag of the risk loads; The newly written risk loads are compared with the non-terminated risk loads in the risk ledger in terms of load representation similarity and source location continuity. If they are similar and continuous, the newly written risk loads are merged into the existing risk loads. If they are not similar and continuous, the newly written risk loads are registered as formed. When the merged risk load continues to exist, it is registered as a continuing state; when the residual value of the merged risk load decreases, it is registered as a decaying state; when the residual value of the merged risk load decreases to the termination threshold, it is registered as a terminated state. The risk ledger is updated according to the state migration chain consisting of formation, continuation, decay, and termination, generating the ledger state.

7. The method for dynamic risk prediction of chronic diseases based on deep learning according to claim 6, characterized in that, The generation of the disease pathology ground state based on phase topology coding state and ledger state specifically includes: Read the end-code representation of the phase topology encoding state, read the risk loads that are not in the termination state in the ledger state, arrange the risk loads that are not in the termination state in the order of collection time, scale the load representation according to the residual value and then sum them up to obtain the ledger summary representation; The terminal encoding representation is concatenated with the ledger summary representation and then input into a fully connected computation to obtain the disease course ground state; The disease course ground state is replicated according to the preset number of bifurcations. Each disease course ground state is added to a trainable branch direction vector and normalized to obtain the corresponding bifurcation starting point. Each fork start point is taken as the current branch state. The current branch state is concatenated with the ledger summary representation and then input into the shared recursive calculation to obtain the next branch state. The next branch state is then used as the current branch state to continue the shared recursive calculation until the preset number of recursive steps is reached. The branch states corresponding to the same bifurcation starting point are arranged in a recursive order to form a bifurcation pathology trajectory, and all bifurcation pathology trajectories are combined into a set of bifurcation pathology trajectories.

8. The method for dynamic risk prediction of chronic diseases based on deep learning according to claim 7, characterized in that, The specific steps of generating dynamic risk values ​​for chronic diseases based on the set of bifurcation disease trajectories include: Read the final branch state of each bifurcation path trajectory in the set of bifurcation path trajectories, calculate the state change between adjacent recursive steps in each bifurcation path trajectory, and obtain the branch risk representation; All branch risk representations are concatenated and normalized to generate dynamic risk values ​​for chronic diseases. The training loss is obtained by calculating the error between the dynamic risk value of chronic diseases and the corresponding dynamic risk value label of chronic diseases in the training sample set. Backpropagation is performed based on the training loss to update the model parameters; The training sample set is input repeatedly for training until the loss on the validation set reaches the convergence condition. The current model parameters are then saved to form a dynamic risk prediction model for chronic diseases.