Patient disease evolution relationship prediction method and system based on time series graph neural network

By integrating online and offline data using a time-series graph neural network approach, a time-series graph is constructed, which solves the problem of missing data in traditional methods, achieves more accurate prediction of disease evolution relationships, and improves the continuity and prediction accuracy of disease management.

CN120565117BActive Publication Date: 2026-01-02ZHEJIANG HONGZHEN YISHEN DATA TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510689217.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2026-01-02
Estimated Expiration
2045-05-27

AI Technical Summary

Technical Problem

In existing technologies, disease prediction methods based on traditional statistical models or simple machine learning ignore the dynamic changes of diseases over time and the complex interactions between diseases, resulting in data gaps and reduced prediction accuracy. In particular, when online drug purchases are not recorded, it is impossible to fully track the patient's treatment process.

Method used

This study employs a temporal graph neural network-based approach to integrate offline diagnostic data (hospital diagnoses, medical insurance payments, and pharmacy purchases) with online diagnostic data (internet hospitals and online drug purchases) to construct a temporal graph. By utilizing recurrent neural networks, long short-term memory networks, and graph convolutional networks, the study captures the dynamic characteristics of diseases over time and the interactions between diseases, thereby forming comprehensive medical record data information.

Benefits of technology

By integrating multi-source data, the integrity of treatment records is ensured, the continuity of disease management and the accuracy of prediction are improved, the clarity and predictive ability of disease evolution are enhanced, and disease process modeling is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120565117B_ABST
    Figure CN120565117B_ABST
Patent Text Reader

Abstract

The present application relates to the medical health information technology field, especially to a patient disease evolution relationship prediction method and system based on a time series graph neural network, comprising: step S01, obtaining offline diagnosis data and online diagnosis data, and establishing first medical record data information and second medical record data information based on the offline diagnosis data and the online diagnosis data; step S02, arranging the first medical record data information and the second medical record data information according to time sequence, obtaining comprehensive medical record data information, analyzing all medical record data, and obtaining target disease medical record data information to establish target disease medical record data information. The present application can fill in the "silent period" caused by a single data source by integrating offline diagnosis and online diagnosis, ensure the completeness of patient treatment records, and improve the continuity of disease management.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of medical health information, in particular to a patient disease evolution relationship prediction method and system based on a time series graph neural network. BACKGROUND

[0002] In the current medical health field, the prediction of the development path of a patient's disease is a key link in a clinical decision support system. The closest prior art to the present application is a disease prediction method based on a traditional statistical model or a simple machine learning method. These methods usually rely on static data in a patient's historical medical record, such as age, gender, and past medical history, to construct a prediction model. Although these methods can assist doctors in judging the development trend of a disease to some extent, they ignore the dynamic changes of a disease over time and the complex interaction between diseases. Specifically, the prior art has the following disadvantages.

[0003] In the prior art, the collection of patient historical medical record data has poor authenticity and effectiveness. With the popularization of online medical sales and the improvement of the public's medical knowledge, patients have more diversified channels to purchase medicine. Many patients may not directly purchase medicine in a hospital after being diagnosed in the hospital, but instead choose to purchase medicine in an offline pharmacy or obtain an electronic prescription through an online consultation platform and purchase medicine on an e-commerce platform.

[0004] If only the diagnosis and prescription data in a hospital are relied on to track the treatment process of a patient, there may be multiple "silent periods" in the treatment data, i.e., the actual medication of a patient cannot be completely recorded in the hospital system. This data loss will affect the continuity of disease management, and thus reduce the accuracy of a disease evolution prediction model trained based on diagnosis-treatment data.

[0005] Simply using an interpolation method to fill in these data gaps, although it can complete the information on the time axis, may introduce incorrect medication records, thus causing deviation in the learning of the development trend of a disease by the model and reducing the accuracy and reliability of the prediction. Therefore, how to effectively integrate multi-source data and construct complete medical record data information is an important research direction for improving the accuracy of a disease prediction model. SUMMARY

[0006] To solve the above problems, the present application provides a patient disease evolution relationship prediction method and system based on a time series graph neural network.

[0007] The present application adopts the following technical solution. The patient disease evolution relationship prediction method based on a time series graph neural network comprises:

[0008] Step S01, obtaining offline diagnosis data and online diagnosis data, and establishing first medical record data information and second medical record data information based on the offline diagnosis data and the online diagnosis data;

[0009] Step S02, arranging the first medical record data information and the second medical record data information in chronological order, obtaining comprehensive medical record data information, analyzing all medical record data, and obtaining medical record data information of a target disease to establish target disease medical record data information;

[0010] Step S03, constructing a time sequence diagram based on the target disease medical record data information;

[0011] Step S04, constructing a time sequence diagram neural network model based on a recurrent neural network or a long short-term memory network and a graph convolution network;

[0012] Step S05, training the time sequence diagram neural network model, inputting the current time sequence diagram of the patient into the trained time sequence diagram neural network model, and predicting the future node state.

[0013] As a further description of the above technical solution: the offline diagnosis data acquisition method is to analyze and obtain diagnosis information, medication records and time based on a medical insurance payment system, a pharmacy management system and a hospital prescription system, generate diagnosis-drug-time sequence data, and record it as first medical record data information;

[0014] The online diagnosis data acquisition method is to analyze and obtain diagnosis information, medication records and time based on an Internet hospital API and e-commerce platform order data, generate diagnosis-drug-time sequence data, and record it as second medical record data information.

[0015] As a further description of the above technical solution: the method for generating first medical record data information includes:

[0016] Step S001: obtaining patient diagnosis and medication records through a medical insurance payment system, wherein the diagnosis and medication records include diagnosis information, medication time and drug information; collecting diagnosis information and doctor-prescribed drug information through a hospital prescription system; and extracting patient ID, medication order, payment method and medication details through a pharmacy management system;

[0017] Step S002: data standardization processing, statistical field name, association, the field name includes: patient ID, diagnosis time, medication time, drug information and diagnosis information;

[0018] Step S013: data matching processing, by matching patient ID + purchase time + drug name, the medical insurance payment record is consistent with the pharmacy order; by matching patient ID + diagnosis information + drug name, ensure that the prescription and medical insurance payment record are consistent; when the time interval between the medical insurance payment time and the prescription time is within the preset interval days, it is considered as normal drug purchase behavior, and the medical insurance payment time is recorded as the purchase time; when the time interval between the medical insurance payment time and the prescription time exceeds the preset interval days, then through the matching of patient ID + prescription time + purchase order within the preset interval days, that is, considering whether the patient purchases drugs from the pharmacy at his own expense, without medical insurance in the hospital, the patient ID, purchase order, payment method and purchase details are extracted through the pharmacy management system to match;

[0019] Step S004: arrange the matched data in time sequence to form complete diagnosis-drug-time sequence data.

[0020] As a further description of the above technical solution: the second medical record data information acquisition method comprises:

[0021] Step P001: based on the internet hospital API, collect patient ID, online consultation record, electronic prescription and purchase record;

[0022] Obtain e-commerce platform order data, and parse the purchase list, purchase time and user ID mapping;

[0023] The user ID mapping is the account information, mobile phone number and delivery address;

[0024] Step P002: data association based on the ID of the patient and the mapping of the ID; for example, if the patient ID used is consistent, directly associate the online diagnosis and purchase data;

[0025] Step P003, data matching based on time window, the preset time window is 7 days, when the purchase list contains the same drug in the electronic prescription, the purchase list is associated with the online consultation record and the purchase time;

[0026] Step P004, arrange the data in time sequence to form a complete diagnosis-drug-time sequence, and generate the second medical record data information.

[0027] As a further description of the above technical solution: the method for constructing a time sequence diagram based on target disease medical record data information comprises:

[0028] Step 1, define the nodes in the time sequence diagram, the nodes include disease type node, test index value node and drug node;

[0029] Step 2, data preprocessing, preprocessing continuous data and discrete data in the constructed time sequence diagram;

[0030] Step 3, defining node features;

[0031] Step 4, defining edges in the timing diagram, obtaining the association between the disease and the test index value or the drug, drawing edges based on the association, and setting the weight according to medical knowledge or statistical data;

[0032] Step 5, based on the target disease medical record data information, adding time information to each node one by one.

[0033] As a further description of the above technical solution: the definition of node features includes:

[0034] For disease type nodes, encode features according to the patient's medical history, diagnosis time, and disease type;

[0035] For test index value nodes, encode features according to the patient's test results;

[0036] For drug nodes, encode features based on drug category, dosage, and frequency information.

[0037] As a further description of the above technical solution: the preprocessing method for continuous data and discrete data in the constructed timing diagram includes:

[0038] Normalizing continuous data in the constructed timing diagram to unify the value range; using one-hot encoding or embedding encoding to process discrete data.

[0039] The continuous data includes test index values;

[0040] The discrete data includes disease types and drug names.

[0041] As a further description of the above technical solution: the method of using one-hot encoding for discrete data includes:

[0042] Mapping each category to a binary vector, which is implemented by predefining n types, and each category is represented by a vector of length n, where only one position is 1 and the rest are 0.

[0043] The method of using embedding encoding for discrete data includes:

[0044] Mapping each category to a low-dimensional dense vector space, which is implemented by using an embedding matrix to embed the dimension w∈R n×d , where n is the number of categories and d is the embedding dimension, and each category is represented by a row of the matrix.

[0045] As a further description of the above technical solutions: the method for selecting the use of one-hot encoding or embedding encoding processing on the sub-type data includes:

[0046] Determine the sub-type data features that need to be encoded;

[0047] Count the number of categories of each sub-type feature, and preset a category number threshold;

[0048] When the number of categories is greater than the category number threshold, embedding encoding is selected, and when the number of categories is less than or equal to the category number threshold, one-hot encoding is selected.

[0049] As a further description of the above technical solutions: the method for training the time series graph neural network model includes:

[0050] Divide the time series graph data into multiple batches;

[0051] In each batch, a part of nodes and their associated data are selected for training;

[0052] For each batch of data, forward propagation, loss calculation, back propagation and parameter update are performed;

[0053] Iterate multiple times until a preset training round or validation set error convergence is reached to complete the training.

[0054] A patient disease evolution relationship prediction system based on a time series graph neural network, implements the patient disease evolution relationship prediction method based on the time series graph neural network, and the system includes:

[0055] A data extraction module acquires medical record data information from a historical electronic medical record system, and the medical record data information includes diagnosis records, test results and medication;

[0056] A time series graph construction module constructs a time series graph based on target disease medical record data information;

[0057] A model construction module constructs a time series graph neural network model based on a recurrent neural network or a long short-term memory network and a graph convolution network;

[0058] A data processing module trains the time series graph neural network model, inputs the current time series graph of a patient using the trained time series graph neural network model, and predicts the future node state.

[0059] Advantages:

[0060] The patient disease evolution relationship prediction method based on a time sequence graph neural network provided by the application can fill in the "silent period" caused by a single data source, ensure the completeness of the patient treatment record, improve the continuity of disease management, combine the first medical record data information and the second medical record data information, arrange the comprehensive medical record data information in chronological order, make the patient treatment path clearer, accurately reflect the evolution process of the disease, and help optimize the data-driven disease process modeling.

[0061] Further, by integrating a recurrent neural network or a long short-term memory network, the dynamic characteristics of the disease changing over time are accurately captured, the time sequence analysis capability is enhanced, the prediction accuracy is improved, the graph convolution network is used to process the graph structure data, the interaction and potential causal chain between diseases are comprehensively considered, the relationship modeling is deepened, and the interpretability and prediction capability of the model are enhanced. BRIEF DESCRIPTION OF DRAWINGS

[0062] The application will be further explained below in combination with the drawings and embodiments:

[0063] Figure 1 The flowchart of the patient disease evolution relationship prediction method based on a time sequence graph neural network provided by the application for the first embodiment is shown in the figure.

[0064] Figure 2 The flowchart of the method for constructing a time sequence graph provided by the application for the second embodiment is shown in the figure.

[0065] Figure 3 The flowchart of the method for constructing a time sequence graph neural network model provided by the application for the second embodiment is shown in the figure.

[0066] Figure 4 The module connection diagram of the patient disease evolution relationship prediction system based on a time sequence graph neural network provided by the application for the fourth embodiment is shown in the figure.

[0067] Figure 5 The knowledge graph for constructing a time sequence graph provided by the application for the second embodiment is shown in the figure. DETAILED DESCRIPTION

[0068] In order to make the technical means, creative features, purposes and effects realized by the application easy to understand, the application will be further described below in combination with specific drawings. It should be noted that the embodiments in the application and the features in the embodiments can be combined with each other without conflict.

[0069] Embodiment 1

[0070] Please refer to Figure 1The embodiment of the application provides a technical scheme: a patient disease evolution relationship prediction method based on a time sequence diagram neural network, comprising the following steps:

[0071] Step S01, offline diagnosis data and online diagnosis data are acquired, and first medical record data information and second medical record data information are established based on the offline diagnosis data and the online diagnosis data;

[0072] The offline diagnosis data acquisition method is that diagnosis information, medication records and time are analyzed and acquired based on a medical insurance payment system, a pharmacy management system and a hospital prescription system, diagnosis-drug-time sequence data is generated, and the diagnosis-drug-time sequence data is recorded as the first medical record data information;

[0073] It should be noted that the following defects exist in the existing data acquisition: the medical insurance system contains diagnosis information, but the purchase data may not be consistent with the hospital prescription; the pharmacy management system data records the purchase time, dose, treatment course and payment method, but does not contain diagnosis information; the hospital prescription system data includes the most detailed diagnosis information, which includes the prescription issued by the doctor, but there may be a time misalignment between the medical insurance payment time and the pharmacy purchase time;

[0074] The method for generating the first medical record data information comprises:

[0075] Step S001: acquiring patient diagnosis and purchase records through a medical insurance payment system, wherein the diagnosis and purchase records comprise diagnosis information, purchase time and drug information;

[0076] Through connection with a hospital prescription system, diagnosis information and drug information issued by a doctor are collected;

[0077] Through a pharmacy management system, patient ID, purchase order, payment method and purchase details are extracted;

[0078] Step S002: data standardization processing, statistical field name, association establishment, wherein the field name comprises patient ID, diagnosis time, purchase time, drug information and diagnosis information;

[0079] Specifically, the diagnosis time is the hospital prescription time, and the purchase time is the medical insurance payment time.

[0080] Step S003: data matching processing, matching through patient ID+purchase time+drug name, so that the medical insurance payment record is consistent with the pharmacy order;

[0081] Through patient ID+diagnosis information+drug name matching, it is ensured that the prescription and the medical insurance payment record are consistent;

[0082] When the time interval between the medical insurance payment time and the prescription time is within a preset interval of days, it is considered as normal purchase behavior, and the medical insurance payment time is recorded as the purchase time;

[0083] When the time interval between the medical insurance payment time and the prescription time exceeds the preset interval days, the patient ID + the preset interval days of the prescription time + the purchase order are matched, that is, whether the patient purchases the medicine from the pharmacy at his own expense is considered, and whether the patient purchases the medicine in the hospital through medical insurance is not considered, and the patient ID, the purchase order, the payment method, and the purchase details are extracted through the pharmacy management system for matching;

[0084] Step S004: The matched data is arranged in chronological order to form complete diagnosis-drug-time sequence data.

[0085] In this embodiment, by analyzing the medical insurance payment, pharmacy purchase, and hospital prescription data, the patient ID, time window, and drug information are matched, the data is arranged in chronological order, and the diagnosis-drug-time sequence is formed, which can monitor the medical insurance payment and pharmacy purchase data, determine whether the patient purchases the medicine according to the medical advice, identify whether the long-term chronic disease patient (such as diabetes and hypertension) discontinues the medicine due to forgetting or economic factors, and ensure the accuracy of the extracted data.

[0086] The online diagnosis data acquisition method is to obtain diagnosis information, medication records, and time based on Internet hospital API and e-commerce platform order data analysis, and generate diagnosis-drug-time sequence data, which is referred to as second medical record data information;

[0087] The second medical record data information acquisition method includes:

[0088] Step P001: Based on the Internet hospital API, the patient ID, online consultation record, electronic prescription, and purchase record are collected;

[0089] The e-commerce platform order data is obtained, and the purchase list, purchase time, and user ID mapping are parsed;

[0090] The user ID mapping is the account information, mobile phone number, and delivery address;

[0091] Step P002: Data correlation is performed based on the patient's ID and the mapping of the ID; for example, if the patient ID used is consistent, the online diagnosis and purchase data are directly associated;

[0092] Step P003, data matching is performed based on the time window, and the preset time window is 7 days. When the purchase list contains the same medicine in the electronic prescription, the purchase list is associated with the online consultation record and the purchase time;

[0093] Step P004, the data is arranged in chronological order to form a complete diagnosis-drug-time sequence, and the second medical record data information is generated;

[0094] Step S02, arranging the first medical record data information and the second medical record data information in chronological order to obtain comprehensive medical record data information, analyzing the comprehensive medical record data, and obtaining medical record data information of the target disease to establish target disease medical record data information;

[0095] The target disease is a disease for which the evolution relationship needs to be predicted, and the medical record data information of the target disease is all the medical record data information of the patient from the time of diagnosis of the disease to the present;

[0096] In this example, by integrating offline diagnosis (hospital diagnosis, medical insurance payment, pharmacy drug purchase) and online diagnosis (internet hospital, online drug purchase), the "silent period" caused by a single data source can be filled, the completeness of the patient's treatment record can be ensured, and the continuity of disease management can be improved. By combining the first medical record data information and the second medical record data information, the comprehensive medical record data information is arranged in chronological order, the patient's treatment path is clearer, the evolution process of the disease can be accurately reflected, and the disease process modeling based on data driving can be optimized.

[0097] Embodiment 2

[0098] This embodiment further includes, on the basis of the previous embodiment:

[0099] Step S03, constructing a time sequence diagram based on the target disease medical record data information;

[0100] Please refer to Figure 2 、 Figure 5 The method for constructing a time sequence diagram based on the target disease medical record data information includes:

[0101] Step 1, defining nodes in the time sequence diagram, the nodes including disease type nodes, inspection index value nodes, and drug nodes;

[0102] It should be noted that the disease type node represents various diseases of the patient (such as diabetes, hypertension, etc.); the inspection index value node represents the inspection data of the patient (such as blood glucose, blood pressure, heart rate, etc.); and the drug node represents the drugs used by the patient (such as insulin, antihypertensive drugs, etc.);

[0103] Step 2, data preprocessing, preprocessing continuous data and categorical data in the constructed time sequence diagram, which includes normalizing the continuous data in the constructed time sequence diagram to unify the value range, and using one-hot encoding or embedding encoding to process the categorical data;

[0104] Step 3, node feature definition;

[0105] For the disease type node, the disease type is encoded to generate features according to the patient's medical history and diagnosis time;

[0106] For example, diseases such as diabetes, hypertension, etc. can be mapped to feature vectors through one-hot encoding or obtain low-dimensional vector representation using embedding encoding.

[0107] For the test index value node feature, the feature is generated by encoding the test results (such as blood glucose, blood pressure, etc.) of the patient.

[0108] For example, the value of blood glucose can be normalized to a certain value and used as the feature of the test index value node.

[0109] Example: If the patient's blood glucose value is 6.5 mmol / L, the normalized value (e.g. 0.8) can be used as the node feature, or the index can be combined with the relevant historical test results to form a vector representation.

[0110] For the drug node, the feature is generated by encoding the category, dose and frequency information of the drug.

[0111] Example: If the patient is taking "insulin" and "hypotensive drugs", the corresponding drug node feature can be represented as [1, 0, 1, 0] or using an embedding vector.

[0112] Step 4, define the edges in the time sequence diagram, obtain the association between the disease and the test index value or the drug, draw the edges based on the association, and set the weight according to the medical knowledge or statistical data;

[0113] It should be noted that in the time sequence diagram, the weight of each edge represents the strength of the association between the two nodes.

[0114] The association includes: obtaining the association based on medical knowledge and obtaining the association based on statistical data;

[0115] Obtaining the association based on medical knowledge is to determine the possible association between the disease and the test index value, the drug by using existing medical knowledge base or clinical guidelines.

[0116] For example: Disease and test index: through clinical experience or medical literature, it is known that certain diseases are related to certain test indexes. For example, diabetes is highly related to blood glucose level, and hypertension is closely related to blood pressure level.

[0117] Disease and drug: certain diseases may have a direct therapeutic relationship with certain drugs, for example, diabetes usually needs insulin treatment, and hypertension often uses antihypertensive drugs;

[0118] Based on statistical data acquisition association is to find the actual association between diseases and test indicators, drugs through statistical analysis of medical record data, its specific method includes: through the co-occurrence information in the medical record data, the co-occurrence frequency of disease, test indicator and drug is analyzed. For example, the co-occurrence frequency of certain diseases and test indicators in medical records is checked, and then the potential association between them is inferred or: using statistical methods (such as Pearson correlation coefficient, Spearman rank correlation coefficient, etc.) to calculate the correlation between diseases and test indicators, drugs.

[0119] The method of setting weight according to medical knowledge is as follows:

[0120] When the association between a certain disease and a test indicator is clear in medicine (such as diabetes and blood glucose indicator), a larger weight (for example, 0.9 or 1.0) can be given to the edge.

[0121] When a certain drug is widely used to treat a specific disease (such as hypertension and antihypertensive drugs), a larger weight can be given to the edge.

[0122] The method of setting weight according to statistical data is as follows:

[0123] Through statistical analysis of the association strength of diseases and test indicators, drugs in medical record data, the weight of the edge is set. For example:

[0124] If disease A and test indicator B frequently appear together in medical record data, it indicates that there is a strong association between them, and the weight of the edge can be set to a higher value. For example, the frequency of co-occurrence of the two can be used as the basis for the weight.

[0125] If the correlation coefficient between disease and test indicator, drug is high, a higher weight is given. The weight size can be determined by calculating the Pearson correlation coefficient between disease node and test indicator value node. The higher the correlation coefficient, the greater the weight.

[0126] Step 5, based on the medical record data information of the target disease, time information is added to each node one by one.

[0127] Step S04, constructing a time series graph neural network model based on a recurrent neural network or a long short-term memory network and a graph convolution network;

[0128] Please refer to Figure 3 , the method of constructing a time series graph neural network model comprises:

[0129] An input layer is constructed, which includes a node feature input layer and a time series feature input layer;

[0130] It should be noted that the node feature input: the initial feature representation of each node comes from the coded representation of diagnosis records, test results or medication.

[0131] time series feature input, providing time series data (such as disease occurrence time, blood glucose change value, etc.) for each node at each time point;

[0132] time series feature modeling, extracting node features of each node at all time points t, using a recurrent neural network or a long short-term memory network to model the node features on the node, to obtain time series hidden features of each node at each time point;

[0133] graph structure learning, using a graph convolutional network to learn the time series graph at each time point t to capture the association between diseases;

[0134] The propagation formula of the graph convolutional layer is:

[0135] H (l+1) = σ (AH (l) W (l) ) ;

[0136] H (l) is the node feature of the lth layer, A is the adjacency matrix of the time series graph, W (l) is the weight matrix of the lth layer, and σ is an activation function (such as ReLU).

[0137] The output of the recurrent neural network or the long short-term memory network is fused with the node feature representation of the graph convolutional network to generate a comprehensive feature representation;

[0138] An output layer is constructed, and the fused comprehensive feature is input into one or more fully connected layers to generate the final prediction value of each node.

[0139] Step S05, training the time series graph neural network model, using the trained time series graph neural network model, inputting the current time series graph of the patient, and predicting the future node state.

[0140] Specifically, the node features are combined with the graph structure characteristics, the model can simultaneously capture the dynamic changes of time and the complex association between nodes, the RNN / LSTM is used to process the time series data, the dynamic changes of the node features over time are learned, the GCN is combined to capture the graph structure association between nodes, the potential relationship between diseases is mined, the fusion (splicing or weighted summation) of the comprehensive features realizes the unified representation of multi-dimensional information, and the adaptability of the model to complex heterogeneous data is enhanced.

[0141] In this embodiment, the complex disease association is captured by the time series graph neural network, the accuracy of disease state prediction is improved, the intuitive visual analysis helps doctors quickly understand the disease development path, optimizes the treatment plan, and realizes targeted diagnosis and treatment combined with the historical data of the patient.

[0142] Embodiment 3

[0143] Referring to Figure 1 The embodiment discloses a method for processing continuous data and discrete data in a constructed time series diagram, comprising:

[0144] Normalizing the continuous data in the constructed time series diagram to unify the value range, and using one-hot encoding or embedding encoding to process the discrete data;

[0145] The continuous data comprises test index values;

[0146] The discrete data comprises disease types and drug names.

[0147] It should be noted that, in order to eliminate dimensional differences and make the continuous data, such as test index values (blood sugar, blood pressure, etc.), in a unified numerical range, normalization is usually required;

[0148] The specific steps of the normalization processing are:

[0149] Linearly transforming the data to a specified range (usually [0, 1] or [-1, 1]) through a calculation formula;

[0150] The calculation formula is:

[0151] In the formula, x is the original data, min(x) and max(x) are the minimum value and the maximum value of the feature respectively, and x' is the normalized data.

[0152] The specific method for using one-hot encoding for the discrete data comprises:

[0153] Mapping each category to a binary vector; the implementation is that there are n preset types, and each category is represented by a vector with a length of n, wherein only one position is 1 and the rest are 0.

[0154] Example:

[0155] Disease types: {diabetes, hypertension, coronary heart disease}

[0156] Encoding result:

[0157] Diabetes -> [1, 0, 0]

[0158] Hypertension -> [0, 1, 0]

[0159] Coronary heart disease -> [0, 0, 1]

[0160] The specific method for using embedding encoding for the discrete data comprises:

[0161] Mapping each category to a low-dimensional dense vector space, and the implementation is that an embedding matrix is used to embed the dimension w∈Rn×d where n is the number of categories, d is the embedding dimension, and each category is represented by a certain row of the matrix.

[0162] Example:

[0163] Data feature: drug name (e.g. "aspirin", "ibuprofen", "penicillin").

[0164] Initial categories: assume there are 5000 different drugs.

[0165] Process:

[0166] Each drug is represented by a unique integer (index).

[0167] Embedding dimension is set to 64 (embedding matrix shape is 5000 x 64).

[0168] Output: each drug is represented as a 64-dimensional dense vector.

[0169] Example:

[0170] "aspirin" -> [0.12, -0.34, 0.56,...] (64 values in total)

[0171] "ibuprofen" -> [0.01, 0.23, -0.15,...] (64 values in total)

[0172] It should be noted that the method of selecting one-hot encoding or embedding encoding processing for categorical data includes:

[0173] Determine the categorical data features that need to be encoded (such as disease type, drug name, etc.);

[0174] Count the number of categories for each categorical feature and set a category number threshold;

[0175] When the number of categories is greater than the category number threshold, embedding encoding is selected, and when the number of categories is less than or equal to the category number threshold, one-hot encoding is selected.

[0176] Specifically, in this embodiment, by counting the number of categories for each categorical feature and setting a category number threshold, the selection of one-hot encoding or embedding encoding processing for categorical data is determined based on the category number threshold, which can fully express the data features and reduce the consumption of computing resources, thereby improving the modeling efficiency and effect, and continuous data and categorical data can be converted into numerical form suitable for model training, laying a good foundation for subsequent modeling.

[0177] Embodiment 3

[0178] The embodiment discloses a method for training a time series graph neural network model, comprising:

[0179] dividing the time series graph data into multiple batches;

[0180] In each batch, a part of nodes and their associated data are selected for training;

[0181] For each batch of data, forward propagation, loss calculation, back propagation and parameter update are performed;

[0182] Iterate multiple times until the preset training epoch or validation set error converges.

[0183] The forward propagation includes:

[0184] The node feature of each node is input to the recurrent neural network or long short-term memory network to obtain the time series hidden feature of each node at each time point;

[0185] At each time point, the time series graph is input to the graph convolution network to capture the complex association between diseases, denoted as graph feature;

[0186] The time series hidden feature and the graph feature are fused by splicing or weighted summation to generate a comprehensive feature representation;

[0187] The comprehensive feature passes through a fully connected layer to generate a predicted value for each node;

[0188] The loss calculation formula is mean square error;

[0189] The method of back propagation is to use the chain rule to calculate the gradient of the loss function with respect to the model parameters;

[0190] The method of parameter update is to use an optimization algorithm to update the parameters using the gradient:

[0191] Parameter update formula:

[0192] In the formula, θ is the model parameter, η is the learning rate, is the gradient of the loss function.

[0193] In this example, the large-scale time series graph data is divided into batches, reducing the single memory occupation and improving the training efficiency. Large-scale medical data sets or other complex graph data can be processed under limited hardware resources. The loss is calculated by mean square error (MSE), which is suitable for regression tasks or continuous value prediction, ensuring that the model optimization direction is clear. In disease severity prediction or index value trend prediction, it can reduce the prediction bias. An optimization algorithm (such as SGD, Adam) is used to dynamically update the model parameters combined with gradient information, ensuring that the training process converges quickly, adapting to complex data distribution, avoiding overfitting or gradient vanishing problem.

[0194] Example 4

[0195] Please refer to Figure 4 The embodiment discloses a patient disease evolution relationship prediction system based on a time sequence graph neural network, and implements a patient disease evolution relationship prediction method based on the time sequence graph neural network.

[0196] A data extraction module acquires medical record data information from a historical electronic medical record system, and the medical record data information includes diagnosis records, test results, and medication conditions.

[0197] A time sequence graph construction module constructs a time sequence graph based on target disease medical record data information.

[0198] A model construction module constructs a time sequence graph neural network model based on a recurrent neural network or a long short-term memory network and a graph convolution network.

[0199] A data processing module trains the time sequence graph neural network model, inputs a current time sequence graph of a patient into the trained time sequence graph neural network model, and predicts a future node state.

[0200] If the technical solution of the present disclosure involves personal information, the product applying the technical solution of the present disclosure has clearly informed the personal information processing rules before processing the personal information, and has obtained the personal independent consent. If the technical solution of the present disclosure involves sensitive personal information, the product applying the technical solution of the present disclosure has obtained the personal independent consent before processing the sensitive personal information, and at the same time meets the requirement of "explicit consent". For example, at the personal information collection device such as camera, a clear and prominent mark is set to inform that the personal information collection range has been entered, and the personal information will be collected. If the individual voluntarily enters the collection range, it is considered to agree to collect the personal information. Or, on the device for processing personal information, the personal information processing rules are informed by using obvious marks / information, and the personal authorization is obtained by means of pop-up information or asking the individual to upload the personal information. The personal information processing rules can include personal information processor, personal information processing purpose, processing method, and personal information type.

[0201] The basic principles, main features and advantages of the present application are shown and described above. It should be understood by those skilled in the art that the present application is not limited by the above examples, and the above examples and descriptions in the specification are only to illustrate the principles of the present application. Without departing from the spirit and scope of the present application, various changes and improvements can be made to the present application, and these changes and improvements all fall within the scope of the claimed present application. The scope of protection of the present application is defined by the appended claims and their equivalents.

Claims

1. A method for predicting patient disease evolution relationships based on temporal graph neural networks, characterized in that, include: Step S01: Obtain offline diagnostic data and online diagnostic data, and establish first medical record data information and second medical record data information based on offline diagnostic data and online diagnostic data; Step S02: Organize the first medical record data and the second medical record data in chronological order to obtain comprehensive medical record data. Analyze all medical record data to obtain medical record data for the target disease and establish medical record data for the target disease. Step S03: Construct a time series diagram based on the medical record data of the target disease; Step S04: Construct a temporal graph neural network model based on recurrent neural networks or long short-term memory networks and graph convolutional networks; Step S05: Train the time sequence graph neural network model, and use the trained time sequence graph neural network model to input the patient's current time sequence graph to predict the future node states. The offline diagnostic data collection method is to analyze and obtain diagnostic information, medication records and time based on the medical insurance payment system, pharmacy management system and hospital prescription system, and generate diagnostic-drug-time series data, which is recorded as the first medical record data information. The online diagnostic data collection method involves obtaining diagnostic information, medication records, and time based on the analysis of order data from Internet hospitals and e-commerce platforms, generating diagnostic-medication-time series data, which is recorded as the second medical record data information; Methods for generating first medical record data include: Step S001: Obtain the patient's diagnosis and medication purchase records through the medical insurance payment system. The diagnosis and medication purchase records include diagnosis information, purchase time, and drug information. Collect the diagnosis information and the drug information prescribed by the doctor by connecting to the hospital prescription system. Extract the patient ID, medication order, payment method, and medication purchase details through the pharmacy management system. Step S002: Data standardization processing, statistical field names, and establishment of associations. The field names include: Patient ID, diagnosis time, medication purchase time, medication information, and diagnosis information. Step S003: Data matching processing. This involves matching patient ID + purchase time + drug name to ensure consistency between medical insurance payment records and pharmacy orders; matching patient ID + diagnosis information + drug name to ensure consistency between prescriptions and medical insurance payment records; when the time interval between medical insurance payment time and prescription time is within a preset interval of days, it is considered a normal purchase, and the medical insurance payment time is recorded as the purchase time; when the time interval exceeds the preset interval of days, matching is performed using patient ID + the preset interval of prescription time + purchase order. The pharmacy management system extracts patient ID, purchase order, payment method, and purchase details for matching. Step S004: Arrange the matched data in chronological order to form complete diagnosis-drug-time series data; Methods for obtaining second medical record data include: Step P001: Collect patient ID, online consultation records, electronic prescriptions, and medication purchase records based on the Internet Hospital API; Obtain order data from e-commerce platforms and parse out the medicine purchase list, purchase time, and user ID mapping; The user ID mapping is account information, mobile phone number, and delivery address; Step P002: Perform data association based on patient ID and ID mapping; Step P003: Data matching is performed based on the time window. If the purchase list contains the same medicine in the electronic prescription, the purchase list is associated with the online consultation record and the purchase time. Step P004: Organize the data in chronological order to form a complete diagnosis-medication-time series and generate the second medical record data information.

2. The patient disease evolution relationship prediction method based on temporal graph neural network according to claim 1, characterized in that, The method for constructing a time series diagram based on target disease medical record data includes: Step 1: Define the nodes in the time sequence graph, including disease type nodes, test indicator value nodes, and drug nodes; Step 2, data preprocessing: preprocess the continuous data and categorical data in the constructed time series diagram; Step 3, define node characteristics; Step 4: Define the edges in the time series graph, obtain the association between the disease and the test index value or drug, draw the edges based on the association, and set the weights according to medical knowledge or statistical data. Step 5: Based on the target disease medical record data, add time information to each node one by one.

3. The patient disease evolution relationship prediction method based on time-series graph neural network according to claim 2, characterized in that, The defined node features include: For disease type nodes, features are generated by encoding based on the patient's medical history, diagnosis time, and disease type. For test indicator value nodes, features are generated by encoding based on the patient's test results; For drug nodes, features are generated by encoding based on drug category, dosage, and frequency information.

4. The patient disease evolution relationship prediction method based on temporal graph neural network according to claim 2, characterized in that, The method for preprocessing continuous and categorical data in the constructed time series graph includes: Continuous data in the constructed time series graph is normalized to ensure a uniform value range; categorical data is processed using one-hot encoding or embedded encoding. The continuous data includes test index values; The categorized data includes disease type and drug name.

5. The patient disease evolution relationship prediction method based on time-series graph neural network according to claim 4, characterized in that, The method for using one-hot encoding for the binary data includes: Each category is mapped to a binary vector. The implementation method is as follows: there are n preset types, and each category is represented by a vector of length n, where only one position is 1 and the rest are 0. The method of using embedding encoding for the dichotomous data includes: Map each category to a low-dimensional dense vector space; The methods for selecting one-hot encoding or embedded encoding for the categorized data include: Determine the categorized data characteristics that need to be encoded; Count the number of categories for each categorical feature, with a preset threshold for the number of categories; When the number of categories is greater than the category number threshold, embedded encoding is selected; when the number of categories is less than or equal to the category number threshold, one-hot encoding is selected.

6. The patient disease evolution relationship prediction method based on temporal graph neural network according to claim 1, characterized in that, The method for training the time-series graph neural network model includes: Divide the time series data into multiple batches; In each batch, a subset of nodes and their associated data are selected for training. For each batch of data, perform forward propagation, loss calculation, backpropagation, and parameter update; The training process is completed by iterating multiple times until the preset number of training rounds is reached or the error on the validation set converges.

7. A patient disease evolution relationship prediction system based on temporal graph neural networks, characterized in that, The system implementing the patient disease evolution relationship prediction method based on temporal graph neural networks according to any one of claims 1-6 includes: The data extraction module retrieves medical record data from the historical electronic medical record system. The medical record data includes diagnostic records, test results, and medication information. The time series diagram construction module constructs a time series diagram based on the target disease's medical record data. The model building module constructs temporal graph neural network models based on recurrent neural networks, long short-term memory networks, and graph convolutional networks. The data processing module trains the time series neural network model, and uses the trained time series neural network model to predict the future node states by inputting the patient's current time series graph.

Citation Information

Patent Citations

  • Risk prediction method and device, equipment and storage medium

    CN114255872A

  • Data processing method and device, equipment and storage medium

    CN114613495A