A disease prediction method, device, equipment and medium
By constructing co-occurrence and heterogeneous relationship graphs and combining them with an improved GRU model, the problem of low disease prediction accuracy was solved, and accurate prediction of patients' health status was achieved.
Patent Information
- Application Number
- CN202310767378.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-27
- Publication Date
- 2026-11-06
- Estimated Expiration
- 2043-06-27
AI Technical Summary
Existing disease prediction technologies fail to capture a comprehensive patient profile, resulting in low accuracy in disease prediction.
By constructing co-occurrence and heterogeneous relationship graphs, a complete representation matrix of medical codes in electronic health record data is obtained. An improved GRU model is then used to process patient medical records, and the representations of diagnosis, surgery, and drug codes are integrated for disease prediction.
It significantly improves the accuracy of disease prediction, accurately represents medical codes and captures the evolution patterns of patients' health status, and provides more precise disease prediction results.
Smart Images

Figure CN117059264B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of medical data technology, and in particular to a method, device, equipment and medium for disease prediction. Background Technology
[0002] Electronic health records, as a system for recording patient medical information, are widely used in medical institutions. They contain rich, multifaceted, and heterogeneous health information about patients, providing researchers with valuable data sources for predicting health events, such as demographic data, diagnostic data, surgical data, drug data, and textual data. Predicting future health status and disease progression based on patients' historical health data is a crucial issue in medical big data research. Various deep learning models have been designed to handle medical event prediction tasks and have achieved excellent performance, such as diagnostic prediction, specific disease risk prediction, in-hospital mortality risk prediction, and readmission prediction—clinically relevant applications. Good deep learning prediction models can promptly identify potential disease risks in patients, assist doctors in making clinical diagnostic decisions, develop personalized care plans in advance, prevent adverse events, and thus improve public health. However, current disease prediction technologies cannot obtain comprehensive patient data, resulting in low accuracy in disease prediction. Summary of the Invention
[0003] This application provides a disease prediction method, apparatus, device, and medium that can solve the problem of low accuracy in disease prediction.
[0004] In a first aspect, embodiments of this application provide a disease prediction method, which includes:
[0005] A co-occurrence graph is constructed based on medical codes in electronic health record data. The electronic health record data includes T visits from multiple patients, and each visit record includes multiple medical codes. Multiple nodes in the co-occurrence graph correspond one-to-one with multiple medical codes in the electronic health record data.
[0006] Based on the types of medical codes in electronic health record data, a heterogeneous relationship graph is constructed; multiple nodes in the heterogeneous relationship graph correspond one-to-one with the medical codes in the electronic health record data.
[0007] The first final coding representation matrix of all medical codes in electronic health record data is obtained based on the co-occurrence relationship graph;
[0008] Obtain the second final coding representation matrix of all medical codes in electronic health record data based on heterogeneous relation graphs;
[0009] The first final coding representation matrix is optimized using the second final coding representation matrix to obtain the complete representation matrix of all medical codes in the electronic health record data;
[0010] Based on the complete representation matrix of medical codes, an improved GRU model is used to process the medical records of the patient to be predicted, and obtain the final representation of the patient at the Tth visit. The improved GRU model includes: a linear layer for obtaining the initial representation, diagnostic representation, surgical representation, and drug representation of the patient to be predicted; a GRU module for obtaining the hidden diagnostic representation of the patient based on the initial and diagnostic representations; a fusion module for fusing the hidden diagnostic representation, surgical representation, and drug representation to obtain the patient representation; and a temporal enhancement module for obtaining the final representation of the patient at the Tth visit based on the patient representation.
[0011] The disease prediction module is used to evaluate the patient's final presentation at the Tth visit, and the prediction result for the patient at the T+1th visit is obtained.
[0012] Secondly, one embodiment of this application provides a disease prediction device, comprising:
[0013] The co-occurrence graph module is used to construct a co-occurrence graph based on medical codes in electronic health record data. The electronic health record data includes T visits from multiple patients, and each visit record includes multiple medical codes. Multiple nodes in the co-occurrence graph correspond one-to-one with multiple medical codes in the electronic health record data.
[0014] The heterogeneous relationship graph module is used to construct a heterogeneous relationship graph based on the type of medical code in the electronic health record data; multiple nodes in the heterogeneous relationship graph correspond one-to-one with the medical codes in the electronic health record data;
[0015] The first acquisition module is used to acquire the first final coding representation matrix of all medical codes in the electronic health record data based on the co-occurrence relationship graph;
[0016] The second acquisition module is used to acquire the second final coding representation matrix of all medical codes in the electronic health record data based on the heterogeneous relationship graph;
[0017] The optimization module optimizes the first final encoding representation matrix using the second final encoding representation matrix to obtain a complete representation matrix of all medical codes in the electronic health record data;
[0018] The processing module is used to process the medical records of the patient to be predicted based on the complete representation matrix of medical codes, and obtain the final representation of the patient at the Tth visit. The improved GRU model includes: a linear layer for obtaining the initial representation, diagnostic representation, surgical representation and drug representation of the patient to be predicted; a GRU module for obtaining the hidden diagnostic representation of the patient based on the initial representation and diagnostic representation of the patient to be predicted; a fusion module for fusing the hidden diagnostic representation, surgical representation and drug representation of the patient to obtain the patient representation; and a temporal enhancement module for obtaining the final representation of the patient at the Tth visit of the patient to be predicted based on the patient representation.
[0019] The prediction module uses the disease prediction module to evaluate the patient's final presentation at the Tth visit, and obtains the prediction result for the patient at the T+1th visit.
[0020] Thirdly, embodiments of this application provide a terminal 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 disease prediction method described above.
[0021] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described disease prediction method.
[0022] The above-mentioned solution in this application has the following beneficial effects:
[0023] In the embodiments of this application, a co-occurrence relationship graph is constructed based on medical codes in electronic health record data, and a heterogeneous relationship graph is constructed based on the types of medical codes in electronic health record data. Then, a first final coding representation matrix of all medical codes in electronic health record data is obtained based on the co-occurrence relationship graph, and a second final coding representation matrix of all medical codes in electronic health record data is obtained based on the heterogeneous relationship graph. The first final coding representation matrix is then optimized using the second final coding representation matrix to obtain a complete representation matrix of all medical codes in electronic health record data. Then, based on the complete representation matrix of medical codes, the medical records of the patient to be predicted are processed using an improved GRU model to obtain the final representation of the patient at the Tth visit. Finally, the final representation of the patient at the Tth visit is evaluated using a disease prediction module to obtain the prediction result of the patient at the T+1th visit. Among them, constructing a co-occurrence relationship graph can represent the relationship between medical codes at the same level, while constructing a heterogeneous relationship graph can represent the relationship between medical codes at different levels and between different levels. Optimizing the co-occurrence relationship graph using the heterogeneous relationship graph can enhance its completeness and accuracy. The resulting complete representation matrix of all medical codes contains complete medical information and can accurately represent medical codes. The improved GRU model can fuse other types of code representations based on the correlation between diagnostic code representation and other types of codes, and model the evolution pattern of patient health status in a fine-grained manner through perceptual differences, thereby obtaining an accurate final patient representation. Disease prediction is then performed using this final patient representation, thus significantly improving the accuracy of disease prediction.
[0024] Other beneficial effects of this application will be described in detail in the following detailed description section. Attached Figure Description
[0025] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0026] Figure 1 A flowchart of a disease prediction method provided in an embodiment of this application;
[0027] Figure 2 This is a schematic diagram of the structure of a hierarchical graph convolutional neural network module provided in an embodiment of this application;
[0028] Figure 3 A schematic diagram of the structure of an improved GRU model provided in an embodiment of this application;
[0029] Figure 4 This is a structural block diagram of a disease prediction system provided in one embodiment of this application. Detailed Implementation
[0030] In the following description, specific details such as particular system architectures and techniques are set forth for illustrative purposes and not for limitation, so as to provide a thorough understanding of the embodiments of this application. In other instances, detailed descriptions of well-known systems, apparatuses, circuits, and methods are omitted so as not to obscure the description of this application with unnecessary detail.
[0031] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, phrases such as "in one embodiment," "in some embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.
[0032] The disease prediction method provided in this application will be described exemplarily below.
[0033] like Figure 1 As shown, the disease prediction method provided in this application includes the following steps:
[0034] Step 11: Construct a co-occurrence relationship graph based on medical codes in electronic health record data.
[0035] The aforementioned electronic health record data includes T visits from multiple patients. Each visit record contains multiple medical codes. Multiple nodes in the co-occurrence graph correspond one-to-one with multiple medical codes in the electronic health record data. The types of medical codes in the electronic health record data include diagnosis codes, surgical codes, and drug codes.
[0036] Specifically, for any patient n, v n Let n be the set of patient n's medical records. This represents the medical record of patient n's first visit. This refers to the medical record of patient n's second visit. Let C represent the medical record of patient n's Tth visit. Let C represent the set of all medical codes, C = {c1, c2, ..., c...} |C|} represents the set of all medical codes, where c1 represents the first medical code, c2 represents the second medical code, and c... |C| Let C represent the |C|th medical code. All medical codes in the medical record are included in the set C of all medical codes. Medical codes include diagnostic codes, surgical codes, and drug codes. For diagnostic codes... dd =d1,d2,...,d D ,|d D | indicates the total number of diagnostic codes, for surgical codes p p =p1,p2,...,p Y ,|p Y | represents the total number of surgical codes, and for drug codes... m m =m1,m2,...,m M ,|m M | represents the total number of drug codes, |C| = |d D |+|p Y |+|m M |
[0037] In some embodiments of this application, a co-occurrence graph can be constructed through the following steps:
[0038] The first step is through the formula:
[0039]
[0040] Calculate the medical code c in electronic health record data j For medical coding c i Influence weight A ij .
[0041] in, This indicates that in electronic health record data, under relation r, there is a relationship with medical code c. i The sum of the frequencies of all medical codes that co-occur, where r is any one of six relationships: relationship between diagnostic codes, relationship between diagnostic codes and surgical codes, relationship between diagnostic codes and drug codes, relationship between surgical codes and surgical codes, relationship between surgical codes and drug codes, and relationship between drug codes and drug codes. This indicates that under relation r, there is a medical code c. i The medical code set that appears together, B ij Represents medical code c i With medical code c j The number of times it appears in all medical records, and the medical code c i With medical code c j If B appears in the t-th visit record of the nth patient, then B ijThe value is incremented by 1, n = 1, 2, ..., U, where U represents the total number of patients, t = 1, 2, ..., T, where T represents the Tth visit record, j = 1, 2, ..., C, i = 1, 2, ..., C, and |C| represents the total number of medical codes.
[0042] For example, the relationship between the above diagnostic codes is as follows: Diagnostic Code With diagnostic codes The relationship between the above diagnostic codes and surgical codes is as follows: Diagnostic Code With surgical code The relationship between the above diagnostic codes and drug codes is as follows: Diagnostic Code Drug coding The relationship between the above surgical codes is as follows: Surgical Code With surgical code The relationship between the above surgical codes and drug codes is as follows: Surgical Code Drug coding The relationship between the above drug codes is as follows: Drug Code Drug coding The relationship between them.
[0043] The second step is to construct a co-occurrence adjacency matrix A based on all the calculated influence weights.
[0044] A co-occurrence relation graph is constructed based on the co-occurrence adjacency matrix; multiple nodes in the co-occurrence relation graph correspond one-to-one with multiple medical codes in the electronic health record data, and the edge between each two nodes in the co-occurrence relation graph is used to represent the influence weight between the corresponding two medical codes.
[0045] It should be noted that the influence weight between medical code pairs reflects the relationship between them. The stronger the relationship between medical code pairs, the greater the influence weight value. If there is no relationship between medical code pairs, the influence weight value is 0.
[0046] It is worth mentioning that constructing a co-occurrence relationship diagram for medical codes in electronic health record data can represent the relationship between medical codes of the same type and between different types of medical codes at the same level.
[0047] Step 12: Construct a heterogeneous relationship graph based on the types of medical codes in the electronic health record data.
[0048] The nodes in the above heterogeneous relationship diagram correspond one-to-one with the medical codes in the electronic health record data. The types of medical codes in the electronic health record data include diagnosis codes, surgical codes, and drug codes.
[0049] In some embodiments of this application, a diagnostic code representation matrix, a surgical code representation matrix, and a drug code representation matrix can be calculated based on the type of medical code in the electronic health record data. Then, a diagnostic adjacency matrix for the diagnostic code, a surgical adjacency matrix for the surgical code, and a drug adjacency matrix for the drug code are calculated. Finally, the diagnostic adjacency matrix, the surgical adjacency matrix, and the drug adjacency matrix are concatenated to obtain a heterogeneous adjacency matrix. A heterogeneous relationship graph is then constructed based on the heterogeneous adjacency matrix.
[0050] It is worth mentioning that the heterogeneous relationship diagram constructed based on the types of medical codes in electronic health record data can represent the relationships between medical codes of the same type, as well as between different types of medical codes at the same and different levels.
[0051] Step 13: Obtain the first final coding representation matrix of all medical codes in the electronic health record data based on the co-occurrence relationship graph.
[0052] In some embodiments of this application, a first relation-specific representation of medical codes can be obtained based on a co-occurrence relation graph using a hierarchical graph convolutional neural network module. Then, the first relation-specific representation of medical codes can be aggregated using importance scores to obtain the first final encoding representation of medical codes. Finally, the first final encoding representations of all medical codes can be integrated into the same matrix to obtain the first final encoding representation matrix of all medical codes.
[0053] It is worth mentioning that the co-occurrence relationship graph can represent the relationship between medical codes of the same type and between medical codes of different types at the same level. The first final coding representation matrix obtained based on the co-occurrence relationship graph can facilitate subsequent calculations.
[0054] Step 14: Obtain the second final coding representation matrix of all medical codes in the electronic health record data based on the heterogeneous relationship graph.
[0055] In some embodiments of this application, a second relation-specific representation of medical codes can be obtained based on a heterogeneous relation graph using a hierarchical graph convolutional neural network module. Then, the second relation-specific representation of medical codes can be aggregated using importance scores to obtain the second final encoding representation of medical codes. Finally, the second final encoding representations of all medical codes can be integrated into the same matrix to obtain the second final encoding representation matrix of all medical codes.
[0056] It is worth mentioning that the heterogeneous relationship graph can represent the relationship between medical codes of the same type, as well as between medical codes of different types, at the same level and at different levels. The second final coding representation matrix obtained based on the heterogeneous relationship graph can facilitate subsequent calculations.
[0057] Step 15: Optimize the first final encoding representation matrix using the second final encoding representation matrix to obtain the complete representation matrix of all medical codes in the electronic health record data.
[0058] In co-occurrence graphs and heterogeneous graphs, the encoding is the same but the information contained in the graphs is different. In some embodiments of this application, the information contained in co-occurrence graphs and heterogeneous graphs can be integrated using the cross-graph comparison loss method.
[0059] In some embodiments of this application, the complete representation matrix described above can be obtained through the following steps:
[0060] Step 1, using the formula:
[0061]
[0062] Calculate the first final encoded representation matrix With the second final encoding representation matrix Loss values between The heterogeneous relationship graph is then backpropagated based on the loss value to obtain the updated heterogeneous relationship graph.
[0063] in, Indicates medical code c i The first final encoding representation, Indicates medical code c i The second final encoding representation, Indicates medical code c k The second final encoding is represented as follows: i = 1, 2, ..., C, k ∈ (1, 2, ..., C), k ≠ i, |C| represents the total number of medical codes, s(·,·) represents the cosine similarity function, and t represents the temperature parameter.
[0064] Specifically, the heterogeneous graph is backpropagated based on the loss value to update the elements in the heterogeneous adjacency matrix, resulting in the updated heterogeneous graph.
[0065] Step 2: Iterate through the updated heterogeneous relation graph to obtain the iterated heterogeneous adjacency matrix. And calculate the second final encoding representation matrix after iteration.
[0066] Determine if the preset number of iterations has been reached. If not, use the iterated heterogeneous relation graph as the new heterogeneous relation graph and return to iterate over the updated graph to obtain the iterated heterogeneous adjacency matrix. And calculate the second final encoding representation matrix after iteration. Steps;
[0067] When the preset number of iterations is reached, the co-occurrence adjacency matrix A is optimized using the following formula:
[0068]
[0069] The optimized co-occurrence adjacency matrix A' is obtained, and the optimized first final encoding representation matrix is calculated. Where β represents a preset parameter.
[0070] Determine whether the number of optimizations has reached the preset total number of optimizations. If the number of optimizations has not reached the preset total number of optimizations, update the first final encoding representation matrix according to the optimized co-occurrence adjacency matrix, and use the updated first final encoding representation matrix as the first final encoding representation matrix. The iteratively obtained second final encoding representation matrix is used as the second final encoding representation matrix. Return to the execution and calculate the first final encoded representation matrix using the formula. With the second final encoding representation matrix Loss values between The process involves backpropagating the heterogeneous graph based on the loss value to obtain the updated heterogeneous graph, incrementing the optimization count and the iteration count by 1. If the optimization count reaches the preset total number of optimizations, the optimized first final encoding representation matrix is then... X° is the complete representation matrix of all medical codes in electronic health record data.
[0071] For example, the loss value between the first and second final encoding representation matrices is calculated using a formula. Backpropagation is then performed on the heterogeneous relation graph based on this loss value to obtain an updated heterogeneous relation graph. The updated heterogeneous relation graph is then iterated to obtain an iterated heterogeneous adjacency matrix, and the iterated second final encoding representation matrix is calculated. If the iteration round is 1 at this point (the preset iteration round is 10), and the preset iteration round has not been reached, the iterated heterogeneous relation graph is used as the updated heterogeneous relation graph, and the process returns to iterating on the updated heterogeneous relation graph to obtain the iterated heterogeneous adjacency matrix and calculating the iterated second final encoding representation matrix. The iteration round is incremented by 1 until the iteration round reaches 10. When the iteration round reaches 10, the co-occurrence relation adjacency matrix is optimized using a formula to obtain an optimized co-occurrence adjacency matrix, and the optimized... If the optimization count is 1 at this point, and the preset optimization count is 5, and the optimization count has not reached the preset optimization count, then the first final encoding representation matrix is updated according to the optimized co-occurrence adjacency matrix. The optimized first final encoding representation matrix is used as the first final encoding representation matrix, and the second final encoding representation matrix after 10 iterations is used as the second final encoding representation matrix. Then, the process returns to the step of calculating the loss value between the first and second final encoding representation matrices using the formula, and performing backpropagation on the heterogeneous relationship graph based on the loss value to obtain the updated heterogeneous relationship graph. The optimization count is incremented by 1, and the iteration round is incremented by 1. At this point, the optimization count is 1, and the iteration round is 11, until the optimization count is 5 and the iteration round is 15. Then, the first final encoding representation matrix after 5 optimizations is used as the complete representation matrix of all medical codes in the electronic health record data.
[0072] It should be noted that during the multiple optimization processes, the loss value gradually decreases, the influence weight of the noise edges in the co-occurrence graph gradually decreases, hidden edges begin to appear, and finally a complete representation matrix of all medical codes containing information from the co-occurrence graph and the heterogeneous graph is obtained.
[0073] It is worth mentioning that optimizing the co-occurrence relationship graph using a heterogeneous relationship graph can enhance the completeness and correctness of the co-occurrence relationship graph. The resulting complete representation matrix of all medical codes contains complete medical information and can accurately represent the medical codes.
[0074] Step 16: Based on the complete representation matrix of medical codes, the medical records of the patient to be predicted are processed using an improved GRU model to obtain the final representation of the patient at the Tth visit.
[0075] The improved recurrent neural network (GRU) model described above includes: a linear layer for obtaining the initial representation, diagnostic representation, surgical representation, and drug representation of the patient to be predicted; a GRU module (i.e., a traditional GRU module) for obtaining the hidden diagnostic representation of the patient based on the initial and diagnostic representations of the patient to be predicted; a fusion module for fusing the hidden diagnostic representation, surgical representation, and drug representation of the patient to obtain the patient representation; and a temporal enhancement module for obtaining the final patient representation at the Tth visit of the patient to be predicted based on the patient representation.
[0076] In some embodiments of this application, an improved GRU model can be used to obtain the final patient representation of the patient to be predicted. A linear layer processes the demographic information of the patient to be predicted to obtain an initial representation. The complete representation matrix of all medical codes in the electronic health record data is used to obtain the diagnostic representation, surgical representation, and medication representation of the patient to be predicted. The GRU module calculates the hidden diagnostic representation of the patient to be predicted. A task-specific integration gate in the fusion module is used to fuse the patient representation based on the correlation between the hidden diagnostic representation, surgical representation, and medication representation of the patient to obtain the final patient representation. Finally, a difference-aware gate in the temporal enhancement module is used to calculate the patient representation of the patient to obtain the difference representation of the patient to be predicted, thus modeling the evolution pattern of the patient's health status in a fine-grained manner.
[0077] It is worth mentioning that the improved GRU model can obtain an accurate final patient representation. The task-specific integration gate in the fusion module can fuse the information of the patient to be predicted to obtain a comprehensive and accurate patient representation. The difference-aware gate in the temporal enhancement module can capture the temporal dynamic development in the electronic health record data of the patient to be predicted with fine granularity, thereby improving the accuracy of the final patient representation.
[0078] Step 17: Use the disease prediction module to evaluate the patient's final presentation at the Tth visit to obtain the prediction result for the patient at the T+1th visit.
[0079] In some embodiments of this application, the disease prediction module described above can be a commonly used prediction classifier as follows:
[0080]
[0081] in, W represents the predicted outcome for patient u at their (T+1)th visit. o and b o Both represent learnable parameters, pu Let represent the final patient representation of the patient u at the Tth visit, and sigmoid() represent the activation function.
[0082] During the training of the prediction classifier, cross-entropy loss can be used as the loss function for backpropagation parameter updates.
[0083] The above prediction results are used to indicate the diagnostic recommendations for the patient at the T+1th visit, such as the probability of having a certain disease and whether to take a certain treatment measure.
[0084] It is worth mentioning that constructing a co-occurrence relationship graph can represent the relationships between medical codes at the same level, while constructing a heterogeneous relationship graph can represent the relationships between medical codes at different levels and within the same level. Optimizing the co-occurrence relationship graph using a heterogeneous relationship graph can enhance its completeness and accuracy. The resulting complete representation matrix of all medical codes contains complete medical information and can accurately represent the medical codes. The improved GRU model can fuse other types of code representations based on the correlation between diagnostic code representations and other types of codes, and model the evolution pattern of patient health status in a fine-grained manner through perceptual differences, thereby obtaining an accurate final patient representation. Using this final patient representation for disease prediction, the accuracy of disease prediction is significantly improved.
[0085] The specific steps of step 12 described above will be illustrated below with reference to specific embodiments.
[0086] The medical ontology graph originates from recognized and authoritative medical information and has high reliability. However, the medical ontology graph can only represent the relationships between upper and lower layers, not the relationships between nodes within a layer. Based on the above medical ontology graph, in some embodiments of this application, the specific implementation process of step 12 includes:
[0087] Step 12.1: Calculate the diagnostic coding representation matrix.
[0088] In some embodiments of this application, the parent classification category of the medical ontology graph is used as a non-leaf node, and the diagnostic code is used as a leaf node to construct a diagnostic ontology graph.
[0089] In the direction from layer l to layer l-1, according to the formula:
[0090]
[0091] Update the parent classification node d in layer l-1 of the diagnostic ontology graph. f Node representation
[0092] in, This indicates the relationship between the parent classification node d in layer l and layer l-1.f The set of connected child nodes. This represents the diagnostic coding in layer l. The corresponding node representation is l = 2, ..., L, where L represents the total number of layers in the diagnostic ontology graph.
[0093] In the direction from layer l-1 to layer l, for the diagnostic coding in layer L The corresponding node is determined by the formula:
[0094]
[0095] Update diagnostic codes in layer L Representation of the corresponding node in, Diagnostic coding in layer L The set d consisting of the corresponding node and its ancestor nodes. d =d1,d2,...,d D ,|d D | indicates the total number of diagnostic codes. Ancestor nodes are all parent nodes that have direct or indirect relationships with this node. Indicates diagnostic code The representation of the corresponding node, Indicates diagnostic code Corresponding node pair diagnostic coding The influence weight of the corresponding node:
[0096]
[0097] in, Diagnostic coding in layer L Representation and diagnostic coding of corresponding nodes The scalar value representing the degree of inheritance between the corresponding nodes. Indicates diagnostic code The representation of the corresponding node, Diagnostic coding in layer L Representation and diagnostic coding of corresponding nodes The scalar value of the inheritance degree between the corresponding node representations:
[0098]
[0099]
[0100] Among them, W a ∈R e×2e Let b represent the learnable parameter matrix. a ∈R e and u a ∈Re Both represent learnable parameter vectors, R e×2e and R e Both represent dimensions, and tanh() represents the inverse triangular nonlinear activation function. Indicates the relationship between u a The transpose operation.
[0101] For example, for diagnostic coding in layer L Corresponding node, diagnostic code The corresponding node is connected to one node in layer L-1, and this node is connected to one node in layer L-2. Diagnostic coding is then performed. The corresponding node has two grandparent nodes. This process is repeated from layer L-1 to layer 1, and all found nodes are associated with the diagnostic code. Nodes that have direct and indirect relationships with each other are called diagnostic codes. The ancestor node of the corresponding node. For the parent category node d in layer l-1. f Parent category node d f It is connected to n nodes in layer l, at which point the parent classification node d f The set of child nodes is obtained by having n child nodes.
[0102] The diagnostic ontology graph is updated using the steps described above, and the updated leaf node representations are then integrated to obtain the diagnostic encoding representation matrix E. d , Indicates dimension.
[0103] Step 12.2: Calculate the surgical coding representation matrix.
[0104] In some embodiments of this application, the parent classification category of the medical ontology graph is used as a non-leaf node, and the surgical code is used as a leaf node to construct the surgical ontology graph.
[0105] In the direction from layer l to layer l-1, according to the formula:
[0106]
[0107] Update the parent classification node p in layer l-1 of the surgical ontology graph. f Node representation
[0108] in, This indicates the relationship between the parent classification node p in layer l and layer l-1. f The set of connected child nodes. Indicates the surgical code in layer l The corresponding node representation is l = 2, ..., L, where L represents the total number of layers in the surgical ontology graph.
[0109] In the direction from layer l-1 to layer l, for surgical coding in layer L The corresponding node is determined by the formula:
[0110]
[0111] Update the surgical code in layer L Representation of the corresponding node
[0112] in, Indicates the surgical code in layer L. The set p consisting of the corresponding node and its ancestor nodes. p =p1,p2,...,p Y ,|p Y | represents the total number of surgical codes. Ancestor nodes are all parent nodes that have direct and indirect relationships with this node. Indicates surgical code The representation of the corresponding node, Indicates surgical code The corresponding node pairs the surgical code. The influence weight of the corresponding node:
[0113]
[0114] in, Indicates the surgical code in layer L. The corresponding node representation and surgical code The scalar value representing the degree of inheritance between the corresponding nodes. Indicates surgical code The representation of the corresponding node, Indicates the surgical code in layer L. The corresponding node representation and surgical code The scalar value of the inheritance degree between the corresponding node representations:
[0115]
[0116]
[0117] Among them, W a ∈R e×2e Let b represent the learnable parameter matrix. a ∈R e and u a ∈R eBoth represent learnable parameter vectors, R e×2e and R e Both represent dimensions, and tanh() represents the inverse triangular nonlinear activation function. Indicates the relationship between u a The transpose operation.
[0118] The above steps update all leaf nodes and non-leaf nodes in the surgical ontology graph, and the updated leaf node representations are then integrated to obtain the surgical encoding representation matrix E. p , Indicates dimension.
[0119] Step 12.3: Calculate the drug coding representation matrix.
[0120] In some embodiments of this application, the parent classification category of the medical ontology graph is used as a non-leaf node, and the drug code is used as a leaf node to construct the drug ontology graph.
[0121] In the direction from layer l to layer l-1, according to the formula:
[0122]
[0123] Update the parent category node m in layer l-1 of the drug ontology graph. f Node representation
[0124] in, This indicates the relationship between the parent classification node m in layer l and layer l-1. f The set of connected child nodes. This represents the drug coding in layer l. The corresponding node representation is l = 2, ..., L, where L represents the total number of layers in the drug ontology graph.
[0125] In the direction from layer l-1 to layer l, for drug coding in layer L The corresponding node is determined by the formula:
[0126]
[0127] Update drug coding in layer L Representation of the corresponding node Here, only the encoding of the Lth layer, i.e., the leaf nodes, is updated.
[0128] in, Indicates drug coding in layer L The set of the corresponding node and its ancestor nodes, m m=m1,m2,...,m M ,|m M | represents the total number of drug codes, and ancestor nodes are all parent nodes that have direct or indirect relationships with this node. Drug code The representation of the corresponding node, Drug code The corresponding node encodes the drug. The influence weight of the corresponding node:
[0129]
[0130] in, Indicates drug coding in layer L The corresponding node representation and drug coding The scalar value representing the degree of inheritance between the corresponding nodes. Drug code The representation of the corresponding node, Indicates drug coding in layer L The corresponding node representation and drug coding The scalar value of the inheritance degree between the corresponding node representations:
[0131]
[0132]
[0133] Among them, W a ∈R e×2e Let b represent the learnable parameter matrix. a ∈R e and u a ∈R e Both represent learnable parameter vectors, R e×2e and R e Both represent dimensions, and tanh() represents the inverse triangular nonlinear activation function. Indicates the relationship between u a The transpose operation.
[0134] The above steps update all leaf nodes and non-leaf nodes in the drug ontology graph, and the updated leaf node representations are then integrated to obtain the drug coding representation matrix E. m , Indicates dimension.
[0135] Step 12.4: Calculate the diagnostic adjacency matrix for diagnostic codes, the surgical adjacency matrix for surgical codes, and the drug adjacency matrix for drug codes.
[0136] Through the formula:
[0137]
[0138] Calculate the diagnostic adjacency matrix of the diagnostic code.
[0139] in, Let |C| represent the dimension of the matrix, |C| represent the total number of medical codes, tanh() represent the inverse triangular nonlinear activation function, and W represent the number of codes. q and W k Both represent parameter matrices, () T The expression `||` represents the matrix transpose operation, and `||` represents the concatenation operation. This represents the representation matrix of diagnostic codes under the relationship between diagnostic codes. This represents the representation matrix of diagnostic codes in relation to surgical codes. This represents the representation matrix of surgical codes in the context of the relationship between diagnostic codes and surgical codes. This represents the representation matrix of diagnostic codes in the context of the relationship between diagnostic codes and drug codes. The representation matrix of drug codes under the relationship between diagnostic codes and drug codes:
[0140]
[0141]
[0142]
[0143]
[0144]
[0145] Among them, U d-d The initial representation of the relationship between diagnostic codes, U d-p The initial representation of the relationship between diagnostic codes and surgical codes, U d-m The initial representation indicates the relationship between diagnostic codes and drug codes, and ⊙ represents the dot product operation.
[0146] Through the formula:
[0147]
[0148] Calculate the surgical adjacency matrix of the surgical code.
[0149] in, Represents the dimension of the matrix. This represents the representation matrix of surgical codes under the relationship between surgical codes. This represents the representation matrix of surgical codes in relation to drug codes. This represents the representation matrix of drug codes in the relationship between surgical codes and drug codes:
[0150]
[0151]
[0152]
[0153] Among them, U p-p The initial representation of the relationship between surgical codes, U p-m An initial representation indicating the relationship between surgical codes and drug codes.
[0154] Through the formula:
[0155]
[0156] Calculate the drug adjacency matrix of drug codes
[0157] in, Represents the dimension of the matrix. This represents the representation matrix of drug codes under the relationship between drug codes:
[0158]
[0159] Among them, U m-m A representation vector that shows the relationship between drug codes and drug codes.
[0160] Step 12.5: Concatenate the diagnostic adjacency matrix, surgical adjacency matrix, and drug adjacency matrix to obtain a heterogeneous adjacency matrix, and then construct a heterogeneous relationship graph based on the heterogeneous adjacency matrix.
[0161] For diagnostic adjacency matrix Surgical Adjacency Matrix Adjacency matrix of drugs By concatenating the matrices, a heterogeneous adjacency matrix is obtained. R |C|×|C| Indicates dimension.
[0162] A heterogeneous relational graph is constructed based on a heterogeneous adjacency matrix. The nodes in the heterogeneous relational graph correspond one-to-one with the medical codes in the electronic health record data. The edge between any two nodes in the heterogeneous relational graph represents the elements of the corresponding two medical codes in the heterogeneous adjacency matrix.
[0163] It is worth mentioning that, based on the types of medical codes in electronic health record data, ontology graphs of different types of medical codes are constructed, and heterogeneous relationship graphs are constructed based on ontology graphs, which supplements the shortcomings of ontology graphs and can represent the relationships between medical codes of the same type, as well as between different types of medical codes at the same level and at different levels.
[0164] The specific steps of step 13 described above will be illustrated below with reference to specific embodiments.
[0165] In some embodiments of this application, step 13 is specifically implemented as follows:
[0166] Step 13.1: Obtain the first relation-specific representation of the medical code based on the co-occurrence relation graph.
[0167] In some embodiments of this application, for medical codes c in the co-occurrence relationship graph i It is possible to aggregate all medical codes c under relation r using the encoding-level attention module in the hierarchical graph convolutional neural network module. i The representation of nodes that are connected to each other is used to obtain the medical code c. i First Relationship Specific Representation
[0168] Through the formula:
[0169]
[0170] Calculate the medical code c in the co-occurrence relationship graph i The first relation-specific representation under relation r
[0171] in, This indicates that under relation r, there is a medical code c. i The set of co-occurring codes, where r is any one of six relationships: the relationship between diagnostic codes, the relationship between diagnostic codes and surgical codes, the relationship between diagnostic codes and drug codes, the relationship between surgical codes and surgical codes, the relationship between surgical codes and drug codes, and the relationship between drug codes. This indicates the medical code c under relation r in the co-occurrence graph. j and medical code c i The value of the edge between them, For medical coding under relation r, c j The initial representation is given by W, where W represents the parameter matrix, j = 1, 2, ..., C, i = 1, 2, ..., C, and |C| represents the total number of medical codes. Initial representation matrix for all medical codes One of the vectors.
[0172] Step 13.2: Calculate the importance score of the first relation-specific representation of the medical code, then aggregate the first relation-specific representations of the medical code using the importance score to obtain the first final code representation of the medical code, and then integrate them to obtain the first final code representation matrix of all medical codes.
[0173] In some embodiments of this application, the relational level attention module in the hierarchical graph convolutional neural network module can be utilized through the formula. Calculate the relation r for medical code c i Importance score α i,r ;
[0174] in This indicates the medical code c under relation r. i The initial representation of W f Represents the parameter matrix;
[0175] Through the formula:
[0176]
[0177] Computational medical coding c i The first final encoding representation
[0178] By integrating the first final encoding representations of all medical codes into a single matrix, we obtain the first final encoding representation matrix of all medical codes.
[0179] The above steps will be explained below with a specific example.
[0180] like Figure 2 As shown, the structure of the hierarchical graph convolutional neural network module consists of an encoding-level attention module and a relation-level attention module. The encoding-level attention module processes the relation graph (i.e., the co-occurrence relation graph or heterogeneous relation graph mentioned above) to obtain a relation-specific representation of the medical code (i.e., the first relation-specific representation or the second relation-specific representation mentioned above). The relation-specific representation of the medical code is calculated by the relation-level attention module to obtain the final encoding representation matrix (i.e., the first final encoding representation matrix or the second final encoding representation matrix mentioned above).
[0181] It is worth mentioning that the co-occurrence relationship graph can represent the relationship between medical codes of the same type and between medical codes of different types at the same level. The first final coding representation matrix obtained based on the co-occurrence relationship graph can facilitate subsequent calculations.
[0182] The specific steps of step 14 described above will be illustrated below with reference to specific embodiments.
[0183] In some embodiments of this application, step 14 is specifically implemented as follows:
[0184] Step 14.1: Obtain the second relation-specific representation of the medical code based on the heterogeneous relation graph.
[0185] In some embodiments of this application, for medical codes c in the heterogeneous relationship graph i It is possible to aggregate all medical codes c under relation r using the encoding-level attention module in the hierarchical graph convolutional neural network module. i The representation of nodes that are connected to each other is used to obtain the medical code c. i Second relation specific representation
[0186] Through the formula:
[0187]
[0188] Calculate the medical code c in the heterogeneous relationship graph i The second relation-specific representation under relation r
[0189] in, This indicates that under relation r, there is a medical code c. i The set of co-occurring codes, where r is any one of six relationships: the relationship between diagnostic codes, the relationship between diagnostic codes and surgical codes, the relationship between diagnostic codes and drug codes, the relationship between surgical codes and surgical codes, the relationship between surgical codes and drug codes, and the relationship between drug codes. In a heterogeneous relation graph, the medical code c is represented under relation r. j and medical code c i The value of the edge between them, For medical coding under relation r, c j The initial representation is given by W, which represents the parameter matrix, j = 1, 2, ..., C, i = 1, 2, ..., C, and |C| represents the total number of medical codes.
[0190] Step 14.2: Calculate the importance score of the second relation-specific representation of the medical code, then use the importance score to aggregate the second relation-specific representation of the medical code to obtain the second final code representation of the medical code, and then integrate them to obtain the second final code representation matrix of all medical codes.
[0191] In some embodiments of this application, the relational level attention module in the hierarchical graph convolutional neural network module can be utilized through the formula. Calculate the relation r for medical code c i Importance score α i,r ;
[0192] in This indicates the medical code c under relation r. i The initial representation of W f Represents the parameter matrix;
[0193] Through the formula:
[0194]
[0195] Computational medical coding c i The second final encoding representation
[0196] By integrating the second final encoding representations of all medical codes into a single matrix, we obtain the second final encoding representation matrix of all medical codes.
[0197] It is worth mentioning that the heterogeneous relationship graph can represent the relationship between medical codes of the same type, as well as between medical codes of different types, at the same level and at different levels. The second final coding representation matrix obtained based on the heterogeneous relationship graph can facilitate subsequent calculations.
[0198] The specific steps of step 16 described above will be illustrated below with reference to specific embodiments.
[0199] In some embodiments of this application, step 16 is specifically implemented as follows:
[0200] Step 16.1: Process the demographic information of the patient to be predicted through a linear layer to obtain the initial representation of the patient to be predicted. Then, use the complete representation matrix of all medical codes in the electronic health record data to obtain the diagnostic representation, surgical representation, and drug representation of the patient to be predicted.
[0201] For the patient u to be predicted, demographic information from his electronic health record data s u This represents the demographic information of patient u (such as age, gender, etc.), among which The first characteristic representing patient u's demographic information. Let i represent the i-th feature of the demographic information of patient u. Let |i| represent the i-th feature of patient u's demographic information, where i = 1, 2, ..., I, and |I| represent the total number of demographic features of the patient. If patient u has the i-th feature, then...
[0202] In some embodiments of this application, the demographic information of the patient u to be predicted is processed through a linear layer to obtain a demographic representation demo of the patient u to be predicted. u The demographic representation of the patient u to be predicted is used as the initial representation of the patient u to be predicted.
[0203] The diagnostic representation of the patient u's t-th visit record is obtained by using the complete representation matrix X° of all medical codes in the electronic health record data. Surgical representation of patient u's tth visit record. Medication representation in the patient's first visit record (to be predicted) t = 1, 2, ..., T, where T represents the total number of medical records.
[0204] For example, the initial representation, diagnostic representation, surgical representation, and drug representation of the patient to be predicted can be obtained through a conventional linear layer. Specifically, the conventional linear layer processes the demographic information of the patient to be predicted to obtain a demographic representation containing all features of the patient's demographic information; based on the medical coding type in the patient's electronic health record data, all medical coding representations of the corresponding type are obtained from the complete representation matrix of all medical codes. For example, for all diagnostic codes in the t-th visit record of the patient u to be predicted, the corresponding representation of the diagnostic code is found in the complete representation matrix of all medical codes, and the representations of all diagnostic codes are added together to obtain the diagnostic representation of the t-th visit record of the patient u to be predicted; for all surgical codes in the t-th visit record of the patient u to be predicted, the corresponding representation of the surgical code is found in the complete representation matrix of all medical codes, and the representations of all surgical codes are added together to obtain the surgical representation of the t-th visit record of the patient u to be predicted; for all drug codes in the t-th visit record of the patient u to be predicted, the corresponding representation of the drug code is found in the complete representation matrix of all medical codes, and the representations of all drug codes are added together to obtain the drug representation of the t-th visit record of the patient u to be predicted.
[0205] Step 16.2: Calculate the diagnostic hidden representation of the patient to be predicted using the GRU module.
[0206] The diagnostic hidden representation of the t-th visit record of the patient u to be predicted is calculated using the GRU module.
[0207]
[0208] Among them, W h and b h All represent parameters. This refers to the patient's (t-1)th visit record, which is to be predicted. This represents the weight of the information that needs to be retained in the (t-1)th visit record of the patient to be predicted:
[0209]
[0210]
[0211] Among them, b r and b z All of these represent learnable parameters. This represents the update weight of the t-th visit record of the patient u to be predicted.
[0212] Step 16.3: Calculate the diagnostic hidden representation of the patient to be predicted using the task-specific integration gate in the fusion module to obtain the patient representation of the patient to be predicted.
[0213] Utilizing task-specific integration gates in the fusion module to extract the diagnostic hidden representation of the t-th visit record of the patient u to be predicted. Calculations are performed to obtain the patient representation of the t-th visit record of the patient to be predicted.
[0214]
[0215]
[0216] in, This represents the hidden representation of the patient's t-th visit record, which is to be predicted. This represents the update weight of the t-th visit record of the patient u to be predicted, and Agg() represents the task-specific ensemble gate operation:
[0217]
[0218]
[0219]
[0220] in, This represents the influence weight of the surgical code in the t-th visit record of the patient to be predicted. W represents the influence weight of the drug code in the t-th visit record of the patient to be predicted. p W m b p and b m Both represent parameters.
[0221] It should be noted that in the disease prediction process, the diagnostic information of the patient to be predicted is usually used as the primary information, and the diagnostic information has a higher weight than other information. Other information is used as auxiliary information to provide necessary supplements. Other information includes drug information and surgical information. Therefore, in this step, a task-specific integration gate is used to calculate the correlation between the diagnostic information and other information, and the other information is integrated into the diagnostic information to obtain a comprehensive and accurate patient representation.
[0222] Step 16.4: Calculate the patient representation of the patient to be predicted using the temporal enhancement module to obtain the differential representation of the patient to be predicted.
[0223] The difference-aware gate Diff in the temporal augmentation module is used to represent the patient's t-th visit record for the patient to be predicted. The calculation is performed to obtain the difference in the patient's (u) t-th visit records.
[0224]
[0225] in, This represents the difference in the patient's (t-1)th visit record. The update weights represent the differences in the patient u's t-th visit record to be predicted. The temporary difference between the (t-1)th and tth medical records of the patient to be predicted is represented as:
[0226]
[0227]
[0228] Among them, W l and b t All represent parameters;
[0229] Through the formula:
[0230]
[0231] The final patient representation p at the Tth visit of the patient to be predicted is calculated. u ;
[0232] in, This indicates the difference in the patient's Tth visit record to be predicted. This indicates the patient's Tth visit record, representing the patient to be predicted.
[0233] It should be noted that the aforementioned difference-perceived gate (Diff) is used to capture the temporal evolution of a patient's health status in a fine-grained manner during computation, using the difference representation of the patient's Tth visit record. Enhanced patient prediction, Tth visit record, patient's expression This is to integrate the fine-grained temporal development process of the patient to be predicted, and obtain the patient's final expression p at the Tth visit. u .
[0234] The above steps will be illustrated with a specific example below.
[0235] like Figure 3 As shown, the improved GRU model structure includes a linear layer, a GRU module, a fusion module, and a temporal enhancement module. The complete representation matrix of the patient data to be predicted and the medical codes enters the linear layer. After processing, it yields an initial patient representation, a diagnostic representation, a drug representation, and a surgical representation. The linear layer inputs the initial patient representation and the diagnostic representation into the GRU module. The GRU module processes these to obtain a diagnostic hidden representation, which is then input into the fusion module. Simultaneously, the drug representation and the surgical representation are input into the fusion module. The task integration gate in the fusion module fuses the diagnostic hidden representation, the drug representation, and the surgical representation to obtain the patient representation, which is then input into the temporal enhancement module. The difference-aware gate in the temporal enhancement module processes the patient representation to obtain the final patient representation.
[0236] It is worth mentioning that the improved GRU model can obtain an accurate final patient representation. The task-specific integration gate in the fusion module can fuse the information of the patient to be predicted to obtain a comprehensive and accurate patient representation. The difference-aware gate in the temporal enhancement module can capture the temporal dynamic development in the electronic health record data of the patient to be predicted with fine granularity, thereby improving the accuracy of the final patient representation.
[0237] The above disease prediction method will be illustrated below with a specific example.
[0238] like Figure 4As shown, the workflow of the disease prediction system provided in a specific example of this application is as follows: Electronic health record data is input into the co-occurrence graph construction module, and after processing, a co-occurrence graph is constructed. Simultaneously, electronic health record data and medical ontology graph are input into the heterogeneous graph construction module, and after processing, a heterogeneous graph is constructed. The co-occurrence graph is input into the hierarchical graph convolutional neural network module, and after processing, a first encoding representation matrix is obtained. The heterogeneous graph is input into the hierarchical graph convolutional neural network module, and after processing, a second encoding representation matrix is obtained. The first and second encoding representation matrices are input into the cross-graph contrast loss module, and after processing, a complete representation matrix is obtained. The complete representation matrix is input into the linear layer of the improved GRU model, and after processing by the linear layer, GRU module, fusion module, and temporal enhancement module of the improved GRU model, the final patient representation is obtained. The final patient representation is input into the disease prediction module for prediction, and the disease prediction result is obtained.
[0239] It is worth mentioning that the above system can effectively implement the disease prediction method provided in this application and obtain evaluation results.
[0240] The disease prediction method provided in this application was experimentally verified based on the above system.
[0241] The Medical Information Mart for Intensive Care III (MIMIC-III) is a publicly available medical dataset. Patients with fewer than two visits were removed from the dataset, and for patients with more than four visits, a sliding window of length 4 with a step size of 4 was used to augment the sample. We extracted patient demographics, diagnostic information, surgical information, and medication information from the dataset. Medication information for each visit was a time series, and medications used within 24 hours of admission were selected as features for the prediction task. The dataset was randomly divided into training, validation, and test sets in a ratio of 0.8:0.1:0.1. Furthermore, a single-level clinical classification software (Single-level CCS) was used to classify diagnostic codes into 273 categories as hierarchical labels.
[0242] The Medical Information Mart for Intensive Care IV (MIMIC-IV) is a publicly available medical dataset. Patients with fewer than four visits were removed from the dataset. Patients with more than four visits were processed using the same methods as MIMIC-III, and demographic, diagnostic, surgical, and medication information was extracted. The dataset was then randomly divided into training, validation, and test sets in a ratio of 0.8:0.1:0.1. Furthermore, a single-level clinical classification software (CSS) was used to classify diagnostic codes into 277 categories as hierarchical labels.
[0243] Two commonly used metrics for diagnostic prediction are precision (P@k, top k precision) and recall (R@k, top k recall). P@k represents the proportion of true positives in the prediction results, while R@k represents the proportion of correctly predicted positives among all positives. R@k is a more important evaluation metric, and higher values for both metrics indicate better predictive performance. Their calculation methods are as follows:
[0244]
[0245]
[0246] In addition to the data selection and evaluation parameters mentioned above, this experiment also selected several state-of-the-art models as baseline models for comparison: RETAIN: an interpretable prediction model that inversely inputs a recurrent neural network (RNN) and computes encoding and patient-level attention to obtain patient representations; Dipole: an attention-based bidirectional recurrent neural network; Time-aware Long Short Term Memory (T-LSTM): a time-aware recurrent neural network; GRAM: a graph-based prediction model; HiTANet: a hierarchical time-aware attention network; Collaborative Graph Learning (CGL): a collaborative graph learning model; Sherbet: a self-supervised learning framework with hyperbolic representations; Chet: a context-aware learning framework; and MCF-LSTM: a multi-channel fusion LSTM model.
[0247] This experiment will Figure 4The provided disease prediction system is named KEDA system, and a comparative experiment was conducted with the baseline model. The disease prediction performance on the MIMIC-III dataset is shown in Table 1, and the disease prediction performance on the MIMIC-IV dataset is shown in Table 2.
[0248]
[0249] Table 1
[0250]
[0251] Table 2
[0252] To verify the effectiveness of integrating medical information, experiments were conducted to compare the performance of the KEDA system and its variants on two datasets.
[0253] KEDAsherbet, KEDAcgl, and KEDAgram are obtained by replacing the learning methods of co-occurrence and heterogeneous graphs in KEDA with the medical encoding representation learning methods in Sherbet, CGL, and GRAM. KEDAupdate is obtained by removing the contrastive learning and dynamic update mechanisms from the learning methods of co-occurrence and heterogeneous graphs. The performance comparison of different medical knowledge fusion methods on the MIMIC-III dataset is shown in Table 3, and the performance comparison of different medical knowledge fusion methods on the MIMIC-IV dataset is shown in Table 4.
[0254]
[0255] Table 3
[0256]
[0257] Table 4
[0258] As shown in Tables 3 and 4, all four variants performed worse than the KEDA system on both datasets. KEDAsherbet performed the worst among all variants on both datasets because it only utilizes information from multiple visits. KEDAgram performed lower than the other two variants because it lacks the fusion of co-occurrence graphs. KEDAcgl and KEDAupdate performed worse than the KEDA system because they did not enhance the reliability of the co-occurrence graph. This fully demonstrates the effectiveness of integrating complete and reliable medical information.
[0259] To investigate the advantages of temporal representation learning methods, the performance of the KEDA system and its variants was compared on two datasets. KEDAlstm, KEDAtran, and KEDAgru were obtained by replacing the improved GRU model in the KEDA system with LSTM, Transformer, and GRU, respectively; KEDAagg- and KEDAdiff- were obtained by removing the task-specific integration gate and differential perception gate in KEDA, respectively; and KEDAa&d- removed the task-specific integration gate and differential perception gate in KEDA. The performance comparison results of different temporal capture methods on the MIMIC-III dataset are shown in Table 5, and the performance comparison results of different temporal capture methods on the MIMIC-IV dataset are shown in Table 6.
[0260]
[0261]
[0262] Table 5
[0263]
[0264] Table 6
[0265] As shown in Tables 5 and 6, KEDAlstm performs the worst among the compared methods on the MIMIC-III dataset. This is because LSTM has more parameters than GRU. Although KEDAtran has more parameters than KEDAlstm and KEDAgru, it outperforms them because the multi-head self-attention mechanism in the Transformer captures the data effects in a different way. Furthermore, our model outperforms it by nearly 2%, mainly because the difference-aware gate in the KEDA system plays a significant role; the performance of the KEDA system degrades after removing each component. KEDAa&d achieves the worst performance because it fails to capture the correlation between different types of data and the prediction task, as well as the fine-grained temporal evolution of patient health conditions.
[0266] It can be seen that the disease prediction method provided in this application can improve the accuracy of disease prediction.
[0267] The patient clinical risk assessment device provided in this application is described below as an example.
[0268] This application provides a disease prediction device, which includes:
[0269] The co-occurrence graph module is used to construct a co-occurrence graph based on medical codes in electronic health record data. The electronic health record data includes T visits from multiple patients, and each visit includes multiple medical codes. The types of medical codes in the electronic health record data include diagnosis codes, surgical codes, and drug codes. Multiple nodes in the co-occurrence graph correspond one-to-one with multiple medical codes in the electronic health record data.
[0270] The heterogeneous relationship graph module is used to construct a heterogeneous relationship graph based on the type of medical code in the electronic health record data; multiple nodes in the heterogeneous relationship graph correspond one-to-one with the medical codes in the electronic health record data.
[0271] The first acquisition module is used to acquire the first final encoding representation matrix of all medical codes in the electronic health record data based on the co-occurrence relationship graph.
[0272] The second acquisition module is used to acquire the second final encoding representation matrix of all medical codes in the electronic health record data based on the heterogeneous relationship graph.
[0273] The optimization module optimizes the first final encoding representation matrix using the second final encoding representation matrix to obtain a complete representation matrix of all medical codes in the electronic health record data.
[0274] The processing module is used to process the medical records of the patient to be predicted based on the complete representation matrix of medical codes, using an improved GRU model to obtain the final representation of the patient at the Tth visit. The improved GRU model includes: a linear layer for obtaining the initial representation, diagnostic representation, surgical representation, and drug representation of the patient to be predicted; a GRU module for obtaining the hidden diagnostic representation of the patient based on the initial and diagnostic representations; a fusion module for fusing the hidden diagnostic representation, surgical representation, and drug representation to obtain the patient representation; and a temporal enhancement module for obtaining the final representation of the patient at the Tth visit based on the patient representation.
[0275] The prediction module uses the disease prediction module to evaluate the patient's final presentation at the Tth visit, and obtains the prediction result for the patient at the T+1th visit.
[0276] It should be noted that the information interaction and execution process between the above-mentioned devices / units are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, and they will not be repeated here.
[0277] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments 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.
[0278] An embodiment of this application provides a terminal device, which includes: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor. When the processor executes the computer program, it implements the steps in any of the above method embodiments, which can significantly improve the accuracy of disease prediction.
[0279] The processor may be a central processing unit (CPU). In some embodiments, the memory may be the internal storage unit of the terminal device, such as the hard disk or memory of the terminal device.
[0280] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps described in the various method embodiments above.
[0281] This application provides a computer program product that, when run on a terminal device, enables the terminal device to implement the steps described in the various method embodiments above.
[0282] 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, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying the computer program code to a disease prediction method device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0283] In the above embodiments, the descriptions of each embodiment have different focuses. For parts that are not described in detail or recorded in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0284] The above description is the preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principles described in this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A disease prediction method, characterized in that, include: Construct a co-occurrence graph based on medical codes in electronic health record data; The electronic health record data includes data from multiple patients. T Each medical visit record includes multiple medical codes, and the multiple nodes in the co-occurrence relationship graph correspond one-to-one with the multiple medical codes in the electronic health record data; Based on the types of medical codes in the electronic health record data, a heterogeneous relationship graph is constructed; Multiple nodes in the heterogeneous relationship graph correspond one-to-one with the medical codes in the electronic health record data; Based on the co-occurrence relationship graph, obtain the first final coding representation matrix of all medical codes in the electronic health record data; Based on the heterogeneous relationship graph, obtain the second final coding representation matrix of all medical codes in the electronic health record data; The first final encoding representation matrix is optimized using the second final encoding representation matrix to obtain a complete representation matrix of all medical codes in the electronic health record data; Based on the complete representation matrix of the medical code, the medical records of the patient to be predicted are processed using an improved GRU model to obtain the first... T The patient's final statement during the second visit was: The improved GRU model includes: a linear layer for acquiring the initial representation, diagnostic representation, surgical representation, and drug representation of the patient to be predicted; a GRU module for obtaining a hidden diagnostic representation of the patient based on the initial and diagnostic representations; a fusion module for fusing the hidden diagnostic representation, surgical representation, and drug representation to obtain a patient representation; and a module for obtaining the first... T The temporal enhancement module representing the patient's final presentation at the first visit; Using the disease prediction module to predict the first patient T The patient at the second visit ultimately indicated that an evaluation would be conducted, and the predicted patient was identified at the [number]th visit. T+ Predicted results at the time of a single medical visit; A co-occurrence relation graph is constructed based on the co-occurrence adjacency matrix; the edge between each pair of nodes in the co-occurrence relation graph is used to represent the influence weight between the corresponding two medical codes. Based on the types of medical codes in electronic health record data, a diagnostic code representation matrix, a surgical code representation matrix, and a drug code representation matrix are calculated. Then, the diagnostic adjacency matrix of the diagnostic code, the surgical adjacency matrix of the surgical code, and the drug adjacency matrix of the drug code are calculated. Finally, the diagnostic adjacency matrix, the surgical adjacency matrix, and the drug adjacency matrix are concatenated to obtain a heterogeneous adjacency matrix. A heterogeneous relation graph is then constructed based on the heterogeneous adjacency matrix. In the heterogeneous relation graph, the edge between each two nodes represents the elements of the corresponding two medical codes in the heterogeneous adjacency matrix.
2. The disease prediction method according to claim 1, characterized in that, The types of medical codes in the electronic health record data include diagnostic codes, surgical codes, and drug codes; The construction of a co-occurrence graph based on medical codes in the electronic health record data includes: Through the formula: Calculate the medical codes in the electronic health record data Medical coding Influence weight ; in, , This indicates that the electronic health record data contains information related to relationships. r Below and medical codes The sum of the number of times all medical codes appear together. r It can be any one of six relationships, namely: the relationship between diagnostic codes, the relationship between diagnostic codes and surgical codes, the relationship between diagnostic codes and drug codes, the relationship between surgical codes and surgical codes, the relationship between surgical codes and drug codes, and the relationship between drug codes and drug codes. , Indicates a relationship Below and medical codes The medical code set that appears together Representative medical code With medical coding The number of times it appears in all medical records, and the medical code With medical coding Simultaneously appearing in the n The first patient's t In the next medical record, Add 1 to the value. n =1,2,..., U , U This indicates the total number of patients. t =1,2,..., T , T Indicates the first T Medical record of the previous visit j= 1,2,..., C , i= 1,2,..., C , | C | indicates the total number of the medical codes; Construct a co-occurrence adjacency matrix based on all calculated influence weights. A .
3. The disease prediction method according to claim 1, characterized in that, The types of medical codes in the electronic health record data include diagnostic codes, surgical codes, and drug codes; The construction of a heterogeneous relationship graph based on the types of medical codes in the electronic health record data includes: Through the formula: Calculate the diagnostic adjacency matrix of the diagnostic code. ; in, , Represents the dimension of the matrix, | | indicates the total number of diagnostic codes. | indicates the total number of the medical codes. This represents the inverse triangular nonlinear activation function. and Both represent parameter matrices. This represents the matrix transpose operation. This indicates a concatenation operation. This represents the representation matrix of the diagnostic codes under the relationship between diagnostic codes. This represents the representation matrix of the diagnostic codes in the context of the relationship between diagnostic codes and surgical codes. This represents the representation matrix of the surgical code in the context of the relationship between diagnostic codes and surgical codes. This represents the representation matrix of the diagnostic codes in the context of the relationship between diagnostic codes and drug codes. The representation matrix of the drug code under the relationship between diagnostic code and drug code; Through the formula: Calculate the surgical adjacency matrix of the surgical code. ; in, , Represents the dimension of the matrix, | | indicates the total number of surgical codes. This represents the representation matrix of the surgical codes under the relationship between surgical codes. This represents the representation matrix of the surgical code in the context of the relationship between surgical codes and drug codes. This represents the representation matrix of the drug code under the relationship between surgical code and drug code; Through the formula: Calculate the drug adjacency matrix of the drug code. ; in, , Represents the dimension of the matrix, | | indicates the total number of drug codes. This represents the representation matrix of drug codes under the relationship between drug codes; The diagnostic adjacency matrix, the surgical adjacency matrix, and the drug adjacency matrix are concatenated to obtain a heterogeneous adjacency matrix. .
4. The disease prediction method according to claim 1, characterized in that, The first final coding representation matrix for obtaining all medical codes in the electronic health record data based on the co-occurrence relationship graph includes: Through the formula: Calculate the medical codes in the co-occurrence graph. In relation r First relation specific representation ; in, Indicates a relationship Below and medical codes The set of co-occurring codes r It can be any one of six relationships, namely: the relationship between diagnostic codes, the relationship between diagnostic codes and surgical codes, the relationship between diagnostic codes and drug codes, the relationship between surgical codes and surgical codes, the relationship between surgical codes and drug codes, and the relationship between drug codes and drug codes. In the co-occurrence relation graph, it is indicated that the relation is... Medical Code and medical codes The value of the edge between them, In relation Medical Code The initial representation, W Represents the parameter matrix, j= 1,2,..., C , i= 1,2,..., C , | C | indicates the total number of the medical codes; Through formula Calculate the relationship For medical coding Importance score ; in Indicates a relationship r Medical Code The initial representation, Represents the parameter matrix; Through the formula: Calculate the medical code The first final encoding representation ; By integrating the first final code representations of all medical codes, we obtain the first final code representation matrix. .
5. The disease prediction method according to claim 1, characterized in that, The second final coding representation matrix for obtaining all medical codes in the electronic health record data based on the heterogeneous relationship graph includes: Through the formula: Calculate the medical codes in the heterogeneous relationship graph. In relation r The second relation-specific representation ; in, Indicates a relationship Below and medical codes The set of co-occurring codes r It can be any one of six relationships, namely: the relationship between diagnostic codes, the relationship between diagnostic codes and surgical codes, the relationship between diagnostic codes and drug codes, the relationship between surgical codes and surgical codes, the relationship between surgical codes and drug codes, and the relationship between drug codes and drug codes. In the heterogeneous relationship graph, the relationship is represented by... Medical Code and medical codes The value of the edge between them, In relation Medical Code The initial representation, W Represents the parameter matrix, j= 1,2,..., C , i= 1,2,..., C , | C | indicates the total number of the medical codes; Through formula Calculate the relationship r For medical coding Importance score ; in Indicates a relationship r Medical Code The initial representation, Represents the parameter matrix; Through the formula: Calculate the medical code The second final encoding representation ; By integrating the second final encoding representations of all medical codes, we obtain the second final encoding representation matrix. .
6. The disease prediction method according to claim 1, characterized in that, The step of optimizing the first final encoding representation matrix using the second final encoding representation matrix to obtain a complete representation matrix of all medical codes in the electronic health record data includes: Through the formula: Calculate the first final encoded representation matrix With the second final encoding representation matrix Loss values between The heterogeneous relationship graph is backpropagated based on the loss value to obtain an updated heterogeneous relationship graph. in, The medical code indicates The first final encoding representation, The medical code indicates The second final encoding representation, The medical code indicates The second final encoding representation, i= 1,2,..., C , k (1,2,..., C ), k ≠i , | C | indicates the total number of the medical codes. Represents the cosine similarity function. Indicates temperature parameter; The updated heterogeneous relation graph is iterated to obtain the iterated heterogeneous adjacency matrix. The second final encoding representation matrix after iteration is calculated. ; Determine whether the preset number of iteration rounds has been reached. If the preset number of iteration rounds has not been reached, use the iterated heterogeneous relation graph as the updated heterogeneous relation graph, and return to perform iteration on the updated heterogeneous relation graph to obtain the iterated heterogeneous adjacency matrix. The second final encoding representation matrix after iteration is calculated. Steps; When the number of iterations reaches the preset number of iterations, the co-occurrence adjacency matrix is optimized using the formula. A : The optimized co-occurrence adjacency matrix is obtained. And the optimized first final encoding representation matrix is obtained through calculation. ;in, Indicates the preset parameters; Determine whether the number of optimization attempts has reached the preset total number of optimization attempts. If the number of optimization attempts has not reached the preset total number of optimization attempts, update the first final encoding representation matrix according to the optimized co-occurrence adjacency matrix, and use the updated first final encoding representation matrix as the first final encoding representation matrix. The iteratively obtained second final encoding representation matrix is used as the second final encoding representation matrix. Return to the execution of the formula to calculate the first final encoded representation matrix. With the second final encoding representation matrix Loss values between The process involves backpropagating the heterogeneous graph based on the loss value to obtain an updated heterogeneous graph, incrementing the optimization count and the iteration round count by 1. If the optimization count reaches the preset total number of optimizations, the optimized first final encoding representation matrix is then... As a complete representation matrix of all medical codes in the electronic health record data .
7. The disease prediction method according to claim 1, characterized in that, The medical records also include the patient's demographic information: The complete representation matrix based on the medical code is processed using an improved GRU model to obtain the patient's medical records. T The patient's final statement at the initial visit included: Through the linear layer, the patient to be predicted u The demographic information is processed to obtain the patient to be predicted. u initial representation ; Using the complete representation matrix of all medical codes in the electronic health record data The patient to be predicted was obtained u No. t Diagnosis indicated in the next medical visit record The patient to be predicted u No. t Surgical indications from the next medical visit and the patient to be predicted u No. t Medication information in the next medical visit record , t= 1,2,..., T , T Indicates the total number of medical records; The patient to be predicted is calculated using the GRU module. u No. t Diagnosis concealment in subsequent medical visits : in, and All represent parameters. This indicates the measurement of the patient to be predicted. u No. t- The weight of information that needs to be retained in a single medical visit record. Indicates the patient to be predicted u No. t- A patient with only one medical visit record stated; The task-specific integration gate in the fusion module is used to predict the patient. u No. t Diagnosis concealment in subsequent medical visits Calculations are performed to obtain the patient to be predicted. u No. t The patient's medical record indicates : in, Indicates the patient to be predicted u No. t Patients whose second medical visit records are hidden indicate that... Indicates the patient to be predicted u No. t The weighting of updating the next medical visit record Represents task-specific integration gate operations: in, Indicates the patient to be predicted u No. t The influence weight of the surgical code in the patient's medical record. Indicates the patient to be predicted u No. t The influence weight of drug codes in the patient's medical record. , , and All represent parameters; The temporal enhancement module is used to predict the patient. u No. t The patient's medical record indicates Calculations are performed to obtain the patient to be predicted. u No. t Differences in the medical records indicate : in, Indicates the patient to be predicted u No. t- The difference in a single medical visit record indicates that Indicates the patient to be predicted u No. t The update weights are represented by the differences in the patient visit records. Indicates the patient to be predicted u No. t- First medical visit record and the first t Temporary differences between medical records are indicated as follows: in, and All represent parameters; Through the formula: The patient to be predicted was calculated. u No. T The patient at the second visit ultimately stated ; in, Indicates the patient to be predicted u No. T The differences in the medical records indicate that Indicates the patient to be predicted u No. T The patient stated in their previous medical record.
8. A disease prediction device, characterized in that, include: The co-occurrence graph module is used to construct a co-occurrence graph based on medical codes in electronic health record data. The electronic health record data includes data from multiple patients. T Each medical visit record includes multiple medical codes, and the multiple nodes in the co-occurrence relationship graph correspond one-to-one with the multiple medical codes in the electronic health record data; The heterogeneous relationship graph module is used to construct a heterogeneous relationship graph based on the type of medical code in the electronic health record data; Multiple nodes in the heterogeneous relationship graph correspond one-to-one with the medical codes in the electronic health record data; The first acquisition module is used to acquire the first final coding representation matrix of all medical codes in the electronic health record data based on the co-occurrence relationship graph; The second acquisition module is used to acquire the second final coding representation matrix of all medical codes in the electronic health record data based on the heterogeneous relationship graph; The optimization module optimizes the first final encoding representation matrix using the second final encoding representation matrix to obtain a complete representation matrix of all medical codes in the electronic health record data. The processing module is used to process the patient's medical records based on the complete representation matrix of the medical code using an improved GRU model to obtain the first... T The patient's final statement during the second visit was: The improved GRU model includes: a linear layer for acquiring the initial representation, diagnostic representation, surgical representation, and drug representation of the patient to be predicted; a GRU module for obtaining a hidden diagnostic representation of the patient based on the initial and diagnostic representations; a fusion module for fusing the hidden diagnostic representation, surgical representation, and drug representation to obtain a patient representation; and a module for obtaining the first... T The temporal enhancement module representing the patient's final presentation at the first visit; The prediction module utilizes the disease prediction module to predict the first... T The patient at the second visit ultimately indicated that an evaluation would be conducted, and the predicted patient was identified at the [number]th visit. T+ Predicted results at the time of a single medical visit; The co-occurrence relation graph module is specifically constructed based on the co-occurrence adjacency matrix; the edge between each two nodes in the co-occurrence relation graph is used to represent the influence weight between the corresponding two medical codes; The heterogeneous relationship graph module specifically calculates the diagnostic code representation matrix, surgical code representation matrix, and drug code representation matrix based on the type of medical codes in the electronic health record data. Then, it calculates the diagnostic adjacency matrix for diagnostic codes, the surgical adjacency matrix for surgical codes, and the drug adjacency matrix for drug codes. Finally, it concatenates the diagnostic adjacency matrix, the surgical adjacency matrix, and the drug adjacency matrix to obtain a heterogeneous adjacency matrix, and then constructs a heterogeneous relationship graph based on the heterogeneous adjacency matrix. In the heterogeneous relationship graph, the edge between each two nodes represents the elements of the corresponding two medical codes in the heterogeneous adjacency matrix.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the disease prediction method as described in any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the disease prediction method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Heterogeneous data feature fusion method in electronic medical record, prediction method and system based on fusion features, and readable storage medium
CN113517046A
Prescription drug prediction model based on enhanced graph space-time convolutional network
CN115910269A
