Drug recommendation method, device, equipment and medium based on machine learning
Through the drug recommendation method based on machine learning, the multi-task joint training of the drug molecular structure and the user's electronic medical record, combined with the mutual constraints between drugs, solves the problem of low drug recommendation accuracy in the existing technology and achieves more accurate and stable drug recommendation results.
Patent Information
- Application Number
- CN202111017487.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-08-31
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2041-08-31
AI Technical Summary
The accuracy of drug recommendation in the existing technology is low and the recommended drug regimen is unreasonable. This is mainly due to the uneven quality of large-scale medical knowledge graph generation, resulting in errors and missing relationships.
A drug recommendation method based on machine learning is adopted. By obtaining the subgraph data of the drug molecular structure and the sample user's electronic medical record as input, the network model is jointly trained with multiple tasks, a drug recommendation model is constructed, and the subgraph data of the drug molecular structure is used to extract the subgraph. The graph represents the vector and combines the drug properties with the user's electronic medical record to output recommended drugs. It uses the mutual constraints between drugs to filter and generates drug recommendation results for the target user.
It improves the accuracy and stability of drug recommendations, especially in drug recommendation results for rare diseases and difficult and complicated diseases. It avoids unreasonable drug combinations and improves the accuracy of drug recommendation for rare diseases.
Smart Images

Figure CN113707264B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a drug recommendation method, device, computer equipment and computer storage medium based on machine learning. Background Art
[0002] With the rise of Internet technology, drug recommendation is a basic task of artificial intelligence in the field of healthcare. It can support functions such as disease auxiliary diagnosis, health management, and remote consultation. It can also assist doctors in more safely, accurately, and efficiently selecting and formulating the best treatment plans and drug combinations that are beneficial to patients based on medical and health big data, thereby alleviating the current shortage of medical resources to a certain extent.
[0003] In the existing technology, professional knowledge is introduced through knowledge graphs, and the entity and relationship sets associated with drugs are directly considered, such as drug indications, contraindications, adverse reactions, etc. However, large-scale medical knowledge graphs are automatically generated by algorithms, and the quality is uneven. There are a large number of errors and omissions in the relationship, resulting in low accuracy of drug recommendations and unreasonable recommended drug regimens. Summary of the invention
[0004] In view of this, the present invention provides a drug recommendation method, apparatus, computer device and computer storage medium based on machine learning, the main purpose of which is to solve the problems of low accuracy of drug recommendation and unreasonable recommended drug regimens in the prior art.
[0005] According to one aspect of the present invention, a method for drug recommendation based on machine learning is provided, the method comprising:
[0006] Obtain drug molecular structure and process it to obtain sub-graph data of drug molecules;
[0007] Using the subgraph data of the drug molecule and the electronic medical records of the sample user as input, a network model is trained jointly with multiple tasks to construct a drug recommendation model, wherein the drug recommendation model is used to extract the subgraph representation vector of the drug molecule according to the subgraph data of the drug molecule structure, and output at least one recommended drug in combination with the drug properties mapped by the subgraph representation vector and the electronic medical records of the sample user;
[0008] Inputting the subgraph data of the drug molecular structure and the target user's electronic medical record into the drug recommendation model for prediction to obtain at least one recommended drug suitable for the target user;
[0009] By utilizing the mutual constraint relationship between different drugs, the at least one recommended drug suitable for the target user is filtered to generate a drug recommendation result for the target user.
[0010] In another embodiment of the present invention, the obtaining of drug molecular structure processing to obtain drug molecule subgraph data specifically includes:
[0011] Characterize the structure of drug molecules and map the characteristics of nodes and edges of the graph structure to the atoms and chemical bonds of the compound;
[0012] According to the atoms and chemical bonds of the compound, subgraph data of the drug molecule is obtained.
[0013] In another embodiment of the present invention, the sample user case data carries the disease type and applicable drug label of the sample user, and the drug recommendation model uses contrastive learning tasks and drug recommendation tasks to train the network model. The subgraph data of the drug molecules and the sample user's electronic medical records are used as input to perform multi-task joint training on the network model to construct a drug recommendation model, including:
[0014] For the contrastive learning task, the graph neural network layer of the network model is used to perform feature extraction on the subgraph data of the drug molecule to obtain a subgraph representation vector of the drug molecule, and the subgraph representation vector is used to represent the characteristics of the drug;
[0015] For the drug recommendation task, using the prediction layer of the network model to predict the drug properties according to the subgraph representation vector, and obtaining applicable features of the drug properties;
[0016] In combination with the applicable characteristics of the drug properties and using drug labels, a mapping relationship between the disease type of the sample user and the drug recommendation is established, and at least one recommended drug suitable for the sample user is output according to the mapping relationship to construct a drug recommendation model.
[0017] In another embodiment of the present invention, for the contrastive learning task, the graph neural network layer of the network model is used to extract features from the subgraph data of the drug molecule to obtain a subgraph representation vector of the drug molecule, specifically including:
[0018] For the comparative learning task, different subgraphs in the same drug molecule structure are selected as positive samples, and subgraphs in different drug molecule structures are selected as negative samples. The graph neural network layer of the network model is used to perform feature extraction on the subgraph data of the drug molecule to obtain a subgraph representation vector of the drug molecule. Different subgraphs of the same drug molecule generate different subgraph representation vectors.
[0019] The subgraph representation vectors of the drug molecules are optimized by maximizing the similarity between different subgraph representation vectors in the same drug molecule structure and minimizing the similarity between subgraph representation vectors in different drug molecule structures as the desired goal of the contrastive learning task.
[0020] In another embodiment of the present invention, the method further comprises:
[0021] Combining the loss function preset for the contrastive learning task with the loss function preset for the drug recommendation task to form a loss function for the combined task;
[0022] During the multi-task joint training of the network model, the model parameters in the drug recommendation model are adjusted in combination with the numerical values output by the loss function of the joint task.
[0023] In another embodiment of the present invention, the mutual constraint relationship represents the interaction between drugs. After inputting the subgraph data of the drug molecular structure and the target user's electronic medical record into the drug recommendation model for prediction to obtain at least one recommended drug suitable for the target user, the method further includes:
[0024] Use multimodal deep autoencoders to pre-train the mutual constraints between different drugs;
[0025] The multimodal deep autoencoder is used to pre-train the mutual constraint relationship between different drugs, specifically including:
[0026] Pre-collect drugs with at least one feature or one interaction to form a drug dataset consisting of multiple feature dimensions;
[0027] Taking each feature dimension in the drug dataset as a drug feature network, training each drug feature network using a multimodal deep autoencoder channel to obtain the correlation between different drug feature networks;
[0028] A random forest classifier is used to constrain the association relationship between the different drug feature networks, and output the mutual constraint relationship between different drugs.
[0029] In another embodiment of the present invention, after inputting the subgraph data of the drug molecular structure and the target user's electronic medical record into the drug recommendation model for prediction to obtain at least one recommended drug suitable for the target user, the method further includes:
[0030] The symptom data of the target user after using the drug recommendation result is analyzed, and whether the drug recommendation result meets the expected effect is evaluated based on the analysis result. If not, at least one recommended drug in the drug recommendation result is adjusted.
[0031] According to another aspect of the present invention, a drug recommendation device based on machine learning is provided, the device comprising:
[0032] An acquisition unit, used for acquiring drug molecular structure processing to obtain sub-graph data of drug molecules;
[0033] A construction unit, used to use the subgraph data of the drug molecule and the electronic medical records of the sample user as input, to perform multi-task joint training on the network model, and to construct a drug recommendation model, wherein the drug recommendation model is used to extract the subgraph representation vector of the drug molecule according to the subgraph data of the drug molecule structure, and to output at least one recommended drug in combination with the drug properties mapped by the subgraph representation vector and the electronic medical records of the sample user;
[0034] A prediction unit, used for inputting the subgraph data of the drug molecular structure and the electronic medical record of the target user into the drug recommendation model for prediction, so as to obtain at least one recommended drug suitable for the target user;
[0035] The generating unit is used to filter the at least one recommended drug suitable for the target user by utilizing the mutual constraint relationship between different drugs, and generate a drug recommendation result for the target user.
[0036] In another embodiment of the present invention, the acquisition unit includes:
[0037] A mapping module is used to characterize the structure of drug molecules and map the characteristics of nodes and edges of the graph structure to the atoms and chemical bonds of the compound;
[0038] The acquisition module is used to acquire sub-graph data of drug molecules according to the atoms and chemical bonds of the compound.
[0039] In another embodiment of the present invention, the sample user case data carries the disease type and applicable drug label of the sample user, and the drug recommendation model uses contrastive learning tasks and drug recommendation tasks to train the network model, and the construction unit includes:
[0040] An extraction module, for performing feature extraction on the subgraph data of the drug molecule using the graph neural network layer of the network model for the contrastive learning task, to obtain a subgraph representation vector of the drug molecule, wherein the subgraph representation vector is used to represent the characteristics of the drug;
[0041] A prediction module, for predicting the properties of the drug according to the subgraph representation vector using the prediction layer of the network model for the drug recommendation task, and obtaining applicable features of the drug properties;
[0042] A construction module is used to combine the applicable characteristics of the drug properties and use drug labels to establish a mapping relationship between the disease type of the sample user and the drug recommendation, output at least one recommended drug suitable for the sample user based on the mapping relationship, and construct a drug recommendation model.
[0043] In another embodiment of the present invention, the extraction module includes:
[0044] An extraction submodule, for selecting different subgraphs in the same drug molecule structure as positive samples and subgraphs in different drug molecule structures as negative samples for the comparative learning task, and using the graph neural network layer of the network model to perform feature extraction on the subgraph data of the drug molecule to obtain a subgraph representation vector of the drug molecule, wherein different subgraphs of the same drug molecule generate different subgraph representation vectors;
[0045] The optimization submodule is used to optimize the subgraph representation vectors of the drug molecules by maximizing the similarity between different subgraph representation vectors in the same drug molecule structure and minimizing the similarity between subgraph representation vectors in different drug molecule structures as the desired goal of the comparative learning task.
[0046] In another embodiment of the present invention, the construction unit further includes:
[0047] A joint module, used for combining the loss function preset for the contrastive learning task and the loss function preset for the drug recommendation task to form a loss function for the joint task;
[0048] An adjustment module is used to adjust the model parameters in the drug recommendation model in combination with the numerical values output by the loss function of the joint task during the multi-task joint training of the network model.
[0049] In another embodiment of the present invention, the mutual constraint relationship represents the interaction between drugs, and the device further comprises:
[0050] A training unit is used to use a multimodal deep autoencoder to pre-train the mutual constraint relationship between different drugs after inputting the subgraph data of the drug molecular structure and the target user's electronic medical record into the drug recommendation model for prediction to obtain at least one recommended drug suitable for the target user.
[0051] The training unit comprises:
[0052] A collection module, used for pre-collecting drugs with at least one feature or one interaction to form a drug data set consisting of multiple feature dimensions;
[0053] A training module, used to take each feature dimension in the drug data set as a drug feature network, train each drug feature network using a multimodal deep autoencoder channel, and obtain the correlation relationship between different drug feature networks;
[0054] The constraint module is used to use a random forest classifier to constrain the association relationship between the different drug feature networks and output the mutual constraint relationship between different drugs.
[0055] In another embodiment of the present invention, the device further comprises:
[0056] An evaluation unit is used to analyze the symptom data of the target user after using the drug recommendation result after inputting the subgraph data of the drug molecular structure and the target user's electronic medical record into the drug recommendation model for prediction to obtain at least one recommended drug suitable for the target user, and evaluate whether the drug recommendation result meets the expected effect based on the analysis result. If not, adjust at least one recommended drug in the drug recommendation result.
[0057] According to another aspect of the present invention, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of a drug recommendation method based on machine learning when executing the computer program.
[0058] According to another aspect of the present invention, a computer storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of a drug recommendation method based on machine learning are implemented.
[0059] By means of the above technical scheme, the present invention provides a drug recommendation method and device based on machine learning, obtains the subgraph data of the drug molecule by processing the drug molecular structure, uses the subgraph data of the drug molecule and the electronic medical record of the sample user as input, performs multi-task joint training on the network model, constructs a drug recommendation model, inputs the subgraph data of the drug molecular structure and the electronic medical record of the target user into the drug recommendation model for prediction, obtains at least one recommended drug suitable for the target user, and uses the mutual constraint relationship between different drugs to filter at least one recommended drug suitable for the target user, and generates a drug recommendation result for the target user. Compared with the method of using medical knowledge graphs to recommend drugs in the prior art, the present application takes into account the drug molecular structure, recommends drugs based on drug functions, uses contrastive learning tasks to obtain more robust subgraph representation vectors of drug molecular structures, and combines drug recommendation tasks for simultaneous learning, which does not simply rely on the co-occurrence relationship between historical diagnosis and medication, and helps to improve the accuracy of drug recommendation results for rare diseases and difficult and complicated diseases, and uses the interaction relationship between drugs to filter recommended drugs, avoid unreasonable drug combinations, and improve the accuracy and stability of drug recommendation results. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present invention. Moreover, the same reference symbols are used throughout the accompanying drawings to represent the same components. In the accompanying drawings:
[0061] Figure 1 A schematic diagram of a process of a drug recommendation method based on machine learning provided by an embodiment of the present invention is shown;
[0062] Figure 2 A schematic diagram of a process flow of another drug recommendation method based on machine learning provided by an embodiment of the present invention is shown;
[0063] Figure 3 A schematic diagram of the structure of a drug recommendation device based on machine learning provided by an embodiment of the present invention is shown;
[0064] Figure 4 A schematic structural diagram of another drug recommendation device based on machine learning provided in an embodiment of the present invention is shown. DETAILED DESCRIPTION
[0065] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0066] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0067] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0068] The embodiment of the present invention provides a drug recommendation method based on machine learning, which can take into account the molecular structure of the drug and make drug recommendations based on the drug function, thereby providing more accurate drug recommendation results, such as Figure 1 As shown, the method includes:
[0069] 101. Obtain the drug molecule structure and process it to obtain sub-graph data of the drug molecule.
[0070] The drug molecular structure is the chemical formula of the drug, which can be obtained through the drug website or drug instructions. Since the drug molecular structure can better reflect the function of the drug, considering the drug molecular structure in the process of drug recommendation can effectively improve the accuracy of drug recommendation. The specific process of obtaining the drug molecular structure and obtaining the subgraph data of the drug molecule can be achieved in the following three ways:
[0071] Method 1: Delete nodes and edges connected to the nodes in the drug molecular structure with a preset probability to obtain a subgraph of the drug molecular structure, so that it obeys a Bernoulli distribution with a parameter of ρ, where ρ is the preset parameter and the ratio of deleted nodes. If ρ = 0.1, the nodes in the graph are deleted with a probability of 10%. The deleted node here refers to a node in the drug molecular structure.
[0072] Method 2: Randomly delete certain edges in the drug molecular structure with a preset probability to obtain a subgraph of the drug molecular structure.
[0073] Method 3: Given a node, specify the maximum walk length, perform random walks in the drug molecular structure, and obtain a subgraph of the drug molecular structure.
[0074] It should be noted that, in the process of constructing the subgraph data of the drug molecular structure here, the subgraph data of the drug molecular structure is generated at a certain ratio, and specifically, the subgraph data can be generated at a ratio of 1:1:1 through the above three generation methods.
[0075] In an embodiment of the present invention, the execution entity may be a drug recommendation device, which is specifically used in medical platforms suitable for drug push, such as smart medical care or medical cloud. The drug molecular structure is obtained through the medical platform, and processed to obtain the subgraph structure of the drug molecule. Since the substructure of the drug molecule may have connected atoms of related energy groups, it can better reflect the function of the drug. Compared with the prior art method of using a knowledge graph with drug-related entity relationships to recommend drugs, the present application considers the drug molecular structure during the modeling process, which can improve the accuracy of drug recommendations.
[0076] 102. Using the subgraph data of the drug molecules and the electronic medical records of sample users as input, multi-task joint training is performed on the network model to build a drug recommendation model.
[0077] In this application, the drug recommendation model uses multi-task learning to train the network model. In the specific training process, the first task is a comparative learning task, and the input parameter of the comparative learning task is the subgraph data of the drug molecular structure, which is used to extract the subgraph representation vector of the drug molecule based on the subgraph data of the drug molecular structure. The second task is a drug recommendation task, and the input of the drug recommendation task is the subgraph representation vector and the sample user's electronic medical record, which is used to combine the drug properties mapped by the subgraph representation vector with the sample user's electronic medical record to output at least one recommended drug. The above training process needs to adjust the network parameters of multiple tasks in the network model in combination with the disease type of the sample user and the applicable drug label.
[0078] It is understandable that the sample user's electronic medical record here can be obtained in combination with the medical cloud. The medical cloud refers to the use of "cloud computing" to create a medical and health service cloud platform based on new technologies such as cloud computing, mobile technology, multimedia, 4G communication, big data, and the Internet of Things, combined with medical technology, to achieve the sharing of medical resources and the expansion of medical scope. Because of the application of cloud computing technology, the medical cloud improves the efficiency of medical institutions and facilitates residents to seek medical treatment. For example, the current hospital appointment registration, electronic medical records, medical insurance, etc. are all products of the combination of cloud computing and the medical field. The medical cloud also has the advantages of data security, information sharing, dynamic expansion, and overall layout. In a possible implementation method, the sample user's electronic medical record is medical data, such as personal health records, prescriptions, examination reports and other data, which is equivalent to medical texts. The medical text can be an electronic medical record (Electronic Healthcare Record), an electronic personal health record, including medical records, electrocardiograms, medical images and other electronic records with preservation value.
[0079] Here, for the contrastive learning task and the drug recommendation task, each task has its own parameters and loss function. In the contrastive learning task, the GNN (graph neural network) method can be used to extract the subgraph representation vector of the drug molecular structure. Here, different subgraphs in the same drug molecular structure will produce different subgraph representation vectors. In the specific learning process, the sample selection selects a pair of different subgraphs in the same drug molecular structure as positive samples, and selects subgraphs in different drug molecular structures as negative samples. The goal of the contrastive learning task is to maximize the similarity between different subgraph representation vectors in the same drug molecular structure and minimize the similarity between subgraph representation vectors in different drug molecular structures. The drug recommendation task uses a network model to predict the recommended drugs suitable for sample users. In the specific learning process, the probability of each drug being recommended can be predicted based on the patient's diagnosis, test examination, historical medication data, and the subgraph representation vector of the drug molecule, and at least one recommended drug with a probability value greater than a preset threshold is selected as at least one recommended drug suitable for the sample user.
[0080] 103. Input the subgraph data of the drug molecular structure and the target user's electronic medical record into the drug recommendation model for prediction to obtain at least one recommended drug suitable for the target user.
[0081] In this application, the target users are users whose disease types and applicable drugs are not marked. The drug recommendation model adopts a self-supervised comparative learning method, fully considers the molecular structure of the drug, and has a higher accuracy in drug recommendations for rare diseases and difficult diseases.
[0082] It can be understood that in order to facilitate the user's selection of recommended drugs, at least one recommended drug suitable for the target user here can be set with different recommendation indexes and recommendation levels. For example, the recommendation index of drug A and drug C is level 1, and the recommendation index of drug B is level 2. It can also be expressed in the form of a drug combination. Specifically, at least one recommended drug can be combined according to different efficacy or administration time. For example, since drug A and drug C have the effect of supplementing vitamin D, the two can be combined. Drug B and drug D are both drugs that are taken once a day, and the two can be combined.
[0083] 104. Utilize the mutual constraint relationship between different drugs to filter the at least one recommended drug suitable for the target user, and generate a drug recommendation result for the target user.
[0084] Among them, the mutual constraint relationship between drugs represents drug-drug interaction, that is, the interaction between drugs when two or more drugs are taken simultaneously or successively. This interaction may enhance the efficacy of the drugs or cause unexpected side effects.
[0085] Here, the mutual constraints between different drugs can be trained through multimodal deep autoencoders. Specifically, drugs with at least one feature or one interaction can be collected to form a drug dataset. The drug dataset consists of 4 different feature dimensions. Each drug dataset is regarded as a drug feature network. Each drug feature network is used as input and trained through a multimodal deep autoencoder channel. Different colors and shapes are used to represent the nodes of different feature networks. Integrating the drug features in the hidden layer together for simultaneous learning helps capture the associations between different networks. Then four operators (averaging, Hadamard product, L1 norm, connection) are used on the learned drug representations and they are input into the random forest classifier to train the model and output the mutual constraints between different drugs.
[0086] It should be noted that for recommended drugs with constraint relationships, it means that the drugs will interact with each other, and two recommended drugs should not be reused at the same time, nor should a recommended scheme be used to recommend patients. Specifically for recommended drugs with constraint relationships, one or more drugs can be filtered, and drug recommendation results can be generated based on the filtered recommended drugs.
[0087] The embodiment of the present invention provides a drug recommendation method based on machine learning, which obtains the subgraph data of the drug molecule by processing the drug molecular structure, uses the subgraph data of the drug molecule and the electronic medical record of the sample user as input, performs multi-task joint training on the network model, builds a drug recommendation model, inputs the subgraph data of the drug molecular structure and the electronic medical record of the target user into the drug recommendation model for prediction, obtains at least one recommended drug suitable for the target user, and uses the mutual constraint relationship between different drugs to filter the at least one recommended drug suitable for the target user, and generates a drug recommendation result for the target user. Compared with the method of using medical knowledge graphs to recommend drugs in the prior art, the present application takes into account the drug molecular structure and recommends drugs based on the drug function, uses the contrast learning task to obtain a more robust subgraph representation vector of the drug molecular structure, and combines the drug recommendation task for simultaneous learning, which does not simply rely on the co-occurrence relationship of historical diagnosis and medication, and helps to improve the accuracy of drug recommendation results for rare diseases and difficult and complicated diseases, and uses the interaction relationship between drugs to filter the recommended drugs to avoid unreasonable drug combinations, thereby improving the accuracy and stability of drug recommendation results.
[0088] The embodiment of the present invention provides another drug recommendation method based on machine learning, which can take into account the molecular structure of the drug and make drug recommendations based on the drug function, thereby providing more accurate drug recommendation results, such as Figure 2 As shown, the method includes:
[0089] 201. Characterize the structure of drug molecules and map the characteristics of nodes and edges of the graph structure to the atoms and chemical bonds of the compound.
[0090] In practical applications, drugs are divided into structural nonspecific drugs and structural specific drugs according to the way they act in the body. The activity of structural nonspecific drugs mainly depends on the various physical and chemical properties of the drug molecules and is not closely related to the chemical structure. When the structure changes, the activity of the drug does not change significantly. Structural specific drugs refer to drugs that have a specific effect on a certain physiological and biochemical process of the disease, that is, the drug is required to bind only to targets related to disease treatment.
[0091] Specifically, in the process of structuring the characteristics of drug molecules, considering the physical and chemical properties of the drug, the structure of the drug molecule can be converted into different structural representations according to the mode of action of the drug in the body, which can be one-dimensional structure, two-dimensional structure, three-dimensional structure, etc., and further based on the characteristics of the nodes and edges of the graph structure, the representations of different structures are mapped to the atoms and chemical bonds of the compound. For example, for the representation of the two-dimensional structure, the characteristics of the nodes and edges of the graph structure can be a unit group composed of vertices and edges as a mapping function, and the representation of the two-dimensional structure is mapped to the atoms and chemical bonds of the compound according to the number of associations between the vertices and the edges.
[0092] 202. Obtain subgraph data of the drug molecule according to the atoms and chemical bonds of the compound.
[0093] Considering the visibility of the compound structure, the atoms and chemical bonds of the compound as the compound structure can be represented in matrix form, such as distance matrix, bond matrix, association matrix, etc., through which the atom list and bond list can be determined. Here, the subgraph data of the drug molecule as part of the drug molecule structure can choose to delete some atomic nodes and corresponding connecting bonds, and can also randomly walk to retain the atomic nodes and corresponding connecting bonds, which is not limited here.
[0094] 203. Using the subgraph data of the drug molecules and the sample user electronic medical records as input, multi-task joint training is performed on the network model to build a drug recommendation model.
[0095] Among them, the drug recommendation model is used to extract the subgraph representation vector of the drug molecule based on the subgraph data of the drug molecular structure, and output at least one recommended drug based on the drug properties mapped by the subgraph representation vector and the electronic medical records of the sample user.
[0096] Specifically, in the process of using the subgraph data of drug molecules and the electronic medical records of sample users as input to perform multi-task joint training on the network model to build a drug recommendation model, the sample user case data carries the sample user's disease type and applicable drug labels. The drug recommendation model uses contrastive learning tasks and drug recommendation tasks to train the network model. For the contrastive learning task, the graph neural network layer of the network model is used to extract features from the subgraph data of drug molecules to obtain a subgraph representation vector of the drug molecules. The subgraph representation vector is used to characterize the characteristics of the drug. For the drug recommendation task, the prediction layer of the network model is used to predict the drug properties based on the subgraph representation vector to obtain applicable characteristics of the drug properties. Further, in combination with the applicable characteristics of the drug properties and the use of drug labels, a mapping relationship between the sample user's disease type and drug recommendation is established. According to the mapping relationship, at least one recommended drug suitable for the sample user is output to build a drug recommendation model.
[0097] Taking into account the accuracy of the drug molecule representation vector, for the contrastive learning task, the graph neural network layer of the network model is used to extract features from the subgraph data of the drug molecules. In the process of obtaining the subgraph representation vector of the drug molecules, specifically for the contrastive learning task, different subgraphs in the same drug molecule structure are selected as positive samples, and subgraphs in different drug molecule structures are selected as negative samples. The graph neural network layer of the network model is used to extract features from the subgraph data of the drug molecules to obtain the subgraph representation vector of the drug molecules. Here, different subgraphs of the same drug molecule produce different subgraph representation vectors, and maximizing the similarity between different subgraph representation vectors in the same drug molecule structure and minimizing the similarity between subgraph representation vectors in different drug molecule structures are used as the expected goals of the contrastive learning task to optimize the subgraph representation vectors of the drug molecules.
[0098] Furthermore, in order to ensure the accuracy of network model training, specifically during the network model training process, the loss function pre-set for the contrastive learning task and the loss function pre-set for the drug recommendation task can be combined to form a loss function for the joint task. In the process of multi-task joint training of the network model, the model parameters in the drug recommendation model are adjusted in combination with the numerical values output by the loss function of the joint task.
[0099] Here the loss function of the contrastive learning task can be defined as The formula is as follows:
[0100]
[0101] Among them, h′ u , h″ u are two different subgraph representation vectors of drug molecule u, h′ v is the subgraph representation vector of drug molecule v, and τ is a hyperparameter representing the scaling factor.
[0102] Here the loss function for the drug recommendation task can be defined as The formula is as follows:
[0103]
[0104] Where T is the number of drugs, y t is the real label, indicating whether the drug numbered t is used. The predicted value output by the drug recommendation model.
[0105] Specifically, in the process of training the network model, the loss function of the contrastive learning task is Loss function for drug recommendation task Combine them for joint training to get the loss function L of the joint task. Use the loss function L to optimize the loss functions of the two tasks at the same time. The specific formula is as follows:
[0106]
[0107] Among them, λ(|Θ|2) 2 It is a regularization term, which is related to the complexity of the model and reduces the risk of overfitting.
[0108] It can be understood that during the training process, the loss function of each learning task can reflect the degree of error between the predicted result and the actual result. The training goal is to minimize the point of the loss function so that the error degree is minimized. During the training process, the value output by the loss function L of the joint task mentioned above is used to continuously adjust the network parameters of the two tasks.
[0109] 204. Input the subgraph data of the drug molecular structure and the target user's electronic medical record into the drug recommendation model for prediction to obtain at least one recommended drug suitable for the target user.
[0110] 205. Use multimodal deep autoencoders to pre-train the mutual constraints between different drugs.
[0111] In actual application scenarios, the multimodal deep autoencoder channel is used for training. The multimodal deep autoencoder channel consists of 5 autoencoder channels and 1 shared hidden layer. The purpose is to learn a unified representation from multiple drug feature networks. After training, a low-dimensional space in the shared hidden layer can be obtained. The objective function of the multimodal deep autoencoder channel is constrained by three parts: the reconstruction error of multiple autoencoders, the mutual constraints between known drugs, and the similarity constraints of drug feature networks.
[0112] It should be noted that the mutual constraint relationship between drugs here can be whether there is interaction between drugs. Recommended drugs with interaction are prone to adverse reactions and are therefore not suitable as co-recommended drugs.
[0113] 206. Utilize the mutual constraint relationship between different drugs to filter the at least one recommended drug suitable for the target user, and generate a drug recommendation result for the target user.
[0114] For example, at least one recommended drug includes A, B, C, D, and E, and the recommended drugs with a constraint relationship include drug A and drug C. At this time, you can filter out any one of drug A and drug C and generate the drug recommendation result by retaining the remaining drugs. At this time, the drug recommendation result is B, C, D, E; A, B, D, E. If the recommended drugs with a constraint relationship include drug A and drug C, drug B and drug D, you need to filter one from drug A and drug C and filter one from drug B and drug D at the same time. At this time, the drug recommendation results are: A, B, E; A, D, E; B, C, E; C, D, E. If there are three recommended drugs with a constraint relationship, you can filter one or two of them as the drug recommendation result.
[0115] 207. Analyze the symptom data of the target user after using the drug recommendation result, and evaluate whether the drug recommendation result meets the expected effect based on the analysis result. If not, adjust at least one recommended drug in the drug recommendation result.
[0116] Furthermore, in order to evaluate the drug recommendation results and facilitate subsequent adjustments, the symptom data of the target user after using the drug recommendation results can be compared with the symptom data corresponding to the drug effect. If the comparison is consistent, it means that the drug recommendation result meets the expected effect. Otherwise, it means that the drug in the drug recommendation result has no obvious effect on the target user or has a counterproductive effect. The recommended drugs in the drug recommendation results are then analyzed to determine whether there are target users who are not suitable for this disease type, and the applicable population type is marked for the recommended drugs.
[0117] Further, as Figure 1 In a specific implementation of the method, an embodiment of the present invention provides a drug recommendation device based on machine learning, such as Figure 3 As shown, the device includes: an acquisition unit 31, a construction unit 32, a prediction unit 33, and a generation unit 34.
[0118] The acquisition unit 31 may be used to acquire the drug molecule structure and obtain the sub-graph data of the drug molecule;
[0119] The construction unit 32 may be used to use the subgraph data of the drug molecule and the sample user's electronic medical record as input to perform multi-task joint training on the network model to construct a drug recommendation model, wherein the drug recommendation model is used to extract the subgraph representation vector of the drug molecule according to the subgraph data of the drug molecule structure, and output at least one recommended drug in combination with the drug properties mapped by the subgraph representation vector and the sample user's electronic medical record;
[0120] The prediction unit 33 may be used to input the subgraph data of the drug molecular structure and the target user's electronic medical record into the drug recommendation model for prediction, and obtain at least one recommended drug suitable for the target user;
[0121] The generating unit 34 may be configured to filter the at least one recommended drug suitable for the target user by utilizing the mutual constraint relationship between different drugs, and generate a drug recommendation result for the target user.
[0122] The embodiment of the present invention provides a drug recommendation device based on machine learning, which obtains the subgraph data of the drug molecule by processing the drug molecular structure, uses the subgraph data of the drug molecule and the electronic medical record of the sample user as input, performs multi-task joint training on the network model, builds a drug recommendation model, inputs the subgraph data of the drug molecular structure and the electronic medical record of the target user into the drug recommendation model for prediction, obtains at least one recommended drug suitable for the target user, and uses the mutual constraint relationship between different drugs to filter the at least one recommended drug suitable for the target user, and generates a drug recommendation result for the target user. Compared with the method of using medical knowledge graphs to recommend drugs in the prior art, the present application takes into account the drug molecular structure and recommends drugs based on the drug function, uses the contrast learning task to obtain a more robust subgraph representation vector of the drug molecular structure, and combines the drug recommendation task for simultaneous learning, which does not simply rely on the co-occurrence relationship of historical diagnosis and medication, and helps to improve the accuracy of drug recommendation results for rare diseases and difficult and complicated diseases, and uses the interaction relationship between drugs to filter the recommended drugs to avoid unreasonable drug combinations, thereby improving the accuracy and stability of drug recommendation results.
[0123] As Figure 3 Further description of the machine learning based drug recommendation device shown in, Figure 4 is a schematic diagram of the structure of another drug recommendation device based on machine learning according to an embodiment of the present invention. Figure 4 As shown, the acquisition unit 31 includes:
[0124] A mapping module 311 may be used to characterize the structure of drug molecules and map the characteristics of nodes and edges of the graph structure to atoms and chemical bonds of the compound;
[0125] The acquisition module 312 may be used to acquire sub-graph data of drug molecules according to the atoms and chemical bonds of the compound.
[0126] In a specific application scenario, the sample user case data carries the disease type and applicable drug label of the sample user, and the drug recommendation model uses contrastive learning tasks and drug recommendation tasks to train the network model. The construction unit 32 includes:
[0127] The extraction module 321 can be used to extract features of the subgraph data of the drug molecule using the graph neural network layer of the network model for the contrastive learning task, and obtain a subgraph representation vector of the drug molecule, wherein the subgraph representation vector is used to represent the drug characteristics;
[0128] A prediction module 322 may be used to predict the properties of a drug according to the subgraph representation vector using the prediction layer of the network model for the drug recommendation task, and obtain applicable features of the properties of the drug;
[0129] The construction module 323 can be used to combine the applicable characteristics of the drug properties and use drug labels to establish a mapping relationship between the disease type of the sample user and the drug recommendation, output at least one recommended drug suitable for the sample user based on the mapping relationship, and construct a drug recommendation model.
[0130] In a specific application scenario, the extraction module 321 includes:
[0131] The extraction submodule 3211 can be used to select different subgraphs in the same drug molecule structure as positive samples and subgraphs in different drug molecule structures as negative samples for the comparative learning task, and use the graph neural network layer of the network model to perform feature extraction on the subgraph data of the drug molecule to obtain a subgraph representation vector of the drug molecule, where different subgraphs of the same drug molecule generate different subgraph representation vectors;
[0132] The optimization submodule 3212 can be used to optimize the subgraph representation vectors of the drug molecules by maximizing the similarity between different subgraph representation vectors in the same drug molecule structure and minimizing the similarity between subgraph representation vectors in different drug molecule structures as the desired goal of the comparative learning task.
[0133] In a specific application scenario, the construction unit 32 further includes:
[0134] A combining module 324 may be used to combine the loss function preset for the contrastive learning task and the loss function preset for the drug recommendation task to form a loss function for the combined task;
[0135] The adjustment module 325 can be used to adjust the model parameters in the drug recommendation model in combination with the numerical values output by the loss function of the joint task during the multi-task joint training of the network model.
[0136] In a specific application scenario, the mutual constraint relationship represents the interaction between drugs, and the device further includes:
[0137] The training unit 35 may be used to pre-train the mutual constraint relationship between different drugs using a multimodal deep autoencoder after inputting the subgraph data of the drug molecular structure and the target user's electronic medical record into the drug recommendation model for prediction to obtain at least one recommended drug suitable for the target user.
[0138] The training unit 35 comprises:
[0139] The collection module 351 may be used to pre-collect drugs having at least one characteristic or one interaction to form a drug data set consisting of multiple characteristic dimensions;
[0140] The training module 352 can be used to use each feature dimension in the drug data set as a drug feature network, and use a multimodal deep autoencoder channel to train each drug feature network to obtain the correlation relationship between different drug feature networks;
[0141] The constraint module 353 can be used to constrain the association relationship between the different drug feature networks using a random forest classifier, and output the mutual constraint relationship between different drugs.
[0142] In a specific application scenario, the device further includes:
[0143] The evaluation unit 36 can be used to analyze the symptom data of the target user after using the drug recommendation result after inputting the subgraph data of the drug molecular structure and the target user's electronic medical record into the drug recommendation model for prediction and obtaining at least one recommended drug suitable for the target user, and evaluate whether the drug recommendation result meets the expected effect based on the analysis result, and if not, adjust at least one recommended drug in the drug recommendation result.
[0144] It should be noted that for other corresponding descriptions of the functional units involved in the drug recommendation device based on machine learning provided in this embodiment, please refer to Figure 1 , Figure 2 The corresponding description in will not be repeated here.
[0145] Based on the above Figure 1 , Figure 2 The method shown in the embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned Figure 1 , Figure 2 The machine learning-based drug recommendation method shown.
[0146] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.
[0147] Based on the above Figure 1 , Figure 2 The method shown, and Figure 3 , Figure 4 In order to achieve the above-mentioned purpose, the embodiment of the present application also provides a computer device, which can be a personal computer, a server, a network device, etc. The physical device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above-mentioned Figure 1 , Figure 2 The machine learning-based drug recommendation method shown
[0148] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.
[0149] Those skilled in the art will understand that the physical device structure of the machine learning-based drug recommendation apparatus provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or a combination of certain components, or different component arrangements.
[0150] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the above-mentioned computer device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the components inside the storage medium, and communication with other hardware and software in the physical device.
[0151] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus the necessary general hardware platform, or by hardware. By applying the technical solution of the present application, compared with the current prior art, the present application takes into account the molecular structure of the drug, makes drug recommendations based on the drug function, uses contrastive learning tasks to obtain more robust subgraph representation vectors of the drug molecular structure, and combines drug recommendation tasks for simultaneous learning. It does not simply rely on the co-occurrence relationship of historical diagnosis and medication, which helps to improve the accuracy of drug recommendation results for rare diseases and difficult and complicated diseases, and uses the interaction relationship between drugs to filter recommended drugs, avoid unreasonable drug combinations, and improve the accuracy and stability of drug recommendation results.
[0152] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.
[0153] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.
Claims
1. A drug recommendation method based on machine learning, characterized in that: The method comprises: Obtaining drug molecule structure processing to obtain subgraph data of drug molecules, specifically characterizing the structure of drug molecules, and mapping the characteristics of nodes and edges of the graph structure to atoms and chemical bonds of the compound; obtaining subgraph data of drug molecules according to the atoms and chemical bonds of the compound; Using the subgraph data of the drug molecule and the electronic medical records of the sample user as input, the network model is trained for multi-task joint training to construct a drug recommendation model. The drug recommendation model is used to extract the subgraph representation vector of the drug molecule based on the subgraph data of the drug molecule structure, and output at least one recommended drug in combination with the drug properties mapped by the subgraph representation vector and the electronic medical records of the sample user. The sample user case data carries the disease type of the sample user and the applicable drug label. Specifically for the comparative learning task, different subgraphs in the same drug molecule structure are selected as positive samples, and subgraphs in different drug molecule structures are selected as negative samples. The graph neural network layer of the network model is used to extract features from the subgraph data of the drug molecule to obtain the subgraph representation vector of the drug molecule. Different subgraphs of the same drug molecule generate different subgraph representation vectors; the subgraph representation vectors of the drug molecule are optimized by maximizing the similarity between different subgraph representation vectors in the same drug molecule structure and minimizing the similarity between subgraph representation vectors in different drug molecule structures as the desired goal of the comparative learning task, and the subgraph representation vectors are used to characterize drug properties; for the drug recommendation task, the prediction layer of the network model is used to predict the drug properties according to the subgraph representation vector to obtain applicable features of the drug properties; a mapping relationship between the disease type of the sample user and the drug recommendation is established in combination with the applicable features of the drug properties and the use of drug labels, and at least one recommended drug suitable for the sample user is output according to the mapping relationship to construct a drug recommendation model; Inputting the subgraph data of the drug molecular structure and the target user's electronic medical record into the drug recommendation model for prediction to obtain at least one recommended drug suitable for the target user; By utilizing the mutual constraint relationship between different drugs, the at least one recommended drug suitable for the target user is filtered to generate a drug recommendation result for the target user; The symptom data of the target user after using the drug recommendation result is analyzed, and whether the drug recommendation result meets the expected effect is evaluated based on the analysis result. If not, at least one recommended drug in the drug recommendation result is adjusted.
2. The method according to claim 1, characterized in that The method further comprises: Combining the loss function preset for the contrastive learning task with the loss function preset for the drug recommendation task to form a loss function for the combined task; During the multi-task joint training of the network model, the model parameters in the drug recommendation model are adjusted in combination with the numerical values output by the loss function of the joint task.
3. The method according to any one of claims 1 to 2, characterized in that: The mutual constraint relationship represents the interaction between drugs. After inputting the subgraph data of the drug molecular structure and the target user's electronic medical record into the drug recommendation model for prediction to obtain at least one recommended drug suitable for the target user, the method further includes: Use multimodal deep autoencoders to pre-train the mutual constraints between different drugs; The multimodal deep autoencoder is used to pre-train the mutual constraint relationship between different drugs, specifically including: Pre-collect drugs with at least one feature or one interaction to form a drug dataset consisting of multiple feature dimensions; Taking each feature dimension in the drug dataset as a drug feature network, training each drug feature network using a multimodal deep autoencoder channel to obtain the correlation between different drug feature networks; A random forest classifier is used to constrain the association relationship between the different drug feature networks, and output the mutual constraint relationship between different drugs.
4. A drug recommendation device based on machine learning, characterized in that: The device comprises: An acquisition unit is used to acquire the drug molecule structure and process it to obtain the subgraph data of the drug molecule, specifically characterize the structure of the drug molecule, and map the characteristics of the nodes and edges of the graph structure to the atoms and chemical bonds of the compound; and acquire the subgraph data of the drug molecule according to the atoms and chemical bonds of the compound; A construction unit is used to use the subgraph data of the drug molecule and the electronic medical records of the sample user as input to perform multi-task joint training on the network model to construct a drug recommendation model. The drug recommendation model is used to extract the subgraph representation vector of the drug molecule based on the subgraph data of the drug molecule structure, and output at least one recommended drug in combination with the drug properties mapped by the subgraph representation vector and the electronic medical records of the sample user. The sample user case data carries the disease type of the sample user and the applicable drug label. Specifically for the comparative learning task, different subgraphs in the same drug molecule structure are selected as positive samples, and subgraphs in different drug molecule structures are selected as negative samples. The graph neural network layer of the network model is used to extract features from the subgraph data of the drug molecule to obtain the subgraph representation of the drug molecule. vector, different subgraphs of the same drug molecule generate different subgraph representation vectors; maximizing the similarity between different subgraph representation vectors in the same drug molecule structure and minimizing the similarity between subgraph representation vectors in different drug molecule structures as the desired goal of the comparative learning task, optimizing the subgraph representation vector of the drug molecule, and the subgraph representation vector is used to characterize the drug properties; for the drug recommendation task, using the prediction layer of the network model to predict the drug properties according to the subgraph representation vector, and obtaining the applicable characteristics of the drug properties; combining the applicable characteristics of the drug properties with the use of drug labels, establishing a mapping relationship between the disease type of the sample user and the drug recommendation, outputting at least one recommended drug suitable for the sample user according to the mapping relationship, and constructing a drug recommendation model; A prediction unit, used for inputting the subgraph data of the drug molecular structure and the electronic medical record of the target user into the drug recommendation model for prediction, so as to obtain at least one recommended drug suitable for the target user; A generating unit, configured to filter the at least one recommended drug suitable for the target user by utilizing the mutual constraint relationship between different drugs, and generate a drug recommendation result for the target user; The evaluation unit is used to analyze the symptom data of the target user after using the drug recommendation result, and evaluate whether the drug recommendation result meets the expected effect based on the analysis result. If not, at least one recommended drug in the drug recommendation result is adjusted.
5. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 3 are implemented.
6. A computer storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 3 are implemented.
