Drug recommendation method and system based on fine-grained relationship enhancement

By constructing a heterogeneous EHR network and multi-layer network structure, the fine-grained relationship in the drug recommendation method is extracted, and the problem of lack of personalization and information loss of drug recommendation is solved, and more accurate and safe drug recommendation is achieved.

CN119296720APending Publication Date: 2025-01-10SHANXI UNIV
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411439396.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

The existing drug recommendation algorithm ignores the complexity of multiple symptoms and diseases that may appear simultaneously during the treatment process, resulting in a lack of personalization and targeted drug recommendation. The figure shows that there is information loss in the learning method in information extraction. question.

Method used

Using a drug recommendation method based on fine-grained relationship enhancement, the complex relationship between patients, diagnosis, and drugs can be extracted by constructing a heterogeneous EHR network, using graph convolutional networks and gated recurrent neural networks to achieve multi-symptom extraction and health Condition prediction, enhancing the accuracy of drug recommendations.

Benefits of technology

Effectively capture a variety of major diseases in patients, improve the accuracy and personalization of drug recommendations, reduce drug side effects, and enhance understanding of the safety of drug combinations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119296720A_ABST
    Figure CN119296720A_ABST
Patent Text Reader

Abstract

The invention discloses a drug recommendation method and system based on fine-grained relationship enhancement, and belongs to the technical field of artificial intelligence and digital medical treatment. Aiming at how to effectively extract complex relationships among different medical entities in EHR medical data and realize accurate recommendation of drugs, entity information in a medical data set is modeled by using a heterogeneous graph representation learning method so as to deal with low quality and sparsity of the medical data; expression of various symptoms is extracted through a multi-symptom extractor, patient expression is refined into multi-symptom expression, and the relation between the symptoms and the medicine is established to achieve personalized medicine recommendation. The system comprises a computer processor, an EHR historical medical record data set storage unit, a graph data processing unit, a fine-grained relationship enhanced drug recommendation model training unit and a drug recommendation unit, multi-symptom representation of a patient can be better extracted through the system, the relationship between multiple symptoms and drugs is established, and personalized drug recommendation is achieved. And the accuracy and reliability of drug recommendation are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of artificial intelligence and digital medical technology, and specifically relates to a drug recommendation method and system based on fine-grained relationship enhancement. Background Art

[0002] In modern medicine, personalized drug recommendations have become an important means to improve treatment outcomes. Each patient has significant differences in physiological characteristics, genetic background, health status, and drug metabolism, resulting in different treatment effects of the same drug on different patients. Therefore, combining individualized genetic information with clinical data to provide more accurate drug treatment plans has become a research hotspot. Personalized drug recommendations can not only provide patients with more accurate drug selection, but also effectively reduce the side effects and adverse reactions of drugs and improve the quality of medical services. Existing drug recommendation algorithms usually rely on the patient's historical medical information to generate a representation of the health status, and make drug recommendations based on the similarity between this representation and the drug representation. Such methods can provide patients with a reference for drug selection to some extent, but since these methods usually use a single patient representation to recommend drugs, they ignore the multiple symptoms that may occur simultaneously during the patient's medical treatment process and the complexity of the disease, which can easily lead to the convergence of health representations of different patients, and thus make the recommended drugs lack personalization and pertinence. In addition, the demand for medical services in modern society is becoming increasingly diverse, and traditional universal drug recommendation programs can no longer meet the needs of patients for personalized treatment, especially in the presence of complications. Patients often have multiple symptoms at the same time, and a single representation extraction method cannot fully capture and reflect the patient's actual health status, thus affecting the accuracy of recommended drugs. Therefore, researchers have begun to explore more complex modeling methods, especially introducing graph representation learning technology to capture the correlation between medical entities and enhance the model's ability to recognize patients' diverse symptoms.

[0003] In the field of graph representation learning, heterogeneous networks can effectively extract the semantic information of these medical entities (diagnosis, drugs) and the structural information between medical entities by virtue of their ability to model multiple types of entities and relationships. Specifically, EHR medical data can be constructed as a heterogeneous EHR network containing three types of nodes: patients, diagnoses, and drugs, and two types of edges: patient-diagnosis and patient-drug. By analyzing the patient's condition and the entity relationships related to drugs, graph neural networks can learn the complex associations between drugs and these entities, and then provide personalized drug recommendations for each patient to better meet the patient's specific needs. In addition, by analyzing the interactions between different drugs and the relationships between them and patient characteristics through graph neural networks, it is possible to identify drug combinations that may cause side effects or adverse reactions and provide safer drug options.

[0004] In recent years, the methods of combining graph learning methods for drug recommendation mainly use recurrent neural networks to encode time-series EHR data, and additional graph models to encode the relationship between drugs to enhance drug representation, without utilizing the structural information between different medical entities. This results in the lack of important association information in the vector representation extracted by the graph representation model, resulting in information loss. In addition, the relationship between medical entities can help the model better understand the patient's condition and needs. By considering the relationship between patients, diagnoses, and drugs, the recommendation system can provide more accurate and personalized drug recommendations. At the same time, these methods usually use a single patient representation to recommend drugs, ignoring the multiple symptoms that may occur simultaneously during the patient's visit and the complexity of the disease, which easily leads to the convergence of health representations of different patients, and thus makes the recommended drugs lack personalization and pertinence. Therefore, how to effectively extract the complex relationship between different medical entities in EHR medical data is a key issue to help doctors provide more personalized treatment plans, reduce drug side effects, and achieve accurate drug recommendations. Summary of the invention

[0005] Aiming at the key issue of how to effectively extract the complex relationships between different medical entities in EHR medical data and achieve accurate drug recommendations, the present invention provides a drug recommendation method and system based on fine-grained relationship enhancement.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] A drug recommendation method based on fine-grained relationship enhancement, the method comprising the following steps:

[0008] Step 1: Preprocess the historical medical record data, extract the diagnosis and drug information corresponding to the patient in the historical medical record data, and obtain the EHR historical medical record data set, which specifically includes the following steps:

[0009] Step 1.1, preprocess the historical medical record data, remove missing values, remove duplicate values ​​and sort operations in sequence, to obtain an EHR historical medical record data set, which includes the patient's diagnosis process and medication records;

[0010] Step 1.2, based on the EHR historical medical record data set obtained by preprocessing, generate diagnosis dictionary information consisting of diagnosis number and corresponding ICD-9 code, and dictionary information consisting of drug number and corresponding NDC code, combine the EHR historical medical record data set with the drug interaction knowledge base, and extract the interaction relationship between all drugs in the EHR historical medical record data set;

[0011] Step 2: Construct a heterogeneous EHR network based on the preprocessed EHR historical medical record data set, which specifically includes the following steps:

[0012] Step 2.1: Take patients, diagnoses, and drugs as nodes, and patient-diagnosis and patient-drug relationships as edges, and construct the EHR historical medical record dataset into a heterogeneous EHR network, denoted as in Represents a collection of nodes. represents the set of patient nodes, Represents a set of diagnostic nodes. represents the drug node set, ε represents the edge set, including patient-diagnosis type R d The edge set of the patient-drug type R m The edge set of ;

[0013] Step 2.2: Based on the heterogeneous EHR network, construct a patient-diagnosis interaction graph based on edge types in, represents a node set containing patient type nodes and diagnosis type nodes, ε pd represents the set of patient-diagnosis edges, and the patient-diagnosis interaction matrix is ​​A pd ; Construct patient-drug interaction graph based on edge type in represents a node set containing patient type nodes and drug type nodes, ε pm represents the set of patient-drug edges, and the patient-drug interaction matrix is ​​A pm ;

[0014] Step 3: Build a randomly initialized fine-grained relationship-enhanced drug recommendation model, including a heterogeneous graph encoding network, a multi-symptom extraction network, and a health status prediction network. Specifically, the following steps are included:

[0015] Step 3.1: Use two layers of lightweight graph convolutional networks to build a heterogeneous graph encoding network to enrich the representation of nodes;

[0016] Step 3.2, construct a multi-symptom extraction network, which includes two linear layers, and the network structure is linear layer, Tanh activation function, linear layer, and Softmax activation function;

[0017] Step 3.3, construct a health status prediction network, which includes a gated recurrent neural network GRU and a multi-layer perceptron network. The multi-layer perceptron network structure is linear layer, Relu activation function, and linear layer in sequence;

[0018] Step 4: Train the drug recommendation model, determine the training parameters, design the optimizer and loss function to update the drug recommendation model, which specifically includes the following steps:

[0019] Step 4.1: Randomly initialize the vector representation E of patient, diagnosis, and drug nodes (p) 、E (d) 、E (m) , build a local structure information aggregation network;

[0020] Specifically: the local structure information aggregation network is a two-layer lightweight graph convolutional network, which is used to encode the relationship between multiple types of nodes to enrich the node vector representation;

[0021] For the patient-diagnosis interaction graph, we first calculate the degree of each patient node and diagnosis node to obtain the degree matrix D (p) and D (d) , and then the patient-diagnosis interaction matrix A pd Perform normalization operation and calculate it as follows:

[0022] For the patient-drug interaction graph, first calculate the degree of each patient node and drug node to obtain the degree matrix D (p) and D (m) , and then the patient-drug interaction matrix A pm Perform normalization operation and calculate it as follows:

[0023] Step 4.2: Use the local structure information aggregation network constructed in step 4.1 to aggregate different types of node information and structure information, and recursively update the vector representation of the node. For the patient-diagnosis interaction graph, the calculation method is shown in formulas (1) and (2):

[0024]

[0025]

[0026] Among them, l represents the index of the lightweight graph convolutional network layer, and Represent the vector representation of the patient and diagnosis nodes of the lth layer respectively. When l = 0, Superscript p d It indicates that the patient representation comes from the patient-diagnosis interaction graph, and T represents the transpose operation of the matrix;

[0027] For the patient-drug interaction graph, the representation of patients and drugs is obtained according to equations (3) and (4):

[0028]

[0029] in, and Respectively represent the vector representation of the patient and drug nodes in the lth layer, with the superscript pm Indicates that the patient representation is from the patient-drug interaction graph, T represents the transpose operation of the matrix, when l = 0,

[0030] Step 4.3: Aggregate the vectors of all layers to obtain the representation of diagnosis and drug, ensuring the effective encoding of local information. The calculation method is:

[0031] Step 4.4, construct a multi-symptom extraction network, which automatically divides the patient's representation into K symptom representations according to the internal structure of the EHR data, captures the patient's multiple main symptoms, and realizes personalized symptom representation;

[0032] The specific steps are as follows: input the diagnosis multi-hot vector of the tth visit of the i-th patient The combination with structural information is achieved through formula (5):

[0033]

[0034] The multi-symptom extraction network performs projection transformation through two linear layers to obtain the diagnosis-symptom attention matrix, and then aggregates the input diagnosis representation based on the attention matrix to obtain the multi-symptom embedding feature representation. The calculation method is shown in formulas (6) and (7):

[0035]

[0036] Among them, A is the attention matrix of diagnosis representation-symptom, and is a trainable parameter; T represents the transpose operation of the matrix;

[0037] Step 4.5: Build a health status prediction network, encode the patient's historical visit sequence, generate a comprehensive health representation, and have a more comprehensive understanding of the patient's health history and current status; the specific steps are:

[0038] First, a parameter-sharing gated recurrent neural network GRU is used to encode the patient's temporal information and learn the diagnostic vector representation related to the patient. The calculation method is shown in formula (8):

[0039]

[0040] in, An indication of the patient's health status;

[0041] Next, the target distribution of multiple symptoms is predicted through the health status prediction network The health status prediction network is implemented by a two-layer multi-layer perceptron, and the calculation method is shown in formula (9):

[0042]

[0043] in is a trainable parameter.

[0044] Step 4.6: Construct a distillation loss function and propose a distillation loss for the target symptom distribution to achieve mutual supervision between the multi-symptom extraction network (student model) and the health status prediction network (teacher model), ensuring that the multi-symptom extraction network captures the multi-symptom characteristics of patients more accurately. The specific steps are:

[0045] First, we calculate the multi-symptom embedding feature representation M t,i and drug expression E (m) The similarity between them measures the predicted symptom distribution, and the calculation method is shown in formula (10):

[0046]

[0047] The cosine similarity sim(·) is used to calculate the applicability relationship between each drug and multiple symptoms as the predicted symptom distribution.

[0048] Next, the predicted symptom distribution and target symptom distribution The normalization operation is performed, and the calculation method is shown in formulas (11) and (12):

[0049]

[0050] Among them, τ is a temperature hyperparameter used to control the smoothness of normalization; K represents the total number of extracted symptoms; k represents the kth symptom;

[0051] Then the target symptom distribution distillation loss is calculated according to formula (13):

[0052]

[0053] Among them, T i represents the number of visits of the patient, and t represents the patient’s kth visit; represents the probability of the symptom distribution of the target;

[0054] The target symptom distribution distillation loss promotes the mutual transfer and fusion of knowledge between the multi-symptom extraction network and the health status prediction network. By integrating the advantages of the two, it helps the model to fully understand the patient's condition and enhance its ability to model symptom changes over time.

[0055] Step 4.7: Based on the multi-symptom embedding feature representation M obtained in step 4.4 t,i The drug obtained in step 4.3 is represented by E (m)Obtain the patient's representation and the comprehensive representation of the drug, and the calculation method is shown in formulas (14) and (15):

[0056]

[0057] in, Indicates the probability of symptom occurrence, Indicates the patient's expression, a t,i is the weight vector of the drug, is the comprehensive representation of drugs; T represents the transposition operation;

[0058] Connect the patient and drug representations through a fully connected network fc 1 (·) Predict the probability that there is an edge between a patient and a drug, calculated as

[0059] Step 4.8: Use the probability of the edge between the patient and the drug obtained in step 4.7 to calculate the binary cross entropy loss. The binary cross entropy loss is calculated as shown in formula (16):

[0060]

[0061] Among them, N p Represents the number of patients, N m represents the number of drugs, y ij represents the true label, i represents the i-th patient, j represents the j-th drug, and σ represents the sigmoid activation function;

[0062] The total loss is:

[0063]

[0064] Step 4.9, repeating steps 4.1 to 4.8 in an iterative manner, setting the learning rate and weight decay rate of the optimizer of each network, and using the stochastic gradient descent strategy to train the disease diagnosis network model to reach the set number of iterations;

[0065] Step 5: Use the fine-grained relationship-based enhanced drug recommendation model to make drug recommendations based on the patient's time-series medical data and present the results to the doctor. The specific steps include:

[0066] Step 5.1, preprocessing the patient's time series medical data using the preprocessing method in step 1;

[0067] Step 5.2: Input the processed time-series medical data into the fine-grained relationship-enhanced drug recommendation model, output the probability of the drug, and present the drug recommendation results to the doctor to help the doctor make drug recommendations.

[0068] A drug recommendation system based on fine-grained relationship enhancement, the system is used for a drug recommendation method based on fine-grained relationship enhancement, the system includes a computer processor, an EHR historical medical record data iteration number storage unit, a graph data processing unit, a fine-grained relationship enhancement drug recommendation model training unit and a drug recommendation unit.

[0069] The EHR historical medical record data storage unit stores the EHR historical medical record data set constructed in step 1 and loads it into the computer memory; the graph data processing unit takes out the EHR historical medical record data set from the computer memory, executes step 2 to process it to obtain graph structure data; the fine-grained relationship enhanced drug recommendation model training unit trains the model by executing steps 3-4, determines the training parameters of the model, and obtains the fine-grained relationship enhanced drug recommendation model; the drug recommendation unit obtains the result of drug recommendation by executing step 5; the specific data processing and calculation work in all units is completed by the computer processor.

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

[0071] 1. The drug recommendation method based on fine-grained relationship enhancement designed by the present invention constructs the EHR historical medical record dataset into a heterogeneous graph consisting of three types of nodes and two types of edges. This method can aggregate different patient information and improve the vector representation of patient features in the graph, while effectively improving the utilization rate of the EHR historical medical record dataset and the quality of the vector representation of EHR medical entities;

[0072] 2. The drug recommendation method based on fine-grained relationship enhancement designed by the present invention automatically divides the patient's representation into K symptom representations according to the internal structure of EHR data through a multi-symptom extractor, captures the patient's multiple major symptoms, and realizes personalized symptom representation.

[0073] 3. The drug recommendation method and system based on fine-grained relationship enhancement designed by the present invention can effectively handle drug recommendation tasks, and generate drug prescription suggestions for them by establishing the relationship between multi-symptom representation and drug representation. It can effectively realize personalized recommendations and improve the accuracy of drug recommendations. BRIEF DESCRIPTION OF THE DRAWINGS

[0074] Figure 1 This is a structural diagram of a drug recommendation model in a drug recommendation method based on fine-grained relationship enhancement described in the present invention;

[0075] Figure 2 This is a structural diagram of a drug recommendation module in a drug recommendation method based on fine-grained relationship enhancement according to the present invention;

[0076] Figure 3A computer-implemented system structure diagram of a drug recommendation method based on fine-grained relationship enhancement according to the present invention;

[0077] Figure 4 This is a flowchart of a drug recommendation method based on fine-grained relationship enhancement described in the present invention. DETAILED DESCRIPTION

[0078] In order to gain a deeper understanding of the present invention, we will provide a comprehensive and detailed description of the present invention. However, the present invention has multiple implementations and is not limited to the specific examples listed herein. The presentation of these examples is intended to deepen the comprehensive understanding of the disclosure of the present invention.

[0079] The drug recommendation method based on fine-grained relationship enhancement of the present invention is implemented by a computer program. Figure 3 The following is a system structure diagram of a computer implementation, where "computer processor" represents the type of computing resources, which can be a separate graphics card that supports GPU computing, or a local server or cloud server that supports GPU computing. Figure 1 , 2 The model structure diagram shown and Figure 4 The method flow chart in the embodiment of the present invention takes the medical record data in the MIMIC-III clinical database as an example to specifically and in detail explain the technical solution in the embodiment of the present invention. The MIMIC-III clinical database records the clinical diagnosis and treatment information of more than 40,000 real patients who lived in the intensive care unit of Beth Israel Deacon Medical Center from 2001 to 2012. The patient information comes from two different intensive care information systems: Philips CareVue clinical information system and IMDSoft MetaVision ICU system. The MIMIC clinical database is based on a relational model and has 26 CSV tables. According to the information source and purpose of the table, it can be divided into four categories: patient hospitalization information, patient ICU clinical diagnosis and treatment information, patient outpatient diagnosis and treatment information, and dictionary information. The present invention pre-processes the patient's outpatient diagnosis and treatment information. The implementation method mainly includes the following key contents:

[0080] Step 1: Preprocess the historical medical record data, extract the diagnosis and drug information corresponding to the patient in the historical medical record data, and obtain the EHR historical medical record data set;

[0081] Step 1.1: First, the medical record data from the MIMIC-III clinical database is preprocessed to obtain an EHR historical medical record data set. The MIMIC-III clinical database is a relational database. The tables can be linked according to the patient ID and hospitalization ID. The medical record data is processed by removing missing values, removing duplicate values, and sorting operations. An EHR historical medical record data set containing about 6,350 patients can be obtained. The EHR historical medical record data set includes the patient's diagnosis process and medication records;

[0082] Step 1.2: Based on the EHR historical medical record dataset obtained through preprocessing in step 1.1, extract the dictionary information including drug number-NDC code and diagnosis number-ICD-9 code, which contains 1958 diagnoses and 112 drugs in total. In addition, use the drug-DDIs knowledge base (DDIs) file drug-DDI.csv to extract drug interaction pairs in the EHR historical medical record dataset.

[0083] Step 2: construct a heterogeneous EHR network based on the preprocessed EHR historical medical record dataset;

[0084] Step 2.1: Take patients, diagnoses, and drugs as nodes, and patient-diagnosis and patient-drug relationships as edges, and construct the EHR historical medical record dataset into a heterogeneous EHR network, denoted as in Represents a collection of nodes. represents the set of patient nodes, Represents a set of diagnostic nodes. represents the drug node set, ε represents the edge set, including patient-diagnosis type R d The edge set of the patient-drug type R m The edge set of ;

[0085] Step 2.2: Based on the heterogeneous EHR network, construct a patient-diagnosis interaction graph based on edge types in, represents a node set containing patient type nodes and diagnosis type nodes, ε pd represents the set of patient-diagnosis edges, and the patient-diagnosis interaction matrix is ​​A pd ; Construct patient-drug interaction graph based on edge type in represents a node set containing patient type nodes and drug type nodes, ε pm represents the set of patient-drug edges, and the patient-drug interaction matrix is ​​A pm The EHR historical medical record dataset contains 75,300 patient-diagnosis links and 87,650 patient-drug links.

[0086] Step 3: Build a randomly initialized fine-grained relationship-enhanced drug recommendation model, including a heterogeneous graph encoding network, a multi-symptom extraction network, and a health status prediction network;

[0087] Step 3.1: Use two layers of lightweight graph convolutional networks to build a heterogeneous graph encoding network to enrich the representation of nodes;

[0088] Step 3.2, construct a multi-symptom extraction network, which includes two linear layers, and the network structure is linear layer, Tanh activation function, linear layer, and Softmax activation function;

[0089] Step 3.3, build a health status prediction network. The health status prediction network includes a gated recurrent neural network GRU and a multi-layer perceptron network. The multi-layer perceptron network structure is linear layer, Relu activation function, and linear layer in sequence.

[0090] Step 4: Train the drug recommendation model, determine the training parameters, and design the optimizer and loss function to update the drug recommendation model;

[0091] Step 4.1: Randomly initialize the vector representation E of patient, diagnosis, and drug nodes (p) 、E (d) 、E (m) , whose representation dimensions are [6350, 64], [1958, 64], and [112, 64], respectively, to build a local structure information aggregation network;

[0092] Specifically: the local structure information aggregation network is a two-layer lightweight graph convolutional network, which is used to encode the relationship between multiple types of nodes to enrich the node vector representation. The input and output dimensions of the network are 64;

[0093] For the patient-diagnosis interaction graph, we first calculate the degree of each patient node and diagnosis node to obtain the degree matrix D (p) and D (d) , and then the patient-diagnosis interaction matrix A pd Perform normalization operation and calculate it as follows:

[0094] For the patient-drug interaction graph, first calculate the degree of each patient node and drug node to obtain the degree matrix D (p) and D (m) , and then the patient-drug interaction matrix A pm Perform normalization operation and calculate it as follows: Normalized patient-diagnosis interaction matrix Patient-Drug Interaction Matrix The sizes are [6350,1958] and [6350,112] respectively;

[0095] Step 4.2: Use the local structure information aggregation network constructed in step 4.1 to aggregate different types of node information and structure information, and recursively update the vector representation of the node. For the patient-diagnosis interaction graph, the calculation method is shown in formulas (1) and (2):

[0096]

[0097] Among them, l represents the index of the lightweight graph convolutional network layer, and Represent the vector representation of the patient and diagnosis nodes of the lth layer respectively. When l = 0, Superscript p d It indicates that the patient representation comes from the patient-diagnosis interaction graph, and T represents the transpose operation of the matrix;

[0098] For the patient-drug interaction graph, the representation of patients and drugs is obtained according to equations (3) and (4):

[0099]

[0100] in, and Respectively represent the vector representation of the patient and drug nodes in the lth layer, with the superscript p m Indicates that the patient representation is from the patient-drug interaction graph, T represents the transpose operation of the matrix, when l = 0, The dimension size of the output patient node vector representation is [6350, 64], and the dimension size of the drug node vector representation is [112, 64];

[0101] Step 4.3: Aggregate the vectors of all layers to obtain the representation of diagnosis and drug, ensuring the effective encoding of local information. The calculation method is:

[0102] Step 4.4, construct a multi-symptom extraction network, which automatically divides the patient's representation into K symptom representations according to the internal structure of the EHR data, captures the patient's multiple main symptoms, and realizes personalized symptom representation;

[0103] The specific steps are as follows: input the diagnosis multi-hot vector of the tth visit of the i-th patient The combination with structural information is achieved through formula (5):

[0104]

[0105] The multi-symptom extraction network performs projection transformation through two linear layers to obtain the diagnosis-symptom attention matrix, and then aggregates the input diagnosis representation based on the attention matrix to obtain the multi-symptom embedding feature representation. The calculation method is shown in formulas (6) and (7):

[0106]

[0107] Among them, A is the attention matrix of diagnosis representation-symptom, and is a trainable parameter; T represents the transpose operation of the matrix;

[0108] Step 4.5: Build a health status prediction network, encode the patient's historical visit sequence, generate a comprehensive health representation, and have a more comprehensive understanding of the patient's health history and current status; the specific steps are:

[0109] First, a parameter-sharing gated recurrent neural network GRU is used to encode the patient's temporal information and learn the diagnostic vector representation related to the patient. The calculation method is shown in formula (8):

[0110]

[0111] in, An indication of the patient's health status;

[0112] Next, the target distribution of multiple symptoms is predicted through the health status prediction network The health status prediction network is implemented by a two-layer multi-layer perceptron, and the calculation method is shown in formula (9):

[0113]

[0114] in is a trainable parameter.

[0115] Step 4.6: Construct a distillation loss function and propose a distillation loss for the target symptom distribution to achieve mutual supervision between the multi-symptom extraction network (student model) and the health status prediction network (teacher model), ensuring that the multi-symptom extraction network captures the multi-symptom characteristics of patients more accurately. The specific steps are:

[0116] First, we calculate the multi-symptom embedding feature representation M t,i and drug expression E (m) The similarity between them measures the predicted symptom distribution, and the calculation method is shown in formula (10):

[0117]

[0118] The cosine similarity sim(·) is used to calculate the applicability relationship between each drug and multiple symptoms as the predicted symptom distribution.

[0119] Next, the predicted symptom distribution and target symptom distribution The normalization operation is performed, and the calculation method is shown in formulas (11) and (12):

[0120]

[0121] Among them, τ is a temperature hyperparameter used to control the smoothness of normalization; K represents the total number of extracted symptoms; k represents the kth symptom;

[0122] Then the target symptom distribution distillation loss is calculated according to formula (13):

[0123]

[0124] Among them, T i represents the number of visits of the patient, and t represents the patient’s tth visit; represents the probability of the symptom distribution of the target;

[0125] The target symptom distribution distillation loss promotes the mutual transfer and fusion of knowledge between the multi-symptom extraction network and the health status prediction network. By integrating the advantages of the two, it helps the model to fully understand the patient's condition and enhance its ability to model symptom changes over time.

[0126] Step 4.7: Based on the multi-symptom embedding feature representation M obtained in step 4.4 t,i The drug obtained in step 4.3 is represented by E (m) Obtain the patient's representation and the comprehensive representation of the drug, and the calculation method is shown in formulas (14) and (15):

[0127]

[0128] in, Indicates the probability of symptom occurrence, Indicates the patient's expression, a t,i is the weight vector of the drug, is the comprehensive representation of drugs; T represents the transpose operation of the matrix;

[0129] Connect the patient and drug representations through a fully connected network fc 1 (·) Predict the probability that there is an edge between a patient and a drug, calculated as

[0130] Step 4.8: Use the probability of the edge between the patient and the drug obtained in step 4.7 to calculate the binary cross entropy loss. The binary cross entropy loss is calculated as shown in formula (16):

[0131]

[0132] Among them, N p Represents the number of patients, N m represents the number of drugs, y ij represents the true label, i represents the i-th patient, j represents the j-th drug, and σ represents the sigmoid activation function;

[0133] The total loss is:

[0134]

[0135] Step 4.9, repeat steps 4.1 to 4.8 in an iterative manner, and use the Adam optimizer to train and optimize the fine-grained relationship enhanced drug recommendation model in S3 in a stochastic gradient descent manner. The training parameters include a learning rate of 0.001, a weight decay rate of 0.001, and an iteration number of 100. The iteration number in the present invention is a fixed value, which is used to set the stop condition of the training process. The training is stopped after the set number of iterations is reached, and the training parameters of the fine-grained relationship enhanced drug recommendation model are determined to obtain the fine-grained relationship enhanced drug recommendation model.

[0136] Step 5: Use the fine-grained relationship-based enhanced drug recommendation model to make drug recommendations based on the patient's time-series medical data and present the results to the doctor. The specific steps include:

[0137] Step 5.1, preprocessing the patient's time series medical data using the preprocessing method in step 1;

[0138] Step 5.2: Input the processed time-series medical data into the fine-grained relationship-enhanced drug recommendation model, output the probability of the drug, and present the drug recommendation results to the doctor to help the doctor make drug recommendations.

[0139] In order to verify the effectiveness of the drug recommendation method based on heterogeneous EHR network representation learning in the present invention, the present invention is based on the MIMIC-III clinical database, and uses AUC, AP, and TopK indicators for evaluation, and compares with drug recommendation methods DMNC, Retain, LEAP, GAMENet, COGNet, and DrugRec. Among them, the AUC indicator evaluates the ability of the model to distinguish between positive and negative drugs when recommending drugs, the AP indicator considers both precision and recall, and TopK evaluates the percentage of the top K recommended drugs in the actual drugs taken by patients, specifically using Top5, Top10, and Top20 indicators. The higher the values ​​of the indicators AUC, AP, and TopK, the more accurate the recommendation results, and the results are shown in Table 1.

[0140] Table 1 Drug recommendation results

[0141]

[0142] As attached Figure 3 As shown, a drug recommendation system based on fine-grained relationship enhancement includes a computer processor, an EHR historical medical record data storage unit, a graph data processing unit, a fine-grained relationship enhancement drug recommendation model training unit, and a drug recommendation unit.

[0143] The EHR historical medical record data storage unit stores the EHR historical medical record data set constructed in step 1 and loads it into the computer memory; the graph data processing unit takes out the EHR historical medical record data set from the computer memory, executes step 2 to process it to obtain graph structure data; the fine-grained relationship enhanced drug recommendation model training unit trains the model by executing steps 3-4, determines the training parameters of the model, and obtains the fine-grained relationship enhanced drug recommendation model; the drug recommendation unit obtains the result of drug recommendation by executing step 5; the specific data processing and calculation work in all units is completed by the computer processor.

[0144] The contents not described in detail in the specification of the present invention belong to the prior art known to the professional and technical personnel in the field. Although the illustrative specific embodiments of the present invention are described above to facilitate the understanding of the present invention by the technical personnel in the field, it should be clear that the present invention is not limited to the scope of the specific embodiments. For the ordinary technical personnel in the field, as long as various changes are within the spirit and scope of the present invention defined and determined by the attached claims, these changes are obvious, and all inventions and creations using the concept of the present invention are protected.

Claims

1. A drug recommendation method based on fine-grained relationship enhancement, characterized in that: The method comprises the following steps: Step 1: Preprocess the historical medical record data, extract the diagnosis and drug information corresponding to the patient in the historical medical record data, and obtain the EHR historical medical record data set; Step 2: construct a heterogeneous EHR network based on the preprocessed EHR historical medical record dataset; Step 3: Build a randomly initialized fine-grained relationship-enhanced drug recommendation model, including a heterogeneous graph encoding network, a multi-symptom extraction network, and a health status prediction network; Step 4: Train the drug recommendation model, determine the training parameters, and design the optimizer and loss function to update the drug recommendation model; Step 5: Use the fine-grained relationship-based enhanced drug recommendation model to make drug recommendations based on the patient's time-series medical data and present the results to the doctor.

2. A drug recommendation method based on fine-grained relationship enhancement according to claim 1, characterized in that: The step 1, pre-processing the historical medical record data, extracting the diagnosis and drug information corresponding to the patient in the historical medical record data, and obtaining the EHR historical medical record data set; specifically includes the following steps: Step 1.1, preprocess the historical medical record data, remove missing values, remove duplicate values ​​and sort operations in sequence, to obtain an EHR historical medical record data set, which includes the patient's diagnosis process and medication records; Step 1.2: Based on the EHR historical medical record data set obtained by preprocessing, generate diagnostic dictionary information consisting of diagnosis numbers and corresponding ICD-9 codes, and dictionary information consisting of drug numbers and corresponding NDC codes, combine the EHR historical medical record data set with the drug interaction knowledge base, and extract the interaction relationship between all drugs in the EHR historical medical record data set.

3. The drug recommendation method based on fine-grained relationship enhancement according to claim 2, characterized in that: The step 2, constructing a heterogeneous EHR network based on the preprocessed EHR historical medical record data set, specifically includes the following steps: Step 2.1: Take patients, diagnoses, and drugs as nodes, and patient-diagnosis and patient-drug relationships as edges, and construct the EHR historical medical record dataset into a heterogeneous EHR network, denoted as in Represents a collection of nodes. represents the set of patient nodes, Represents a set of diagnostic nodes. represents the drug node set, ε represents the edge set, including patient-diagnosis type R d The edge set of the patient-drug type R m The edge set of ; Step 2.2: Based on the heterogeneous EHR network, construct a patient-diagnosis interaction graph based on edge types in, represents a node set containing patient type nodes and diagnosis type nodes, ε pd represents the set of patient-diagnosis edges, and the patient-diagnosis interaction matrix is ​​A pd ; Construct patient-drug interaction graph based on edge type in represents a node set containing patient type nodes and drug type nodes, ε pm represents the set of patient-drug edges, and the patient-drug interaction matrix is ​​A pm .

4. The drug recommendation method based on fine-grained relationship enhancement according to claim 3, characterized in that: Step 3: Build a randomly initialized fine-grained relationship-enhanced drug recommendation model, including a heterogeneous graph encoding network, a multi-symptom extraction network, and a health status prediction network. Specifically, the following steps are included: Step 3.1: Use two layers of lightweight graph convolutional networks to build a heterogeneous graph encoding network to enrich the representation of nodes; Step 3.2, construct a multi-symptom extraction network, which includes two linear layers, and the network structure is linear layer, Tanh activation function, linear layer, and Softmax activation function; Step 3.3, build a health status prediction network. The health status prediction network includes a gated recurrent neural network GRU and a multi-layer perceptron network. The multi-layer perceptron network structure is linear layer, Relu activation function, and linear layer in sequence.

5. The drug recommendation method based on fine-grained relationship enhancement according to claim 4, characterized in that: The step 4, training the drug recommendation model, determining the training parameters, designing the optimizer and the loss function to update the drug recommendation model, specifically includes the following steps: Step 4.1: Randomly initialize the vector representation E of patient, diagnosis, and drug nodes (p) 、E (d) 、E (m) , build a local structure information aggregation network; Specifically: the local structure information aggregation network is a two-layer lightweight graph convolutional network, which is used to encode the relationship between multiple types of nodes to enrich the node vector representation; For the patient-diagnosis interaction graph, we first calculate the degree of each patient node and diagnosis node to obtain the degree matrix D (p) and D (d) , and then the patient-diagnosis interaction matrix A pd Perform normalization operation and calculate it as follows: For the patient-drug interaction graph, first calculate the degree of each patient node and drug node to obtain the degree matrix D (p) and D (m) , and then the patient-drug interaction matrix A pm Perform normalization operation and calculate it as follows: Step 4.2: Use the local structure information aggregation network constructed in step 4.1 to aggregate different types of node information and structure information, and recursively update the vector representation of the node. For the patient-diagnosis interaction graph, the calculation method is shown in formulas (1) and (2): Among them, l represents the index of the lightweight graph convolutional network layer, and Represent the vector representation of the patient and diagnosis nodes of the lth layer respectively. When l = 0, Superscript p d It indicates that the patient representation comes from the patient-diagnosis interaction graph, and T represents the transpose operation of the matrix; For the patient-drug interaction graph, the representation of patients and drugs is obtained according to equations (3) and (4): in, and Respectively represent the vector representation of the patient and drug nodes in the lth layer, with the superscript p m Indicates that the patient representation is from the patient-drug interaction graph, T represents the transpose operation of the matrix, when l = 0, Step 4.3: Aggregate the vectors of all layers to obtain the representation of diagnosis and drug, ensuring the effective encoding of local information. The calculation method is: Step 4.4, construct a multi-symptom extraction network, which automatically divides the patient's representation into K symptom representations according to the internal structure of the EHR data, captures the patient's multiple main symptoms, and realizes personalized symptom representation; The specific steps are as follows: Input the diagnosis multi-hot vector of the tth visit of the i-th patient The combination with structural information is achieved through formula (5): The multi-symptom extraction network performs projection transformation through two linear layers to obtain the diagnosis-symptom attention matrix, and then aggregates the input diagnosis representation based on the attention matrix to obtain the multi-symptom embedding feature representation. The calculation method is shown in formulas (6) and (7): Among them, A is the attention matrix of diagnosis representation-symptom, and is a trainable parameter; T represents the transpose operation of the matrix; Step 4.5: Build a health status prediction network, encode the patient's historical medical visit sequence, generate a comprehensive health representation, and understand the patient's health history and current status; the specific steps are: First, a parameter-sharing gated recurrent neural network GRU is used to encode the patient's temporal information and learn the diagnostic vector representation related to the patient. The calculation method is shown in formula (8): in, An indication of the patient's health status; Next, the target distribution of multiple symptoms is predicted through the health status prediction network The health status prediction network is implemented by a two-layer multi-layer perceptron, and the calculation method is shown in formula (9): in is a trainable parameter; Step 4.6: Construct a distillation loss function and propose a distillation loss for the target symptom distribution to achieve mutual supervision between the multi-symptom extraction network and the health status prediction network, ensuring that the multi-symptom extraction network captures the multi-symptom characteristics of patients more accurately. The specific steps are: First, we calculate the multi-symptom embedding feature representation M t,i and drug expression E (m) The similarity between them measures the predicted symptom distribution, and the calculation method is shown in formula (10): The cosine similarity sim(·) is used to calculate the applicability relationship between each drug and multiple symptoms as the predicted symptom distribution. Next, the predicted symptom distribution and target symptom distribution The normalization operation is performed, and the calculation method is shown in formulas (11) and (12): Among them, τ is a temperature hyperparameter used to control the smoothness of normalization; K represents the total number of extracted symptoms; k represents the kth symptom; Then the target symptom distribution distillation loss is calculated according to formula (13): Among them, T i represents the number of visits of the patient, and t represents the patient’s tth visit; represents the probability of the symptom distribution of the target; Step 4.7: Based on the multi-symptom embedding feature representation M obtained in step 4.4 t,i The drug obtained in step 4.3 is represented by E (m) Obtain the patient's representation and the comprehensive representation of the drug, and the calculation method is shown in formulas (14) and (15): in, Indicates the probability of symptom occurrence, Indicates the patient's expression, a t,i is the weight vector of the drug, is the comprehensive representation of drugs; T represents the transpose operation of the matrix; The patient and drug representations are connected, and the probability of the existence of an edge between the patient and the drug is predicted through the fully connected network fc1(·), which is calculated as Step 4.8: Use the probability of the edge between the patient and the drug obtained in step 4.7 to calculate the binary cross entropy loss. The binary cross entropy loss is calculated as shown in formula (16): Among them, N p Represents the number of patients, N m represents the number of drugs, y ij represents the true label, i represents the i-th patient, j represents the j-th drug, and σ represents the sigmoid activation function; The total loss is: Step 4.9, repeat steps 4.1 to 4.8 in an iterative manner, set the learning rate and weight decay rate of the optimizer of each network, and use the stochastic gradient descent strategy to train the disease diagnosis network model to reach the set number of iterations.

6. The drug recommendation method based on fine-grained relationship enhancement according to claim 5, characterized in that: The step 5, using the fine-grained relationship-based enhanced drug recommendation model, recommends drugs based on the patient's time-series medical data, and presents the results to the doctor, specifically includes the following steps: Step 5.1, preprocessing the patient's time series medical data using the preprocessing method in step 1; Step 5.2: Input the processed time-series medical data into the fine-grained relationship-enhanced drug recommendation model, output the probability of the drug, and present the drug recommendation results to the doctor to help the doctor make drug recommendations.

7. A drug recommendation system based on fine-grained relationship enhancement, characterized in that: The system is used to implement a drug recommendation method based on fine-grained relationship enhancement as described in any one of claims 1-6, and the system includes a computer processor, an EHR historical medical record data storage unit, a graph data processing unit, a fine-grained relationship enhanced drug recommendation model training unit, and a drug recommendation unit.

8. The drug recommendation system based on fine-grained relationship enhancement according to claim 7, characterized in that: The EHR historical medical record data storage unit stores the EHR historical medical record data set constructed in step 1 and loads it into the computer memory; the graph data processing unit takes out the EHR historical medical record data set from the computer memory, executes step 2 to process it to obtain graph structure data; the fine-grained relationship enhanced drug recommendation model training unit trains the model by executing steps 3-4, determines the training parameters of the model, and obtains the fine-grained relationship enhanced drug recommendation model; the drug recommendation unit obtains the result of drug recommendation by executing step 5; the specific data processing and calculation work in all units is completed by the computer processor.

Citation Information

Cited By

  • Patient medication risk early warning method

    CN120260971A

  • Drug recommendation method and system based on drug mapping and diagnosis enhancement

    CN121096523A

  • Drug recommendation method and system based on drug mapping and diagnosis augmentation

    CN121096523B