Interactive drug molecule design method, apparatus, electronic device, and medium
By using an interactive drug molecule design system that combines molecule generation, evaluation, and dialogue management models, user-participatory and feedback-driven molecule design is achieved. This addresses the lack of user participation and multi-objective optimization in existing methods, and improves the efficiency and interpretability of molecule design.
Patent Information
- Application Number
- CN202310727557.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-19
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2043-06-19
AI Technical Summary
Existing machine learning-based molecular design methods lack user participation and feedback, multi-objective optimization capabilities, interpretability, and interactivity, resulting in low efficiency and unsatisfactory results.
An interactive drug molecule design system is adopted, which enables users to interact with the system in natural language through the collaborative training of molecular generation model, molecular evaluation model and dialogue management model, and dynamically adjusts molecular generation strategy and target attributes until a molecular structure that satisfies the user is generated.
It improves the flexibility and personalization of molecular design, enhances user participation and feedback, improves the comprehensiveness and practicality of molecular design, enhances interpretability and interactivity, and provides a user-friendly human-computer interface.
Smart Images

Figure CN116779061B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence and the field of medical health, in particular to an interactive drug molecule design method and device, electronic equipment and medium. BACKGROUND
[0002] Molecule design is an important research topic in the fields of chemistry, biology, materials, etc., which aims to design and synthesize molecular structures with specific properties and functions according to specific requirements and conditions. Traditional molecule design methods mainly rely on human experience and experimental verification, which is time-consuming, labor-intensive and inefficient.
[0003] In recent years, with the development of artificial intelligence technology, molecule design methods based on machine learning have gradually attracted attention. These methods mainly use neural networks, graph neural networks, generative adversarial networks, etc. to learn the mapping relationship between molecular structure and properties from a large amount of known molecular data, and generate new molecular structures according to the given target properties.
[0004] However, these methods also have some problems and limitations, such as lack of user participation and feedback, lack of multi-objective optimization ability, lack of interpretability and interactivity, etc. SUMMARY
[0005] In view of the above problems, the embodiments of the present application provide an interactive drug molecule design method, device, electronic equipment and medium to overcome or at least partially overcome the deficiencies of the prior art.
[0006] In a first aspect, the embodiments of the present application provide an interactive drug molecule design method, which is realized by an interactive drug molecule design system, the system comprising a molecule generation model, a molecule evaluation model and a dialogue management model connected with each other;
[0007] The method comprises:
[0008] The structure generation step: based on the molecule generation model, according to the previous round candidate molecular structure and the target molecular attribute, the current round candidate molecular structure is generated according to the pre-trained generation strategy, wherein the initial value of the candidate molecular structure is a specified molecular structure;
[0009] The performance evaluation step: based on the molecule evaluation model, the acceptability of the candidate molecular structure is evaluated to obtain an evaluation result;
[0010] The interactive adjustment step: based on the dialogue management model, the user is interacted with natural language according to the candidate molecular structure and / or the evaluation result to obtain user feedback; and the generation strategy and the target molecular attribute are adjusted according to the user feedback;
[0011] The cycle step: the structure generating step, the performance evaluating step and the interactive adjusting step are cyclically executed several times until the generated candidate molecular structure is determined as the target drug molecule according to the user feedback.
[0012] In a second aspect, the embodiments of the present application provide an interactive drug molecule design device for implementing the above-mentioned interactive drug molecule design method.
[0013] In a third aspect, the embodiments of the present application also provide an electronic device, comprising: a processor; and a memory arranged to store computer executable instructions that, when executed, cause the processor to perform the above-mentioned interactive drug molecule design method.
[0014] In a fourth aspect, the embodiments of the present application also provide a computer readable storage medium storing one or more programs, which, when executed by an electronic device comprising a plurality of applications, cause the electronic device to perform the above-mentioned interactive drug molecule design method.
[0015] The above-mentioned at least one technical solution adopted by the embodiments of the present application can achieve the following beneficial effects:
[0016] The application designs an interactive drug molecule design system, which comprises two-by-two connected molecule generation models, molecule evaluation models and dialogue management models, and the molecule generation models, the molecule evaluation models and the dialogue management models are collaboratively trained; when a drug molecule is designed, a specified molecular structure is given as an initial molecular structure and a target molecular attribute, and based on the pre-trained generation strategy of the molecule generation model, a candidate molecule is generated according to the initial molecular structure and the target molecular attribute; the generated candidate molecule can be input into the molecule evaluation model to evaluate the acceptability of the candidate molecular structure, and an evaluation result is obtained; the candidate molecular structure, the evaluation result of the matching degree between the candidate molecular structure and the target molecular attribute, and the target molecular attribute are taken as inputs of the dialogue management model, the dialogue management model can interact with the user according to the inputs to form an output language, obtain user feedback, and update the generation strategy and the target molecular attribute according to the user feedback; then the next round of molecule generation process is entered, the last round of candidate molecular structure is taken as the given molecular structure, the updated target molecular attribute is taken as the target molecular attribute of this round, and the candidate molecular structure is generated again according to the updated generation strategy; the above process is repeated until a user-satisfactory molecular structure is generated as a target drug molecule. The application can dynamically adjust and optimize the molecular structure according to the real-time demand and feedback of the user, improve the flexibility and individualization of the molecular design, greatly improve the user participation and feedback; and the acceptability can include multidimensional performance of the target attribute of the candidate molecule, such as synthesis difficulty, stability, toxicity, etc. The application considers various factors that may affect the molecular design, and balances and balances according to the user's preference, improves the comprehensiveness and practicality of the molecular design; and through natural language interaction with the user, the principle and basis in the generation process can be explained to the user, a friendly and intuitive man-machine interface is provided, the credibility and ease of use of the molecular design are improved, and the explainability and interactivity of the drug molecule design are increased. BRIEF DESCRIPTION OF DRAWINGS
[0017] The drawings described herein are used to provide further understanding of the application, form a part of the application, the illustrative embodiments of the application and the description thereof are used to explain the application, and do not constitute improper limitation of the application. In the drawings:
[0018] Figure 1 A flowchart of an interactive drug molecule design method according to an embodiment of the application is shown;
[0019] Figure 2 A structural schematic diagram of an interactive drug molecule design system according to an embodiment of the application is shown;
[0020] Figure 3A structural schematic diagram of an interactive drug molecule design system according to another embodiment of the present application is shown.
[0021] Figure 4 A schematic diagram of collaborative training of a molecule generation model 210, a molecule evaluation model 220, and a dialogue management model 230 according to one embodiment of the present application is shown.
[0022] Figure 5 A flowchart of an interactive drug molecule design method according to another embodiment of the present application is shown.
[0023] Figure 6 A structural schematic diagram of an interactive drug molecule design device according to one embodiment of the present application is shown.
[0024] Figure 7 A structural schematic diagram of an electronic device according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] To make the objectives, technical solutions, and advantages of the present application clearer, the technical solutions of the present application will be described below in conjunction with specific embodiments of the present application and corresponding drawings. Obviously, the described embodiments are only some of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0026] The technical solutions provided by the embodiments of the present application will be described in detail below with reference to the drawings.
[0027] Molecule design is an important research topic in the fields of chemistry, biology, materials, etc., and its purpose is to design and synthesize molecule structures with specific properties and functions according to specific requirements and conditions. Traditional molecule design methods mainly rely on manual experience and experimental verification, which is time-consuming, labor-intensive, and inefficient.
[0028] In recent years, with the development of artificial intelligence and intelligent medical technology, molecule design methods based on machine learning have gradually attracted attention. These methods mainly use neural networks, graph neural networks, generative adversarial networks, etc., to learn the mapping relationship between molecule structures and properties from a large amount of known molecule data, and generate new molecule structures according to given target properties. However, these methods also have some problems and limitations, such as:
[0029] (1) Lack of user participation and feedback. These methods can only generate a fixed number of candidate molecule structures according to pre-set target properties, and cannot dynamically adjust and optimize according to user real-time requirements and feedback, actual efficiency and effect are not ideal;
[0030] (2) Lack of multi-objective optimization capability. These methods usually only consider a single or limited target properties, ignoring other factors that may affect molecular design, such as synthesis difficulty, stability, toxicity, etc.;
[0031] (3) Lack of explainability and interactivity. These methods usually cannot explain the principles and basis of the generation process to the user, and cannot interact with the user in natural language, providing a friendly and intuitive human-machine interface.
[0032] In order to overcome the above problems and limitations, the present application aims to provide an interactive drug molecule design method, device, electronic equipment and medium, which can automatically design and generate molecular structures with specific properties and functions according to user needs and feedback.
[0033] Figure 1 The flowchart of the interactive drug molecule design method according to an embodiment of the present application is shown, from Figure 1 It can be seen that the present application at least includes the steps of S110-S140, which are executed in a loop until the target drug molecule is generated:
[0034] Structure generation step S110: based on the molecular generation model, according to the previous round candidate molecular structure and the target molecular property, the current round candidate molecular structure is generated according to the pre-trained generation strategy, wherein the initial value of the candidate molecular structure is a specified molecular structure.
[0035] The interactive drug molecule design method of the present application can be realized through an interactive drug molecule design system, which includes molecular generation model, molecular evaluation model and dialogue management model connected in pairs, please refer to Figure 2 , Figure 2 The structural diagram of the interactive drug molecule design system according to an embodiment of the present application is shown, from Figure 2 It can be seen that the interactive drug molecule design system 200 includes molecular generation model 210, molecular evaluation model 220 and dialogue management model 230, which are connected in pairs and can interact with each other;
[0036] The main function of the molecular generation model 210 is to generate a candidate molecular structure according to an initial molecular structure (if it is not the first round, the candidate molecular structure is used as the initial molecular structure) and the target molecular property (usually one, but also multiple).
[0037] The main role of the molecule evaluation model 220 is to estimate the acceptability of the candidate molecule structure output by the molecule generation model 210, which can be multidimensional, such as including but not limited to the similarity between the candidate molecule structure and the target molecule attribute, and rationality, toxicity, synthesis difficulty, stability, etc.
[0038] The dialogue management model 230 mainly interacts with the user in natural language according to the information output by the molecule generation model 210 and the molecule evaluation model 220, obtains the user's requirements and feedback, and dynamically adjusts the target molecule attribute and the generation strategy.
[0039] In training, the collaborative training and updating of the molecule generation model 210, the molecule evaluation model 220 and the dialogue management model 230 form the interactive drug molecule design system 200, which realizes the dialogue interactive drug molecule design and optimization.
[0040] In the design of the drug molecule, a specified molecule structure is given as an initial molecule structure (initial value of the candidate molecule structure) and a target molecule attribute, and based on the pre-trained generation strategy, the molecule generation model generates a candidate molecule according to the initial molecule structure and the target molecule attribute; the generated candidate molecule can be input into the molecule evaluation model to evaluate the acceptability of the candidate molecule structure and obtain the evaluation result; the candidate molecule structure, the evaluation result of the matching degree between the candidate molecule structure and the target molecule attribute, and the target molecule attribute are input into the dialogue management model, and the dialogue management model can form an output language to interact with the user according to these inputs, obtain user feedback, and update the generation strategy and the target molecule attribute according to the user feedback; then enter the next round of molecule generation process, take the last round of candidate molecule structure as the given molecule structure, take the updated target molecule attribute as the target molecule attribute of this round, and generate the candidate molecule structure again according to the updated generation strategy, and the above process is repeated until a user-satisfactory molecule structure is generated.
[0041] In some embodiments of the present application, the molecule generation model is constructed based on a variational autoencoder structure of a graph neural network, and is trained by maximizing the reconstruction probability and minimizing the KL divergence (relative enthalpy) of the latent space; the molecule generation model comprises a first encoder and a first decoder; the structure generation step comprises: mapping a first image containing the previous round of candidate molecule structure to a continuous latent space based on the first encoder; based on the first decoder, sampling in the latent space, reconstructing the previous round of candidate molecule structure to obtain the candidate molecule structure of this round.
[0042] In some embodiments, the molecule generation model is constructed based on a Graph Neural Network-based Variational Autoencoder (GNN-VAE) structure, please refer to Figure 3 , Figure 3 A structural schematic diagram of an interactive drug molecule design system according to another embodiment of the present application is shown, and the molecule generation model 210 is trained by maximizing the reconstruction probability and minimizing the KL divergence (relative enthalpy) of the latent space; from Figure 3 As can be seen, the molecule generation model 210 includes a first encoder 211 and a first decoder 212, the molecule generation model 210 takes an image containing a molecular structure as input, denoted as a first image here, maps the first image to a continuous latent space through the first encoder 211, and samples and reconstructs a molecular graph from the latent space through the first decoder 212, that is, a candidate molecular structure can be obtained.
[0043] In some embodiments of the present application, in the above method, the first encoder includes a first graph message passing layer and a first multi-layer perceptron; and the mapping of the first image containing the candidate molecular structure of the previous round to the continuous latent space based on the first encoder of the molecule generation model includes: based on the first graph message passing layer, performing neighborhood propagation on each atomic information and each chemical bond information in the first image to obtain a node feature vector of each atomic node; and based on the first multi-layer perceptron, converging each node feature vector into a global feature vector, and determining a mean vector and a variance vector of the latent space.
[0044] More specifically, please refer to Figure 3 In some embodiments of the present application, the first encoder 211 includes a first graph message passing layer 211-1 and a first multi-layer perceptron 211-2; and when mapping the first image containing the candidate molecular structure of the previous round to the continuous latent space: first, based on the first graph message passing layer 211-1, performing neighborhood propagation on each atomic information and each chemical bond information in the first image to obtain a node feature vector of each atomic node; and then, by the first multi-layer perceptron 211-2, converging each node feature vector into a global feature vector, and determining a mean vector and a variance vector of the latent space.
[0045] The first encoder 211 is composed of a message passing neural network (MPNN) and a multi-layer perceptron (MLP). The first message passing neural network 211-1 is used to extract the feature vector of each atom node in the molecular graph, and the first multi-layer perceptron 211-2 is used to aggregate the feature vectors of all nodes into a global feature vector, and output the mean vector and variance vector of the latent space, so as to complete the projection of the first image to the latent space.
[0046] wherein, let the molecular graph be G=(V, E), wherein V is a node set, and E is an edge set. Each node v∈V corresponds to an atom, and each edge e∈E corresponds to a chemical bond. Each node v has an initial feature vector xv (in vector form), and each edge e has an initial feature vector xe (in vector form). The calculation process of the message passing neural network is as follows:
[0047] B1: For each node v, calculate the information exchange with adjacent nodes:
[0048] hv=∑u∈N(v)Wxu+be;
[0049] wherein N(v) represents the adjacent node set of v, u is an existing node, wherein xu represents the feature vector of the existing node (xu is in vector form), and W and b are learnable parameters.
[0050] B2: For each node v, calculate the information exchange with adjacent edges:
[0051] gv=∑e∈M(v)Uxe+ce;
[0052] wherein M(v) represents the edge set connected to v, and U and c are learnable parameters.
[0053] B3: For each node v, calculate the node feature vector zv (in vector form) after neighborhood propagation:
[0054] zv=σ(hv+gv);
[0055] wherein σ is an activation function.
[0056] B4: Repeat the above steps multiple times to obtain the node feature vector of each node, and form the final node feature vector set Z={zv|v∈V}.
[0057] B5: Aggregate all node feature vectors into a global feature vector:
[0058] h=MLP(Z).
[0059] In some embodiments of the present application, the first decoder comprises a second multi-layer perception machine and a graph generation network; and the sampling in the latent space and reconstructing the candidate molecular structure of the previous round to obtain the candidate molecular structure of the current round based on the first decoder comprises: sampling a latent variable in the latent space based on the second multi-layer perception machine and mapping the latent variable to a node feature vector; constructing an initial round second image based on the graph generation network, the initial round second image comprising at least the node feature vector; and repeatedly performing the steps of generating a next round action based on a current round second image and the generation strategy, generating a next round second image based on the current round second image and the next round action, and updating the node feature vector of the current round based on the next round second image to generate the node feature vector of the next round until the generated next round action is a stop generation, thereby obtaining the candidate molecular structure.
[0060] Referring again to Figure 3 , from Figure 3 It can be seen that the first decoder 212 comprises a second multi-layer perception machine 212-1 and a graph generation network 212-2, that is, the first decoder is composed of a multi-layer perception machine and a graph generation network (GGN). The second multi-layer perception machine 212-1 is used to sample a latent variable from the latent space and map it to an initial node feature vector. The graph generation network 212-2 is used to gradually generate nodes and edges in the molecular graph and update the node feature vector.
[0061] wherein the latent variable is z ~ N(mu, sigma), the initial node feature vector is x0 = MLP(z), and the calculation process of the graph generation network is as follows:
[0062] A1: initialize an empty graph G0 = (V0, E0), wherein V0 = {x0},
[0063] A2: for the t-th step, generate a next action a t-1 from the current graph G t-1 = (V t-1 , E t ). The action a t may be one of the following three:
[0064] A21: add a new node and connect it to an existing node. For example: a t = (ADD_NODE, xv, u), indicating adding a new node v and connecting it to an existing node u with an edge.
[0065] A22: add a new edge and update the edge feature vector. For example: at = (ADD_EDGE, u, v, xe) means adding a new edge e, connecting the existing nodes u and v, and assigning an eigenvector xe to edge e.
[0066] A23: Stop generating and output the final graph. For example: a t = (STOP).
[0067] A3: Based on the current graph G t-1 and action a t Generate the next graph G t And update the node feature vectors. Specifically:
[0068] A31: If a t If the expression is (ADD_NODE, xv, u), then the new node v and the new edge e = (u, v) are added to the graph, resulting in G. t =(V t-1 ∪{v},E t-1 ∪{e}), and initialize the feature vector of node v with xv.
[0069] A32: If a t If the edge is (ADD_EDGE, u, v, xe), then add the new edge e = (u, v) to the graph to obtain G. t =(V t-1 E t-1 ∪{e}), and update the eigenvector of edge e with xe.
[0070] c) If a t = (STOP), then the final graph G will be output. t =G t-1 And then end the generation process.
[0071] A4: For each node v, according to the graph G in the current round t and node feature vector Z t ={z t v|v∈V t}, calculate its updated node feature vector, specifically:
[0072] A41: For each node v, calculate the information exchange with its neighboring nodes:
[0073] hv t =∑u∈N(v)Wz t u+be;
[0074] Where N(v) represents the set of neighboring nodes of v, u is an existing node, and W and b are learnable parameters.
[0075] A42: For each node v, compute its information exchange with adjacent edges:
[0076] gv t =∑e∈M(v)Ux t e+ce;
[0077] where M(v) denotes the set of edges connected to v, and U and c are learnable parameters.
[0078] A43: For each node v, compute its updated feature vector:
[0079] z t+1 v=σ(hv t +gv t );
[0080] where σ is an activation function.
[0081] Repeat steps A2 to A4 until the generation is finished or the preset maximum number of steps is reached, output the final candidate molecular structure, and calculate its reconstruction probability.
[0082] The molecular generation model 210 generates a candidate molecular structure and transmits the candidate molecular structure to the molecular evaluation model 220 and the dialogue management model 230 respectively.
[0083] Performance evaluation step S120: Based on the molecular evaluation model, evaluate the acceptability of the candidate molecular structure to obtain an evaluation result.
[0084] After generating the second image containing the candidate molecular structure, it is input into the molecular evaluation model 220, and the molecular evaluation model 220 evaluates its acceptability. The information contained in the acceptability can be multidimensional. In addition to the similarity between the candidate molecular structure and the target molecular attribute, it can also contain information such as the rationality, synthesis difficulty, stability, and toxicity of the candidate molecular structure. The form of acceptability is usually in the form of a score.
[0085] The molecular evaluation model 220 can calculate the acceptability of a candidate molecular structure, such as the similarity to the target molecular attribute and the rationality. The molecular evaluation model 220 adopts the structure of a Graph Neural Network-based Regressor (GNN-R), uses the second image containing the candidate molecular structure output by the molecular generation model as input, extracts molecular features through graph convolution layers and fully connected layers, and outputs a real value as an evaluation result. The molecular evaluation model 220 is trained by minimizing the mean square error.
[0086] Please refer to Figure 3 , from Figure 3It can be seen that the molecule evaluation model 220 comprises a graph convolution layer 221 and a first full connection layer 222; the performance evaluation step comprises: based on the graph convolution layer, performing neighborhood propagation on each atomic information and each chemical bond information in the second image to obtain a node feature vector of each atomic node; and converging the node feature vectors of each atomic node into a global feature vector; based on the first full connection layer, evaluating the acceptability of the candidate molecule structure according to the global feature vector to obtain an evaluation result, the evaluation result at least comprising: a matching degree similarity between the candidate molecule structure and the target molecule attribute, and rationality of the candidate molecule structure.
[0087] Let the molecule graph be G = (V, E), where V is the node set and E is the edge set. Each node v ∈ V corresponds to an atom, and each edge e ∈ E corresponds to a chemical bond. Each node v has an initial feature vector xv, and each edge e has an initial feature vector xe. The calculation process of the graph convolution layer is the same as that in the molecule generation model, that is:
[0088] C1: For each node v, calculate the information exchange with adjacent nodes:
[0089] hv=∑u∈N(v)Wxu+be;
[0090] where N(v) represents the adjacent node set of v, and u is an existing node, wherein xv represents the feature vector of the existing node (xv is in vector form), W and b are learnable parameters.
[0091] C2: For each node v, calculate the information exchange with adjacent edges:
[0092] gv=∑e∈M(v)Uxe+ce;
[0093] where M(v) represents the edge set connected to v, and U and c are learnable parameters.
[0094] C3: For each node v, calculate the updated feature vector:
[0095] zv=σ(hv+gv);
[0096] where σ is an activation function.
[0097] C4: Repeat the above steps C1-C3 multiple times to obtain the node feature vectors of all nodes, forming a set of node feature vectors Z = {zv | v ∈ V}.
[0098] C5: Converge all node feature vectors into a global feature vector:
[0099] h=MLP(Z);
[0100] C6: output the evaluation result y:
[0101] y = MLP(h).
[0102] After the molecular evaluation model 220 generates the evaluation result, the evaluation result can be transmitted to the molecular generation model 210 and the dialogue management model 230 respectively.
[0103] Interaction adjustment step S130: based on the dialogue management model, interact with the user according to the candidate molecular structure and / or the evaluation result to obtain user feedback; and adjust the generation strategy and the target molecular property according to the user feedback.
[0104] After the dialogue management model 230 obtains the candidate molecular structure and / or the evaluation result, it can interact with the user in natural language based on these information to obtain user feedback. The main role of the dialogue management model 230 is to dynamically adjust the target molecular property and the generation strategy according to the user's demand and feedback, and interact with the user in natural language.
[0105] Specifically, in some embodiments of the present application, in the above method, the dialogue management model is constructed based on the sequence-to-sequence structure of Transformer, and the dialogue management model comprises a second encoder, a second decoder and a strategy adjuster; the interaction adjustment step comprises: based on the second encoder, converting an input sequence formed by encoding the candidate molecular structure, the target molecular property, the matching degree and the user feedback into a word vector form, and mapping the input sequence to a first hidden state; based on the second decoder, generating an output sequence according to the first hidden state, so that the user makes user feedback according to the output sequence; based on the strategy adjuster, taking the dialogue management model as an agent, taking the user as an environment, taking the user feedback as a reward, taking the target molecular property and the generation strategy as actions, and taking the evaluation result as a state, to maximize the future cumulative reward, updating the policy parameters of the generation strategy by gradient ascent method.
[0106] Specifically, in some embodiments, the dialogue management model 230 adopts the sequence-to-sequence (Seq2Seq) structure based on Transformer, which can be trained by maximizing cross-entropy. The user feedback, candidate molecular structure, target molecular property and evaluation result are used as input to form an input sequence, which is mapped to a hidden state by an encoder, and an output sequence is generated from the hidden state by a decoder.
[0107] Specifically, please refer to Figure 3The dialogue management model 230 includes a second encoder 231, a second decoder 232, and a policy adjuster 233. The function of the second encoder 231 is to map the input sequence to a hidden state. Specifically, the second encoder 231 converts the input sequence formed by the candidate molecule structure, the target molecule attribute, the matching degree, and the user feedback encoding into word vector form, and maps the input sequence to a first hidden state.
[0108] Specifically, in some embodiments, the second encoder 231 includes: a first word embedding layer 231-1 and a first multi-head self-attention layer 231-2; based on the first word embedding layer 231-1, for any target word in the input sequence, the corresponding embedding matrix is searched in the constructed dictionary to obtain the word vector of the target word, and positional encoding is assigned to the word vector to obtain the input sequence in the form of word vectors; based on the first multi-head self-attention layer 231-2, for any word vector in the input sequence, the query vector, key vector, and value vector of the word vector are determined; for a query vector, the attention weight of the query vector is determined according to the dot product of the query vector and all the key vectors; and the weighted sum of the query vector and all the value vectors is determined according to the attention weight to obtain the encoded output vector of the query vector; the multiple encoded output vectors obtained are concatenated and linearly transformed to obtain the first hidden state of the input sequence.
[0109] The second encoder 231 consists of a word embedding layer (WEL) and a multi-head self-attention layer (MHSAL). The first word embedding layer 231-1 is used to convert user input, candidate molecular structure, target molecular attributes and evaluation results into word vectors, and add positional encoding (PE).
[0110] Specifically, user input, candidate molecule structures, target molecule attributes, and evaluation results form an input sequence, let the input sequence be X = {x1, x2, ..., x...} n}, where x i Let represent the i-th word. The calculation process of the first word embedding layer 231-1 is as follows:
[0111] D1: For each word x i Find a pre-trained word embedding matrix E to obtain a word vector e. i =E[x i ].
[0112] D2: For each word x i Calculate a position code p i= PE ( i ), where PE is a learnable function.
[0113] D3: For each word x i , compute its final word vector v i = e i + p i .
[0114] The main role of the first multi-head self-attention layer 231-2 is to calculate the relevance of each word in the input sequence to other words and output a hidden state. The calculation process of the first multi-head self-attention layer 231-2 is as follows:
[0115] E1: For each word vector v i , respectively compute its query vector q i , key vector k i and value vector v i , where q i = W q v i , k i = W k v i , v i = W v v i , W q , W k and W v are learnable parameters.
[0116] E2: For each query vector q i , compute its dot product with all key vectors k i , and scale and normalize to get an attention weight , where d is the dimension of the word vector.
[0117] E3: For each query vector q i , compute its weighted sum with all value vectors v i , and linearly transform to get an output vector o i = W o ∑j a ij v j , where W o is a learnable parameter.
[0118] E4: Repeat the above steps E1-E3 multiple times to get multiple different output vectors O1, O2, …, O H .
[0119] E5: Concatenate the H output vectors and linearly transform to get the final hidden state h i = W f[O1; O2;... ; O H ], wherein W f is a learnable parameter.
[0120] After the encoding is completed, an input sequence formed by the user input, the candidate molecular structure, the target molecular property, and the evaluation result is projected to a hidden state, denoted as a first hidden state.
[0121] The second decoder 232 is configured to generate an output sequence based on the first hidden state, so that the user makes user feedback according to the output sequence; in some embodiments, please refer to Figure 4 , the second decoder 232 comprises a second word embedding layer 232-1, a second multi-head self-attention layer 232-2, a multi-head cross-attention layer 232-3, and a second full connection layer 232-4; the second decoder is configured to generate an output sequence based on the first hidden state, comprising: constructing an initial output sequence, based on the second word embedding layer, for any target word in the initial output sequence, searching for a corresponding embedding matrix in the constructed dictionary to obtain a word vector of the target word, and assigning a position code to the word vector to obtain an output sequence in the form of a word vector; based on the second multi-head self-attention layer, for any word vector in the output sequence, determining the query vector, the key vector and the value vector of the word vector; for a query vector, determining the attention weight of the query vector according to the dot product of the query vector and all key vectors; and determining the weighted sum of the query vector and all value vectors according to the attention weight to obtain the decoding output vector of the query vector; the obtained plurality of decoding output vectors are spliced and linearly transformed to obtain the second hidden state of the output sequence; based on the multi-head cross-attention layer, for any word vector in the second hidden state, determining the query vector, the key vector and the value vector of the word vector; for a query vector, determining the attention weight of the query vector according to the dot product of the query vector and all key vectors; and determining the weighted sum of the query vector and all value vectors according to the attention weight to obtain the decoding output vector of the query vector; the obtained plurality of decoding output vectors are spliced and linearly transformed to obtain the third hidden state of the output sequence; based on the second full connection layer, for any word vector in the third hidden state, mapping the word vector to a probability distribution to determine the next word of the current output sequence, until the output sequence is generated.
[0122] The second decoder 232 is composed of a word embedding layer, a multi-head self-attention layer, a multi-head cross-attention layer (MHA), and a fully connected layer. The second word embedding layer 232-1 is used to convert the output sequence into word vectors and add position encodings. The second multi-head self-attention layer 232-2 is used to calculate the correlation between each word in the output sequence and other words, and output a hidden state. The multi-head cross-attention layer 232-3 is used to calculate the correlation between each word in the output sequence and each word in the input sequence, and output a hidden state. The second fully connected layer 232-4 is used to map the hidden state to a probability distribution and output the next word.
[0123] Let the output sequence be Y = {y1, y2, …, y m}, where y i represents the i-th word. Let the hidden state of the input sequence be H = {h1, h2, …, h n}. The calculation process of the second word embedding layer 232-1 is as follows:
[0124] F1: For each word y i , find a pre-trained word embedding matrix E to get a word vector e i = E[y i ].
[0125] F2: For each word y i , calculate a position encoding p i = PE(i), where PE is a learnable function.
[0126] F3: For each word y i , calculate its final word vector v i = e i + p i .
[0127] The second multi-head self-attention layer 232-2 is used to calculate the correlation between each word in the output sequence and other words, and output a hidden state. The calculation process of the second multi-head self-attention layer 232-2 is as follows:
[0128] F4: For each word vector v i , calculate its query vector q i , key vector k i , and value vector v i , respectively, where q i = W q v i , k i = W k v i , v i = Wv v i W q W k and W v These are learnable parameters.
[0129] F5: For each query vector q i Calculate its relationship with all key vectors k i The dot product is then scaled and normalized to obtain an attention weight. , where d is the dimension of the word vector.
[0130] F6: For each query vector q i Calculate its relationship with all value vectors v i The weighted sum of the values is then subjected to a linear transformation to obtain an output vector o. i =W o ∑ja ij v j W o These are learnable parameters.
[0131] F7: Repeat the above steps multiple times to obtain H different output vectors O1, O2, ..., O H .
[0132] F8: Concatenate the H output vectors and perform a linear transformation to obtain the second hidden state s. i =W f [O1; O2; ...; O H ], where W f These are learnable parameters.
[0133] The main function of the multi-head cross-attention layer 232-3 is to calculate the correlation between each word in the output sequence and each word in the input sequence, and output a hidden state. The calculation process of the multi-head cross-attention layer 232-3 is as follows:
[0134] F9: For each word vector s i Calculate its query vector q respectively i Key vector k i Sum vector v i , where q i =W q s i k i =W k h i v i =W v h i W q W k and W v These are learnable parameters.
[0135] F10: For each query vector q i Calculate its relationship with all key vectors k i The dot product is then scaled and normalized to obtain an attention weight. , where d is the dimension of the word vector.
[0136] F11: For each query vector q i Calculate its relationship with all value vectors v i The weighted sum of the values is then subjected to a linear transformation to obtain an output vector o. i =W o ∑jb ij v j W o These are learnable parameters.
[0137] F12: Repeat the above steps H times to obtain H different output vectors O1, O2, ..., O H .
[0138] F13: Concatenate the H output vectors and perform a linear transformation to obtain the third hidden state t. i =W f [O1; O2; ...; O H ], where W f These are learnable parameters.
[0139] The main function of the second fully connected layer 232-4 is to map the hidden state to a probability distribution and output the next word. The calculation process of the second fully connected layer 232-4 is as follows:
[0140] F14: For each hidden state t i It is mapped to a probability distribution p through a fully connected layer. i =softmax(W p t i +b), where W p b are learnable parameters.
[0141] F15: Based on the probability distribution p i Sampling or greedily selecting the next word y i+1 And add it to the output sequence.
[0142] F16: Repeat the above steps until an end symbol is generated or the preset maximum length is reached; output the final output sequence Y.
[0143] After the output sequence Y is generated, the dialogue management model 230 can conduct natural language interaction with the user, i.e., dialogue, according to the output sequence Y. During the interaction with the user, feedback of the user can be obtained, such as hoping to increase the target molecule attribute a little, hoping to reduce the toxicity a little, etc.
[0144] Finally, based on the policy adjuster 233, the dialogue management model is taken as an agent, the user is taken as an environment, the user feedback is taken as a reward, the target molecule attribute and the generation policy are taken as actions, and the evaluation result is taken as a state, so as to maximize future cumulative rewards, and the policy parameters of the generation policy are updated by a gradient ascent method.
[0145] After the user feedback is obtained, the target molecule attribute and the generation policy can be adjusted according to the user feedback, and the adjusted target molecule attribute and generation policy are used for generation of candidate molecules in the next round.
[0146] The adjustment of the target molecule attribute can be directly adjusted according to the user feedback, such as initially setting the target molecule attribute as: the anti-cancer activity index is 0.75, if the user feedback is “hoping to increase the anti-cancer activity index a little more”, the anti-cancer activity index can be adjusted to 0.80 or 0.85, etc., as the target molecule attribute in the next round.
[0147] The adjustment process of the generation policy is consistent with the training process. The following takes the training process as an example to describe the adjustment of the generation policy:
[0148] During the training of the interactive drug molecule design system, the collaborative training and updating of the molecule generation model 210, the molecule evaluation model 220 and the dialogue management model 230 are implemented. Specifically, in some embodiments, a deep reinforcement learning (DRL) method based on policy gradient is used, the dialogue management model is taken as an agent, the user is taken as an environment, the user evaluation and suggestion are taken as a reward, the target molecule attribute and the generation policy are taken as actions, and the candidate molecule structure and the evaluation result are taken as a state, so as to optimize the policy of the agent by continuously interacting with the user. For details, please refer to Figure 4 , Figure 1 A schematic diagram of the collaborative training of the molecule generation model 210, the molecule evaluation model 220 and the dialogue management model 230 of one embodiment of the present application is shown.
[0149] Suppose the agent is in state s t at the t-th step, and performs action a t . The environment adjusts the state s t according to the state s tThe next state s is generated t+1 and a reward r is given t . The agent chooses the next action a t+1 based on the state s t+1 . This forms a Markov Decision Process (MDP).
[0150] The goal of the agent is to maximize the future cumulative reward, i.e.,
[0151] J(θ) = E[∑t=0∞γtrt];
[0152] where θ is the generated policy parameter of the agent, γ is the discount factor, and E is the expectation.
[0153] The generated policy of the agent can be represented by a neural network πθ(a t | s t ), which is the probability of performing action a t given state s t . The agent can update the policy parameter by gradient ascent, i.e.,
[0154]
[0155] where α is the learning rate, is the policy gradient, i.e.,
[0156]
[0157] where Q t is the state-action value function, which is the expected future cumulative reward given state s t and action a t , i.e.,
[0158] Q t = E[∑k=t∞γk-r t ].
[0159] However, since the environment is unknown, the agent cannot directly compute the state-action value function. Therefore, in some embodiments, the agent can sample trajectories by interacting with the environment and estimate the state-action value function using the rewards in the trajectories.
[0160] Specifically, in some embodiments of the present application, the updating of the strategy parameter of the generated strategy by the gradient ascent method comprises: cyclically performing the steps of generating and executing a current round action according to a current round state and a current round generated strategy; generating a next round state and giving a current round reward according to the current round state and the current round action, until the end of the action prediction trajectory is obtained; estimating an action state value function according to the reward in the action prediction trajectory, as an estimated future cumulative reward; estimating a strategy gradient according to the state, action and estimated future cumulative reward in the action prediction trajectory; and updating the strategy parameter of the generated strategy according to the strategy gradient.
[0161] The specific calculation process of updating the generated strategy by the action prediction trajectory is as follows:
[0162] P1: the agent starts from an initial state s0, selects an action a0 according to the current strategy πθ, and executes the action.
[0163] P2: the environment generates a next state s1 according to the state s0 and the action a0, and gives a reward r0.
[0164] P3: the agent selects a next action a1 according to the state s1, and executes the action.
[0165] P4: the environment generates a next state s2 according to the state s1 and the action a1, and gives a reward r1.
[0166] P5: repeat the above steps P1-P4 until the termination state is reached or the preset maximum number of steps is reached, output a trajectory τ = {(s0, a0, r0), (s1, a1, r1), …, (s T , a T , r T )}.
[0167] P6: the agent can estimate the state-action value function with the rewards in the trajectory, that is:
[0168] Q t ≈G t =∑k=tTγk-rt;
[0169] P7: the agent can estimate the strategy gradient with the state, action and reward in the trajectory, that is:
[0170]
[0171] P8: the agent can update the strategy parameter with the estimated strategy gradient, that is:
[0172]
[0173] P9: The agent can repeat the above steps until the policy converges or the preset maximum number of iterations is reached.
[0174] Cyclic step S140: The structure generation step, the performance evaluation step, and the interactive adjustment step are executed repeatedly until the generated candidate molecular structure is determined to be the target drug molecule based on the user feedback.
[0175] The above steps are repeated, inputting the candidate molecular structure generated in the previous round into the molecular generation model for the current round, and then executing the structure generation step S110, performance evaluation step S120, and interactive adjustment step S130 again to generate the candidate molecular structure for this round. The candidate molecular structure is then interacted with by the user. If the user does not approve of the candidate molecular structure, the next round begins; if the user approves of the candidate molecular structure, the candidate molecular structure for this round is used as the target drug molecule.
[0176] The following is a brief description of the application of this application through a specific example:
[0177] Suppose a user wants to design a molecule with anticancer activity. They can use aspirin as a reference for the initial molecular structure and the Anticancer Activity Index (AAI) as a target molecule attribute. Then, the interactive molecular optimization method can proceed as follows:
[0178] (1) Using a molecular generation model, a candidate molecular structure is generated based on the molecular structure and anticancer activity index of aspirin as target attributes, and this structure is used as the input of the dialogue management model.
[0179] (2) Through a dialogue management model, the target attributes and generation strategy are dynamically adjusted based on user needs and feedback. Natural language interaction is then used to present candidate molecular structures to users and obtain their evaluations and suggestions. For example:
[0180] System: Hello, welcome to our interactive molecular optimization design system. What kind of molecule would you like to design?
[0181] User: I want to design a molecule with anti-cancer activity.
[0182] System: Okay, do you have any initial molecular structures and target properties for reference?
[0183] User: I can use aspirin as the initial molecular structure and the anticancer activity index as the target attribute.
[0184] System: OK, I have generated a candidate molecule structure based on your input. Please see the image on the screen. The anticancer activity index of this molecule structure is 0.75. What do you think?
[0185] User: The molecule structure looks good, but I hope the anticancer activity index can be higher.
[0186] System: OK, I understand. Do you have any specific suggestions or requirements?
[0187] User: I hope the molecule structure can add a hydroxyl group (-OH) or an amino group (-NH2). System: OK, I will try to modify it according to your suggestion.
[0188] (3) Through the molecular evaluation model, calculate the similarity and rationality of the candidate molecule structure with the target attribute based on the candidate molecule structure, and use it as the input of the dialogue management model, so that the dialogue management model displays the similarity and rationality of the candidate molecule structure with the target attribute to the user. (It should be noted that this step can also be placed before step (2))
[0189] (4) Repeat steps (1) to (3) until the user is satisfied or reaches the preset termination condition; for example:
[0190] System: I have modified the candidate molecule structure according to your suggestion. Please see the image on the screen. The molecule structure has added a hydroxyl group, and the anticancer activity index has increased to 0.85. What do you think?
[0191] User: The molecule structure is good, and I am satisfied.
[0192] System: I am glad you like this molecule structure. So, we have completed the dialogue interactive molecule optimization process. You can save this molecule structure and view the relevant dialogue record and evaluation results.
[0193] (5) Output the final optimized molecule structure and save the relevant dialogue record and evaluation results.
[0194] In some embodiments, preferably, the interaction function part of the dialogue management model 223 in this application can be replaced or enhanced by chatgpt or chatgpt-like models, so as to improve the naturalness and fluency of the dialogue. Chatgpt is a Transformer-based language model that can generate human-like text responses and can answer follow-up questions, admit mistakes, challenge the premise of errors, and refuse inappropriate requests. By using chatgpt, the dialogue management model can better understand and meet the needs and feedback of users, improve user satisfaction and trust.
[0195] The method shown in Figure 5 It can be seen from the method that the application designs an interactive drug molecule design system, which includes a molecule generation model, a molecule evaluation model and a dialogue management model connected with each other, and the molecule generation model, the molecule evaluation model and the dialogue management model are collaboratively trained; when designing a drug molecule, a specified molecular structure is given as an initial molecular structure and a target molecular attribute, and based on the pre-trained generation strategy, the molecule generation model generates a candidate molecule according to the initial molecular structure and the target molecular attribute; the generated candidate molecule can be input into the molecule evaluation model to evaluate the acceptability of the candidate molecular structure, and obtain an evaluation result; the candidate molecular structure, the evaluation result of the matching degree between the candidate molecular structure and the target molecular attribute, and the target molecular attribute are input into the dialogue management model, and the dialogue management model can interact with the user according to the output language, obtain user feedback, and update the generation strategy and the target molecular attribute according to the user feedback; then the next round of molecule generation process is entered, the last round of candidate molecular structure is given as the molecular structure, the updated target molecular attribute is given as the target molecular attribute of this round, and the candidate molecular structure is generated again according to the updated generation strategy; the above process is repeated until a user-satisfactory molecular structure is generated as a target drug molecule. The application can dynamically adjust and optimize the molecular structure according to the real-time demand and feedback of the user, improve the flexibility and individualization of the molecular design, greatly improve the user participation and feedback; and the acceptability can include multidimensional performance of the target attribute of the candidate molecule, such as synthesis difficulty, stability, toxicity, etc. The application considers various factors that may affect the molecular design, and balances and balances according to the user's preference, improving the comprehensiveness and practicality of the molecular design; and through natural language interaction with the user, the principle and basis in the generation process can be explained to the user, a friendly and intuitive man-machine interface is provided, the credibility and ease of use of the molecular design are improved, and the explainability and interactivity of the drug molecule design are increased.
[0196] Figure 5 The flowchart of the interactive drug molecule design method according to another embodiment of the application is shown, from Figure 3 It can be seen that the embodiment adopts Figure 6 The interactive drug molecule design system shown in the embodiment is implemented, and the embodiment includes:
[0197] The first image containing the specified molecular structure and the target molecular attribute are input to the first graph message passing layer of the molecule generation model, based on the first graph message passing layer, the neighborhood propagation is performed on the atomic information and the chemical bond information in the first image, the node feature vector of each atomic node is obtained, and then the first multi-layer perception machine of the molecule generation model is entered.
[0198] Based on the first multi-layer perception machine, the node feature vectors are aggregated into a global feature vector, and a mean vector and a variance vector of the latent space are determined, and then a second multi-layer perception machine is entered.
[0199] Based on the second multi-layer perception machine, a latent variable is sampled in the latent space, and the latent variable is mapped to a node feature vector, and then a graph generation network is entered.
[0200] The graph generation network is entered to generate a second image of the current round containing a candidate molecular structure.
[0201] The second image is input into a molecular evaluation model and a dialogue management model respectively.
[0202] After the second image enters the graph convolution layer of the molecular evaluation model, based on the graph convolution layer, the neighborhood propagation of each atomic information and each chemical bond information in the second image is performed to obtain the node feature vector of each atomic node; and the node feature vectors of each atomic node are aggregated into a global feature vector, and then a first fully connected layer of the molecular evaluation model is entered.
[0203] Based on the first fully connected layer, the acceptability of the candidate molecular structure is evaluated according to the global feature vector to obtain an evaluation result.
[0204] The evaluation result is also input into the dialogue management model as an input of the dialogue management model, and a first word embedding layer of the dialogue management model is entered.
[0205] Based on the first word embedding layer, the input sequence formed by the second image, the target molecular attribute and the evaluation result is converted into a word vector form, and then a first multi-head self-attention layer is entered.
[0206] Based on the first multi-head self-attention layer, the input sequence is projected into a first hidden state, and then a second multi-head self-attention layer is entered.
[0207] Based on the second multi-head self-attention layer, a second hidden state of the output sequence is encoded, and then a multi-head cross-attention layer is entered.
[0208] Based on the multi-head cross-attention layer, the second hidden state is projected into a third hidden state of the output sequence, and then a second fully connected layer is entered.
[0209] Based on the second fully connected layer, for any word vector in the third hidden state, the word vector is mapped to a probability distribution to determine the next word of the current output sequence until the output sequence is generated.
[0210] Based on the output sequence, the user is interacted to obtain user feedback.
[0211] The second image, the target molecule attribute, the evaluation result, and the user feedback are taken as inputs of the strategy adjustment layer, the target molecule attribute and the generation strategy are adjusted, and then the next round of candidate molecule generation is entered.
[0212] The above steps are repeated multiple times until the user requirement is reached.
[0213] Figure 7 An interactive drug molecule design device according to an embodiment of the present application is shown, which includes:
[0214] The structure generation unit 610 generates a candidate molecule structure of the current round according to a pre-trained generation strategy based on a molecule generation model and the candidate molecule structure of the previous round and the target molecule attribute, wherein the initial value of the candidate molecule structure is a specified molecule structure.
[0215] The performance evaluation unit 620 evaluates the acceptability of the candidate molecule structure based on a molecule evaluation model to obtain an evaluation result.
[0216] The interactive adjustment unit 630 performs natural language interaction with the user based on a dialogue management model according to the candidate molecule structure and / or the evaluation result to obtain user feedback, and adjusts the generation strategy and the target molecule attribute according to the user feedback.
[0217] The loop control unit 640 repeatedly executes the structure generation step, the performance evaluation step, and the interactive adjustment step several times until the generated candidate molecule structure is determined to be a target drug molecule according to the user feedback.
[0218] In some embodiments of the present application, in the above interactive drug molecule design device, the molecule generation model is constructed based on a variational autoencoder structure of a graph neural network and obtained by maximizing the reconstruction probability and minimizing the relative enthalpy of the latent space; the molecule generation model includes a first encoder and a first decoder; the structure generation unit 610 is configured to map a first image containing the candidate molecule structure of the previous round to a continuous latent space based on the first encoder; and the candidate molecule structure of the current round is reconstructed based on the first decoder and sampling in the latent space to obtain the candidate molecule structure of the current round.
[0219] In some embodiments of the present application, in the above-mentioned interactive drug molecule design device, the first encoder comprises: a first graph message passing layer and a first multi-layer perception machine; and a structure generation unit 610 is configured to perform neighborhood propagation on each atomic information and each chemical bond information in the first image based on the first graph message passing layer to obtain a node feature vector of each atomic node; and aggregate each node feature vector into a global feature vector based on the first multi-layer perception machine, and determine a mean vector and a variance vector of the latent space.
[0220] In some embodiments of the present application, in the above-mentioned interactive drug molecule design device, the first decoder comprises: a second multi-layer perception machine and a graph generation network; and a structure generation unit 610 is configured to sample a latent variable in the latent space based on the second multi-layer perception machine, and map the latent variable to a node feature vector; construct an initial round second image based on the graph generation network, the initial round second image comprising at least each node feature vector; and perform the steps of generating a next round action based on a current round second image and the generation strategy, generating a next round second image based on the current round second image and the next round action, and updating each node feature vector in the current round based on the next round second image, to generate each node feature vector in the next round, until the generated next round action is a stop generation, to obtain the candidate molecule structure.
[0221] In some embodiments of the present application, in the above-mentioned interactive drug molecule design device, the molecule evaluation model is constructed based on a graph neural network regressor structure, and the molecule evaluation model comprises a graph convolution layer and a first full connection layer; and a performance evaluation unit 620 is configured to perform neighborhood propagation on each atomic information and each chemical bond information in the second image based on the graph convolution layer to obtain a node feature vector of each atomic node; aggregate the node feature vector of each atomic node into a global feature vector; and evaluate the acceptability of the candidate molecule structure based on the global feature vector according to the first full connection layer to obtain an evaluation result, the evaluation result comprising at least: a matching degree similarity between the candidate molecule structure and the target molecular property, and a rationality of the candidate molecule structure.
[0222] In some embodiments of the present application, in the interactive drug molecule design device described above, the dialogue management model is constructed based on a Transformer sequence-to-sequence structure, and includes a second encoder, a second decoder, and a policy adjuster; an interaction adjustment unit 630 is configured to convert an input sequence formed by encoding the candidate molecular structure, the target molecular attribute, the matching degree, and the user feedback into a word vector form based on the second encoder, and map the input sequence to a first hidden state; generate an output sequence based on the second decoder according to the first hidden state, so that the user makes user feedback according to the output sequence; based on the policy adjuster, the dialogue management model is used as an agent, the user is used as an environment, the user feedback is used as a reward, the target molecular attribute and the generated policy are used as actions, and the evaluation result is used as a state, so as to maximize the future cumulative reward, and update the policy parameters of the generated policy by gradient ascent method.
[0223] In some embodiments of the present application, in the interactive drug molecule design device described above, the second encoder includes a first word embedding layer and a first multi-head self-attention layer; the interaction adjustment unit 630 is configured to, based on the first word embedding layer, for any target word in the input sequence, find the corresponding embedding matrix in the constructed dictionary to obtain the word vector of the target word, and assign a position encoding to the word vector to obtain the input sequence in the form of a word vector; based on the first multi-head self-attention layer, for any word vector in the input sequence, determine the query vector, the key vector and the value vector of the word vector; for a query vector, determine the attention weight of the query vector according to the dot product of the query vector and all key vectors; and determine the weighted sum of the query vector and all value vectors according to the attention weight to obtain the encoding output vector of the query vector; the obtained multiple encoding output vectors are spliced and linearly transformed to obtain the first hidden state of the input sequence.
[0224] In some embodiments of the present application, in the above-mentioned interactive drug molecule design device, the second decoder comprises: a second word embedding layer, a second multi-head self-attention layer, a multi-head cross-attention layer, and a second fully connected layer; and the interaction adjustment unit 630 is configured to: construct an initial output sequence, for any target word in the initial output sequence, find a corresponding embedding matrix in the constructed dictionary based on the second word embedding layer, obtain a word vector of the target word, and assign a position encoding to the word vector to obtain an output sequence in the form of a word vector; for any word vector in the output sequence, determine a query vector, a key vector, and a value vector of the word vector based on the second multi-head self-attention layer; for one of the query vectors, determine an attention weight of the query vector according to the dot product of the query vector and all the key vectors; and determine a weighted sum of the query vector and all the value vectors according to the attention weight to obtain a decoding output vector of the query vector; splice the obtained multiple decoding output vectors and perform linear transformation to obtain a second hidden state of the output sequence; for any word vector in the second hidden state, determine a query vector, a key vector, and a value vector of the word vector based on the multi-head cross-attention layer; for one of the query vectors, determine an attention weight of the query vector according to the dot product of the query vector and all the key vectors; and determine a weighted sum of the query vector and all the value vectors according to the attention weight to obtain a decoding output vector of the query vector; splice the obtained multiple decoding output vectors and perform linear transformation to obtain a third hidden state of the output sequence; and for any word vector in the third hidden state, map the word vector to a probability distribution based on the second fully connected layer to determine the next word of the current output sequence, until the output sequence is generated.
[0225] In some embodiments of the present application, in the above-mentioned interactive drug molecule design device, the interaction adjustment unit 630 is configured to: cyclically perform the steps of generating and executing a current round action according to a current round state and a current round generation policy; generating a next round state and giving a current round reward according to the current round state and the current round action, until the end of the game is generated, to obtain an action prediction trajectory; estimating an action state value function based on the rewards in the action prediction trajectory as an estimated future cumulative reward; estimating a policy gradient based on the states, actions, and estimated future cumulative rewards in the action prediction trajectory; and updating policy parameters of the generation policy based on the policy gradient.
[0226] It should be noted that the above-mentioned interactive drug molecule design device can implement the above-mentioned interactive drug molecule design method, which will not be described here.
[0227] Figure 7is a structural schematic diagram of an electronic device according to an embodiment of the present application. Please refer to Figure 7 At the hardware level, the electronic device comprises a processor, and optionally further comprises an internal bus, a network interface, and a memory. The memory can include a memory such as a random-access memory (RAM), and can further include a non-volatile memory such as at least one disk memory. Of course, the electronic device can further include other hardware required by a business.
[0228] The processor, the network interface, and the memory can be connected to each other through the internal bus, which can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 In the figure, only one bidirectional arrow is used to represent the internal bus, but it does not mean that there is only one bus or only one type of bus.
[0229] The memory is used to store a program. Specifically, the program can include program code including computer operation instructions. The memory can include a memory and a non-volatile memory, and provide instructions and data to the processor.
[0230] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs, and forms an interactive drug molecule design device at the logical level. The processor executes the program stored in the memory, and is specifically used to execute the above method.
[0231] The above as described in the present application Figure 6The method performed by the interactive drug molecule design apparatus disclosed in the embodiments shown can be applied in a processor or implemented by the processor. The processor can be an integrated circuit chip having a processing capability of signals. In the implementation, each step of the method can be completed by integrated logic circuits of hardware in the processor or instructions in the form of software. The processor can be a general processor including a central processing unit (CPU), a network processor (NP), etc.; or a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step and logic block disclosed in the embodiments of the present application can be implemented or executed. The general processor can be a microprocessor or any conventional processor. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module can be located in a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register or other mature storage medium in the art. The storage medium is located in a memory, and the processor reads information in the memory and combines the hardware to complete the steps of the method.
[0232] The electronic device can also perform the method performed by the interactive drug molecule design apparatus in the middle Figure 6 The electronic device can also perform the method performed by the interactive drug molecule design apparatus in the middle Figure 6 The functions of the interactive drug molecule design apparatus in the embodiments shown are implemented, and the embodiments of the present application will not be repeated here.
[0233] The embodiments of the present application also propose a computer readable storage medium storing one or more programs, the one or more programs including instructions capable of causing an electronic device including a plurality of application programs to perform the method performed by the interactive drug molecule design apparatus in the embodiments shown and specifically for performing the foregoing method when the instructions are executed by the electronic device. Figure 1 The embodiments of the present application also propose a computer readable storage medium storing one or more programs, the one or more programs including instructions capable of causing an electronic device including a plurality of application programs to perform the method performed by the interactive drug molecule design apparatus in the embodiments shown and specifically for performing the foregoing method when the instructions are executed by the electronic device.
[0234] Those skilled in the art will appreciate that embodiments of the application can be readily used as software, hardware, or a combination of software and hardware. In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0235] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0236] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 means for functionally implementing the steps listed in the flowchart block or blocks.
[0237] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks means for functionally implementing the steps listed in the flowchart block or blocks.
[0238] In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
[0239] The memory can include non-persistent memory and / or persistent memory, such as flash memory, readonly memory (ROM), or similar storage elements, in a computer-readable medium. Memory is an example of computer-readable media.
[0240] Computer-readable media includes permanent and non-permanent, movable and non-movable media that can be implemented by any method or technology to store information. The information can be computer-readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information accessible to a computing device. According to the definition herein, computer-readable media does not include transitory media such as modulated data signals and carriers.
[0241] It should also be noted that the terms "comprising", "containing", or any other variant thereof are intended to cover non-exclusive inclusions, so that a process, method, article or apparatus that includes a list of elements does not only include those elements, but also includes other elements not explicitly listed, or other elements inherent to such a process, method, article or apparatus. Without more limitations, the element defined by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article or apparatus that includes the element.
[0242] Those skilled in the art will appreciate that embodiments of the present application can be provided as a method, a system or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0243] The above only describes the embodiments of the present application and is not intended to limit the present application. Those skilled in the art can make various modifications and changes to the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application shall be included in the scope of the claims of the present application.
Claims
1. An interactive drug molecule design method, characterized in that, The method is implemented through an interactive drug molecule design system, which includes a pairwise connected molecule generation model, a molecule evaluation model, and a dialogue management model. The method includes: Structure generation steps: Based on the molecular generation model, according to the candidate molecular structures of the previous round and the properties of the target molecule, the candidate molecular structures of the current round are generated according to the pre-trained generation strategy, wherein the initial value of the candidate molecular structure is the specified molecular structure; Performance evaluation steps: Based on the molecular evaluation model, assess the acceptability of the candidate molecular structures in this round and obtain the evaluation results; Interactive adjustment steps: Based on the dialogue management model, engage in natural language interaction with the user according to the candidate molecular structure of this round and / or the evaluation results to obtain user feedback; and adjust the generation strategy and the target molecular attributes according to the user feedback; The cyclical step involves repeatedly executing the structure generation step, the performance evaluation step, and the interactive adjustment step several times until the generated candidate molecular structure is determined to be the target drug molecule based on the user feedback. The dialogue management model is constructed based on the sequence-to-sequence structure of Transformer, and includes a second encoder, a second decoder, and a policy adjuster. The interactive adjustment steps include: Based on the second encoder, the input sequence formed by the candidate molecular structure of the current round, the target molecular attribute, the matching degree between the candidate molecular structure of the current round and the target molecular attribute, and the user feedback encoding is transformed into word vector form, and the input sequence is mapped to the first hidden state; Based on the second decoder, an output sequence is generated according to the first hidden state so that the user can make user feedback based on the output sequence; Based on the policy adjuster, the dialogue management model is used as the agent, the user as the environment, the user feedback as the reward, the target molecular attributes and the generation policy as actions, and the evaluation result as the state. With the goal of maximizing future cumulative rewards, the policy parameters of the generation policy are updated using the gradient ascent method.
2. The interactive drug molecule design method according to claim 1, characterized in that, The molecular generation model is constructed based on a variational autoencoder structure of a graph neural network and is trained by maximizing the reconstruction probability and minimizing the relative enthalpy of the latent space. The molecular generation model includes: a first encoder and a first decoder; The structure generation steps include: Based on the first encoder, the first image containing the candidate molecular structures from the previous round is mapped to a continuous latent space; Based on the first decoder, the previous round of candidate molecular structures are sampled in the potential space and reconstructed to obtain the current round of candidate molecular structures.
3. The interactive drug molecule design method according to claim 2, characterized in that, The first encoder includes: a first graph message passing layer and a first multilayer perceptron; The step of mapping the first image containing the candidate molecular structures from the previous round to a continuous latent space based on the first encoder includes: Based on the message passing layer of the first image, neighborhood propagation is performed on the atomic information and chemical bond information in the first image to obtain the node feature vector of each atomic node. Based on the first multilayer perceptron, the feature vectors of each node are aggregated into a global feature vector, and the mean vector and variance vector of the latent space are determined.
4. The interactive drug molecule design method according to claim 3, characterized in that, The first decoder includes: a second multilayer perceptron and a graph generation network; The step of sampling in the latent space based on the first decoder and reconstructing the candidate molecular structures from the previous round to obtain the candidate molecular structures for the current round includes: Based on the second multilayer perceptron, latent variables are sampled in the latent space and mapped to node feature vectors; Based on the graph generation network, an initial round second image is constructed, which includes at least the feature vectors of each node; and the following steps are executed iteratively: generating the next round action based on the current round second image and the generation strategy, generating the next round second image based on the current round second image and the next round action, and updating the feature vectors of each node in the current round based on the next round second image to generate the feature vectors of each node in the next round, until the generated next round action is stopped, thus obtaining the candidate molecular structure for this round.
5. The interactive drug molecule design method according to claim 4, characterized in that, The molecular evaluation model is constructed based on a graph neural network regressor structure, and the molecular evaluation model includes a graph convolutional layer and a first fully connected layer; The performance evaluation steps include: Based on the graph convolutional layer, neighborhood propagation is performed on the atomic information and chemical bond information in the second image of the candidate molecular structure in this round to obtain the node feature vector of each atomic node; and the node feature vectors of each atomic node are aggregated into a global feature vector. Based on the first fully connected layer, the acceptability of the candidate molecular structure in this round is evaluated according to the global feature vector to obtain the evaluation result. The evaluation result includes at least: the similarity of the matching degree between the candidate molecular structure in this round and the target molecule attribute, and the rationality of the candidate molecular structure in this round.
6. The interactive drug molecule design method according to claim 1, characterized in that, The second encoder includes: a first word embedding layer and a first multi-head self-attention layer; The step of converting the input sequence formed by the current round candidate molecular structure, the target molecular attribute, the matching degree between the current round candidate molecular structure and the target molecular attribute, and the user feedback encoding into word vector form based on the second encoder, and mapping the input sequence to the first hidden state, includes: Based on the first word embedding layer, for any target word in the input sequence, the corresponding embedding matrix is searched in the constructed dictionary to obtain the word vector of the target word, and position encoding is assigned to the word vector to obtain the input sequence in the form of word vector; Based on the first multi-head self-attention layer, for any word vector in the input sequence, the query vector, key vector, and value vector of the word vector are determined; for a query vector, the attention weight of the query vector is determined according to the dot product of the query vector and all the key vectors; and the weighted sum of the query vector and all the value vectors is determined according to the attention weight to obtain the encoded output vector of the query vector; the multiple encoded output vectors obtained are concatenated and linearly transformed to obtain the first hidden state of the input sequence.
7. The interactive drug molecule design method according to claim 1, characterized in that, The second decoder includes: a second word embedding layer, a second multi-head self-attention layer, a multi-head cross-attention layer, and a second fully connected layer; The step of generating an output sequence based on the second decoder and the first hidden state includes: An initial output sequence is constructed. Based on the second word embedding layer, for any target word in the initial output sequence, the corresponding embedding matrix is searched in the constructed dictionary to obtain the word vector of the target word. Position encoding is assigned to the word vector to obtain the output sequence in the form of word vector. Based on the second multi-head self-attention layer, for any word vector in the output sequence, the query vector, key vector, and value vector of the word vector are determined; for a query vector, the attention weight of the query vector is determined according to the dot product of the query vector and all the key vectors; and the weighted sum of the query vector and all the value vectors is determined according to the attention weight to obtain the decoded output vector of the query vector; the multiple decoded output vectors obtained are concatenated and linearly transformed to obtain the second hidden state of the output sequence; Based on the multi-head cross-attention layer, for any word vector in the second hidden state, the query vector, key vector, and value vector of the word vector are determined; for a query vector, the attention weight of the query vector is determined according to the dot product of the query vector and all the key vectors; and the weighted sum of the query vector and all the value vectors is determined according to the attention weight to obtain the decoded output vector of the query vector; the multiple decoded output vectors obtained are concatenated and linearly transformed to obtain the third hidden state of the output sequence; Based on the second fully connected layer, for any word vector in the third hidden state, the word vector is mapped to a probability distribution to determine the next word in the current output sequence, until the output sequence is generated.
8. The interactive drug molecule design method according to claim 1, characterized in that, The step of updating the policy parameters of the generated policy using the gradient ascent method includes: The process involves repeatedly generating and executing the action for the current round based on the current round state and the current round generation strategy; generating the next round state and providing the current round reward based on the current round state and the current round action; and continuing until the generation process is considered complete, thus obtaining the predicted action trajectory. The action state value function is estimated based on the reward in the action prediction trajectory, and used as the estimated future cumulative reward. The policy gradient is estimated based on the state, action, and estimated future cumulative reward in the predicted trajectory. The policy parameters of the generated policy are updated according to the policy gradient.
9. An interactive drug molecule design device, characterized in that, The apparatus is used to implement the interactive drug molecule design method according to any one of claims 1 to 8.
10. An electronic device, comprising: processor; as well as A memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the interactive drug molecule design method according to any one of claims 1 to 8.
11. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of applications, cause the electronic device to perform the interactive drug molecule design method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Selection of genotyped transfusion donors by cross-matching to genotyped recipients
CN101601039A
Molecular graph generation method based on variational auto-encoder and message passing neural network
CN113327651A