Nothing Special   »   [go: up one dir, main page]

CN113808693B - Drug recommendation method based on graph neural network and attention mechanism - Google Patents

Drug recommendation method based on graph neural network and attention mechanism Download PDF

Info

Publication number
CN113808693B
CN113808693B CN202111061579.9A CN202111061579A CN113808693B CN 113808693 B CN113808693 B CN 113808693B CN 202111061579 A CN202111061579 A CN 202111061579A CN 113808693 B CN113808693 B CN 113808693B
Authority
CN
China
Prior art keywords
information
neural network
data
gru
drug
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111061579.9A
Other languages
Chinese (zh)
Other versions
CN113808693A (en
Inventor
万健
岳魏琦
张蕾
洪高枫
郑慧琳
史斌彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Lover Health Science and Technology Development Co Ltd
Original Assignee
Zhejiang Lover Health Science and Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Lover Health Science and Technology Development Co Ltd filed Critical Zhejiang Lover Health Science and Technology Development Co Ltd
Priority to CN202111061579.9A priority Critical patent/CN113808693B/en
Publication of CN113808693A publication Critical patent/CN113808693A/en
Application granted granted Critical
Publication of CN113808693B publication Critical patent/CN113808693B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H10/00ICT specially adapted for the handling or processing of patient-related medical or healthcare data
    • G16H10/60ICT specially adapted for the handling or processing of patient-related medical or healthcare data for patient-specific data, e.g. for electronic patient records
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16HHEALTHCARE INFORMATICS, i.e. INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR THE HANDLING OR PROCESSING OF MEDICAL OR HEALTHCARE DATA
    • G16H70/00ICT specially adapted for the handling or processing of medical references
    • G16H70/40ICT specially adapted for the handling or processing of medical references relating to drugs, e.g. their side effects or intended usage

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Mathematical Physics (AREA)
  • Biophysics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Public Health (AREA)
  • Primary Health Care (AREA)
  • Medical Informatics (AREA)
  • Epidemiology (AREA)
  • Toxicology (AREA)
  • Pharmacology & Pharmacy (AREA)
  • Medicinal Chemistry (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Chemical & Material Sciences (AREA)
  • Medical Treatment And Welfare Office Work (AREA)
  • Measuring And Recording Apparatus For Diagnosis (AREA)

Abstract

The invention discloses a medicine recommendation method based on a graph neural network and an attention mechanism. The invention takes the structural characteristics of the medical treatment situation or the medication information of each patient as a node, adopts the graph neural network to capture the relation among the structural characteristics, and learns the high-order characteristics comprising the knowledge of a medical system. Meanwhile, the attention mechanism is used for modeling the history medical records of the user better, and the medicine interaction knowledge is introduced, so that the accuracy and the safety of medicine recommendation are improved effectively.

Description

Drug recommendation method based on graph neural network and attention mechanism
Technical Field
The invention belongs to the technical field of computer application, and relates to a medicine recommendation method based on a graph neural network and an attention mechanism.
Background
The development of modern medical technology has led to the widespread use of electronic medical records, accumulating a large amount of clinical data such as vital signs, clinical summaries, disease diagnoses, prescription drugs, etc. Meanwhile, the deep learning technology provides a new technical means for mining and utilizing medical data, and is a current research hotspot. The combined medicine recommendation algorithm based on the electronic medical records can assist doctors to make safe and effective prescriptions according to the change characteristics of patient conditions, the medicine attributes and the action relations among a large number of medicines, and has important research values.
Early drug recommendation techniques were mostly rule-based. Relevant specialists extract medication rules based on medical information such as diagnosis, disease classification, symptoms, detection results and the like of patients, and the disadvantage is that maintenance is complex and difficult to update and expand. The medicine recommendation technology under deep learning embeds the information of physical sign, diagnosis, past medicine and the like of a patient into a low-dimensional space, and uses the embedded representation to recommend, so that the recommendation accuracy is improved. However, they also have many problems including data sparsity, inability to effectively utilize the patient's history information, neglecting medical ontology information underlying medical codes, and the like.
A graph neural network is a neural network that acts directly on the graph structure. It has the following characteristics: neglecting the input sequence of the nodes; in the calculation process, the representation of the node is influenced by the neighboring nodes around the node, and the connection of the graph is unchanged; the representation of the graph structure allows reasoning based on the graph. Therefore, the graphic neural network becomes a great hotspot for research, and is widely applied to the fields of social networks, recommendation systems, financial wind control, physical systems, molecular chemistry, life sciences, knowledge maps, traffic prediction and the like.
Drawing attention mechanisms have been introduced into graphic neural networks and have found widespread use in many fields. The method has the advantages that attention mechanisms are benefited, the graph neural network better realizes the weighted aggregation of neighbors by learning the weights of the neighbors, noise neighbors are further filtered, model performance is improved, and the result can be interpreted to a certain extent.
Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to provide the medicine recommendation method which can effectively relieve the sparsity of medical data, effectively utilize the history case information of patients and consider the medicine safety.
In order to achieve the above object, the technology provided by the present invention is a drug recommendation method based on a graph neural network and an attention mechanism, comprising the steps of:
step 1, acquiring historical electronic medical record data and carrying out structural treatment:
acquiring historical diagnosis conditions of a patient and medication information corresponding to the diagnosis conditions to construct an electronic medical record, wherein the diagnosis conditions comprise diagnosis data and operation condition data; the electronic medical record of the patient is expressed as p= [ x 1,x2,...,xt-1 ], t is the current visit times of the patient, wherein the ith visit of the patient is expressed as x i=[di,pi,mi],i=1,2,...,t-1,di which represents the diagnosis data of the ith visit of the patient, p i which represents the operation condition data of the ith visit in the medical record of the patient, and m i which represents the medication data of the ith visit.
Step 2, constructing three graphic neural networks for learning the patient treatment condition and the structural characteristics of the medication information; the three graphic neural networks are respectively used for inputting diagnosis data, operation condition data and medication data of a patient, and the corresponding outputs are respectively d e、pe、me;
The three graph neural networks adopt the same structure and specifically comprise nodes and edges; the nodes comprise leaf nodes and non-leaf nodes, wherein the leaf nodes are one of input data, namely diagnosis data, operation condition data and medication data of a patient, and the non-leaf nodes are medical attribution classifications of the leaf nodes; edges are medical classification relations of two nodes;
Each non-leaf node is represented as the sum of its own vector representation and its vector representation of all child nodes, calculated by way of GAT graph annotation mechanism:
Where g n denotes the nth non-leaf node, K denotes the total number of attentions, reLU and LeakyReLU denote nonlinear functions, ch (n) denotes the vector representation of the nth non-leaf node itself and all its children, The weight calculation coefficient representing the current non-leaf node under the kth attention and all sub-nodes thereof, W k representing the learning parameter of the non-leaf node under the kth attention, e * representing the vector representation of the node, a representing a learnable matrix, and a T being the transpose thereof.
Each leaf node is represented as the sum of its own vector representation and all its ancestor nodes, again calculated by way of the GAT graph annotation mechanism:
Where c' n represents the nth leaf node, an (n) represents the vector representation of the nth leaf node itself and all ancestor nodes thereof, The weight calculation coefficients representing the current leaf node itself and all its ancestor nodes at the kth attention, W' k represents the learning parameters of the leaf node at the kth attention.
Step 3, constructing two GRU network models with attention mechanisms, wherein the input is the output result d e、pe of the step 2 respectively, and the corresponding output is k d、kp with history information respectively;
the two GRU network models with the attention mechanisms adopt the same structure and comprise two parallel GRU networks and an attention mechanism module connected with the outputs of the two parallel GRU networks;
Two parallel GRU models are hidden layer output information of historical treatment conditions (i.e. diagnosis or operation condition information) obtained by adopting different activation functions, and the hidden layer output information is specifically as follows:
H=GRU1(r) (5)
Wh=softmax(Fh(H)) (6)
H=GRU2(r) (7)
W′htanh(Fh′(H′)) (8)
Wherein, H, H' respectively represent hidden layer information output by a first GRU network and a second GRU network model, W h,W′h respectively represent attention mechanism weights obtained by the first GRU network and the second GRU network through softmax and tanh activation functions, F h,F′h respectively represent linear transformation matrix functions which can be learned by the first GRU network and the second GRU network, and r represents d e or p e;
the attention mechanism module calculates k d、kp with history information according to formula (9), i.e For diagnostic information with historical information for different time scales,Is the operation condition information with history information of different time scales.
Wherein t represents the total number of patient visits, W h(i),W′h (i) represents the attention mechanism weight obtained through the softmax and tanh activation functions corresponding to the ith visit,Representing element-by-element multiplication; k represents k d or k p;
Step 4, constructing two memory neural networks MANN with the same structure; wherein the key-value pair stored in the first memory neural network is the "ith visit diagnostic data fusion information Medication information of "-" graph neural network"; The key-value pair stored in the second memory neural network is' fusion information of the ith treatment operation conditionMedication information of "-" graph neural network”;
The ith treatment condition and the historical treatment condition are subjected to para-multiplication, and the weight of the ith treatment condition is calculated
Wherein the method comprises the steps ofOr (b)The treatment condition information which indicates that the treatment is carried out for the ith treatment and has history information;
By weight Obtaining historical medication vectorThe ith dose is as follows:
further obtaining the key of the memory neural network
Wherein the method comprises the steps ofRepresenting learning weights, keysCorresponding value is
According toCan obtainAnd
Step 5, constructing a drug interaction knowledge base
The drug interaction knowledge is introduced, and the coexistence relationship of the drugs in the electronic medical record is represented by using an adjacency matrix A C, and the drug interaction relationship is represented by an adjacency matrix A D. And (3) learning a drug co-occurrence relationship and a drug interaction relationship by adopting a graph convolution neural network, and combining the drug interaction and co-occurrence relationship with the key value pair in the step (4) to generate a recommended drug list.
5-1 In step 4AndCombining to obtain query vectors containing historical medical record information, ith diagnosis information and ith operation information
Wherein W s represents the comparative weight of the diagnostic and surgical information.
5-2 Constructing a drug coexistence relationship matrix and a drug interaction relationship matrix in the electronic medical record
A*=D-1(A*+I)D-1 (14)
Wherein D represents a diagonal matrix transformed by A *, D -1 is the inverse thereof, I is an identity matrix, and A * represents a drug coexistence relationship matrix A C or a drug interaction relationship matrix A D in the electronic medical record.
5-3 Learning relationships between drugs using a graph convolution neural network, combining interactions and coexistence relationships of drugs into an embedded representation, resulting in a representation matrix Z C of a drug co-occurrence graph, and a representation matrix Z D of a drug interaction graph:
ZC=ACtanh(ACme)WC (15)
ZD=ADtanh(ADme)WD (16)
Wherein W C,WD is the parameter matrix of the drug contribution graph and the drug interaction graph, and m e is the set of key value pairs obtained in the step 4.
Based on matrix Z C、ZD and query vectorCalculate attention λ i:
Wherein W CD represents a comparative weight of drug coexistence relationship and interaction.
Finally, a recommended drug list y i is obtained:
Wherein W y represents the weight coefficient when the recommended medicine list is calculated.
When the recommendation probability y i of a drug in the drug list is greater than the recommendation probability threshold ρ, the drug is recommended.
It is another object of the present invention to provide a drug recommendation device based on a graph neural network and an attention mechanism, comprising
The data preprocessing module is used for carrying out structural processing on the historical treatment condition of the patient and the medication information corresponding to the treatment condition to construct corresponding electronic medical record data;
The graphic neural network module is used for learning the patient treatment condition and the structural characteristics of the medication information; the three graphic neural networks are respectively used for inputting diagnosis data, operation condition data and medication data of a patient, and the corresponding outputs are respectively d e、pe、me;
And the GRU network model module with an attention mechanism is used for extracting characteristics of the diagnosis data and the operation condition data output by the graphic neural network module through the GRU network and combining the characteristics with the current diagnosis condition to obtain the diagnosis data and the operation condition data with history information.
The memory neural network MANN module is used for constructing a key value pair of the i-th diagnosis data fusion information output by the GRU network model module with the attention mechanism and the medication information of the graphic neural network, and a key value pair of the i-th diagnosis operation condition fusion information output by the GRU network model module with the attention mechanism and the medication information of the graphic neural network;
and the medicine interaction knowledge base module is used for learning medicine co-occurrence relations and medicine interaction relations by adopting a graph convolution neural network, combining the medicine interaction and co-occurrence relations to the medicine embedding representation of the memory neural network MANN module and generating a recommended medicine list.
Yet another object of the present invention is a computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the above-mentioned method.
Yet another object of the present invention is a computing device comprising a memory having executable code stored therein and a processor which, when executing the executable code, implements the method described above.
The invention has the following advantages: the invention takes the structural characteristics of the medical treatment situation or the medication information of each patient as a node, adopts the graph neural network to capture the relation among the structural characteristics, and learns the high-order characteristics comprising the knowledge of a medical system. Meanwhile, the attention mechanism is used for modeling the history medical records of the user better, and the medicine interaction knowledge is introduced, so that the accuracy and the safety of medicine recommendation are improved effectively.
Drawings
Fig. 1 is a drug recommendation process based on a graph neural network and an attention mechanism.
FIG. 2 is a tree diagram of a medical code encoding architecture.
FIG. 3is a graph showing the comparison of F1 values for different visits by different methods.
Detailed Description
The invention will be further analyzed with reference to specific examples.
The technology provided by the invention is a medicine recommendation method based on a graph neural network and an attention mechanism, and comprises the following steps:
step 1, acquiring historical electronic medical record data and carrying out structural treatment:
acquiring historical diagnosis conditions of a patient and medication information corresponding to the diagnosis conditions to construct an electronic medical record, wherein the diagnosis conditions comprise diagnosis data and operation condition data; the electronic medical record of the patient is expressed as p= [ x 1,x2,...,xt-1 ], t is the current visit times of the patient, wherein the ith visit of the patient is expressed as x i=[di,pi,mi],i=1,2,...,t-1,di which represents the diagnosis data of the ith visit of the patient, p i which represents the operation condition data of the ith visit in the medical record of the patient, and m i which represents the medication data of the ith visit.
Step 2, constructing three graphic neural networks for learning the patient treatment condition and the structural characteristics of the medication information; the three graphic neural networks are respectively used for inputting diagnosis data, operation condition data and medication data of a patient, and the corresponding outputs are respectively d e、pe、me;
The three graph neural networks adopt the same structure and specifically comprise nodes and edges; the nodes comprise leaf nodes and non-leaf nodes, wherein the leaf nodes are one of input data, namely diagnosis data, operation condition data and medication data of a patient, and the non-leaf nodes are medical attribution classifications of the leaf nodes; edges are medical classification relations of two nodes;
Each non-leaf node is represented as the sum of its own vector representation and its vector representation of all child nodes, calculated by way of GAT graph annotation mechanism:
Where g n denotes the nth non-leaf node, K denotes the total number of attentions, reLU and LeakyReLU denote nonlinear functions, ch (n) denotes the vector representation of the nth non-leaf node itself and all its children, The weight calculation coefficient representing the current non-leaf node under the kth attention and all sub-nodes thereof, W k representing the learning parameter of the non-leaf node under the kth attention, e * representing the vector representation of the node, a representing a learnable matrix, and a T being the transpose thereof.
Each leaf node is represented as the sum of its own vector representation and all its ancestor nodes, again calculated by way of the GAT graph annotation mechanism:
Where c' n represents the nth leaf node, an (n) represents the vector representation of the nth leaf node itself and all ancestor nodes thereof, The weight calculation coefficients representing the current leaf node itself and all its ancestor nodes at the kth attention, W' k represents the learning parameters of the leaf node at the kth attention.
Step 3, constructing two GRU network models with attention mechanisms, wherein the input is the output results de and p e of the step 2 respectively, and the corresponding output is k d、kp with history information respectively;
the two GRU network models with the attention mechanisms adopt the same structure, and each GRU network model comprises a GRU network and an attention mechanism module connected with the output of the GRU network;
The GRU model uses the attention mechanism to incorporate hidden layer output information of historical medical conditions (i.e., diagnostic or surgical condition information) into the current information representation in the following manner:
H=GRU1(r) (5)
Wh=softmax(Fh(H)) (6)
H′=GRU2(r) (7)
W′h=tanh(Fh′(H′)) (8)
Wherein, H, H' respectively represent hidden layer information output by the first and second GRU network models, W h,W′h respectively represent attention mechanism weights obtained by softmax and tanh activation functions, F h,F′h represents a linear transformation matrix function which can be learned by the first and second GRU network models, and r represents d e or p e;
the attention mechanism module calculates k d、kp with history information according to formula (9), i.e For diagnostic information with historical information for different time scales,Is the operation condition information with history information of different time scales.
Wherein t represents the total number of patient visits, W h(i),Wh (i) represents the attention mechanism weight obtained through the softmax and tanh activation functions corresponding to a specific visit,Representing element-by-element multiplication; k * represents k d or k p;
step 4, constructing two memory neural networks MANN with similar structures; wherein the key-value pair stored in the first memory neural network is the "ith visit diagnostic data fusion information Medication information of "-" graph neural network"; The key-value pair stored in the second memory neural network is' fusion information of the ith treatment operation conditionMedication information of "-" graph neural network”;
The ith treatment condition and the historical treatment condition are subjected to para-multiplication, and the weight of the ith treatment condition is calculated
Wherein the method comprises the steps ofOr (b)Surgical condition information representing the i-th visit with history information;
By weight Obtaining historical medication vectorThe ith dose is as follows:
further obtaining the key of the memory neural network
Wherein the method comprises the steps ofRepresenting learning weights, keysCorresponding value is
Step 5, constructing a drug interaction knowledge base
The drug interaction knowledge is introduced, and the coexistence relationship of the drugs in the electronic medical record is represented by using an adjacency matrix A C, and the drug interaction relationship is represented by an adjacency matrix A D. And (3) learning a drug co-occurrence relationship and a drug interaction relationship by adopting a graph convolution neural network, and combining the drug interaction and the co-occurrence relationship with the drug embedded representation obtained in the step (4) to generate a recommended drug list.
5-1 In step fourAndCombining to obtain query vectors containing historical medical record information, ith diagnosis information and ith operation information
Wherein W s represents a comparative weight of the diagnostic and surgical information.
5-2 Constructing a drug coexistence relationship matrix and a drug interaction relationship matrix in the electronic medical record
A*=D-1(A*+I)D-1 (14)
Wherein D represents a diagonal matrix transformed by A *, D -1 is the inverse thereof, I is an identity matrix, and A * represents a drug coexistence relationship matrix A C or a drug interaction relationship matrix A D in the electronic medical record.
5-3 Learning relationships between drugs using a graph convolution neural network, combining interactions and coexistence relationships of drugs into an embedded representation, resulting in a representation matrix Z C of a drug co-occurrence graph, and a representation matrix Z D of a drug interaction graph:
zC=ACtanh(ACme)WC (15)
ZD=ADtanh(ADme)WD (16)
Wherein W C,WD is the parameter matrix of the drug contribution graph and the drug interaction graph, and me is the structural characteristic of the drug output in the step 2.
Based on matrix Z C、ZD and query vectorCalculate attention λ i:
Wherein W CD represents a comparative weight of drug coexistence relationship and interaction.
Finally, a recommended drug list y i is obtained:
Wherein W y represents the weight coefficient when the recommended medicine list is calculated.
The obtained medicine list is a group of one-dimensional matrixes with absolute values smaller than 1, the horizontal and vertical coordinates respectively represent the kind of the medicine and the recommendation probability, and when the recommendation probability of the medicine in the medicine list is larger than a preset threshold value of 0.5, the medicine is recommended.
The experimental process comprises the following steps:
The experiment used electronic medical record data from the MIMIC-III (Medical Information Mark for INTENSIVE CARE) database, a free public intensive care data set issued by the institute of technology computing physiology laboratory. The present invention uses the diagnostic, surgical and prescription data in the database to screen patients for medications that are received within 24 hours after entering the ICU.
In order to measure the recommendation accuracy, the invention uses a Jaccard similarity coefficient (Jaccard), namely the size of the intersection of the real drug and the recommended drug divided by the union size, the average F1 value (F1), namely the harmonic average of the precision rate and the recall rate, and an accuracy calling curve (PRAUC) as a measurement index of the precision rate.
In order to measure the safety of recommended drugs, the drug interaction rate DDI, i.e. the ratio of the recommended combination drugs containing DDI drugs, is used.
Compared with the six methods which are more effective at present, the Nearst method recommends according to the similarity between the current visit and the past diagnosis, and recommends the combined medicament which is the same as the past diagnosis; the LR method is L2 regularized logistic regression, using multiple thermal vectors to represent the input data, with the dichotomous used to process the multi-tag output. The Leap method uses a recurrent neural network to model tag dependencies, and uses a content-based attention mechanism to capture mappings between tag instances. The RETAIN method is based on a sequential data drug combination of a two-layer attention network model that selects clinical variables important in past visits. The GAMENet method is a method of integrating historical medication and medication interaction DDI usage graph rolling networks through a storage module. The PREMIER method learns patient history using the attention mechanism and drug interactions in conjunction with the graph attention mechanism.
Table 1 model comparison experiments
Table 1 is the performance of the drug recommendation task on the data set for various methods. Experimental results show that the model of the method can achieve the best effect in all methods. In particular, the method proposed by the present invention is 0.97%, 0.89% and 0.93% higher than the latest method (PREMIER) in Jaccard, PRAUC and F1 scores, respectively. Meanwhile, the method of the invention gives consideration to drug interaction, and the minimum DDI is 0.0705 under the condition of taking the first 40 drug interaction rates in all similar deep learning methods. In addition, the average medicine quantity recommended by the invention is 14.98, and the average medicine quantity closest to the actual medical record in comparison with each deep learning method is 14.68.
GRAD-mkg represents the experimental results of the invention, with the knowledge base of drug interactions removed. Under the condition that a medicine interaction knowledge base is not available, the accuracy of the recommended medicines is not changed greatly, but DDI in the recommended medicines of the model is increased to 0.767, which shows that knowledge of interaction relations among medicines and query vectors with historical treatment information are combined in the method, so that the interaction rate in the recommended medicines is reduced, and the medication safety is improved. Grad-tree represents a model generated using only the neural network to learn structural features of patient's medical condition and medication information. After the medical code body structure is not embedded, the accuracy of the medicine recommendation is obviously reduced, which indicates that the graph neural network used in the text has the coding capability on the high-order structural characteristics, can enrich the embedded representation of the medical code body, makes up the problem of sparse training data to a certain extent, and improves the accuracy of the medicine recommendation.
Since the number of visits is different for each patient, the influence of the number of previous visits should be considered. For different timing lengths, the invention is superior to all other methods. As shown in FIG. 3, the present invention has the highest F1 value among all classifications with number of visits. In particular, for data with more times of treatment, higher accuracy can be maintained compared with other methods, which shows that the method has better modeling capability on long time sequence dependence in patient medical records.
TABLE 2 comparative experiments with different degrees of DDI
Further experiments were carried out with respect to the effect on drug interactions. The first 40, 60, 80, 100 DDI types were used separately to investigate the impact of the present invention and those methods compared to, considering the use of different numbers of DDIs. Results as shown in table 2, GRAD is the only algorithm that can achieve DDI reduction when the number of DDI types considered is changed from 40 to 100, although the Δddi rate rises from-18.48 to-0.26%, and is always greater than zero, regardless of the DDI type. This shows that the invention can reduce the interaction rate of recommended drugs after introducing the knowledge of drug interactions, and has more safety.
It can thus be seen that the present invention has the following advantages: the proposed medicine recommendation algorithm based on the graph neural network and the attention mechanism takes the structural characteristics of the medical condition or the medication information of each patient as a node, adopts the graph neural network to capture the relation among the nodes, and learns the higher-order characteristics comprising the medical classification relation. Meanwhile, the attention mechanism is used for modeling the history medical records of the user better, and the medicine interaction knowledge is introduced, so that the accuracy and the safety of medicine recommendation are improved effectively.

Claims (7)

1. The medicine recommending method based on the graph neural network and the attention mechanism is characterized by comprising the following steps of:
step 1, acquiring historical electronic medical record data and carrying out structural treatment:
Acquiring historical diagnosis conditions of a patient and medication information corresponding to the diagnosis conditions to construct an electronic medical record, wherein the diagnosis conditions comprise diagnosis data and operation condition data; the electronic medical record of the patient is expressed as p= [ x 1,x2,...,xt-1 ], t is the current visit times of the patient, wherein the ith visit of the patient is expressed as x i=[di,pi,mi],i=1,2,...,t-1,di which represents the diagnosis data of the ith visit of the patient, p i which represents the operation condition data of the ith visit in the medical record of the patient, and m i which represents the medication data of the ith visit;
step 2, constructing three graphic neural networks for learning the patient treatment condition and the structural characteristics of the medication information; the three graphic neural networks are respectively used for inputting diagnosis data, operation condition data and medication data of a patient, and the corresponding outputs are respectively d e、pe、me;
Step 3, constructing two GRU network models with attention mechanisms, wherein the input is the output result d e、pe of the step 2 respectively, and the corresponding output is k d、kp with history information respectively;
Step 4, constructing two memory neural networks MANN with the same structure; wherein the key-value pair stored in the first memory neural network is the "ith visit diagnostic data fusion information Medication information of "-" graph neural network"; The key-value pair stored in the second memory neural network is' fusion information of the ith treatment operation conditionMedication information of "-" graph neural network”;
Step 5, constructing a drug interaction knowledge base
5-1 In step 4AndCombining to obtain query vectors containing historical medical record information, ith diagnosis information and ith operation information
Wherein W s represents a contrasting weight of the diagnostic and surgical information;
5-2 constructing a drug coexistence relationship matrix and a drug interaction relationship matrix in the electronic medical record
A*=D-1(A*+I)D-1 (1)
Wherein D represents a diagonal matrix transformed by A *, D -1 is the inverse thereof, I is an identity matrix, and A * represents a drug coexistence relationship matrix A C or a drug interaction relationship matrix A D in the electronic medical record;
5-3 learning relationships between drugs using a graph convolution neural network, combining interactions and coexistence relationships of drugs into an embedded representation, resulting in a representation matrix Z C of a drug co-occurrence graph, and a representation matrix Z D of a drug interaction graph:
Zc=Actanh(Acme)Wc (15)
ZD=ADtanh(ADme)WD (16)
Wherein W C,WD is the parameter matrix of the drug contribution graph and the drug interaction graph, and m e is the set of key value pairs obtained in the step 4;
based on matrix Z C、ZD and query vector Calculate attention λ i:
wherein W CD represents a comparative weight of drug coexistence relationship and interaction;
finally, a recommended medicine list yi is obtained:
wherein W y represents a weight coefficient when calculating a recommended medicine list;
When the recommendation probability yi of the drug in the drug list is larger than the recommendation probability threshold ρ, the corresponding drug is recommended.
2. The medicine recommendation method based on the graph neural network and the attention mechanism as claimed in claim 1, wherein in the step2, three graph neural networks adopt the same structure and all comprise nodes and edges; the nodes comprise leaf nodes and non-leaf nodes, wherein the leaf nodes are input data, namely one of diagnosis data, operation condition data and medication data of a patient, and the non-leaf nodes are medical attribution classification of the leaf nodes; edges are medical classification relations of two nodes;
Each non-leaf node is represented as the sum of its own vector representation and its vector representation of all child nodes, calculated by way of GAT graph annotation mechanism:
Where g n denotes the nth non-leaf node, K denotes the total number of attentions, reLU and LeakyReLU denote nonlinear functions, ch (n) denotes the vector representation of the nth non-leaf node itself and all its children, The weight calculation coefficient of the current non-leaf node and all child nodes thereof under the kth attention is represented, W k represents the learning parameter of the non-leaf node under the kth attention, e * represents the vector representation of the node, a represents a leavable matrix, and a T is the transpose thereof;
Each leaf node is represented as the sum of its own vector representation and all its ancestor nodes, again calculated by way of the GAT graph annotation mechanism:
Where c' n represents the nth leaf node, an (n) represents the vector representation of the nth leaf node itself and all ancestor nodes thereof, The weight calculation coefficients representing the current leaf node itself and all its ancestor nodes at the kth attention, W' k represents the learning parameters of the leaf node at the kth attention.
3. The method for recommending drugs based on a graph neural network and an attention mechanism as claimed in claim 1 or 2, wherein in the step 3, two GRU network models with the attention mechanism are of the same structure, and each GRU network model comprises two parallel GRU networks and an attention mechanism module connected with the outputs of the two parallel GRU networks;
the two parallel GRU models are specifically a first GRU network and a second GRU network, wherein the first GRU network and the second GRU network respectively adopt different activation functions to acquire hidden information of historical visit conditions, and the hidden information is specifically as follows:
H=GRU1(r) (5)
wh=softmax(Fh(H)) (6)
H′=GRU2(r) (7)
w′h=tanh(Fh′(H′)) (8)
Wherein, H, H' respectively represent hidden layer information output by a first GRU network and a second GRU network model, w h,w′h respectively represent attention mechanism weights obtained by the first GRU network and the second GRU network through softmax and tanh activation functions, F h,F′h respectively represent linear transformation matrix functions which can be learned by the first GRU network and the second GRU network, and r represents d e or p e;
the attention mechanism module calculates k d、kp with history information according to formula (9), i.e For diagnostic information with historical information for different time scales,Surgical condition information with history information for different time scales;
wherein t represents the total number of patient visits, W h(i),W′h (i) represents the attention mechanism weight obtained through softmax and tanh activation functions corresponding to the ith visit, Representing element-by-element multiplication; k * represents k d or k p.
4. The method for recommending drugs based on graphic neural network and attention mechanism as set forth in claim 1 or 2, wherein the memory neural network in step 4 performs para-multiplication on the i-th diagnosis situation and its historical diagnosis situation, calculates the weight of the i-th diagnosis situation
Wherein the method comprises the steps ofOr (b)The treatment condition information which indicates that the treatment is carried out for the ith treatment and has history information;
By weight Obtaining historical medication vectorThe ith dose is as follows:
further obtaining the key of the memory neural network
Wherein the method comprises the steps ofRepresenting learning weights, keysCorresponding value is
According toCan obtainAnd
5. A graph neural network and attention mechanism based drug recommendation device implementing the method of any one of claims 1-4, comprising:
the data preprocessing module is used for carrying out structural processing on the historical treatment condition of the patient and the medication information corresponding to the treatment condition to construct corresponding electronic medical record data;
The graphic neural network module is used for learning the patient treatment condition and the structural characteristics of the medication information; the three graphic neural networks are respectively used for inputting diagnosis data, operation condition data and medication data of a patient, and the corresponding outputs are respectively d e、pe、me;
The GRU network model module is used for extracting characteristics of the diagnosis data and the operation condition data output by the graphic neural network module through the GRU network, and then combining the characteristics with the current diagnosis condition to obtain the diagnosis data and the operation condition data with history information;
The memory neural network MANN module is used for constructing a key value pair of the i-th diagnosis data fusion information output by the GRU network model module with the attention mechanism and the medication information of the graphic neural network, and a key value pair of the i-th diagnosis operation condition fusion information output by the GRU network model module with the attention mechanism and the medication information of the graphic neural network;
and the medicine interaction knowledge base module is used for learning medicine co-occurrence relations and medicine interaction relations by adopting a graph convolution neural network, combining the medicine interaction and co-occurrence relations to the medicine embedding representation of the memory neural network MANN module and generating a recommended medicine list.
6. A computer readable storage medium, characterized in that it has stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of any of claims 1-4.
7. A computing device comprising a memory having executable code stored therein and a processor that, when executing the executable code, performs the method of any of claims 1-4.
CN202111061579.9A 2021-09-10 2021-09-10 Drug recommendation method based on graph neural network and attention mechanism Active CN113808693B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111061579.9A CN113808693B (en) 2021-09-10 2021-09-10 Drug recommendation method based on graph neural network and attention mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111061579.9A CN113808693B (en) 2021-09-10 2021-09-10 Drug recommendation method based on graph neural network and attention mechanism

Publications (2)

Publication Number Publication Date
CN113808693A CN113808693A (en) 2021-12-17
CN113808693B true CN113808693B (en) 2024-10-22

Family

ID=78940750

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111061579.9A Active CN113808693B (en) 2021-09-10 2021-09-10 Drug recommendation method based on graph neural network and attention mechanism

Country Status (1)

Country Link
CN (1) CN113808693B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114386528B (en) * 2022-01-18 2024-05-14 平安科技(深圳)有限公司 Model training method and device, computer equipment and storage medium
CN114496234B (en) * 2022-04-18 2022-07-19 浙江大学 Cognitive-atlas-based personalized diagnosis and treatment scheme recommendation system for general patients
CN116110588B (en) * 2022-05-10 2024-04-26 北京理工大学 Medical time sequence prediction method based on dynamic adjacency matrix and space-time attention
CN115458045B (en) * 2022-09-15 2023-05-23 哈尔滨工业大学 Drug pair interaction prediction method based on heterogeneous information network and recommendation system
CN115631852B (en) * 2022-11-02 2024-04-09 北京大学重庆大数据研究院 Certificate type recommendation method and device, electronic equipment and nonvolatile storage medium
CN116153528B (en) * 2023-04-20 2023-07-14 武汉纺织大学 Drug recommendation method based on attention mechanism and global retrieval
CN116631612B (en) * 2023-06-09 2024-03-19 广东工业大学 Graph convolution herbal medicine recommendation method and computer based on multi-graph fusion

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111798954A (en) * 2020-06-11 2020-10-20 西北工业大学 Drug combination recommendation method based on time attention mechanism and graph convolution network
CN111968715A (en) * 2020-06-30 2020-11-20 厦门大学 Drug recommendation modeling method based on medical record data and drug interaction risk

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112084407B (en) * 2020-09-08 2024-03-12 辽宁工程技术大学 Collaborative filtering recommendation method integrating graph neural network and attention mechanism
CN113223656A (en) * 2021-05-28 2021-08-06 西北工业大学 Medicine combination prediction method based on deep learning

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111798954A (en) * 2020-06-11 2020-10-20 西北工业大学 Drug combination recommendation method based on time attention mechanism and graph convolution network
CN111968715A (en) * 2020-06-30 2020-11-20 厦门大学 Drug recommendation modeling method based on medical record data and drug interaction risk

Also Published As

Publication number Publication date
CN113808693A (en) 2021-12-17

Similar Documents

Publication Publication Date Title
CN113808693B (en) Drug recommendation method based on graph neural network and attention mechanism
Srinivasu et al. From blackbox to explainable AI in healthcare: existing tools and case studies
Pham et al. Predicting healthcare trajectories from medical records: A deep learning approach
Shickel et al. Deep EHR: a survey of recent advances in deep learning techniques for electronic health record (EHR) analysis
Kim et al. Multi-modal stacked denoising autoencoder for handling missing data in healthcare big data
Davoodi et al. Mortality prediction in intensive care units (ICUs) using a deep rule-based fuzzy classifier
Pham et al. Deepcare: A deep dynamic memory model for predictive medicine
Badawy et al. Healthcare predictive analytics using machine learning and deep learning techniques: a survey
Beaulieu-Jones et al. Mapping patient trajectories using longitudinal extraction and deep learning in the MIMIC-III critical care database
Miller The medical AI insurgency: what physicians must know about data to practice with intelligent machines
Harerimana et al. Deep learning for electronic health records analytics
CN109887606B (en) Attention-based diagnosis and prediction method for bidirectional recurrent neural network
CN113223656A (en) Medicine combination prediction method based on deep learning
Malone et al. Learning representations of missing data for predicting patient outcomes
Karaca et al. Multi-chaos, fractal and multi-fractional artificial intelligence of different complex systems
CN115240873A (en) Medicine recommendation method based on machine learning, electronic equipment and computer-readable storage medium
Rampogu A review on the use of machine learning techniques in monkeypox disease prediction
Jaffar et al. Efficient deep learning models for predicting super-utilizers in smart hospitals
Albogamy et al. Decision support system for predicting survivability of hepatitis patients
Chen et al. Imbalanced prediction of emergency department admission using natural language processing and deep neural network
Li et al. Mtssp: Missing value imputation in multivariate time series for survival prediction
Yu et al. AKA-SafeMed: A safe medication recommendation based on attention mechanism and knowledge augmentation
Wang et al. Predicting clinical visits using recurrent neural networks and demographic information
Feng et al. Can Attention Be Used to Explain EHR-Based Mortality Prediction Tasks: A Case Study on Hemorrhagic Stroke
Li et al. MVIRA: A model based on Missing Value Imputation and Reliability Assessment for mortality risk prediction

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant