Drug recommendation system based on causal co-occurrence enhancement

By constructing a co-occurrence graph and a causal structure graph of medical information, and combining graph attention neural networks and greedy equivalence search algorithms, the problem that existing drug recommendation algorithms cannot utilize global co-occurrence relationships is solved. This achieves causal relationship enhancement and calibration in drug recommendations, improving the accuracy and safety of recommendations.

CN121096522APending Publication Date: 2025-12-09SOUTH CHINA UNIV OF TECH

Patent Information

Application Number
CN202511063789.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2025-12-09

AI Technical Summary

Technical Problem

Existing drug recommendation algorithms cannot effectively utilize global co-occurrence relationships in medical big data, resulting in a poor knowledge base, limited recommendation capabilities, and the reliance on co-occurrence relationships may produce logically unreasonable suggestions, failing to meet the requirements of high safety and high reliability in clinical practice.

Method used

By constructing co-occurrence graphs and causal structure graphs for medical information, and using graph attention neural networks and greedy equivalence search algorithms to learn the embedding vectors and causal relationships of medical information, drug recommendations are made in combination with multilayer perceptrons and logistic regression, thereby enhancing co-occurrence relationships and calibrating causal effects.

Benefits of technology

It significantly improves the accuracy and interpretability of drug recommendations, ensuring that the recommended drugs are based on causal relationships and precise targeted therapy, thereby improving clinical applicability and safety.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121096522A_ABST
    Figure CN121096522A_ABST
Patent Text Reader

Abstract

The invention discloses a drug recommendation system based on causal co-occurrence enhancement, which fuses a co-occurrence relationship and a causal relationship between medical information to realize high-precision and high-safety personalized drug recommendation. Comprises: a medical information representation generation module based on a medical information co-occurrence relationship, used for constructing a medical entity co-occurrence graph and obtaining embedded representation through graph attention neural network learning; the patient treatment characterization generation module based on the medical information causal relationship constructs a treatment-level medical causal graph by using a causal discovery algorithm, and performs weighted fusion according to the causal roles (such as cause nodes and intermediate nodes) of entities to form patient treatment characterization; according to the drug recommendation module based on the co-occurrence causal relationship, co-occurrence enhancement factors and a causal effect matrix calibration mechanism are introduced on the basis of preliminary prediction, and it is ensured that a recommendation result has statistical rationality and causal interpretation at the same time. The accuracy, interpretability and clinical applicability of drug recommendation are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the technical field of drug recommendation, and in particular to a drug recommendation system based on causal co-occurrence enhancement. Background Technology

[0002] With the rapid development of information technology and the deepening of medical informatization, electronic medical records have accumulated massive amounts of multi-dimensional clinical data. This data not only records detailed patient diagnostic information, surgical records, symptoms, and signs, but also includes valuable treatment experiences such as medication regimens. How to effectively utilize this big data to extract potential medical knowledge and treatment patterns to assist doctors in clinical decision-making has become a research hotspot in the field of smart healthcare. Among these, building a precise and secure automated drug recommendation system is one of the core tasks. An efficient drug recommendation system can automatically generate personalized medication suggestions based on the patient's current condition. This can significantly improve doctors' work efficiency, reduce their decision-making burden, and help standardize the diagnosis and treatment process, reduce medication errors, and ensure patient safety.

[0003] In current research on drug recommendation algorithms, many methods can be categorized as instance-based, whose core logic is to analyze and model only the health status of a patient during a single medical visit. These algorithms treat a single medical record (containing a set of diagnoses, symptoms, etc.) as an independent input instance and then directly map it to a recommended drug combination. While this "case-by-case" approach is intuitive, its fundamental flaw in the context of precision medicine lies in its failure to effectively utilize the global co-occurrence relationships inherent in massive amounts of medical big data. The co-occurrence relationships between entities in medical information are an objective manifestation of the "collective clinical wisdom" accumulated from thousands of medical records. For example, a strong co-occurrence relationship between a rare symptom and a specific disease may be valuable knowledge summarized by many experienced doctors. Existing instance-based drug recommendation algorithms cannot learn and utilize this valuable knowledge accumulated globally and transcending individual medical records. They can only learn from a limited combination of entities existing in the current instance, resulting in a poor knowledge base and limited recommendation capabilities.

[0004] The second type of algorithm comprises deep learning-based methods that have emerged in recent years. Researchers utilize models such as recurrent neural networks and graph neural networks to learn the complex relationships between patient visit sequences or medical information entities. While these methods improve recommendation accuracy to some extent, they have a fundamental limitation: the relationships they uncover are essentially statistical correlations, rather than medical "causal relationships." In complex clinical settings, two medical information entities may frequently co-occur, perhaps simply because they are different manifestations of the same underlying disease, or one is a disease while the other is a medication used to treat its side effects. Relying solely on co-occurrence relationships for recommendations can easily lead to logically illogical or even harmful suggestions, failing to meet the high safety and reliability requirements of clinical practice.

[0005] Currently, drug recommendation methods based on electronic medical records can be mainly divided into two categories. The first category is instance-based drug recommendation methods. These methods model patient representations by analyzing the currently accessed medical information entities (such as diseases, symptoms, and medications) in the patient's medical record data to make drug recommendations. However, these methods have a fundamental limitation: the "associations" they uncover are essentially statistical correlations, rather than medical "causal relationships." In complex clinical settings, two medical information entities may frequently co-occur, possibly simply because they are different manifestations of the same underlying disease. Relying solely on co-occurrence relationships for recommendations may produce logically illogical or even harmful suggestions, failing to meet the high safety and reliability requirements of clinical practice. Summary of the Invention

[0006] The purpose of this invention is to overcome the shortcomings and deficiencies of the prior art and provide a drug recommendation system based on enhanced causal co-occurrence. This system deeply integrates the "co-occurrence relationship" and "causal relationship" between medical information to achieve accurate and highly safe patient medication recommendations. It significantly improves the accuracy, interpretability, and clinical applicability of drug recommendations and is suitable for building intelligent and reliable clinical decision support systems.

[0007] To achieve the above objectives, the technical solution provided by this invention is: a drug recommendation system based on causal co-occurrence enhancement, comprising:

[0008] The medical information representation generation module based on the co-occurrence relationship of medical information constructs a medical information co-occurrence graph by statistically analyzing the co-occurrence relationships among medical information based on all electronic medical record data, and then applies a graph attention neural network to the medical information co-occurrence graph to learn and generate a medical information embedding table containing the embedding vectors of each medical information.

[0009] The patient visit representation generation module based on the causal relationship of medical information learns a causal structure graph of medical information entities at the visit level based on all electronic medical record data using a greedy equivalence search algorithm. For a certain visit event, according to the topological role of each medical information entity in the causal structure graph, the embedding vectors of each medical information entity are weighted through a causal attention mechanism. Finally, all weighted vectors are merged to generate a patient representation vector that can represent the visit.

[0010] The medication recommendation module based on co-occurrence causality is used to input the patient representation vector into a multilayer perceptron to generate a preliminary medication recommendation probability. Then, a co-occurrence adjustment vector is calculated based on the co-occurrence relationship of medical information to enhance the preliminary medication recommendation probability. Subsequently, a causal effect matrix generated in advance through logistic regression is queried to obtain the causal effect quantification value corresponding to the current medical information. The enhanced medication recommendation probability is then recalibrated to obtain the final medication recommendation probability. Finally, medications are selected according to a predefined threshold to form the final recommendation scheme.

[0011] Furthermore, the specific details of the medical information representation generation module are as follows:

[0012] Iterate through all historical electronic medical record data, summarize all medical information entities, including diagnoses, surgeries, symptoms, and medications, and construct a global vocabulary V = {c1, c2, ..., c...} i ,...,c N}, where N is the total number of all unique medical information entities in the electronic medical record dataset, and each entity c i Each element has a unique index i and an element M in the co-occurrence matrix. co (i,j) is calculated using point mutual information to measure the medical information entity c. i and c j The correlation strength is given by the formula:

[0013]

[0014] In the formula, For co-occurrence matrices, This indicates that the matrix has dimensions N×N, and c i Let c represent the i-th medical information entity. j Let P(c) represent the j-th medical information entity. i ,c j ) represents medical information entity c i and c j The joint probability of entities appearing together in the same medical record is calculated as follows: i and c jThe total number of times they appear together in the same visit divided by the total number of visits in the dataset, P(c i ) and P(c j ) represents medical information entity c i and c j The marginal probability is calculated by dividing the number of visits containing the medical information entity by the total number of visits in the dataset.

[0015] Subsequently, the co-occurrence matrix is ​​transformed into a weighted undirected graph, namely the medical information co-occurrence graph G. co = (V, E), where the global vocabulary V is the node set, and the entities in the vocabulary are nodes. If two nodes c i and c j between M co If the value of (i,j) is greater than a preset threshold ε, then an edge is created between them; a graph attention neural network is applied to the medical information co-occurrence graph G. co To learn; for any node c in the graph i The updated node features are calculated by aggregating information from its neighboring nodes, using the following formula:

[0016]

[0017] In the formula, h i ′ represents the updated node feature vector, N i Represents the neighboring nodes of the i-th node. Let be the input feature vector of the j-th node, d be the feature dimension, W1 be a learnable weight matrix, σ be the non-linear activation function, and α be the attention weight. ij The importance of the j-th node to the i-th node is calculated by the following formula:

[0018]

[0019] In the formula, LeakkyReLU is a non-linear activation function, and a is a learnable attention parameter vector. T || denotes the transpose of it, || denotes vector concatenation, h i h represents the feature vector of the i-th node. k The feature vector representing the k-th node;

[0020] After training, the network defines each medical information entity c. i Generate a final embedding vector. All these vectors together constitute a medical information embedding table.

[0021] Furthermore, the specific details of the patient visit representation generation module are as follows:

[0022] Based on the entire historical electronic medical record dataset, a causal discovery algorithm is used to learn a causal relationship graph of medical information entities at the visitation level. This graph reveals the causal relationships between different medical information entities. The causal discovery algorithm employs a greedy intervention equivalence search algorithm based on Bayesian scoring, heuristically searching for the causal graph structure that best fits the observed data. The algorithm's goal is to find a graph G that maximizes its equivalence score S(G,U) under the data distribution U, defined as:

[0023]

[0024] In the formula, G is a candidate causal graph structure, U is the global data distribution observed from all electronic medical records, n is the total number of nodes in the graph, i.e., the total number of all unique medical information entities, and C i P represents the i-th node in the graph. i G Represents node C in graph G i The set of parent nodes;

[0025] The total set of medical records in the electronic medical record dataset is D = {v1, v2, ..., v...} t ,...,v M}, where M is the total number of visits, and v is a specific target visit event for a particular patient. t The event is caused by a set of medical information entities {c1,c2,...,c i ,...,c k The table is composed of}, where k is the total number of medical information entities present in this visit. By querying the embedded table E, each medical information entity c in this visit event is retrieved. i Mapped to its corresponding embedding vector Where E(c) i This indicates retrieving the medical information entity c from the embedded table E. i The corresponding d-dimensional vector representation; for a specific target medical visit event, based on its corresponding visit-level causal graph G t Based on the topological location of each entity in the global causal graph, medical information entities are classified. According to the in-degree and out-degree of each medical information entity in the global causal graph, they are divided into four different clinical role types: ① Cause node: Only has out-degree, no in-degree, representing the root cause of the disease; ② Intermediate node: Has both in-degree and out-degree, representing an intermediate link in the causal transmission path; ③ Result node: Only has in-degree, no out-degree, representing the final manifestation or complication caused by the disease; ④ Independent node: Has neither in-degree nor out-degree, representing an independent event unrelated to other entities in causal relationships.

[0026] Using the above classification results, weights are dynamically assigned to medical information entities with different roles through an attention mechanism to highlight key information. The formula is as follows:

[0027]

[0028] In the formula, This is the calculated type weight, where K represents the causal role type index of the medical information entity, with values ​​of 1, 2, 3, and 4. It is an aggregate vector obtained by summing the embedding vectors of all medical information entities belonging to the Kth type in this medical visit. W2 is the aggregated vector obtained by summing the embedding vectors of all medical information entities belonging to the j′ type in this visit, where W2 is a learnable weight matrix and b1 is a learnable bias term.

[0029] The calculated type weights are used to adjust the representation of each of the aforementioned medical information entities. The aim is to highlight its importance in causal networks; finally, to generate the final patient visit characterization p. t The calculation formula is:

[0030]

[0031] Furthermore, the specific details of the medication recommendation module are as follows:

[0032] First, the patient's current medical treatment representation vector p t The input is fed into a multilayer perceptron to directly predict the recommendation probability value for each drug, as shown in the following formula:

[0033] r init =Sigmoid(W4·ReLU(W3p) t +b2)+b3)

[0034] In the formula, Let r be the initial drug recommendation probability value, D be the total number of drugs, and r be the probability value. init The i-th element r init (i) represents the initial probability of recommending the i-th drug, Sigmoid and ReLU are activation functions, W3 and W4 are learnable weight matrices, and b2 and b3 are learnable bias terms.

[0035] Then, for the medical information entity in the current visit, an association vector is calculated. This association vector quantifies the co-occurrence strength between the current medical information entity and each drug in historical data. This association vector is then used as an additional signal in the calculation of the recommendation probability. The formula for calculating the association vector is as follows:

[0036]

[0037] In the formula, This is the calculated association vector. The j-th element U(j) in the vector represents the cumulative co-occurrence strength of all entities in the current medical visit with the j-th drug. N is the total number of all unique medical information entities in the electronic medical record dataset, and M... co (c i j) is the medical information entity c i The co-occurrence association strength with the j-th drug; this association vector, after standardization, is added to the initial drug recommendation probability value to update the drug recommendation probability, using the following formula:

[0038] r update =Sigmoid(r init +std(U))

[0039] In the formula, r update This represents the updated drug recommendation probability value, and std represents the standardized operation.

[0040] Based on the causal graph of the patient's current medical visit, for each medical information entity c in the causal graph... i Logistic regression fitting is performed on the j-th drug, and the formula is:

[0041]

[0042] In the formula, and Y j Both are binary variables, if This indicates that the current causal graph of the medical visit contains a medical information entity C. i ,otherwise If Y j =1, then the patient is currently using the j-th drug; otherwise, Y = 1. j =0, Represents probability, that is, given a binary variable Under the given conditions, the probability that a patient will use the j-th drug. This is the intercept term of the logistic regression fit, representing the condition when the patient does not contain any entities that do not contain medical information. The baseline log-odds of using the j-th drug. It is a binary variable in logistic regression fitting. The regression coefficient is quantized as entity c. i The causal effect on the j-th drug represents the effect when the patient includes a medical information entity, i.e. How much does the logarithmic probability of using the j-th drug change when the value changes from 0 to 1?

[0043] Each pair (c iPerforming the logistic regression fitting above once for each of the following (j) will ultimately generate a causal effect matrix. any one of its elements M e (c i The formula for calculating j) is expressed as:

[0044]

[0045] Then, based on the causal effect matrix, the probability value r of drug recommendation is... update The calibration is performed, and the calibration formula for the probability value of recommending the j-th drug is as follows:

[0046]

[0047] In the formula, r final (j) represents the probability value of recommending the j-th drug, φ1 and φ2 are learnable probability adjustment values, and δ1 and δ2 are pre-set high-order and low-order causal effect thresholds, max(M e (v t ,j)) represents finding the value with the greatest causal effect on the j-th drug among all medical information entities currently being treated;

[0048] Finally, drugs with a probability value greater than a preset threshold δ are selected as recommended medications for the patient's current visit.

[0049]

[0050] In the formula, This represents the set of drugs predicted by the medication recommendation module. This represents the predicted value of the j-th drug, where 1 represents a recommendation and 0 represents a non-recommendation.

[0051] The training process selects binary cross-entropy loss and drug interaction loss as loss functions, as shown in the following formula:

[0052]

[0053] In the formula, L bce It is a binary cross-entropy loss, where m(j) is the true value of the j-th drug in the patient's current visit. If m(j) = 1, it means that the j-th drug was included in the current visit; otherwise, m(j) = 0 means that the j-th drug was not included in the current visit. DDI It is a loss due to drug interactions, A DDI (i,j) is a matrix composed of known drug interactions. If drug i and drug j interact, then A DDI (i,j) = 1, otherwise A DDI (i,j)=0; is the predicted value of the i-th drug, and m(i) is the actual value of the i-th drug in the patient's current visit;

[0054] The final loss function L is obtained by setting a predefined hyperparameter λ, as shown in the following formula:

[0055] L=λL bce +(1-λ)L DDI

[0056] The medication recommendation module is trained by minimizing L.

[0057] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0058] 1. This invention discloses a method for transforming massive and fragmented raw medical record data into a structured, context-aware, and high-quality medical knowledge representation base. It does not simply statistically analyze information, but rather, based on global data, quantifies the true strength of relationships between medical information entities through point mutual information, constructing a networked medical information co-occurrence graph, thus endowing it with a knowledge context structure. Finally, an advanced graph attention neural network is used to learn on this graph, assigning differentiated weights to different relationships through an attention mechanism, ultimately generating an information-rich, accurate embedding vector for each medical information entity that contains complex network relationships.

[0059] 2. This invention discloses a method for mining causal relationships between medical information entities. It learns causal relationships between medical information entities using a greedy equivalence search algorithm, constructs an explicit causal graph, and classifies entities by role based on their topological location. A causal attention mechanism is used to assign different weights to medical information entities with different roles, making the system's decision-making process highly transparent. Its recommendation logic corresponds to the doctor's diagnostic thinking, alleviating the problem that traditional deep learning models, due to their "black box" characteristics, are difficult to gain trust in clinical practice. At the same time, it avoids over-reliance on co-occurrence relationships, confusing correlation with causality, and ensuring more accurate modeling of patient status representation.

[0060] 3. This invention discloses a drug recommendation system that enhances co-occurrence relationships and calibrates quantified causal effects. Firstly, by "enhancing co-occurrence relationships," it utilizes statistical patterns in global historical data to introduce a strong layer of statistical rationality and robustness to the initial recommendation results, effectively compensating for the limitations of single-case information. Building upon this, it further delves into the causal attribution of medical logic from the level of statistical correlation, ensuring that the ultimately recommended drugs are not only high-frequency choices based on data but also precise targeted treatments for the current condition. Attached Figure Description

[0061] Figure 1 This is an architecture diagram of the system of the present invention.

[0062] Figure 2 This is a block diagram illustrating the principle of the medical information representation generation module.

[0063] Figure 3 A schematic diagram of the principle of the module for generating patient visit representations.

[0064] Figure 4 This is a block diagram illustrating the principle of the medication recommendation module. Detailed Implementation

[0065] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.

[0066] like Figure 1 As shown, this embodiment discloses a drug recommendation system based on causal co-occurrence enhancement, including:

[0067] The medical information representation generation module based on the co-occurrence relationship of medical information constructs a medical information co-occurrence graph by statistically analyzing the co-occurrence relationships among medical information based on all electronic medical record data, and then applies a graph attention neural network to the medical information co-occurrence graph to learn and generate a medical information embedding table containing the embedding vectors of each medical information.

[0068] The patient visit representation generation module based on the causal relationship of medical information learns a causal structure graph of medical information entities at the visit level using a greedy equivalence search algorithm based on all electronic medical record data. For a specific visit event, according to the topological role of each medical information entity in the causal structure graph (determined by in-degree and out-degree), the embedding vectors of each medical information entity are weighted through a causal attention mechanism. Finally, all weighted vectors are merged to generate a patient representation vector that can represent the visit.

[0069] The medication recommendation module based on co-occurrence causality is used to input the patient representation vector into a multilayer perceptron to generate a preliminary medication recommendation probability. Then, a co-occurrence adjustment vector is calculated based on the co-occurrence relationship of medical information to enhance the preliminary medication recommendation probability. Subsequently, a causal effect matrix generated in advance through logistic regression is queried to obtain the causal effect quantification value corresponding to the current medical information. The enhanced medication recommendation probability is then recalibrated to obtain the final medication recommendation probability. Finally, medications are selected according to a predefined threshold to form the final recommendation scheme.

[0070] Specifically, such as Figure 2 As shown, the specific details of the medical information representation generation module based on the co-occurrence relationship of medical information are as follows:

[0071] Iterate through all historical electronic medical record data, summarize all medical information entities, including diagnoses, surgeries, symptoms, and medications, and construct a global vocabulary V = {c1, c2, ..., c...} i ,...,c N}, where N is the total number of all unique medical information entities in the electronic medical record dataset, and each entity c i Each element has a unique index i and an element M in the co-occurrence matrix. co (i,j) is calculated using point mutual information to measure the medical information entity c. i and c j The correlation strength is given by the formula:

[0072]

[0073] In the formula, For co-occurrence matrices, This indicates that the matrix has dimensions N×N, and c i Let c represent the i-th medical information entity. j Let P(c) represent the j-th medical information entity. i ,c j ) represents medical information entity c i and c j The joint probability of entities appearing together in the same medical record is calculated as follows: i and c j The total number of times they appear together in the same visit divided by the total number of visits in the dataset, P(c i ) and P(c j ) represents medical information entity c i and c j The marginal probability is calculated by dividing the number of visits containing the medical information entity by the total number of visits in the dataset.

[0074] Subsequently, the co-occurrence matrix is ​​transformed into a weighted undirected graph, namely the medical information co-occurrence graph G. co = (V, E), where the global vocabulary V is the node set, and the entities in the vocabulary are nodes. If two nodes c i and c j between M co If the value of (i,j) is greater than a preset threshold ε, then an edge is created between them; a graph attention neural network is applied to the medical information co-occurrence graph G. co To learn; for any node c in the graph i The updated node features are calculated by aggregating information from its neighboring nodes, using the following formula:

[0075]

[0076] In the formula, h i ′ represents the updated node feature vector, N i Represents the neighboring nodes of the i-th node. Let be the input feature vector of the j-th node, d be the feature dimension, W1 be a learnable weight matrix, σ be the non-linear activation function, and α be the attention weight. ij The importance of the j-th node to the i-th node is calculated by the following formula:

[0077]

[0078] In the formula, LeakkyReLU is a non-linear activation function, and a is a learnable attention parameter vector. T || denotes the transpose of it, || denotes vector concatenation, h i h represents the feature vector of the i-th node. k The feature vector representing the k-th node;

[0079] After training, the network defines each medical information entity c. i Generate a final embedding vector. All these vectors together constitute a medical information embedding table.

[0080] Specifically, such as Figure 3 As shown, the specific details of the patient visit representation generation module based on the causal relationship of medical information are as follows:

[0081] Based on the entire historical electronic medical record dataset, a causal discovery algorithm is used to learn a causal relationship graph of medical information entities at the visitation level. This graph reveals the causal relationships between different medical information entities. The causal discovery algorithm employs a greedy intervention equivalence search algorithm based on Bayesian scoring, heuristically searching for the causal graph structure that best fits the observed data. The algorithm's goal is to find a graph G that maximizes its equivalence score S(G,U) under the data distribution U, defined as:

[0082]

[0083] In the formula, G is a candidate causal graph structure, U is the global data distribution observed from all electronic medical records, n is the total number of nodes in the graph, i.e., the total number of all unique medical information entities, and C i P represents the i-th node in the graph. i G Represents node C in graph G i The set of parent nodes;

[0084] The total set of medical records in the electronic medical record dataset is D = {v1, v2, ..., v...} t,...,v M}, where M is the total number of visits, and v is a specific target visit event for a particular patient. t The event is caused by a set of medical information entities {c1,c2,...,c i ,...,c k The table is composed of}, where k is the total number of medical information entities present in this visit. By querying the embedded table E, each medical information entity c in this visit event is retrieved. i Mapped to its corresponding embedding vector Where E(c) i This indicates retrieving the medical information entity c from the embedded table E. i The corresponding d-dimensional vector representation; for a specific target medical visit event, based on its corresponding visit-level causal graph G t Based on the topological location of each entity in the global causal graph, medical information entities are classified. According to the in-degree and out-degree of each medical information entity in the global causal graph, they are divided into four different clinical role types: ① Cause node: Only has out-degree, no in-degree, representing the root cause of the disease; ② Intermediate node: Has both in-degree and out-degree, representing an intermediate link in the causal transmission path; ③ Result node: Only has in-degree, no out-degree, representing the final manifestation or complication caused by the disease; ④ Independent node: Has neither in-degree nor out-degree, representing an independent event unrelated to other entities in causal relationships.

[0085] Using the above classification results, weights are dynamically assigned to medical information entities with different roles through an attention mechanism to highlight key information. The formula is as follows:

[0086]

[0087] In the formula, This is the calculated type weight, where K represents the causal role type index of the medical information entity, with values ​​of 1, 2, 3, and 4. It is an aggregate vector obtained by summing the embedding vectors of all medical information entities belonging to the Kth type in this medical visit. W2 is the aggregated vector obtained by summing the embedding vectors of all medical information entities belonging to the j′ type in this visit, where W2 is a learnable weight matrix and b1 is a learnable bias term.

[0088] The calculated type weights are used to adjust the representation of each of the aforementioned medical information entities. The aim is to highlight its importance in causal networks; finally, to generate the final patient visit characterization p. t The calculation formula is:

[0089]

[0090] Specifically, such as Figure 4 As shown, the specific details of the medication recommendation module based on co-occurrence causality are as follows:

[0091] First, the patient's current medical treatment representation vector p t The input is fed into a multilayer perceptron to directly predict the recommendation probability value for each drug, as shown in the following formula:

[0092] r init =Sigmoid(W4·ReLU(W3p) t +b2)+b3)

[0093] In the formula, Let r be the initial drug recommendation probability value, D be the total number of drugs, and r be the probability value. init The i-th element r init (i) represents the initial probability of recommending the i-th drug, Sigmoid and ReLU are activation functions, W3 and W4 are learnable weight matrices, and b2 and b3 are learnable bias terms.

[0094] Then, for the medical information entity in the current visit, an association vector is calculated. This association vector quantifies the co-occurrence strength between the current medical information entity and each drug in historical data. This association vector is then used as an additional signal in the calculation of the recommendation probability. The formula for calculating the association vector is as follows:

[0095]

[0096] In the formula, This is the calculated association vector. The j-th element U(j) in the vector represents the cumulative co-occurrence strength of all entities in the current medical visit with the j-th drug. N is the total number of all unique medical information entities in the electronic medical record dataset, and M... co (c i j) is the medical information entity c i The co-occurrence association strength with the j-th drug; this association vector, after standardization, is added to the initial drug recommendation probability value to update the drug recommendation probability, using the following formula:

[0097] r update =Sigmoid(r init +std(U))

[0098] In the formula, r update This represents the updated drug recommendation probability value, and std represents the standardized operation.

[0099] Based on the causal graph of the patient's current medical visit, for each medical information entity c in the causal graph... i Logistic regression fitting is performed on the j-th drug, and the formula is:

[0100]

[0101] In the formula, and Y j Both are binary variables, if This indicates that the current causal graph of the medical visit contains a medical information entity C. i ,otherwise If Y j =1, then the patient is currently using the j-th drug; otherwise, Y = 1. j =0, Represents probability, that is, given a binary variable Under the given conditions, the probability that a patient will use the j-th drug. This is the intercept term of the logistic regression fit, representing the condition when the patient does not contain any entities that do not contain medical information. The baseline log-odds of using the j-th drug. It is a binary variable in logistic regression fitting. The regression coefficient is quantized as entity c. i The causal effect on the j-th drug represents the effect when the patient includes a medical information entity, i.e. How much does the logarithmic probability of using the j-th drug change when the value changes from 0 to 1?

[0102] Each pair (c i Performing the logistic regression fitting above once for each of the following (j) will ultimately generate a causal effect matrix. any one of its elements M e (c i The formula for calculating j) is expressed as:

[0103]

[0104] Then, based on the causal effect matrix, the probability value r of drug recommendation is... update The calibration is performed, and the calibration formula for the probability value of recommending the j-th drug is as follows:

[0105]

[0106] In the formula, r final (j) represents the probability value of recommending the j-th drug, φ1 and φ2 are learnable probability adjustment values, and δ1 and δ2 are pre-set high-order and low-order causal effect thresholds, max(M e (v t ,j)) represents finding the value with the greatest causal effect on the j-th drug among all medical information entities currently being treated;

[0107] Finally, drugs with a probability value greater than a preset threshold δ are selected as recommended medications for the patient's current visit.

[0108]

[0109] In the formula, This represents the set of drugs predicted by the medication recommendation module. This represents the predicted value of the j-th drug, where 1 represents a recommendation and 0 represents a non-recommendation.

[0110] The training process selects binary cross-entropy loss and drug interaction loss as loss functions, as shown in the following formula:

[0111]

[0112]

[0113] In the formula, L bce It is a binary cross-entropy loss, where m(j) is the true value of the j-th drug in the patient's current visit. If m(j) = 1, it means that the j-th drug was included in the current visit; otherwise, m(j) = 0 means that the j-th drug was not included in the current visit. DDI It is a loss due to drug interactions, A DDI (i,j) is a matrix composed of known drug interactions. If drug i and drug j interact, then A DDI (i,j) = 1, otherwise A DDI (i,j)=0; is the predicted value of the i-th drug, and m(i) is the actual value of the i-th drug in the patient's current visit;

[0114] The final loss function L is obtained by setting a predefined hyperparameter λ, as shown in the following formula:

[0115] L=λL bce +(1-λ)L DDI

[0116] The medication recommendation module is trained by minimizing L.

[0117] The above embodiments are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above embodiments. Any changes, modifications, substitutions, combinations, or simplifications made without departing from the spirit and principle of the present invention shall be considered equivalent substitutions and shall be included within the protection scope of the present invention.

Claims

1. A drug recommendation system based on causal co-occurrence enhancement, characterized in that, include: The medical information representation generation module based on the co-occurrence relationship of medical information constructs a medical information co-occurrence graph by statistically analyzing the co-occurrence relationships among medical information based on all electronic medical record data, and then applies a graph attention neural network to the medical information co-occurrence graph to learn and generate a medical information embedding table containing the embedding vectors of each medical information. The patient visit representation generation module based on the causal relationship of medical information learns a causal structure graph of medical information entities at the visit level based on all electronic medical record data using a greedy equivalence search algorithm. For a certain visit event, according to the topological role of each medical information entity in the causal structure graph, the embedding vectors of each medical information entity are weighted through a causal attention mechanism. Finally, all weighted vectors are merged to generate a patient representation vector that can represent the visit. The medication recommendation module based on co-occurrence causality is used to input the patient representation vector into a multilayer perceptron to generate a preliminary medication recommendation probability. Then, a co-occurrence adjustment vector is calculated based on the co-occurrence relationship of medical information to enhance the preliminary medication recommendation probability. Subsequently, a causal effect matrix generated in advance through logistic regression is queried to obtain the causal effect quantification value corresponding to the current medical information. The enhanced medication recommendation probability is then recalibrated to obtain the final medication recommendation probability. Finally, medications are selected according to a predefined threshold to form the final recommendation scheme.

2. The drug recommendation system based on causal co-occurrence enhancement according to claim 1, characterized in that, The specific details of the medical information representation generation module are as follows: Iterate through all historical electronic medical record data, summarize all medical information entities, including diagnoses, surgeries, symptoms, and medications, and construct a global vocabulary V = {c1, c2, ..., c...} i ,...,c N }, where N is the total number of all unique medical information entities in the electronic medical record dataset, and each entity c i Each element has a unique index i and an element M in the co-occurrence matrix. co (i,j) is calculated using point mutual information to measure the medical information entity c. i and c j The correlation strength is given by the formula: In the formula, For co-occurrence matrices, This indicates that the matrix has dimensions N×N, and c i Let c represent the i-th medical information entity. j Let P(c) represent the j-th medical information entity. i ,c j ) represents medical information entity c i and c j The joint probability of entities appearing together in the same medical record is calculated as follows: i and c j The total number of times they appear together in the same visit divided by the total number of visits in the dataset, P(c i ) and P(c j ) represents medical information entity c i and c j The marginal probability is calculated by dividing the number of visits containing the medical information entity by the total number of visits in the dataset. Subsequently, the co-occurrence matrix is ​​transformed into a weighted undirected graph, namely the medical information co-occurrence graph G. co = (V, E), where the global vocabulary V is the node set, and the entities in the vocabulary are nodes. If two nodes c i and c j between M co If the value of (i,j) is greater than a preset threshold ε, then an edge is created between them; a graph attention neural network is applied to the medical information co-occurrence graph G. co To learn; for any node c in the graph i The updated node features are calculated by aggregating information from its neighboring nodes, using the following formula: In the formula, h′ i N represents the updated node feature vector. i Represents the neighboring nodes of the i-th node. Let be the input feature vector of the j-th node, d be the feature dimension, W1 be a learnable weight matrix, σ be the non-linear activation function, and α be the attention weight. ij The importance of the j-th node to the i-th node is calculated by the following formula: In the formula, LeakkyReLU is a non-linear activation function, and a is a learnable attention parameter vector. T || denotes the transpose of it, || denotes vector concatenation, h i h represents the feature vector of the i-th node. k The feature vector representing the k-th node; After training, the network defines each medical information entity c. i Generate a final embedding vector. All these vectors together constitute a medical information embedding table.

3. A drug recommendation system based on causal co-occurrence enhancement according to claim 2, characterized in that, The specific details of the patient visit representation generation module are as follows: Based on the entire historical electronic medical record dataset, a causal discovery algorithm is used to learn a causal relationship graph of medical information entities at the visitation level. This graph reveals the causal relationships between different medical information entities. The causal discovery algorithm employs a greedy intervention equivalence search algorithm based on Bayesian scoring, heuristically searching for the causal graph structure that best fits the observed data. The algorithm's goal is to find a graph G that maximizes its equivalence score S(G,U) under the data distribution U, defined as: In the formula, G is a candidate causal graph structure, U is the global data distribution observed from all electronic medical records, n is the total number of nodes in the graph, i.e., the total number of all unique medical information entities, and C i This represents the i-th node in the graph. Represents node C in graph G i The set of parent nodes; The total set of medical records in the electronic medical record dataset is D = {v1, v2, ..., v...} t ,...,v M }, where M is the total number of visits, and v is a specific target visit event for a particular patient. t The event is caused by a set of medical information entities {c1,c2,...,c i ,...,c k The table is composed of}, where k is the total number of medical information entities present in this visit. By querying the embedded table E, each medical information entity c in this visit event is retrieved. i Mapped to its corresponding embedding vector Where E(c) i This indicates retrieving the medical information entity c from the embedded table E. i The corresponding d-dimensional vector representation; for a specific target medical visit event, based on its corresponding visit-level causal graph G t Based on the topological location of each entity in the global causal graph, medical information entities are classified. According to the in-degree and out-degree of each medical information entity in the global causal graph, they are divided into four different clinical role types: ① Cause node: Only has out-degree, no in-degree, representing the root cause of the disease; ② Intermediate node: Has both in-degree and out-degree, representing an intermediate link in the causal transmission path; ③ Result node: Only has in-degree, no out-degree, representing the final manifestation or complication caused by the disease; ④ Independent node: Has neither in-degree nor out-degree, representing an independent event unrelated to other entities in causal relationships. Using the above classification results, weights are dynamically assigned to medical information entities with different roles through an attention mechanism to highlight key information. The formula is as follows: In the formula, This is the calculated type weight, where K represents the causal role type index of the medical information entity, with values ​​of 1, 2, 3, and 4. It is an aggregate vector obtained by summing the embedding vectors of all medical information entities belonging to the Kth type in this medical visit. W2 is the aggregated vector obtained by summing the embedding vectors of all medical information entities belonging to the j′ type in this visit, where W2 is a learnable weight matrix and b1 is a learnable bias term. The calculated type weights are used to adjust the representation of each of the aforementioned medical information entities. The aim is to highlight its importance in causal networks; finally, to generate the final patient visit characterization p. t The calculation formula is:

4. A drug recommendation system based on causal co-occurrence enhancement according to claim 3, characterized in that, The specific details of the medication recommendation module are as follows: First, the patient's current medical treatment representation vector p t The input is fed into a multilayer perceptron to directly predict the recommendation probability value for each drug, as shown in the following formula: r init Sigmoid (W4·ReLU (W3p)) t +b2)+b3) In the formula, Let r be the initial drug recommendation probability value, D be the total number of drugs, and r be the probability value. init The i-th element r init (i) represents the initial probability of recommending the i-th drug, Sigmoid and ReLU are activation functions, W3 and W4 are learnable weight matrices, and b2 and b3 are learnable bias terms. Then, for the medical information entity in the current visit, an association vector is calculated. This association vector quantifies the co-occurrence strength between the current medical information entity and each drug in historical data. This association vector is then used as an additional signal in the calculation of the recommendation probability. The formula for calculating the association vector is as follows: In the formula, This is the calculated association vector. The j-th element U(j) in the vector represents the cumulative co-occurrence strength of all entities in the current medical visit with the j-th drug. N is the total number of all unique medical information entities in the electronic medical record dataset, and M... co (c i j) is the medical information entity c i The co-occurrence association strength with the j-th drug; this association vector, after standardization, is added to the initial drug recommendation probability value to update the drug recommendation probability, using the following formula: r update =Sigmoid(r init +std(U)) In the formula, r update This represents the updated drug recommendation probability value, and std represents the standardized operation. Based on the causal graph of the patient's current medical visit, for each medical information entity c in the causal graph... i Logistic regression fitting is performed on the j-th drug, and the formula is: In the formula, X ci and Y j Both are binary variables, if This indicates that the current causal graph of the medical visit contains a medical information entity C. i ,otherwise If Y j =1, then the patient is currently using the j-th drug; otherwise... Represents probability, that is, given a binary variable Under the given conditions, the probability that a patient will use the j-th drug. This is the intercept term of the logistic regression fit, representing the condition when the patient does not contain any entities that do not contain medical information. The baseline log-odds of using the j-th drug. It is a binary variable in logistic regression fitting. The regression coefficient is quantized as entity c. i The causal effect on the j-th drug represents the effect when the patient includes a medical information entity, i.e. How much does the logarithmic probability of using the j-th drug change when the value changes from 0 to 1? Each pair (c i Performing the logistic regression fitting above once for each of the following (j) will ultimately generate a causal effect matrix. any one of its elements M e (c i The formula for calculating j) is expressed as: Then, based on the causal effect matrix, the probability value r of drug recommendation is... update The calibration is performed, and the calibration formula for the probability value of recommending the j-th drug is as follows: In the formula, r final (j) represents the probability value of recommending the j-th drug, φ1 and φ2 are learnable probability adjustment values, and δ1 and δ2 are pre-set high-order and low-order causal effect thresholds, max(M e (v t ,j)) represents finding the value with the greatest causal effect on the j-th drug among all medical information entities currently being treated; Finally, drugs with a probability value greater than a preset threshold δ are selected as recommended medications for the patient's current visit. In the formula, This represents the set of drugs predicted by the medication recommendation module. This represents the predicted value of the j-th drug, where 1 represents a recommendation and 0 represents a non-recommendation. The training process selects binary cross-entropy loss and drug interaction loss as loss functions, as shown in the following formula: In the formula, L bce It is a binary cross-entropy loss, where m(j) is the true value of the j-th drug in the patient's current visit. If m(j) = 1, it means that the j-th drug was included in the current visit; otherwise, m(j) = 0 means that the j-th drug was not included in the current visit. DDI It is a loss due to drug interactions, A DDI (i,j) is a matrix composed of known drug interactions. If drug i and drug j interact, then A DDI (i,j) = 1, otherwise A DDI (i,j)=0; is the predicted value of the i-th drug, and m(i) is the actual value of the i-th drug in the patient's current visit; The final loss function L is obtained by setting a predefined hyperparameter λ, as shown in the following formula: L=λL bce +(1-λ)L DDI The medication recommendation module is trained by minimizing L.

Citation Information

Patent Citations

  • Drug recommendation system based on electronic medical record

    CN118588321A

Cited By

  • Geological metallogenic causal knowledge extraction method, storage medium, equipment and product

    CN121301895A