Drug recommendation method based on causal comparison and message passing

Through a causal comparison and messaging method, the problem of sparse data and drug interaction in drug recommendations is solved, and more accurate and safe drug combination recommendations are achieved, ensuring the safety of drug use.

CN118969175APending Publication Date: 2024-11-15DALIAN MARITIME UNIVERSITY
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411005117.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-25
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

The existing drug recommendation methods have recommendation deviations caused by sparse data and drug safety problems caused by drug interactions. They fail to effectively control the interactions between drugs and affect drug safety.

Method used

Using a method based on causal comparison and message delivery, the attention mechanism is used to perform causal inference, model the symptom-drug relationship diagram, randomly enhance graph comparison learning, eliminate data sparse problems, and calculate message transmission between drugs through update functions. Predict inter-drug side effects scores to achieve more accurate and safe drug combination recommendations.

Benefits of technology

Through causal comparison and message delivery, the recommendation bias caused by sparse data is eliminated, the safety and accuracy of drug combinations are improved, the interaction between drugs is effectively controlled, and the safety and reliability of drug recommendations are improved. .

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118969175A_ABST
    Figure CN118969175A_ABST
Patent Text Reader

Abstract

The invention provides a drug recommendation method based on causal comparison and message passing, and the method comprises the steps: carrying out the coding embedding of diagnosis and drug information in an electronic medical record; then, causal inference is carried out by utilizing an attention mechanism, and modeling is carried out on a symptom-drug relation graph; medicines which are not commonly used are regarded as confounding factors, and recommendation deviation caused by the problem of data sparseness is eliminated; then, the symptom-drug causal relationship graph is randomly enhanced for graph contrast learning, and correlation representation between symptoms and drugs is better learned. Meanwhile, the updating function pairs are used for calculating message passing between the drugs and predicting side effect scores between the drugs, and more accurate and safer drug combination recommendation is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology for medical care, and in particular, to a drug recommendation method based on causal comparison and message passing. Background Art

[0002] With the rapid development of smart healthcare, the digitization of medical records has become an irreversible trend. The digitization of medical records covers diagnosis, procedures, prescriptions and other aspects. Advanced artificial intelligence technology can process large-scale electronic health records (electronic medical records), providing valuable information support for doctors and researchers. With the advancement of medical digitization, advances in deep learning processing technology can help medical professionals make more accurate and efficient decisions. The task of drug recommendation aims to recommend appropriate drug combinations based on the patient's disease condition. Current drug recommendation methods usually model the recommended drugs based on the diagnosis and procedures in the patient's medical records. At the same time, information in biomedical knowledge graphs is also widely used in the drug recommendation process to avoid the negative effects of drug interactions.

[0003] There are two existing drug recommendation methods: rule-based and supervised. Supervised methods often have data sparsity problems (i.e., drugs with low frequency of occurrence are not recommended). At the same time, existing drug recommendation methods often ignore the side effects between drugs. Two basic issues should be considered in the drug recommendation model. First, the recommendation bias problem caused by data sparsity. In addition, the drug safety problem caused by the interaction between drugs is also one of the issues that need to be focused on in the drug recommendation model. When recommending multiple drugs, the system must effectively control the interaction between drugs to ensure the safety of patients' medication. Summary of the invention

[0004] According to the technical problems raised above, a drug recommendation method based on causal comparison and message passing is provided. First, the attention mechanism is used for causal inference to model the symptom-drug relationship graph. Uncommon drugs are regarded as confounding factors to eliminate the recommendation bias caused by data sparsity; then, the symptom-drug causal relationship graph is randomly enhanced for graph comparison learning to better learn the correlation representation between symptoms and drugs. At the same time, the update function is used to calculate the message passing between drugs, predict the side effect scores between drugs, and achieve more accurate and safer drug combination recommendations.

[0005] The technical means adopted by the present invention are as follows:

[0006] A drug recommendation method based on causal comparison and message delivery, comprising:

[0007] S1. Establish a medical embedding module to encode and embed the diagnosis and drug information in the electronic medical record;

[0008] S2, establish a causal comparison module, use the attention mechanism to perform causal inference, and model the symptom-drug relationship graph;

[0009] S3. Establish a message update module, use the update function to calculate the message transmission between drugs, predict the side effect scores between drugs, and achieve more accurate and safer drug combination recommendations.

[0010] Furthermore, step S1 specifically includes:

[0011] S11. Set the tth visit of patient j in the electronic medical record Depend on Composition, of which At the tth visit, it is a multi-hot vector; the multi-hot vector are encoded by binary, representing the symptom vector and drug vector recorded at the tth visit;

[0012] S12, multi-hot vector Perform linear embedding, for the symptom of the tth visit The medical embedding results are as follows:

[0013]

[0014] in, is the embedding matrix for linear embedding. After linear embedding, accessing vector x t Embed as

[0015] S13. Design a bilateral RNN network to further embed the patient's electronic medical record data; for each input vector in the transformed clinical medical record Search m , e s , and use bilateral RNN to encode the visit-level diagnosis and program embedding respectively as follows:

[0016]

[0017] Among them, the bilateral RNN network embeds all patients’ historical visit information

[0018] Furthermore, in step S13, the bilateral RNN network includes two bilateral RNN encoders, one for learning symptom representation and the other for learning drug representation, to ensure that the overall performance of the model is not affected by data missing.

[0019] Furthermore, step S2 specifically includes:

[0020] S21. Use the causal attention mechanism to perform causal inference and learn causal effects. The causal inference module dynamically captures multiple symptom vectors. The vector of each symptom and the corresponding treatment drug set The correlation between ij , the correlation A ij It is expressed as:

[0021]

[0022] Among them, σ is the learnable weight matrix;

[0023] S22. Learn causal attention to correlation A ij As the importance of each symptom in affecting drug selection, as the causal effect between the symptom and the corresponding drug, the causal relationship between symptoms and drugs is modeled. and medicine set vector As nodes, we construct a symptom-drug causal relationship diagram as follows:

[0024] G (S,M) (X,A)

[0025] Among them, X is the symptom and drug node, A is the relationship between symptoms and drugs, The causal effect between node i and node j is A ij , based on the learned causal effect, determine whether there is a causal relationship between two variables and decide the direction of the edge;

[0026] S23. Using graph enhancement generator τ A , τ B The symptom-drug cause-effect diagram G (S,M) (X, A) generates an enhanced view V A and V B , will enhance the view V A and V B Send it to two identical encoders to aggregate each node;

[0027] S24, view V A and V B The output node embedding of the encoder is represented as Z 1 , as follows:

[0028]

[0029] S25. The nodes in the symptom-drug causal relationship graph are embedded into the final representation as follows:

[0030]

[0031] Further, step S3 specifically includes:

[0032] S31. Obtain the drug set corresponding to the t-th visit symptom of patient j from EHRs, mc(m1, m2...m n ), n is the number of drug types, and the corresponding SIMES symbol is used to represent each drug compound, and the compound is regarded as a graph of interactions between atoms;

[0033] S32. Use the open source chemical informatics software RDKit to convert the SMILES data into its corresponding molecular graph representation; for the molecular graph of drug m1, As atomic nodes, are considered as bonds between atoms; for each bond, a discrete bond type is encoded as a learnable input edge vector For drug m1, the i-th atomic node Input to the multilayer perceptron to obtain the feature representation of the node

[0034] S33. In order to better learn the internal message transmission of drug m1, a Multi-MLP module is designed to capture the connectivity relationship between the nodes of the molecular graph and obtain the final message representation through the fully connected layer. as follows:

[0035]

[0036] Among them, f1 is a single-layer MLP network, f2 is a double-layer MLP network, and f3 is a three-layer MLP network;

[0037] S34, taking edge keys into account Message passing on the drug m1, calculate the edge message between the i-th atomic node and the j-th node Edge News Contains both the features of atomic node i and edge bonds The features are calculated as follows:

[0038]

[0039] Among them, f1 is a single-layer MLP network, · is the product of two vectors;

[0040] S35, aggregate the received messages for each atomic node by summing them up, and update its own representation, so as to obtain the final internal message representation of atomic node i as follows:

[0041]

[0042] Where N(i) represents the set of edges connected to node i;

[0043] S36. In order to calculate the message transmission between the two drugs, the atomic nodes of the two drugs are allowed to interact through the common attention mechanism; for the two atomic nodes i and k of drug m1 and drug m2, the attention coefficient α of the two atomic nodes is calculated ij ,as follows:

[0044]

[0045] Among them, W v is the learnable projection matrix, <, > is the inner product operation, and Softmax is obtained from the atomic node k of drug m2;

[0046] S37. Use multi-head attention mechanism to learn the external message representation between two drugs as follows:

[0047]

[0048] Among them, f0 is a multi-head attention network, and Connect is the concatenation of vectors;

[0049] S38. Internal information and external messages Standardization is performed to obtain the message transmission M of drug m1 i ,as follows:

[0050]

[0051] Among them, LayerNorm is the standardized layer network;

[0052] S39, message transmission M to drug m1 i , message transmission M of drug m2 k And drugs n The transmission message M j Perform a simple summation to obtain drugs m1, m2, and m n The vector representation of is as follows:

[0053]

[0054] S40. Define the prediction layer to predict whether there are side effects between the two drugs. Input the representations of the two drugs m1 and m2 and project them into 964 side effects. Use the nonlinear activation function σ to convert these scores into the scores of side effects between drugs m1 and m2:

[0055]

[0056] Among them, W v is the learnable projection matrix, b p is a learnable bias;

[0057] S41. The predicted recommendation probability It is expressed as:

[0058]

[0059] Where n is the total number of drug types in the drug set m, For symptom indication;

[0060] S42. Use contrastive learning during training and define the contrastive loss function to optimize the loss:

[0061]

[0062] S43. During training, the model is trained end-to-end using gradient descent, and the binary cross entropy function is used to optimize the loss between drugs m1 and m2. The loss function is as follows:

[0063]

[0064] Therefore, the final loss target is expressed as:

[0065]

[0066] Among them, β1 and β2 are hyperparameters.

[0067] Furthermore, in step S33, the Multi-MLP module is composed of three sub-modules of MLP. In the first sub-module, three MLP layers are stacked; in the second sub-module, two MLP layers are stacked; and in the last sub-module, one MLP layer is used.

[0068] Compared with the prior art, the present invention has the following advantages:

[0069] 1. The present invention provides a drug recommendation method based on causal comparison and message passing. The established medical embedding module extracts symptom and drug information from the patient's EHRs, and uses bilateral RNN to embed the symptom and drug information respectively.

[0070] 2. The present invention provides a drug recommendation method based on causal comparison and message passing. The established causal comparison module first uses the attention mechanism to perform causal inference and construct a symptom-drug causal relationship graph. Then, the symptom-drug causal relationship graph is randomly enhanced to compare and learn the correlation representation between symptoms and drugs. This eliminates the recommendation bias caused by data sparsity.

[0071] 3. The present invention provides a drug recommendation method based on causal comparison and message transmission. The message update module established by the present invention converts the corresponding drug information into a drug molecule graph according to the SMILES sequence; the update function is used to calculate the message transmission between drugs and predict the side effect scores between drugs, thereby achieving more accurate and safer drug combination recommendations.

[0072] Based on the above reasons, the present invention can be widely promoted in the fields of artificial intelligence in medical care and so on. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0074] Figure 1 The figure is a flow chart of the method of the present invention.

[0075] Figure 2 A causal structure model between symptoms and drugs provided in an embodiment of the present invention.

[0076] Figure 3 A causal inference process diagram provided for an embodiment of the present invention.

[0077] Figure 4 A model flow chart provided for an embodiment of the present invention. DETAILED DESCRIPTION

[0078] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0079] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0080] like Figure 1 As shown, the present invention provides a drug recommendation method based on causal comparison and message transmission, comprising:

[0081] S1. Establish a medical embedding module to encode and embed the diagnosis and drug information in the electronic medical record;

[0082] S2, establish a causal comparison module, use the attention mechanism to perform causal inference, and model the symptom-drug relationship graph;

[0083] S3. Establish a message update module, use the update function to calculate the message transmission between drugs, predict the side effect scores between drugs, and achieve more accurate and safer drug combination recommendations.

[0084] In specific implementation, as a preferred embodiment of the present invention, step S1 specifically includes:

[0085] S11. Set the tth visit of patient j in the electronic medical record Depend on Composition, of which At the tth visit, it is a multi-hot vector; the multi-hot vector are encoded by binary, representing the symptom vector and drug vector recorded at the tth visit;

[0086] S12, multi-hot vector Perform linear embedding, for the symptom of the tth visit The medical embedding results are as follows:

[0087]

[0088] in, is the embedding matrix for linear embedding. After linear embedding, accessing vector x t Embed as

[0089] S13. Design a bilateral RNN network to further embed the patient's electronic medical record data; for each input vector in the transformed clinical medical record Search m , e s , and use bilateral RNN to encode the visit-level diagnosis and program embedding respectively as follows:

[0090]

[0091] Among them, the bilateral RNN network embeds all patients’ historical visit information

[0092] In specific implementation, as a preferred embodiment of the present invention, in step S13, the bilateral RNN network includes two bilateral RNN encoders, one for learning symptom representation and the other for learning drug representation, to ensure that the overall performance of the model is not affected by data missing.

[0093] In specific implementation, as a preferred embodiment of the present invention, in the drug recommendation task, there may be large differences in the usage frequency of different drugs, resulting in a data sparsity problem with imbalanced categories. This will affect the training and prediction of the model, making the model more inclined to predict drugs with higher frequencies and ignore drugs with lower frequencies. The present invention constructs a symptom-drug causal relationship graph from a causal perspective and performs causal comparative learning. This method can use the causal relationship between drugs and symptoms for recommendation without being limited by the amount of data. Even if a drug appears less frequently in the data, as long as the drug has a causal relationship, it can be recommended to patients who meet these symptoms. Uncommon drugs in the patient's electronic medical record are regarded as confounding factors (C). General drug recommendations ignore confounding factors and lead to recommendation bias. The recommendation bias caused by confounding factors is eliminated by comparative learning of the causal relationship between the treatment variable symptom (S) and the outcome variable drug (M). The causal structure model between symptoms and drugs is as follows: Figure 2 shown.

[0094] In specific implementation, as a preferred embodiment of the present invention, step S2 specifically includes:

[0095] S21. Use the causal attention mechanism to perform causal inference and learn causal effects. The causal inference module dynamically captures multiple symptom vectors. The vector of each symptom and the corresponding treatment drug set The correlation between ij (i.e., causal effect), the learning process is as follows Figure 3 As shown. ij It is expressed as:

[0096]

[0097] Among them, σ is the learnable weight matrix;

[0098] S22. Learn causal attention to correlation A ij As the importance of each symptom in affecting drug selection, as the causal effect between the symptom and the corresponding drug, the causal relationship between symptoms and drugs is modeled. and medicine set vector As nodes, we construct a symptom-drug causal relationship diagram as follows:

[0099] G (S,M) (X, A)

[0100] Among them, X is the symptom and drug node, A is the relationship between symptoms and drugs, The causal effect between node i and node j is A ij , based on the learned causal effect, determine whether there is a causal relationship between two variables and decide the direction of the edge;

[0101] S23. Using graph enhancement generator τ A , τ B The symptom-drug cause-effect diagram G (S,M) (X, A) generates an enhanced view V A and V B , will enhance the view V A and V B Feed two identical encoders (i.e. g θ , p θ , g ζ , p ζ ), aggregate each node;

[0102] S24, view V A and V B The output node embedding of the encoder is represented as Z 1 , as follows:

[0103]

[0104] S25. The nodes in the symptom-drug causal relationship graph are embedded into the final representation as follows:

[0105]

[0106] During specific implementation, as a preferred embodiment of the present invention, the drug safety problem caused by the interaction between drugs is also one of the issues that need to be focused on in the drug recommendation model. When recommending multiple drugs, the system must effectively control the interaction between drugs to ensure the safety of the patient's medication. The present invention calculates the score of the drug interaction by updating the message passing between the two drugs. Then the DDI problem is modeled as a Boolean problem, and those above the threshold are considered to have side effects and are recorded as 1, and those less than or equal to the threshold are considered to have no side effects and are recorded as 0. The selection of each drug is represented by a Boolean variable. In these two drugs, the model of the present invention applies a series of message passing layers respectively. Each node is allowed to pass messages, and each node will collect information from its neighboring nodes and update its own representation based on the collected information. This process usually includes two steps: message passing (internal messages and external messages) and message aggregation. That is: step S3, specifically including:

[0107] S31. Obtain the drug set corresponding to the t-th visit symptom of patient j from EHRs, mc(m1,m2...m n ), n is the number of drug types, and the corresponding SIMES (Simplified Molecular Entry Line Input System) notation is used to represent each drug compound, and the compound is regarded as a graph of interactions between atoms (i.e., nodes);

[0108] S32. Use the open source chemical informatics software RDKit to convert the SMILES data into its corresponding molecular graph representation (i.e., adjacency representation A∈RN×N). For the molecular graph of drug m1, As atomic nodes, are considered as bonds between atoms; for each bond, a discrete bond type (e.g., single bond, double bond, etc.) is encoded as a learnable input edge vector For drug m1, the i-th atomic node Input to the multi-layer perceptron (MLP) to obtain the feature representation of the node

[0109] S33. In order to better learn the internal message transmission of drug m1, a Multi-MLP module is designed to capture the connectivity relationship between the nodes of the molecular graph and obtain the final message representation through the fully connected layer. as follows:

[0110]

[0111] Among them, f1 is a single-layer MLP network, f2 is a double-layer MLP network, and f3 is a three-layer MLP network;

[0112] S34, taking edge keys into account Message passing on the drug m1, calculate the edge message between the i-th atomic node and the j-th node Edge News Contains both the features of atomic node i and edge bonds The features are calculated as follows:

[0113]

[0114] Among them, f1 is a single-layer MLP network, · is the product of two vectors;

[0115] S35, aggregate the received messages for each atomic node by summing them up, and update its own representation, so as to obtain the final internal message representation of atomic node i as follows:

[0116]

[0117] Where N(i) represents the set of edges connected to node i;

[0118] S36. In order to calculate the message transmission (external message) between the two drugs, the atomic nodes of the two drugs are allowed to interact through the common attention mechanism; for the two atomic nodes i and k of drug m1 and drug m2, the attention coefficient α of the two atomic nodes is calculated. ij ,as follows:

[0119]

[0120] Among them, W v is the learnable projection matrix, <, > is the inner product operation, and Softmax is obtained from the atomic node k of drug m2;

[0121] S37. Use multi-head attention mechanism to learn the external message representation between two drugs as follows:

[0122]

[0123] Among them, f0 is a multi-head attention network (k=8), Connect is the concatenation of vectors;

[0124] S38. Internal information and external messages Standardization is performed to obtain the message transmission M of drug m1 i ,as follows:

[0125]

[0126] Among them, LayerNorm is the standardized layer network;

[0127] S39, message transmission M to drug m1 i , message transmission M of drug m2 k And drugs n The transmission message M j Perform a simple summation to obtain drugs m1, m2, and m n The vector representation of is as follows:

[0128]

[0129] S40. Define the prediction layer to predict whether there are side effects between the two drugs. Input the representations of the two drugs m1 and m2 and project them into 964 side effects. Use the nonlinear activation function σ to convert these scores into the scores of side effects between drugs m1 and m2:

[0130]

[0131] Among them, W v is the learnable projection matrix, b p is a learnable bias;

[0132] S41. The predicted recommendation probability It is expressed as:

[0133]

[0134] Where n is the total number of drug types in the drug set m, For symptom indication;

[0135] S42. Use contrastive learning during training and define the contrastive loss function to optimize the loss:

[0136]

[0137] S43. During training, the model is trained end-to-end using gradient descent, and the binary cross entropy function is used to optimize the loss between drugs m1 and m2. The loss function is as follows:

[0138]

[0139] Therefore, the final loss target is expressed as:

[0140]

[0141] Wherein, β1 and β2 are hyperparameters. In this embodiment, β2 is set to 1.1 and 0.1 respectively.

[0142] In specific implementation, as a preferred embodiment of the present invention, in step S33, the Multi-MLP module is composed of three sub-modules of MLP. In the first sub-module, three MLP layers are stacked; in the second sub-module, two MLP layers are stacked; in the last sub-module, one MLP layer is used.

[0143] Example

[0144] like Figure 4 As shown, in this embodiment, symptom medication information is extracted and medication information The attention mechanism is used for causal reasoning to establish a symptom-drug causal graph. The symptom-drug causal graph is randomly enhanced into ViewA and ViewB through τ for comparative learning to obtain the symptom-drug correlation representation. At the same time, multiple MLPs are used to calculate the information transfer M of drug m1 i Information transmission M with drug m2 k To predict the side effect scores between drugs, so as to achieve more accurate and safer drug combinations. Experimental results show that the method proposed in this invention achieves state-of-the-art performance on the medical datasets MIMIC-III and MIMIC-IV, proving the effectiveness and safety of the method of this invention.

[0145] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A drug recommendation method based on causal comparison and message transmission, characterized in that: include: S1. Establish a medical embedding module to encode and embed the diagnosis and drug information in the electronic medical record; S2, establish a causal comparison module, use the attention mechanism to perform causal inference, and model the symptom-drug relationship graph; S3. Establish a message update module, use the update function to calculate the message transmission between drugs, predict the side effect scores between drugs, and achieve more accurate and safer drug combination recommendations.

2. A drug recommendation method based on causal comparison and message transmission according to claim 1, characterized in that: Step S1 specifically includes: S11. Set the tth visit of patient j in the electronic medical record Depend on Composition, of which At the tth visit, it is a multi-hot vector; the multi-hot vector are encoded by binary, representing the symptom vector and drug vector recorded at the tth visit; S12, multi-hot vector Perform linear embedding, for the symptom of the tth visit The medical embedding results are as follows: in, is the embedding matrix for linear embedding. After linear embedding, accessing vector x t Embed as S13. Design a bilateral RNN network to further embed the patient's electronic medical record data; for each input vector in the transformed clinical medical record Search m , e s , and use bilateral RNN to encode the visit-level diagnosis and program embedding respectively as follows: Among them, the bilateral RNN network embeds all patients’ historical visit information 3. A drug recommendation method based on causal comparison and message transmission according to claim 2, characterized in that: In step S13, the bilateral RNN network includes two bilateral RNN encoders, one for learning symptom representation and the other for learning drug representation, to ensure that the overall performance of the model is not affected by data missing.

4. The drug recommendation method based on causal comparison and message transmission according to claim 1, characterized in that: Step S2 specifically includes: S21. Use the causal attention mechanism to perform causal inference and learn causal effects. The causal inference module dynamically captures multiple symptom vectors. The vector of each symptom and the corresponding treatment drug set The correlation between ij , the correlation A ij It is expressed as: Among them, σ is the learnable weight matrix; S22. Learn causal attention to correlation A ij As the importance of each symptom in affecting drug selection, as the causal effect between the symptom and the corresponding drug, the causal relationship between symptoms and drugs is modeled. and medicine set vector As nodes, we construct a symptom-drug causal relationship diagram as follows: G (S,M) (X,A) Among them, X is the symptom and drug node, A is the relationship between symptoms and drugs, The causal effect between node i and node j is A ij , based on the learned causal effect, determine whether there is a causal relationship between two variables and decide the direction of the edge; S23. Using graph enhancement generator τ A , τ B The symptom-drug cause-effect diagram G (S,M) (X, A) generates an enhanced view V A and V B , will enhance the view V A and V B Send it to two identical encoders to aggregate each node; S24, view V A and V B The output node embedding of the encoder is represented as Z 1 , as follows: S25. The nodes in the symptom-drug causal relationship graph are embedded into the final representation as follows:

5. The drug recommendation method based on causal comparison and message transmission according to claim 1, characterized in that: Step S3 specifically includes: S31. Obtain the drug set corresponding to the t-th visit symptom of patient j from EHRs, mc(m1, m2...m n ), n is the number of drug types, and the corresponding SIMES symbol is used to represent each drug compound, and the compound is regarded as a graph of interactions between atoms; S32. Use the open source chemical informatics software RDKit to convert the SMILES data into its corresponding molecular graph representation; for the molecular graph of drug m1, As atomic nodes, are considered as bonds between atoms; for each bond, a discrete bond type is encoded as a learnable input edge vector For drug m1, the i-th atomic node Input to the multilayer perceptron to obtain the feature representation of the node S33. In order to better learn the internal message transmission of drug m1, a Multi-MLP module is designed to capture the connectivity relationship between the nodes of the molecular graph and obtain the final message representation through the fully connected layer. as follows: Among them, f1 is a single-layer MLP network, f2 is a double-layer MLP network, and f3 is a three-layer MLP network; S34, taking edge keys into account Message passing on the drug m1, calculate the edge message between the i-th atomic node and the j-th node Edge News Contains both the features of atomic node i and edge bonds The features are calculated as follows: Among them, f1 is a single-layer MLP network, · is the product of two vectors; S35, aggregate the received messages for each atomic node by summing them up, and update its own representation, so as to obtain the final internal message representation of atomic node i as follows: Where N(i) represents the set of edges connected to node i; S36. In order to calculate the message transmission between the two drugs, the atomic nodes of the two drugs are allowed to interact through the common attention mechanism; for the two atomic nodes i and k of drug m1 and drug m2, the attention coefficient α of the two atomic nodes is calculated ij ,as follows: Among them, W v is the learnable projection matrix, <, > is the inner product operation, and Softmax is obtained from the atomic node k of drug m2; S37. Use multi-head attention mechanism to learn the external message representation between two drugs as follows: Among them, f0 is a multi-head attention network, and Connect is the concatenation of vectors; S38. Internal information and external messages Standardization is performed to obtain the message transmission M of drug m1 i ,as follows: Among them, LayerNorm is the standardized layer network; S39, message transmission M to drug m1 i , message transmission M of drug m2 k And drugs n The transmission message M j Perform a simple summation to obtain drugs m1, m2, and m n The vector representation of is as follows: S40. Define the prediction layer to predict whether there are side effects between the two drugs. Input the representations of the two drugs m1 and m2 and project them into 964 side effects. Use the nonlinear activation function σ to convert these scores into the scores of side effects between drugs m1 and m2: Among them, W v is the learnable projection matrix, b p is a learnable bias; S41. The predicted recommendation probability It is expressed as: Where n is the total number of drug types in the drug set m, For symptom indication; S42. Use contrastive learning during training and define the contrastive loss function to optimize the loss: S43. During training, the model is trained end-to-end using gradient descent, and the binary cross entropy function is used to optimize the loss between drugs m1 and m2. The loss function is as follows: Therefore, the final loss target is expressed as: Among them, β1 and β2 are hyperparameters.

6. A drug recommendation method based on causal comparison and message transmission according to claim 5, characterized in that: In step S33, the Multi-MLP module is composed of three sub-modules of MLP. In the first sub-module, three MLP layers are stacked; in the second sub-module, two MLP layers are stacked, and in the last sub-module, one MLP layer is used.

Citation Information

Cited By

  • Drug recommendation system and method based on causal inference

    CN119811576A

  • Drug Recommendation System and Method Based on Causal Inference

    CN119811576B

  • DDI prediction method and system based on dual-view robust fruit substructure network

    CN120748555A

  • DDI prediction method and system based on dual-view robust causal substructure network

    CN120748555B