Health trajectory prediction method and system based on double-branch collaborative learning

By employing a dual-branch collaborative learning method that combines sequence branching and graph branching, the modeling challenges of temporal dependencies and structural associations in EHR data were solved, enabling efficient and accurate prediction of patients' health status and improving the model's robustness and predictive performance.

CN121938634APending Publication Date: 2026-04-28UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610067234.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-19
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

Existing health trajectory prediction methods struggle to effectively model long-term temporal dependencies and complex structural associations in EHR data, and are also unable to efficiently integrate multimodal information, resulting in insufficient prediction accuracy and robustness.

Method used

A bi-branch collaborative learning approach is adopted, which captures the deep temporal evolution patterns of multimodal medical visit sequences through sequence branching and finely describes the dynamic topological relationships between medical events through graph branching. Combined with an adaptive fusion mechanism, this approach enables comprehensive modeling and prediction of patients' health status.

Benefits of technology

It significantly improves the accuracy and recall of health trajectory prediction, enhances the robustness of the model, and can maintain stable prediction performance in the face of data noise or sparsity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121938634A_ABST
    Figure CN121938634A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of medical information and artificial intelligence, and discloses a health trajectory prediction method and system based on double-branch collaborative learning. According to the sequence-graph double-branch collaborative architecture provided by the invention, the limitation of a single modeling view angle is fundamentally changed. The sequence branch focuses on mining a deep time sequence evolution mode in a multi-mode treatment sequence, and the graph branch depicts dynamic topological association among treatment events in a fine manner. The two are fused through a self-adaptive mechanism, high-quality dynamic representation capable of comprehensively reflecting time sequence evolution and structure correlation of a patient is generated, and a solid foundation is laid for accurate prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of medical information technology and artificial intelligence technology, specifically to a health trajectory prediction method and system based on bi-branch collaborative learning. Background Technology

[0002] With the development of medical informatization, a large amount of electronic health record (EHR) data is being legally and compliantly collected and stored in the information systems of medical institutions. This data typically originates from clinical diagnosis and management processes with the patient's informed consent, and after rigorous anonymization and desensitization, it can be used for medical research. EHR systems record multi-dimensional and multimodal medical events throughout a patient's visits, including diagnoses, medications, examinations, and surgeries, providing a valuable data foundation for in-depth analysis of the dynamic evolution of patients' health conditions.

[0003] Among numerous EHR data analysis tasks, health trajectory prediction holds significant clinical importance. This task aims to predict future medical events or health status evolution based on a patient's past historical records. Accurate predictions can provide decision support for clinicians, enabling early disease warnings and personalized interventions. However, the inherent complexity of EHR data presents a dual challenge to health trajectory prediction models: Firstly, a patient's health trajectory is a process involving long-term temporal dependencies and complex structural associations. Long-term temporal patterns exist between different visits, while within a single visit, complex co-occurrence and logical relationships exist among various events such as diagnosis, examination, and medication. Existing methods struggle to model this intertwined spatiotemporal dependency in a unified and precise manner. Secondly, EHR data naturally possesses multimodal and heterogeneous characteristics, and due to the discreteness of medical behaviors, the data often suffers from high-dimensional sparsity. Furthermore, potential omissions and encoding inconsistencies during the recording process further increase the difficulty of constructing high-quality patient representations.

[0004] Currently, mainstream health trajectory prediction methods can be divided into three categories: models based on recurrent neural networks (RNNs) and their variants, which are good at capturing the temporal dependence of medical visit sequences, but are difficult to model the complex structural relationships within and across medical visits; methods based on graph neural networks (GNNs), which can capture structural associations by constructing patient medical maps, but static maps are difficult to effectively represent the dynamic temporal evolution of patient states; and methods based on temporal heterogeneous graphs, which introduce temporal edges to enhance temporal perception, still have significant shortcomings in how to deeply integrate temporal dynamics and topological structure, and how to efficiently integrate multimodal information.

[0005] In view of this, the present invention is proposed. Summary of the Invention

[0006] This invention aims to solve at least one of the above-mentioned technical problems and provides a health trajectory prediction method and system based on bi-branch collaborative learning. The method of this invention significantly outperforms existing mainstream methods in key indicators such as accuracy and recall across multiple prediction tasks. Furthermore, the bi-branch collaborative and adaptive fusion mechanism endows the model with better robustness, enabling it to maintain stable prediction performance even in the face of data noise or sparsity.

[0007] Compared with the prior art, the present invention has the following beneficial effects: The sequence-graph dual-branch collaborative architecture proposed in this invention fundamentally changes the limitations of a single modeling perspective. The sequence branch focuses on mining deep temporal evolution patterns in multimodal medical visit sequences, while the graph branch meticulously depicts the dynamic topological relationships between medical events. The two are fused through an adaptive mechanism to generate a high-quality dynamic representation that comprehensively reflects the patient's temporal evolution and structural relationships, laying a solid foundation for accurate prediction.

[0008] To address the multimodal, high-dimensional, and sparse characteristics of EHR data, this invention designs a hierarchical cross-modal bottleneck fusion mechanism in sequence branches. This mechanism, through a progressive process of "intramodal modeling - bottleneck alignment - sparse fusion," not only effectively captures contextual information within each modality but also achieves accurate alignment and fusion of key cross-modal semantics in a learnable and efficient manner, significantly improving the model's efficiency in understanding and utilizing complex medical information.

[0009] In the graph branch, this invention designs a heterogeneous graph neural network that integrates spatiotemporal coding. Through a time-aware edge weight control mechanism, the model can dynamically adjust the information propagation intensity based on the time interval between diagnostic and treatment events, thus better aligning with the clinical practice pattern that "recent events have a greater impact." By integrating spatial location coding with global and local information, the model can simultaneously grasp the overall structure and local context of the diagnostic and treatment path. This fine-grained spatiotemporal awareness enables the model to more accurately capture the trajectory of disease development. Attached Figure Description

[0010] Figure 1 A flowchart illustrating the health trajectory prediction method based on dual-branch collaborative learning provided in the first embodiment of the present invention; Figure 2 A model structure diagram of a health trajectory prediction method based on dual-branch collaborative learning provided in a preferred embodiment of the present invention; Figure 3 A schematic diagram of a hierarchical cross-modal bottleneck fusion mechanism provided in a preferred embodiment of the present invention; Figure 4 A schematic diagram of a Top-k sparse attention mechanism provided in a preferred embodiment of the present invention; Figure 5This is a schematic diagram of a spatiotemporal encoder structure provided in a preferred embodiment of the present invention; Figure 6 A schematic diagram of the structure of a health trajectory prediction system based on dual-branch collaborative learning provided in the second embodiment of the present invention; Figure 7 A schematic block diagram of an example electronic device provided for an embodiment of the present invention. Detailed Implementation

[0011] 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, and 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.

[0012] This invention provides a "sequence-graph" dual-branch collaborative learning framework for predicting health trajectories. Its core concept lies in moving away from using a single model (such as a pure sequence model or a pure graph model) to fit complex medical trajectories. Instead, it employs two clearly defined and complementary branches in parallel: one branch (the sequence branch) specializes in capturing the evolutionary patterns of multimodal medical events over time; the other branch (the graph branch) specializes in uncovering the intricate structural relationships between these events. Finally, an adaptive fusion mechanism combines the insights from both branches, thereby achieving a more comprehensive and accurate modeling and prediction of the patient's health status.

[0013] refer to Figure 1 , Figure 2 , Figure 1 This is a flowchart illustrating a health trajectory prediction method based on dual-branch collaborative learning. Figure 2 The diagram shows a model structure of a health trajectory prediction method based on two-branch collaborative learning, according to a preferred embodiment of the present invention. The first embodiment of the present invention provides a health trajectory prediction method based on two-branch collaborative learning, comprising the following steps: S101, Obtain the patient's electronic health record data, which includes various types of medical events.

[0014] The electronic health record data typically originates from hospital information systems, regional health information platforms, etc., and its collection and use must comply with relevant laws, regulations, and ethical standards to ensure patient privacy. After security processing such as de-identification and anonymization, it can be used for model training and prediction in this invention. The various types of medical events are the premise for this invention to process multimodal information, and typically include, but are not limited to: basic information, diagnostic information (such as ICD-10 codes), drug prescriptions (such as ATC codes), treatment procedures (such as ICD-9-CM codes), laboratory test results, vital sign measurements, and visit timestamps. These event types constitute different modalities.

[0015] This step is a standard data access procedure. It is typically performed by retrieving data from the hospital database through a secure data interface, or by loading anonymized research datasets. The acquired data should at least include the patient ID, event timestamp, event type, and event content.

[0016] In some preferred embodiments, to ensure data quality, a series of conventional preprocessing steps can be performed on the original data to improve data quality. For example, at least one of the following preprocessing steps may be included: (1) Data cleaning: cleaning outliers and missing values, and deleting patients with fewer than 2 medical records; (2) Discrete variable encoding: mapping discrete variables such as diagnosis, treatment, and drugs to continuous integer IDs and constructing a vocabulary; (3) Sorting the original medical records by patient and time: sorting multiple medical records in ascending order by patient ID and medical record timestamp to generate patient-level diagnosis and treatment sequences; (4) Calculating and normalizing the medical record time interval: calculating the time interval Δt (unit: days) between adjacent medical records and performing logarithmic normalization; (5) Dividing the dataset: randomly dividing the training set, validation set, and test set in a 7:1:2 ratio to ensure that all medical records of the same patient fall into the same subset. After the above preprocessing, a standardized EHR dataset that can be directly input into the model of this invention is obtained.

[0017] S102, Based on the electronic health record data, construct the time series of the patient's visits and the heterogeneous graph based on the visit trajectory.

[0018] This step transforms the raw, unstructured EHR data into two structured representations suitable for machine learning models: a sequence view emphasizing time series and a graph view emphasizing relationships.

[0019] Time series analysis refers to constructing a time-ordered sequence of medical visits for each patient, with each visit being represented as a set of multiple modal events (diagnosis, medication, etc.). Therefore, it is a composite sequence that is temporal in terms of medical visits and multimodal within a single visit.

[0020] A heterogeneous graph is a graph structure that contains multiple types of nodes (such as "visit" nodes, "diagnosis" nodes, and "medication" nodes) and multiple types of edges (such as "visit-include-diagnosis", "visit-use-medication", and "visit-include-treatment"). It can more accurately depict the complex relationships between medical entities.

[0021] Constructing time series is a common method in this field. The medical records of each patient are sorted by time and further organized into a structured sequence. Each medical visit is represented as a set containing multimodal events (diagnosis, medication, etc.), and finally a patient-level sequence is formed, i.e., time series.

[0022] Constructing heterogeneous graphs of patient visit trajectories is a common method in this field. Based on patient visit and event data from electronic health records, a heterogeneous graph is constructed to represent the relationships between entities. Node types are defined, such as "patient visit," "diagnosis," and "medication." Edge types and construction rules are defined, for example: if the diagnosis is Diagnosis... p Appeared during a visit q In the middle, then in Visit q Nodes and Diag p An "inclusion" edge is established between nodes; if two drugs appear together in a large number of visits, a "co-occurrence" edge can be established between their nodes. Visit timestamps can be used as attributes of nodes. This graph structure is a heterogeneous graph of visit trajectory, serving as the input for graph branching.

[0023] S103, the time series is input to the sequence branch, and the sequence branch is used to extract the sequence feature representation that characterizes the patient’s temporal evolution process.

[0024] This step aims to model the evolution of patient state from a temporal perspective. The core task is to capture and fuse long-term dependencies in multimodal information and output a feature vector with patient historical temporal information.

[0025] The sequence branch, the first branch in the dual-branch architecture of this invention, has the main advantage of handling serialized data. The sequence feature representation is a high-dimensional vector output by this branch that contains the patient's temporal evolution pattern.

[0026] The implementation basis of sequence branching is any deep learning model capable of processing sequence data. As is known to those skilled in the art, a typical implementation includes: (1) First, mapping each discrete medical event (such as diagnostic code ICD-10, drug code ATC) in the time series to a dense vector through an embedding layer. For each visit, the embedding vectors of all the events contained therein are aggregated (e.g., summed, averaged) to form a preliminary vector representation of the visit. (2) The vector sequence of the visit records ordered by time is input into a sequence encoder, which can be a recurrent neural network (RNN), long short-term memory network (LSTM), gated recurrent unit (GRU) or basic Transformer encoder, etc., which are well known in the art. The encoder captures the dependencies between events in the sequence through its internal mechanism. (3) Taking the output of the last time step of the sequence encoder, or performing global pooling (e.g., average pooling) on ​​the output of all time steps, to obtain the final sequence feature representation of the overall temporal evolution of the patient.

[0027] In some preferred embodiments, a cross-modal fusion step is performed in the sequence branch in order to fuse information from different medical modalities in the time series.

[0028] refer to Figure 3 , Figure 4 In some preferred embodiments, to further improve time alignment capabilities and reduce redundant modal interference, the cross-modal fusion step is implemented through a hierarchical cross-modal bottleneck fusion mechanism. This includes the following steps: performing temporal context encoding on the event sequence within each medical modality to obtain an intra-modal context representation; concatenating the intra-modal context representation of each modality with a learnable modality type embedding, and then concatenating this with a set of learnable bottleneck tokens to form a fusion input; processing the fusion input using a transform layer containing a Top-k sparse attention mechanism, and outputting the fused sequence feature representation by retaining only the first k attention connections with key semantic segments for each query token.

[0029] As a specific example, it includes: (1) Intramodal temporal modeling: Unlike the general approach of first aggregating events and then modeling the medical visit sequence, this preferred embodiment first performs fine modeling within the modality, fully modeling the local temporal dependencies in each medical modality. Event sequences of different modalities such as diagnosis, drugs and treatment are modeled separately, and context modeling is performed using an independent lightweight Transformer encoder, so that the model can first fully learn the contextual semantics of various events within their own modality, and obtain an intramodal context-enhanced representation H. (m) The formula is: , where X (m) Let m be the event sequence of the m-th modality.

[0030] (2) Cross-modal bottleneck fusion: At the most basic implementation level, this module can adopt the standard fully connected self-attention mechanism to enable global interaction of tokens from different modalities. However, in order to overcome the shortcomings of standard self-attention, such as high computational overhead and redundant interaction on long sequences, this invention introduces a Top-k sparse attention mechanism as an optimization. Specifically, it includes the following steps: a. Constructing fusion input: The representation H of each modal context is enhanced. (m) After being added to the corresponding learnable modality embeddings, the sequences are concatenated along the sequence length dimension. Simultaneously, a set of learnable bottleneck tokens is introduced and appended to the concatenated sequence as a mediator for cross-modal information interaction. b. Top-k Sparse Attention Fusion: A transformation layer incorporating a Top-k sparse attention mechanism is used to process the concatenated input. For each query vector, only the k highest attention scores with all key vectors are retained; scores at other positions are masked (set to extremely small negative values). Softmax normalization and weighted summation are then performed.

[0031] (3) Output: After passing through multiple bottleneck fusion layers, the state of the bottleneck token position, which represents global information, is taken as the final sequence feature representation. This representation not only includes temporal information but also deeply integrates precise cross-modal semantics.

[0032] This preferred embodiment provides a hierarchical cross-modal bottleneck fusion mechanism that achieves efficient medical time series modeling through a three-level mechanism. First, a lightweight Transformer is used to perform intra-modal context modeling of sequences such as diagnoses and medications, precisely capturing unimodal time series dependencies. Next, a set of learnable bottleneck vectors is introduced as a cross-modal shared semantic channel, replacing the fully connected computation in multi-head attention, reducing the amount of interactive computation and improving fusion efficiency. Finally, a Top-k sparse attention mechanism is introduced, retaining only the k most semantically relevant key segments in the cross-modal fusion stage, reducing the overall computational complexity from the original... Down to ,in This framework improves the modeling efficiency and expressive power of long-sequence medical data while ensuring the accuracy of semantic alignment between modalities.

[0033] S104, The heterogeneous graph is input to the graph branch, and the graph feature representation that characterizes the structural association between diagnostic and treatment events is extracted through the graph branch.

[0034] This step aims to model the complex relationships between diagnostic and treatment events from a structural perspective, and output a feature vector containing patient diagnosis and treatment topology information.

[0035] As a basic implementation method, graph branching can employ any neural network capable of processing graph-structured data. A typical implementation method includes: (1) Node initialization: Assigning initial feature vectors to various types of nodes in the heterogeneous graph. This can be done through random initialization, pre-trained embeddings, or intermediate features with rich semantics generated by the sequence branch during processing. (2) Graph neural network modeling: Inputting the heterogeneous graph into a graph neural network, such as a graph convolutional network (GCN), a graph attention network (GAT), or a model specifically designed for heterogeneous graphs (such as RGCN). This network encodes the local graph structure information of each node's representation through multi-layer message passing (aggregating neighbor node information) and node updates. (3) Feature extraction: For health trajectory prediction tasks, the feature vector of the last visit node corresponding to the target patient, updated by the GNN, is usually selected as the graph feature representation.

[0036] refer to Figure 5 Because existing methods neglect the clinical significance of visit intervals in temporal modeling and lack global structural awareness in spatial modeling, this invention proposes improvement strategies in both temporal and spatial dimensions to construct an encoder with stronger spatiotemporal awareness as a preferred implementation. Specifically, a spatiotemporal coding step is performed in the graph branch to enhance the heterogeneous graph's ability to model time intervals and spatial structures.

[0037] Regarding time encoding, existing health trajectory prediction methods mainly use Time2Vec and time mapping functions to process timestamp information, neglecting time intervals. Therefore, a preferred embodiment of this invention provides a time-aware edge weight control mechanism that integrates time interval information. This mechanism dynamically calculates edge weights based on the time intervals between connected nodes in the graph using a decay function, thereby strengthening the influence of nearby events in message propagation within heterogeneous graphs and improving the temporal modeling capability of health trajectory prediction.

[0038] Specifically, it includes the following steps: 1. Temporal Embedding Representation: For each node in the heterogeneous graph (representing a medical event, such as a diagnosis, medication, or treatment), a vectorized representation of its timestamp is generated to transform discrete, absolute timestamps into continuous, model-understandable feature vectors. The formula for calculating the timestamp is as follows: , where t v Indicates the timestamp of the event. For the corresponding time embedding vector, represent d A dimensional real vector; It is a generalizable temporal embedding function.

[0039] 2. Edge Weight Mechanism for Time Interval Regulation: This mechanism dynamically adjusts the intensity of information propagation in the graph using time intervals. The invention argues that medical events occurring close together typically have stronger relevance and propagation value, and therefore should be given higher weights in the information transmission of the graph neural network. Specifically, let the edges in the heterogeneous graph... Connect two time-correlated medical events, whose occurrence times are t and t, respectively. i With t j Then the time interval is This invention defines a time-aware weight w. e A function, w, is used to dynamically adjust the influence weight of an edge in the heterogeneous graph message passing process. e The calculation formula is as follows: The parameter λ can be a preset value or learned automatically during training. This weight represents a control factor that decays over time, allowing historical nodes closer to the current event to have a greater impact on information dissemination.

[0040] 3. Message passing mechanism for integrating time-aware weights: The time-aware weights w calculated above are... e This is integrated into a multi-head attention message-passing framework for heterogeneous graph neural networks. When aggregating node features, it simultaneously considers the feature similarity, relationship type, and temporal proximity of neighboring nodes. Specifically, a. For the node v at the t-th visit... t (Target node) and neighbor node e t Feature representation at layer l and Perform a linear transformation to obtain the query vector. and key vector The formula is: b. At the Эth attention head, calculate the neighbor node e t For medical treatment node v t The original attention score is multiplied by the time-aware weight w. e and event type modulation factor a t The formula is: ;in, Let the attention weight of the Эth attention head be... A learnable weight matrix related to medical event types. Represents a d×d dimensional real vector. Indicates the type of medical event (such as diagnosis, surgery, medication, etc.). for The transpose of the matrix. This attention mechanism not only considers the features of the nodes connected by the edges and the time points, but also explicitly introduces the time interval between events, thus more comprehensively reflecting the importance of the edges in the current diagnostic context. c. Softmax normalize the attention scores of all neighbors, and sum the features of the neighbors in a weighted manner to obtain the aggregated message. Then, fuse the aggregated message with the node's own features to obtain a new representation under this attention head. Finally, concatenate the outputs of all attention heads to form node v. t The updated representation at level l+1 .

[0041] This preferred implementation transforms abstract time intervals into operable graph edge weights and deeply embeds them into the core computation of heterogeneous graph neural networks. This enables the model not only to perceive the sequence of events but also to quantify the impact of "proximity" on the strength of association, thereby achieving a more refined and clinically accurate modeling of higher-order spatiotemporal dependencies in the diagnosis and treatment trajectory.

[0042] In terms of spatial coding, the preferred embodiment of this invention introduces global location coding on top of local location coding, and uses a multilayer perceptron (MLP) to fuse global and local location information, which is then concatenated into the initial feature representation of the consultation node, i.e., fused spatial coding. This location coding method effectively captures key structural features of metapaths such as diagnosis sequence, treatment path, and disease progression. Metapaths, such as diagnosis sequence and treatment path, are crucial for accurately predicting disease progression. Using this coding strategy, this invention can identify complex co-occurrence relationships between medical events and disease development trajectories, improving the predictive performance of patients' future health status.

[0043] The fusion spatial coding is used to generate a position representation for nodes in the graph that fuses a global position code based on the Laplacian matrix and a local structure code based on random walks, and then fuses the two into a unified enhanced node position representation through a multilayer perceptron. Specifically, it includes the following steps: 1. Construction of Medical Event Meta-Paths: Since heterogeneous diagnostic graphs contain various types of nodes and edges, directly calculating certain global or local attributes is complex. Therefore, this invention first introduces medical event meta-paths as semantic guidance. Meta-paths define an ordered sequence of node types. For example, to explore the associations between drug nodes, the following meta-path can be defined: , where N m N v N d These represent the Medication, Visit, and Diagnosis nodes, respectively, with "→" indicating a virtual edge connection. Based on the above meta-paths, a semantic adjacency matrix can be constructed between the Medication nodes. The adjacency matrix can be represented as: ,in, denoted by , represents the number of distinct drug nodes in the graph. This adjacency matrix has a non-zero value only when two drug nodes are connected on a given metapath; it encodes structural relationships under specific medical semantics.

[0044] 2. Global position encoding based on the eigenvectors of the Laplacian matrix: Based on the semantic adjacency matrix constructed above for specific node types (such as drug nodes). Calculate the corresponding (symmetric normalized) Laplacian matrix and extract its first Ь eigenvectors to represent the spatial location information of the nodes in the graph. For each node e in the graph, its global location encoding P(e) is defined as a Ь-dimensional vector composed of the elements corresponding to that node from these eigenvectors, as shown in the formula: ,in, Let P(e) represent the element corresponding to node e in the ψ-th eigenvector. This encoding P(e) can distinguish nodes in different connected components or distant regions of the graph.

[0045] 3. Local structure encoding based on the return probability of random walks: using the same semantic adjacency matrix. Calculate the 6-step random walk matrix In each step, the cumulative probability of self-connection of node e is extracted to form the local structure code S(e). The calculation formula is as follows: ,in, Let represent the diagonal element of node e during its random walk at step τ, reflecting the probability that the node returns to itself at that step.

[0046] By fusing the global location encoding P(e) and the local structure encoding S(e) mentioned above, the model can simultaneously consider global and local location information, which helps to improve the overall performance of the prediction task.

[0047] Specifically, for each node e, its global location encoding P(e) and local structure encoding S(e) are concatenated to form a fused vector. Subsequently, a multilayer perceptron (MLP) performs a nonlinear transformation and dimensionality reduction on this fused vector to generate a unified, low-dimensional augmented spatial location representation. Before inputting the node into the graph neural network, this augmented spatial location representation is added to or concatenated with the node's original feature representation (such as medical event embeddings or temporal embeddings) as the node's initial or additional features. This allows the model to perceive the rich and comprehensive spatial structural context of each node from the very first layer of message passing.

[0048] S105, the sequence feature representation and the graph feature representation are fused to obtain the fused patient state representation.

[0049] This step aims to synergistically integrate information from two complementary perspectives—temporal and structural—to form a more comprehensive and robust representation of the final patient status.

[0050] This step uses a trainable adaptive fusion parameter to perform a weighted summation of the predicted logical values ​​output by the sequence branch and the predicted logical values ​​output by the graph branch, resulting in a fused patient state representation.

[0051] Specifically, let the predicted logic value of the sequence branch output be logit. seq The predicted logical value of the graph branch output is logit. graph A trainable adaptive fusion parameter β is introduced (initial value can be set to 0.5). The final fusion prediction logistic value... The formula for the calculation process is as follows: (The result is obtained through weighted summation.) The parameter β is automatically learned through gradient descent during model training, thereby achieving dynamic fusion and complementary synergy between the two branches.

[0052] S106, Based on the fused patient state representation, predict the patient's future health trajectory.

[0053] This step performs the final prediction task, mapping the fused patient state representation to specific clinical prediction results.

[0054] The fused patient state representation obtained in S105 is input into a task-specific prediction layer, which is typically a fully connected neural network. For common multi-label diagnostic prediction tasks, the dimension of this output layer is equal to the total number of diagnostic categories C. Each output unit is activated by a sigmoid function and independently outputs a probability value between 0 and 1, representing the probability of the corresponding diagnosis occurring in the future.

[0055] During model training, to effectively optimize the multi-label diagnosis and treatment behavior prediction task, this invention employs a multi-label binary cross-entropy loss function based on logits (L). This function measures the deviation between the model's predicted probability and the true label in each label dimension, thereby guiding the model to learn a more accurate label distribution. BCE The formula is defined as follows: Where T represents the predicted sequence length, and σ(⋅) represents the sigmoid activation function. Indicates the true label, This represents the predicted value.

[0056] refer to Figure 6The second embodiment of the present invention provides a health trajectory prediction system 600 based on dual-branch collaborative learning, including: an acquisition module 601, a construction module 602, a first extraction module 603, a second extraction module 604, a fusion module 605, and a prediction module 606. The functions of each module are described below: The acquisition module 601 is used to acquire the patient's electronic health record data, which includes various types of medical events; The construction module 602 is used to construct a time series of patient visits and a heterogeneous graph based on the visit trajectory based on the electronic health record data. The first extraction module 603, as a sequence branch, is used to process the time series to extract sequence feature representations characterizing the patient's temporal evolution process; The second extraction module 604, as a graph branch, is used to process the heterogeneous graph to extract graph feature representations that characterize the structural relationships between diagnostic and treatment events; The fusion module 605 is used to fuse the sequence feature representation with the graph feature representation to obtain a fused patient state representation; The prediction module 606 is used to predict the patient's future health trajectory based on the fused patient state representation.

[0057] Based on the above embodiments, the present invention also provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps in the health trajectory prediction method based on dual-branch collaborative learning in the first embodiment.

[0058] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0059] like Figure 7As shown, the electronic device 700 may include a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. The RAM 703 may also store various programs and data required for the operation of the device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0060] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0061] The computing unit 701 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various methods and processes described above, such as a health trajectory prediction method based on two-branch co-learning or a method for predicting health trajectories based on two-branch co-learning. For example, in some embodiments, the health trajectory prediction method based on two-branch co-learning or the model training method for predicting health trajectories based on two-branch co-learning can be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program can be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by computing unit 701, one or more steps of the health trajectory prediction method based on two-branch co-learning or the model training method for health trajectory prediction based on two-branch co-learning described above can be performed. Alternatively, in other embodiments, computing unit 701 can be configured by any other suitable means (e.g., by means of firmware) to perform the health trajectory prediction method based on two-branch co-learning or the model training method for health trajectory prediction based on two-branch co-learning.

[0062] Based on the above embodiments, the present invention also provides a non-transitory computer-readable storage medium storing computer instructions, the computer instructions being used to cause the computer to execute the health trajectory prediction method based on dual-branch collaborative learning disclosed in the embodiments of the present invention.

[0063] Based on the above embodiments, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the health trajectory prediction method based on dual-branch collaborative learning disclosed in the embodiments of the present invention.

[0064] The computer program includes computer program code, which can be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.

[0065] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0066] In the several embodiments provided in this application, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.

[0067] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0068] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0069] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application.

[0070] The above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A health trajectory prediction method based on dual-branch collaborative learning, characterized in that, Includes the following steps: Acquire the patient's electronic health record data, which includes various types of medical events; Based on the electronic health record data, a time series of patient visits and a heterogeneous graph based on the visit trajectory are constructed. The time series is input into the sequence branch, and the sequence branch is used to extract sequence feature representations that characterize the patient's temporal evolution process; The heterogeneous graph is input into a graph branch, and graph feature representations characterizing the structural relationships between diagnostic and treatment events are extracted through the graph branch; The sequence feature representation and the graph feature representation are fused to obtain the fused patient state representation; Based on the fused patient status representation, the patient's future health trajectory is predicted.

2. The health trajectory prediction method based on dual-branch collaborative learning as described in claim 1, characterized in that, In the sequence branch, a cross-modal fusion step is performed to fuse information from different medical modalities in the time series.

3. The health trajectory prediction method based on dual-branch collaborative learning as described in claim 2, characterized in that, The cross-modal fusion step is implemented through a hierarchical cross-modal bottleneck fusion mechanism.

4. The health trajectory prediction method based on dual-branch collaborative learning as described in claim 3, characterized in that, The hierarchical cross-modal bottleneck fusion mechanism includes the following steps: Temporal context encoding is performed on the event sequence within each medical modality to obtain the intramodal context representation; The intramodal context representation of each modality is added to the learnable modality type embedding and then concatenated with a set of learnable bottleneck tokens to form a fused input; The fused input is processed by a transformation layer containing a Top-k sparse attention mechanism. By retaining only the first k attention connections with key semantic segments for each query token, the fused sequence feature representation is output.

5. The health trajectory prediction method based on dual-branch collaborative learning as described in claim 1, characterized in that, In the graph branch, a spatiotemporal coding step is performed to enhance the heterogeneous graph's ability to model time intervals and spatial structures.

6. The health trajectory prediction method based on dual-branch collaborative learning as described in claim 5, characterized in that, The spatiotemporal coding step includes time-aware edge weight control, which is used to dynamically calculate edge weights based on the time interval between connected nodes in the graph through a decay function, so as to enhance the influence of nearby events in message propagation in heterogeneous graphs.

7. The health trajectory prediction method based on dual-branch collaborative learning as described in claim 5 or 6, characterized in that, The spatiotemporal coding step includes fusion spatial coding, which generates a position representation for nodes in the graph that fuses a global position code based on the Laplacian matrix and a local structure code based on random walks, and then fuses the two into a unified enhanced node position representation through a multilayer perceptron.

8. The health trajectory prediction method based on dual-branch collaborative learning as described in claim 1, characterized in that, The sequence feature representation and the graph feature representation are fused together by using a trainable adaptive fusion parameter to perform a weighted summation of the predicted logical values ​​output by the sequence branch and the predicted logical values ​​output by the graph branch, thereby obtaining the fused patient state representation.

9. The health trajectory prediction method based on dual-branch collaborative learning as described in claim 1, characterized in that, Before constructing the time series of patient visits and the heterogeneous graph based on the visit trajectory, the method also includes a step of preprocessing the electronic health record data. The preprocessing includes: data cleaning, discrete variable encoding, sorting the original visit records by patient and time, calculating and normalizing the visit time interval, and partitioning the dataset, at least one of the following:

10. A health trajectory prediction system based on dual-branch collaborative learning, characterized in that, include: The acquisition module is used to acquire the patient's electronic health record data, which includes various types of medical events; The construction module is used to construct a time series of patient visits and a heterogeneous graph based on the visit trajectory based on the electronic health record data. The first extraction module, as a sequence branch, is used to process the time series to extract sequence feature representations characterizing the patient's temporal evolution process; The second extraction module, as a graph branch, is used to process the heterogeneous graph to extract graph feature representations that characterize the structural relationships between diagnostic and treatment events; The fusion module is used to fuse the sequence feature representation with the graph feature representation to obtain a fused patient state representation; The prediction module is used to predict the patient's future health trajectory based on the fused patient state representation.