Disease prediction method and device based on implicit knowledge enhancement, equipment and medium
By integrating the multi-dimensional data of patients and the implicit knowledge in the medical records, a disease prediction model with multi-source information fusion was constructed, which solved the problem of the lack of interpretability and insufficient information integration in the existing models in disease prediction, and achieved more accurate and transparent disease prediction results.
Patent Information
- Application Number
- CN202411895104.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-21
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-21
AI Technical Summary
The existing deep learning models lack interpretability in disease prediction, fail to effectively integrate external medical knowledge, ignore multi-source information such as patient static information, main diagnostic information, similar patient information and heterogeneous diagrams in the treatment timing, resulting in insufficient understanding of the patient's health status and limited prediction accuracy.
By obtaining the patient's historical medical record characterization and static information characterization, comprehensive patient characterization is calculated and backbone network is trained, similar patients are screened, heterogeneous diagrams of the visit timing are constructed and encoding, and comprehensive disease characterization is fused with multi-source information to build, and disease prediction models are trained to output prediction results.
It improves the accuracy of disease prediction, provides a clear explanation of predicted results, and enhances the application value and credibility of the model in the medical field.
Smart Images

Figure CN119889649A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of medical health technology, and in particular relates to a disease prediction method, device, equipment and medium based on implicit knowledge enhancement. Background Art
[0002] In the field of healthcare, using deep learning models to predict diseases has become an important research direction. Compared with traditional machine learning methods, deep learning models can learn complex features and correlations from data, thereby predicting diseases more effectively. The interpretability of deep learning models is directly related to the accuracy of disease prediction results and the transparency of medical decisions.
[0003] At present, the application of deep learning models in the field of disease prediction mainly includes traditional disease prediction models, interpretable disease prediction models, knowledge-enhanced disease prediction models, and disease prediction models that integrate similar patients. Traditional disease prediction models usually use unsupervised deep learning methods to predict the patient's future health status by analyzing HER (electronic health records) data. Interpretable disease prediction models usually process HER data through two levels of neural network attention mechanisms, where the first level of attention focuses on the importance of historical visits and the other level of attention focuses on the key diagnoses in the visits. Finally, the visit records are modeled through RNN (Recurrent Neural Network), which provides an explanation of the prediction results while maintaining the accuracy of the prediction. Or the contextual information of the medical code is captured through the attention mechanism and RNN structure, and the time-aware disease progression function is used to simulate the dynamic changes of the impact of different diseases on the patient's future visits, while providing explanations by analyzing and understanding the influence of different medical codes on the patient's future visit risks. Knowledge-enhanced disease prediction models treat the disease hierarchy as internal knowledge and enrich the disease information by utilizing the parent nodes and child nodes in the hierarchy, thereby more accurately modeling patient representations. Disease prediction models that integrate similar patients use statistical or numerical methods to measure the similarity between patients, that is, by standardizing all the characteristics of the patients and then using distance-based metrics to evaluate the similarity.
[0004] In summary, although deep learning technology has made significant progress in the field of healthcare, it still faces the following shortcomings:
[0005] 1) Many current deep learning models are used as black boxes in disease prediction and lack interpretability. Although some models attempt to provide explanations through attention mechanisms, they are not comprehensive enough. In addition, most existing models only use patients' discrete medical records and fail to effectively integrate external medical knowledge. Even knowledge-enhanced methods often only focus on the hierarchical structure or direct relationship between diseases, and fail to fully consider the more complex and subtle interactions between diseases, limiting the model's comprehensive understanding and accurate prediction of patients' health status.
[0006] 2) Existing models generally ignore multiple sources of information such as patients’ static information, primary diagnosis information, similar patients’ information, and heterogeneous time series graphs of medical visits. They also often regard diseases in medical records as unordered sets, ignoring the complex interactions between diseases. In terms of patient similarity calculation, the global information of medical records may be lost, affecting the model’s ability to capture the patient’s overall condition, resulting in insufficient modeling of patient status, thereby affecting the accuracy of disease prediction.
[0007] 3) Existing models have generalization problems in disease prediction and are often limited to specific diseases and difficult to expand to multiple disease situations. This limits the model's ability to be applied in complex medical scenarios and restricts its widespread application and long-term effectiveness in actual clinical settings. Summary of the invention
[0008] The present application provides a disease prediction method, device, equipment and medium based on implicit knowledge enhancement, aiming to solve at least one of the above-mentioned technical problems in the prior art to a certain extent.
[0009] In order to solve the above problems, this application provides the following technical solutions:
[0010] A disease prediction method based on implicit knowledge enhancement, comprising:
[0011] Obtaining a patient's historical medical record representation and a static information representation, calculating a comprehensive patient representation based on the historical medical record and the static information representation, and using the comprehensive patient representation to train a backbone network;
[0012] Input the historical medical record representations of all patients into the backbone network, calculate the patient representation matrix through the backbone network, and use cosine similarity to screen out K similar patient representations with the highest similarity to the target patient;
[0013] Extracting disease types and relationship types between different disease types from the historical medical record representation, constructing a medical time series heterogeneous graph according to the disease types and relationship types, and encoding the medical time series heterogeneous graph using a heterogeneous graph encoding algorithm to obtain a representation of the patient's medical graph level;
[0014] A comprehensive disease representation is constructed using the comprehensive patient representation, similar patient representations, and a heterogeneous graph representation of the medical consultation time series. A disease prediction model is trained based on the comprehensive disease representation, and a disease prediction result is output using the trained disease prediction model.
[0015] The technical solution adopted by the embodiment of the present application also includes: obtaining the patient's historical medical record representation and static information representation, calculating the patient's comprehensive representation based on the historical medical record and static information representation, and using the patient's comprehensive representation to train a backbone network, specifically:
[0016] Encoding the static information representation, and fusing the encoded static information representation with the historical medical record representation to obtain a backbone network;
[0017] The comprehensive representation of the patient is calculated according to the historical medical records and the static information representation, the main diagnosis prediction is performed using the comprehensive representation of the patient, and the backbone network is optimized and trained by using multi-label cross entropy as a loss function to obtain a trained backbone network.
[0018] The technical solution adopted by the embodiment of the present application also includes: the static information representation includes the patient's gender information sex (i) , age information (i) and race information (i) , the encoding of the static information representation is specifically:
[0019] The gender information sex is encoded by one-hot encoding (i) Convert to a binary vector x sex ;
[0020] The age information age is normalized (i) Mapped to a value range of 0 to 1 and represented by x age In order to reflect the differences between different age groups;
[0021] The race information race is encoded by one-hot encoding (i) Convert to num r dimensional vector x race , where num r represents the number of all ethnicities in the dataset;
[0022] The encoded x sex 、x age 、x race Splice to get the patient's static information representation
[0023] The technical solution adopted by the embodiment of the present application also includes: inputting the historical medical record representations of all patients into the backbone network, calculating the patient representation matrix through the backbone network, and using cosine similarity to screen out K similar patient representations with the highest similarity to the target patient, specifically:
[0024] Traverse the patient representation matrix M p , use cosine similarity to calculate the distance between any two patients, two patients P i ∈M p and P j ∈M p The distance between is calculated as:
[0025]
[0026] Among them, H i and H j Patient P i and P j The representation of , “·” represents the vector dot product, and |·| represents the Euclidean norm of the vector;
[0027] According to the distance calculation results, the similarities between all patients are sorted, and the patient with the target patient P is selected. i The top-k similar patients with the highest similarity simP (i) , apply the cross attention mechanism to obtain the similar patients P j ∈simP (i) Weighted representation;
[0028] The representations of all similar patients are weighted and summed by attention weights to obtain the comprehensive similar patient representation H simP .
[0029] The technical solution adopted by the embodiment of the present application also includes: extracting the disease type and the relationship type between different disease types from the historical medical record representation, and constructing a medical time series heterogeneous graph according to the disease type and the relationship type, specifically:
[0030] The disease types include persistent diseases, diseases caused by previous diseases, and sudden diseases. The relationship types between the different disease types include co-occurrence relationship, inheritance relationship, and causal relationship. i and c j When they appear together in the same medical record, the disease is considered i and c j There is a co-occurrence relationship between them. At this time, in the disease c i With c j construct an edge between them and define the edge type as “Co-occurring”; when the disease ci In two consecutive visits V t-1 and V t If it appears in i It is a disease inherited from a previous visit. In this case, it is disease c i Construct a self-loop and define the edge type as "Inherited"; when the disease c j Appears in the current medical record V t In the previous visit record V t-1 Does not appear in, but is related to V t-1 Diseases in i If there is a co-occurrence relationship, then c j With c i There is an inducement relationship. At this time, construct a line from c i to c j and define the edge type as "Cause";
[0031] A heterogeneous graph G of medical consultation time series is constructed based on the relationship types and edge types between different disease types.
[0032] The technical solution adopted by the embodiment of the present application also includes: the heterogeneous graph encoding algorithm is used to encode the heterogeneous graph of the time series of medical consultation to obtain the heterogeneous graph representation of the patient's time series of medical consultation, specifically:
[0033] A BERT model is obtained by pre-training the historical medical records of all patients with only one medical record, and the BERT model is used to initialize the representation of each node in the medical time series heterogeneous graph G;
[0034] Obtain a visit subgraph consisting of different edge types from the visit time series heterogeneous graph G after the representation is initialized, and use a multi-layer graph attention network to encode each visit subgraph respectively. After performing the encoding operation on all visit subgraphs, integrate the representations under all relationship types to obtain the final representation of node i at the lth layer
[0035] Through global average pooling, global information is extracted from each medical consultation sub-graph to obtain sub-graph representations representing each medical consultation sub-graph.
[0036] Use LSTM to represent all subgraphs After processing, we get the heterogeneous graph representation H of the time series of medical consultations G for:
[0037]
[0038] Where T represents the total number of visits of the patient, Represents the subgraph representation obtained during the t-th visit.
[0039] The technical solution adopted by the embodiment of the present application also includes: constructing a comprehensive disease representation by using the comprehensive patient representation, similar patient representations and the heterogeneous graph representation of the time series of medical consultations, training a disease prediction model according to the comprehensive disease representation, and outputting a disease prediction result by using the trained disease prediction model, and further includes:
[0040] The historical medical contribution is extracted from the patient's historical medical records, and the key path in the medical time series heterogeneous graph G and the related paths of similar patients are extracted. The historical medical contribution, the key path and the related paths of similar patients are used as reasoning basis, and the reasoning basis is converted into prompt words according to a preset prompt word template, and the LLMs model is guided to generate an explanatory text of the disease prediction result according to the prompt words.
[0041] Another technical solution adopted by the embodiment of the present application is: a disease prediction device based on implicit knowledge enhancement, comprising:
[0042] Backbone network construction module: used to obtain the patient's historical medical record representation and static information representation, calculate the patient's comprehensive representation based on the historical medical record and static information representation, and use the patient's comprehensive representation to train the backbone network;
[0043] Similarity screening module: used to input the historical medical record representations of all patients into the backbone network, calculate the patient representation matrix through the backbone network, and use cosine similarity to screen out K similar patient representations with the highest similarity to the target patient;
[0044] Heterogeneous graph construction module: used to extract disease types and relationship types between different disease types from the historical medical record representation, construct a medical time series heterogeneous graph according to the disease types and relationship types, and encode the medical time series heterogeneous graph using a heterogeneous graph encoding algorithm to obtain a patient's medical time series heterogeneous graph representation;
[0045] Disease prediction module: used to construct a comprehensive disease representation using the patient comprehensive representation, similar patient representations and the heterogeneous graph representation of the medical consultation time series, train a disease prediction model based on the comprehensive disease representation, and output a disease prediction result using the trained disease prediction model.
[0046] Another technical solution adopted by the embodiment of the present application is: a device, the device includes a processor and a memory coupled to the processor, wherein:
[0047] The memory stores program instructions for implementing the disease prediction method based on implicit knowledge enhancement;
[0048] The processor is used to execute the program instructions stored in the memory to control the disease prediction method based on implicit knowledge enhancement.
[0049] Another technical solution adopted by the embodiment of the present application is: a medium storing program instructions executable by a processor, wherein the program instructions are used to execute the disease prediction method based on implicit knowledge enhancement.
[0050] Compared with the prior art, the beneficial effects of the embodiments of the present application are as follows: the disease prediction method, device, equipment and medium based on implicit knowledge enhancement of the embodiments of the present application propose a disease prediction model based on implicit knowledge enhancement, which integrates the multi-dimensional data of patients, mines and utilizes implicit knowledge such as similar patients and heterogeneous graphs of medical treatment time series in medical records, and enhances patient modeling by utilizing the group wisdom of similar patients and the potential complex relationship between diseases. The medical treatment time series heterogeneous graph is encoded through heterogeneous graph coding technology and sequence modeling technology to more accurately capture the complex relationship between diseases and the dynamic evolution of patients' health status, and the historical medical contribution, critical path and related paths of similar patients are combined to form a task-specific reasoning basis. Combined with a large language model, a context-related explanatory text that conforms to domain expertise is generated for the prediction results, which not only improves the accuracy of disease prediction, but also provides a clear explanation for the prediction results, thereby improving the model performance while enhancing its practical application value and credibility in the medical field. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] Figure 1 is a flow chart of a disease prediction method based on implicit knowledge enhancement according to an embodiment of the present application;
[0052] Figure 2 A schematic diagram of a backbone network and its pre-training process according to an embodiment of the present application;
[0053] Figure 3 This is a schematic diagram of the structure of a disease prediction device based on implicit knowledge enhancement according to an embodiment of the present application;
[0054] Figure 4 A schematic diagram of the device structure of an embodiment of the present application;
[0055] Figure 5 Schematic diagram of the structure of the medium of the embodiment of the present application. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0057] The terms "first", "second", "third" in this application are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Thus, the features defined as "first", "second", "third" can expressly or implicitly include at least one of the features. In the description of this application, the meaning of "multiple" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined. In the embodiments of this application, all directional indications (such as up, down, left, right, front, back...) are only used to explain the relative position relationship, movement, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication also changes accordingly. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device comprising a series of steps or units is not limited to the steps or units listed, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices.
[0058] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0059] Specifically, see Figure 1 , is a flow chart of a disease prediction method based on implicit knowledge enhancement in an embodiment of the present application. The disease prediction method based on implicit knowledge enhancement in an embodiment of the present application comprises the following steps:
[0060] S100: Obtain the patient's historical medical record representation and static information representation respectively, encode the static information representation, and then fuse it with the historical medical record representation to obtain a backbone network;
[0061] In this step, the backbone network is designed based on the patient medical record encoding module in the disease prediction model IKxDP based on implicit knowledge enhancement. Specifically, the patient's historical medical record representation is first obtained through the patient medical record encoding module in IKxDP, and the patient's static information representation is obtained through the MIMIC (Medical Information Martfor Intensive Care, a large public clinical database) database. After encoding the static information representation, the historical medical record representation is fused with the patient's static information representation to obtain the backbone network. The backbone network can be expressed as:
[0062]
[0063] in, represents the health status of patient i, V (i) Represents the patient's historical medical records. Represents a static information representation of the patient.
[0064] Furthermore, the obtained static information representation includes the patient's gender information sex (i) , age information (i) and race information (i) The encoding process of encoding the representation of static information includes:
[0065] Gender information is encoded using one-hot encoding (i) Convert to a binary vector x sex ;
[0066] By normalizing the age information (i) Mapped to a value range of 0 to 1 and represented by x age In order to reflect the differences between different age groups;
[0067] The race information is encoded using one-hot encoding. (i) Convert to num r dimensional vector x race , where num r Represents the number of all ethnicities in the dataset.
[0068] After encoding all individual static information, the encoded individual static information is spliced as the patient's static information representation
[0069] S110: Calculate the patient's comprehensive representation based on the patient's historical medical records and static information representation, use the comprehensive representation to predict the main diagnosis, and use multi-label cross entropy as the loss function to optimize the backbone network to obtain a trained backbone network;
[0070] In this step, if Figure 2 The figure shows the backbone network and its pre-training process of the embodiment of the present application. First, the patient's historical medical records and static information representation are obtained through the MIMIC data set, and the main diagnosis of each visit of the patient is extracted. The patient's comprehensive representation H representing the patient's health status is calculated based on the patient's historical medical records and static information. p , and then use the patient comprehensive representation H p Perform the main diagnosis prediction, optimize the backbone network by using multi-label cross entropy as the loss function, obtain the trained backbone network, and save it for application in downstream tasks.
[0071] S120: Input the historical medical record representations of all patients into the trained backbone network, calculate the representations of all patients through the backbone network, obtain the patient representation matrix, traverse the patient representation matrix, use cosine similarity to calculate the distance between any two patients, and select K similar patient representations with the highest similarity to the target patient based on the distance calculation results;
[0072] In this step, after successfully pre-training and saving the backbone network, the representation of all patients can be calculated by loading the backbone network and combining the patient's historical medical record representation to obtain the patient representation matrix M p , and traverse the patient representation matrix M p , use cosine similarity to calculate the distance between any two patients, and select the K similar patients with the highest similarity to the target patient based on the distance calculation results H simP , which is used to capture the health status information of other patients similar to the target patient, and provide the target patient with predictions and suggestions based on group wisdom, thereby improving the accuracy of disease prediction for the target patient.
[0073] Specifically, the screening process for similar patient characteristics includes the following steps:
[0074] S121: Traverse the patient representation matrix M p , use cosine similarity to calculate the distance between any two patients, two patients P i ∈M p and P j ∈M p The distance between is calculated as:
[0075]
[0076] Among them, H i and H j Patient P i and P j The representation of , “·” represents the vector dot product, and |·| represents the Euclidean norm of the vector.
[0077] S122: Sort the similarities between all patients according to the distance calculation results, and select the patient P i The top-k similar patients with the highest similarity simP (i) , for the selected similar patients P j ∈simP (i) , and apply the cross attention mechanism to obtain its weighted representation:
[0078]
[0079] Among them, W is the learnable weight matrix.
[0080] S123: The representations of all similar patients are weighted and summed by attention weights to obtain a comprehensive similar patient representation H simP , the specific weighted summation calculation method is:
[0081]
[0082] S130: extracting disease types and relationship types between different disease types from the historical medical records of all patients using a data statistical algorithm, constructing a medical time series heterogeneous graph according to the disease types and relationship types, and encoding the medical time series heterogeneous graph using a heterogeneous graph encoding algorithm to obtain a medical time series heterogeneous graph representation of the patient;
[0083] In this step, the embodiment of the present application obtains disease types and relationship types based on data statistical analysis, so as to adaptively learn and reveal potential connections between diseases from different medical data without relying on external knowledge bases. Specifically, disease types include persistent diseases, diseases caused by previous diseases, and sudden diseases. Among them, persistent diseases refer to diseases that appear in at least two consecutive medical records. For example, a disease c i Also appears in the medical record V t and V t-1 In the i Classified as a persistent illness. An illness caused by a previous illness is one that appears in the current medical record V t and the previous visit record V t-1 Diseases in which there is a co-occurrence relationship can be obtained based on the global co-occurrence matrix M. The specific construction method of M is:
[0084]
[0085] Where I{·} is an indicator function, I(i, j) = 1 if and only if diseases i and j appear in the same medical record; otherwise, (i, j) = 0. To ensure the significance of the co-occurrence relationship, in the embodiment of the present application, a relationship threshold θ is set. When the co-occurrence frequency C of two diseases ij When the relationship threshold θ is exceeded, the two diseases are judged to have a significant co-occurrence relationship. The judgment method is shown in the following formula:
[0086]
[0087] The above determination method can accurately identify and quantify the co-occurrence relationship between different diseases, and filter out accidental or low-frequency co-occurrences, so as to better characterize the relationship between diseases.
[0088] Sudden illness refers to only the current medical record V t In the previous visit record V t-1 It has never appeared in the game, and it is related to V t-1 Diseases that have no direct co-occurrence relationship.
[0089] The relationship types between different disease types include co-occurrence relationship, inheritance relationship and causation relationship. Among them, co-occurrence relationship refers to when two disease c i and c j When the two diseases co-occur in the same medical record, it is considered that there is a co-occurrence relationship between the two diseases. i With c j An edge is constructed between them, and the type of the edge is defined as "Co-occurring". The inheritance relationship means that if a disease c i In two consecutive visits V t-1 and V t If both appear in i It is a disease inherited from a previous visit. In this case, it is disease c i Construct a self-loop and define the edge type as "Inherited". The causal relationship refers to when a disease c j Appears in the current medical record V t In the previous visit record V t-1 Does not appear in, but is related to V t-1 A disease in i If there is a co-occurrence relationship, then c j With c i There is an inducement relationship. At this time, construct a line from c i to c j and define the edge type as "Cause".
[0090] Finally, a heterogeneous graph G of medical consultation time series is constructed based on the relationship types and edge types between different disease types. It can not only represent the potential complex relationship between diseases, but also be used to analyze the dynamic evolution of patients' health status, provide a new perspective for patient modeling, and further enrich the representation of patients.
[0091] Furthermore, since the medical consultation time series heterogeneous graph G is a heterogeneous graph, the traditional graph neural network model is not suitable for directly encoding it. Therefore, the embodiment of the present application designs a heterogeneous graph encoding algorithm according to the characteristics of the task, and the specific encoding process includes the following steps:
[0092] S131: Pre-train the historical medical record representations of all patients with only one medical record to obtain a BERT (Bidirectional Encoder Representations from Transformers, a Transformer-based deep learning model) model, and use the BERT model to initialize the representation of each node in the medical time series heterogeneous graph G;
[0093] The representation initialization process is as follows: Assume that node c in the heterogeneous graph G of the medical consultation time series i The initialization representation is x i ∈R dim , where dim is the dimension of representation, using the representation matrix E N The node c i Node type n i ∈N maps to a vector space of fixed dimension, where E N ∈R |N|×dim , N is the number of node types; based on this, we get node c i Enhanced representation of node type x′ i , the specific calculation is:
[0094] x′ i =x i +E N [n i ] (7)
[0095] where n i is the node type, E N [n i ] indicates node type n i representation.
[0096] S132: Obtain a visit subgraph consisting of different edge types from the visit time series heterogeneous graph G after representation initialization, and encode each visit subgraph separately using a multi-layer graph attention network;
[0097] In order to deeply model the complex relationships in the heterogeneous graph G of the time series of medical consultations, the embodiment of the present application uses a multi-layer graph attention network to encode them. Specifically, for the relationship type r∈R in the heterogeneous graph G of the time series of medical consultations, first obtain the medical consultation subgraph G consisting of all nodes and edges with the relationship type r r , and then use a separate graph attention network to the visit subgraph G r Encode, in the consultation subgraph G r In the example, the current node i and its neighboring nodes The previous layer representation of is used to update the current layer representation of node i. The specific calculation formula is as follows:
[0098]
[0099] in, and It is the weight matrix of the lth layer of the graph neural network, which is used for the linear transformation of node features. represents the importance of node j to update the representation of node i under relationship type r. It can also represent the attention weight of the edge between node j and node i, which is used to identify and extract the key path in the heterogeneous graph of the time series of medical consultations, thereby revealing the potential pattern of disease progression. Specifically, The calculation formula is:
[0100]
[0101] Among them, a T is the parameter of the learned attention mechanism, σ (r) Represents a nonlinear activation function, such as LeakyReLU, and “|” represents a feature concatenation operation.
[0102] After performing the above encoding operation on all the consultation subgraphs, the representations of all relationship types r∈R are integrated to obtain the final representation of node i at layer l for:
[0103]
[0104] S133: Extract global information from each medical consultation subgraph through global average pooling to obtain subgraph representations representing each medical consultation subgraph.
[0105] Among them, after encoding each visit subgraph separately using a multi-layer graph attention network, global information is extracted from each visit subgraph through global average pooling, and the global information is extracted from each visit subgraph by calculating the V t In the corresponding visit subgraph, all nodes are represented in the last layer of the graph attention network. The average value of is realized, so as to obtain a subgraph representation that can represent the consultation subgraph The global information calculation formula is as follows:
[0106]
[0107] S134: Use LSTM to represent all subgraphs After processing, we get the heterogeneous graph representation H of the time series of medical consultations G for:
[0108]
[0109] Where T represents the total number of visits of the patient, H represents the subgraph representation obtained from the t-th visit. G It can not only handle the complex relationships between diseases in each visit, but also capture the dynamic evolution of the patient's health status.
[0110] S140: construct a comprehensive disease representation using the comprehensive patient representation, similar patient representation, and the heterogeneous graph representation of the medical consultation time series, train a disease prediction model based on the comprehensive disease representation, and output a disease prediction result using the trained disease prediction model;
[0111] In this step, the model training strategy is the same as IKxDP. p , similar patient characterization H simP And the heterogeneous graph representation of the time series of medical consultations H G Building a comprehensive disease representation all The comprehensive representation of the disease is input into the MLP (Multilayer Perceptron) model for training. The loss function is calculated based on the output results of the MLP model and the disease prediction model is trained. This not only integrates the multi-dimensional information of the patient, deeply captures the personalized health status and dynamic evolution of the health status of the target patient, but also draws on the collective wisdom of similar patients, significantly improving the disease prediction ability of the model.
[0112] S150: extracting the historical visit contribution from the patient's historical visit records, and extracting the key path and the related path of similar patients in the visit time series heterogeneous graph, taking the historical visit contribution, the key path and the related path of similar patients as the reasoning basis, converting the reasoning basis into the prompt word according to the preset prompt word template, and guiding the large language model (LLMs) to generate the explanation text of the disease prediction result according to the prompt word;
[0113] In this step, the process of extracting the reasoning basis is as follows:
[0114] 1) Contribution of historical medical treatment records: Based on the IKxDP model’s analysis of the importance of historical medical records, the contribution of historical diseases to disease prediction results is calculated and used as part of the reasoning basis.
[0115] 2) Critical path extraction: The critical path in the heterogeneous graph of the medical consultation time series is extracted by attention weights It is found that the larger the attention weight is, the more attention the model pays to this edge when predicting. Specifically, the key path extraction algorithm includes: in the heterogeneous graph of the medical consultation time series G = {G1, G2, ..., G T}, V represents the set of all nodes, and E represents the set of all edges. Each edge e i,j ∈E has a weight α ij , which is used to measure the importance of the edge in the entire heterogeneous graph of the time series of medical consultations. In order to quantify the importance of each path in the heterogeneous graph of the time series of medical consultations, we first summarize all the nodes in the heterogeneous graph of the time series of medical consultations to form a node set N G ; Then, by traversing N G For each node v∈N G , calculate all edges e with v as the end point i,v The sum of the weights of the node v is used to obtain the weight score of the path corresponding to the node v. v , the specific calculation formula is as follows:
[0116]
[0117] Among them, {end(E)} represents the end point set of all edges in the heterogeneous graph of medical consultation time series. Finally, the weight score Weight v Arrange in descending order, and select the paths corresponding to the top-k endpoints with the highest scores as the key paths. By extracting the key paths from the heterogeneous graph of the time series of medical consultations, we can mine the disease paths that the model focuses on in the decision-making process, thereby assisting in the interpretation of the disease prediction results.
[0118] 3) Related path analysis of similar patients: The key path of the target patient is compared with the related paths of similar patients. If the same path also exists in similar patients, it is considered that the path can be used as a related path for auxiliary explanation and used as part of the reasoning basis.
[0119] Finally, the historical visit contribution, critical paths, and related paths of similar patients are combined to form task-specific reasoning basis, which is converted into prompt words through a preset prompt template, and the LLMs are guided to generate explanatory text of the disease prediction results according to the prompt words.
[0120] It can be understood that the application scope of the embodiments of the present application is not limited to disease prediction, but can also be flexibly extended to multiple medical fields such as drug recommendation and personalized treatment plan formulation. It has significant scalability and adaptability, and can effectively integrate patients' multimodal data or medical information. In terms of multimodal data fusion, the embodiments of the present application also provide the potential for further optimization, and can introduce more advanced and flexible fusion strategies such as attention mechanisms or graph neural networks, which can dynamically adjust the weights of different modal data in the decision-making process according to their relative importance.
[0121] Based on the above, the disease prediction method based on implicit knowledge enhancement in the embodiment of the present application proposes a disease prediction model based on implicit knowledge enhancement. The model integrates the patient's multi-dimensional data, mines and utilizes implicit knowledge such as similar patients and heterogeneous graphs of medical treatment time series in the medical records, and enhances patient modeling by utilizing the group wisdom of similar patients and the potential complex relationship between diseases. The medical treatment time series heterogeneous graph is encoded through heterogeneous graph coding technology and sequence modeling technology to more accurately capture the complex relationship between diseases and the dynamic evolution of patients' health status, and the historical medical contribution, critical path and related paths of similar patients are combined to form a task-specific reasoning basis. Combined with a large language model, a context-related and domain-specific explanatory text is generated for the prediction results, which not only improves the accuracy of disease prediction, but also provides a clear explanation for the prediction results, thereby improving the model performance while enhancing its practical application value and credibility in the medical field.
[0122] See also Figure 3 , is a schematic diagram of the structure of a disease prediction device based on implicit knowledge enhancement in an embodiment of the present application. The disease prediction method device 40 based on implicit knowledge enhancement in an embodiment of the present application includes:
[0123] Backbone network construction module 41: used to obtain the patient's historical medical record representation and static information representation, calculate the patient's comprehensive representation according to the historical medical record and static information representation, and use the patient's comprehensive representation to train the backbone network;
[0124] Similarity screening module 42: used to input the historical medical record representations of all patients into the backbone network, calculate the patient representation matrix through the backbone network, and use cosine similarity to screen out K similar patient representations with the highest similarity to the target patient;
[0125] Heterogeneous graph construction module 43: used for extracting disease types and relationship types between different disease types from the historical medical record representation, constructing a medical time series heterogeneous graph according to the disease types and relationship types, and encoding the medical time series heterogeneous graph using a heterogeneous graph encoding algorithm to obtain a medical time series heterogeneous graph representation of the patient;
[0126] Disease prediction module 44: used to construct a comprehensive disease representation using the patient comprehensive representation, similar patient representations and the heterogeneous graph representation of the medical consultation time series, train a disease prediction model according to the comprehensive disease representation, and output a disease prediction result through the trained disease prediction model.
[0127] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0128] The device provided in the embodiment of the present application can be applied in the aforementioned method embodiment. For details, please refer to the description of the aforementioned method embodiment, which will not be repeated here.
[0129] See also Figure 4 , is a schematic diagram of the device structure of an embodiment of the present application. The device 50 includes:
[0130] A memory 51 storing executable program instructions;
[0131] A processor 52 connected to the memory 51;
[0132] The processor 52 is used to call the executable program instructions stored in the memory 51 and perform the following steps: obtain the patient's historical medical record representation and static information representation, calculate the patient's comprehensive representation based on the historical medical record and static information representation, and use the patient's comprehensive representation to train a backbone network; input the historical medical record representations of all patients into the backbone network, calculate the patient representation matrix through the backbone network, and use cosine similarity to screen out K similar patient representations with the highest similarity to the target patient; extract the disease type and the relationship type between different disease types from the historical medical record representation, construct a medical time series heterogeneous graph based on the disease type and the relationship type, and use a heterogeneous graph coding algorithm to encode the medical time series heterogeneous graph to obtain the patient's medical time series heterogeneous graph representation; construct a disease comprehensive representation using the patient comprehensive representation, similar patient representations, and medical time series heterogeneous graph representation, train a disease prediction model based on the disease comprehensive representation, and output a disease prediction result through the trained disease prediction model.
[0133] The processor 52 may also be referred to as a CPU (Central Processing Unit). The processor 52 may be an integrated circuit chip having signal processing capabilities. The processor 52 may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0134] See also Figure 5 , which is a structural diagram of the medium of the embodiment of the present application. The medium of the embodiment of the present application stores program instructions 61 that can implement the following steps: obtaining the patient's historical medical record representation and static information representation, calculating the patient's comprehensive representation based on the historical medical record and static information representation, and using the patient's comprehensive representation to train a backbone network; inputting the historical medical record representation of all patients into the backbone network, calculating the patient representation matrix through the backbone network, and using cosine similarity to screen out the K similar patient representations with the highest similarity to the target patient; extracting the disease type and the relationship type between different disease types from the historical medical record representation, constructing a medical time series heterogeneous graph according to the disease type and the relationship type, and encoding the medical time series heterogeneous graph using a heterogeneous graph encoding algorithm to obtain the patient's medical time series heterogeneous graph representation; constructing a disease comprehensive representation using the patient comprehensive representation, similar patient representations, and medical time series heterogeneous graph representation, training a disease prediction model according to the disease comprehensive representation, and outputting a disease prediction result through the trained disease prediction model.
[0135] Among them, the program instruction 61 can be stored in the above-mentioned medium in the form of a software product, including several instructions for enabling a device (which can be a personal computer, server, or network device, etc.) or a processor to execute all or part of the steps of each implementation method of the present application. The aforementioned medium includes: various media that can store program instructions, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or a terminal device such as a computer, a server, a mobile phone, or a tablet. Among them, the server can be an independent server, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDN), and big data and artificial intelligence platforms.
[0136] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the system embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0137] In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. The above is only an implementation method of the present application, and does not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made by using the description and drawings of this application, or directly or indirectly used in other related technical fields, is also included in the patent protection scope of the present application.
Claims
1. A disease prediction method based on implicit knowledge enhancement, characterized in that: include: Obtaining a patient's historical medical record representation and a static information representation, calculating a comprehensive patient representation based on the historical medical record and the static information representation, and using the comprehensive patient representation to train a backbone network; Input the historical medical record representations of all patients into the backbone network, calculate the patient representation matrix through the backbone network, and use cosine similarity to screen out K similar patient representations with the highest similarity to the target patient; Extracting disease types and relationship types between different disease types from the historical medical record representation, constructing a medical time series heterogeneous graph according to the disease types and relationship types, and encoding the medical time series heterogeneous graph using a heterogeneous graph encoding algorithm to obtain a medical time series heterogeneous graph representation of the patient; A comprehensive disease representation is constructed using the comprehensive patient representation, similar patient representations, and a heterogeneous graph representation of the medical consultation time series. A disease prediction model is trained based on the comprehensive disease representation, and a disease prediction result is output using the trained disease prediction model.
2. The disease prediction method based on implicit knowledge enhancement according to claim 1 is characterized in that: The step of obtaining the patient's historical medical record representation and static information representation, calculating the patient's comprehensive representation based on the historical medical record and static information representation, and using the patient's comprehensive representation to train a backbone network is specifically as follows: Encoding the static information representation, and fusing the encoded static information representation with the historical medical record representation to obtain a backbone network; The comprehensive representation of the patient is calculated according to the historical medical records and the static information representation, the main diagnosis prediction is performed using the comprehensive representation of the patient, and the backbone network is optimized and trained by using multi-label cross entropy as a loss function to obtain a trained backbone network.
3. The disease prediction method based on implicit knowledge enhancement according to claim 2 is characterized in that: The static information representation includes the patient's gender information sex (i) , age information (i) and race information (i) , the encoding of the static information representation is specifically: The gender information sex is encoded by one-hot encoding (i) Convert to a binary vector x sex ; The age information age is normalized (i) Mapped to a value range of 0 to 1 and represented by x age In order to reflect the differences between different age groups; The race information race is encoded by one-hot encoding (i) Convert to num r dimensional vector x race , where num r represents the number of all ethnicities in the dataset; The encoded x sex 、x age 、x race Splice to get the patient's static information representation 4. The disease prediction method based on implicit knowledge enhancement according to claim 3 is characterized in that: The historical medical record representations of all patients are input into the backbone network, the patient representation matrix is calculated by the backbone network, and the K similar patient representations with the highest similarity to the target patient are screened out using cosine similarity, specifically: Traverse the patient representation matrix M p , use cosine similarity to calculate the distance between any two patients, two patients P i ∈M p and P j ∈M p The distance between is calculated as: Among them, H i and H j Patient P i and P j The representation of "·", represents the dot product of vectors, and |·| represents the Euclidean norm of vectors; According to the distance calculation results, the similarities between all patients are sorted, and the patient with the target patient P is selected. i The top-k similar patients with the highest similarity simP (i) , apply the cross attention mechanism to obtain the similar patients P j ∈simP (i) Weighted representation; The representations of all similar patients are weighted and summed by attention weights to obtain the comprehensive similar patient representation H simP .
5. The disease prediction method based on implicit knowledge enhancement according to claim 4 is characterized in that: The extracting of disease types and relationship types between different disease types from the historical medical record representation, and constructing a medical time series heterogeneous graph according to the disease types and relationship types, is specifically as follows: The disease types include persistent diseases, diseases caused by previous diseases, and sudden diseases. The relationship types between the different disease types include co-occurrence relationship, inheritance relationship, and causal relationship. i and c j When they appear together in the same medical record, the disease is considered i and c j There is a co-occurrence relationship between them. At this time, in the disease c i With c j construct an edge between them and define the edge type as "Co-occurring"; when the disease c i In two consecutive visits V t-1 and V t If it appears in i It is a disease inherited from a previous visit. In this case, it is disease c i Construct a self-loop and define the edge type as "Inherited"; when the disease c j Appears in the current medical record V t In the previous visit record V t-1 Does not appear in, but is related to V t-1 Diseases in i If there is a co-occurrence relationship, then c j With c i There is an inducement relationship. At this time, construct a line from c i to c j The edge is defined as "Cause"; a heterogeneous graph G of the medical consultation time series is constructed based on the relationship types and edge types between different disease types.
6. The disease prediction method based on implicit knowledge enhancement according to claim 5 is characterized in that: The heterogeneous graph encoding algorithm is used to encode the heterogeneous graph of the medical consultation time sequence to obtain the heterogeneous graph representation of the patient's medical consultation time sequence, which is specifically: A BERT model is obtained by pre-training the historical medical records of all patients with only one medical record, and the BERT model is used to initialize the representation of each node in the medical time series heterogeneous graph G; Obtain a visit subgraph consisting of different edge types from the visit time series heterogeneous graph G after the representation is initialized, and use a multi-layer graph attention network to encode each visit subgraph respectively. After performing the encoding operation on all visit subgraphs, integrate the representations under all relationship types to obtain the final representation of node i at the lth layer Through global average pooling, global information is extracted from each medical consultation sub-graph to obtain sub-graph representations representing each medical consultation sub-graph. Use LSTM to represent all subgraphs After processing, we can get the heterogeneous graph representation H of the time series of medical consultations G for: Where T represents the total number of visits of the patient, Represents the subgraph representation obtained during the t-th visit.
7. The disease prediction method based on implicit knowledge enhancement according to any one of claims 1 to 6, characterized in that: After constructing a comprehensive disease representation using the comprehensive patient representation, similar patient representations, and the heterogeneous graph representation of the time series of medical consultations, training a disease prediction model based on the comprehensive disease representation, and outputting a disease prediction result using the trained disease prediction model, the method further includes: The historical medical contribution is extracted from the patient's historical medical records, and the key path in the medical time series heterogeneous graph G and the related paths of similar patients are extracted. The historical medical contribution, the key path and the related paths of similar patients are used as reasoning basis, and the reasoning basis is converted into prompt words according to a preset prompt word template, and the LLMs model is guided to generate an explanatory text of the disease prediction result according to the prompt words.
8. A disease prediction device based on implicit knowledge enhancement, characterized in that: include: Backbone network construction module: used to obtain the patient's historical medical record representation and static information representation, calculate the patient's comprehensive representation based on the historical medical record and static information representation, and use the patient's comprehensive representation to train the backbone network; Similarity screening module: used to input the historical medical record representations of all patients into the backbone network, calculate the patient representation matrix through the backbone network, and use cosine similarity to screen out K similar patient representations with the highest similarity to the target patient; Heterogeneous graph construction module: used to extract disease types and relationship types between different disease types from the historical medical record representation, construct a medical time series heterogeneous graph according to the disease types and relationship types, and encode the medical time series heterogeneous graph using a heterogeneous graph encoding algorithm to obtain a patient's medical time series heterogeneous graph representation; Disease prediction module: used to construct a comprehensive disease representation using the patient comprehensive representation, similar patient representations and the heterogeneous graph representation of the medical consultation time series, train a disease prediction model based on the comprehensive disease representation, and output a disease prediction result using the trained disease prediction model.
9. A device, characterized in that: The device comprises a processor and a memory coupled to the processor, wherein: The memory stores program instructions for implementing the disease prediction method based on implicit knowledge enhancement according to any one of claims 1 to 7; The processor is used to execute the program instructions stored in the memory to control the disease prediction method based on implicit knowledge enhancement.
10. A medium, characterized in that The device stores program instructions executable by a processor, wherein the program instructions are used to execute the disease prediction method based on implicit knowledge enhancement as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Medical consultation dialogue system and method applying heterogeneous graph neural network
CN112271001A
Risk prediction method and device, equipment and storage medium
CN114255872A
Heart failure patient re-admission prediction method fusing multivariate heterogeneous data
CN116092668A
Disease diagnosis and treatment path clustering method and system based on heterogeneous information network
CN116364299A
Disease prediction model training method and disease prediction system
CN117690578A
Cited By
Patient disease evolution relation prediction method and system based on time sequence diagram neural network
CN120565117A