Knowledge-guided molecular property relation graph enhanced small sample molecular property prediction method and device
By constructing a knowledge-guided molecular property relationship diagram and auxiliary task sampler, the problem of failure to effectively capture the local similarity and property correlation of molecules in the prior art is solved, and more efficient and accurate molecular property prediction is achieved.
Patent Information
- Application Number
- CN202411926429.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-05-02
- Estimated Expiration
- 2044-12-25
AI Technical Summary
Existing small sample molecular properties prediction methods fail to effectively capture the correlation between local similarities between molecules and the existence of multiple properties of the same molecule, resulting in insufficient information utilization and reduced prediction accuracy.
By constructing a knowledge-guided molecular properties relationship diagram, the similarity between the molecular skeleton and functional groups is calculated, combined with an auxiliary task sampler, the known properties are used to assist in predicting new properties, reducing information redundancy, and improving model performance.
It significantly improves the accuracy and efficiency of the molecular property prediction model, can more accurately capture the differences between molecules and the relationship between properties, and improves information utilization and prediction accuracy.
Smart Images

Figure CN119920353A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a small sample molecular property prediction method and device based on knowledge-guided molecular property relationship graph enhancement, belonging to the field of molecular property prediction and graph neural network. Background Art
[0002] Molecular property prediction is an important task in drug development, aiming to predict the physicochemical properties and biological activity of molecules. Traditional molecular property prediction methods are costly, time-consuming, and have certain risks when conducting wet experiments. In recent years, machine learning has made breakthrough progress, especially deep learning methods have shown great application potential, such as modeling molecules as text or graph structures, using language models or graph neural networks to explore their complex molecular properties. However, these methods are often limited by data dependence and scarcity of labeled data in practical applications, resulting in challenges in molecular property prediction. In essence, this is a small sample learning problem, and more efficient algorithms need to be developed to overcome the problem of insufficient data.
[0003] In recent years, researchers have explored this issue from both data and model perspectives, and proposed a series of small sample molecular property prediction models. Based on the model perspective, researchers optimize small sample molecular property algorithms by designing new neural network architectures, training frameworks, or parameter update mechanisms. Similarly, based on the data perspective, researchers have developed a series of methods by mining the many-to-many relationships between molecules and properties. These relationships include molecule-molecule relationships, molecule-property relationships, and property-property relationships. Mining molecule-property relationships is itself a task for small sample molecular property prediction, so researchers focus on extracting useful information from molecule-molecule and property-property relationships.
[0004] Regarding molecule-molecule relationships, existing methods focus on quantifying the similarities between molecules. For example, building a relationship graph based on position perception emphasizes the importance of relationships between different molecules and proposes that molecules have property-aware relationships. Although this method pays attention to the relationship between molecules, it ignores the importance of local similarities between molecules. Although existing methods have noticed the relationship between molecules, they lack the exploration of property-property relationships. Some methods integrate the relationship between known properties and target properties and the relationship between them and molecular structures. This method does not quantify the relationship between different molecular properties, but randomly selects some known properties as auxiliary tasks, which will lead to the underutilization of useful properties and introduce unnecessary information redundancy, thereby reducing the model prediction performance.
[0005] Existing small sample molecular property prediction methods, such as a small sample molecular property prediction method based on a hybrid relational network disclosed in publication number CN116580782A. First, the method processes the data to create multiple subtasks. On each task, three different relationship graphs are generated using the RDkit tool and graph neural network, respectively, to construct a hybrid relationship network model and a hybrid prior relationship graph. Finally, the hybrid relationship network model is learned under the constraints of the hybrid prior relationship graph to obtain a molecular characterization vector for molecular property prediction. This invention does not explore the correlation between the properties of the same molecule, resulting in insufficient information utilization and loss of molecular property prediction accuracy.
[0006] Based on the above problems, the present invention proposes a method for predicting small sample molecular properties based on knowledge-guided molecular property relationship graph enhancement. Specifically, in order to address the above problem of ignoring the local similarity between molecules, a molecular property relationship graph module based on knowledge guidance is designed to focus on capturing the local similarity of molecules. In order to address the problem of ignoring the correlation between multiple properties of the same molecule, an auxiliary task sampler is designed to use known properties to assist in predicting new properties. The representation of molecules and properties is learned by updating the molecular property relationship graph module based on knowledge guidance. Summary of the invention
[0007] The present invention aims to overcome the above-mentioned shortcomings of the prior art and proposes a small sample molecular property prediction method and device based on knowledge-guided molecular property relationship diagram enhancement. The present invention calculates the similarity of molecular skeletons and functional groups to construct a molecular property relationship diagram based on knowledge guidance, uses an auxiliary task sampler for sampling to reduce information redundancy and improve information utilization, and fully mines the molecule-property relationship diagram to improve the performance of the molecular property prediction model.
[0008] The first aspect of the present invention relates to a small sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement, comprising the following steps:
[0009] S1: construct molecule-property relationship diagram;
[0010] S2: Building a knowledge-guided molecule-property relationship diagram based on the molecule-property relationship diagram;
[0011] S3: Based on the enhanced graph obtained in step S2, the target task is extracted from the training task set by random sampling, and the subgraph is extracted according to the selected target task to obtain the subgraph representation;
[0012] S4: Sampling is performed through the auxiliary task sampler to obtain auxiliary tasks that are highly related to the target task. A subgraph with richer relationships is reconstructed based on the subgraph and auxiliary tasks obtained in S3.
[0013] S5: Perform small sample molecular property prediction training based on the subgraph obtained in S4, calculate the loss, update the model parameters, and improve the model's ability to quickly generalize to new target properties;
[0014] S6: Use the model trained in step S5 to adapt the target property parameters, and then obtain a generalized model oriented to the target property for molecular property prediction.
[0015] In the step S1, a molecule-property relationship graph is constructed as follows: by taking molecules and properties as nodes, and the relationship between molecules and properties as edges, the type of edge can be determined according to the label of the molecule on the property; if a molecule is marked with a certain property, an active edge is created between the corresponding molecule node and the property node; if the molecule does not have a certain property, an inactive edge is created; if the relationship between the molecule and the property is unknown, an unknown property edge is created, and a molecule-property relationship graph G = (V, T, E, B) is obtained, where V and T represent the set of molecules i and properties τ respectively, E covers the molecule and property information, and the edge weight set B = {b i,τ |(i,τ)∈E} represents the label of molecule i for property τ, where b i,τ The value range of is {0,1,2}, representing inactive, active and unknown states respectively; this structure represents the relationship between molecules and properties in a graphical way, enabling the model to effectively capture and utilize the information of molecules.
[0016] In the step S2: constructing a knowledge-guided molecular property relationship diagram based on the molecule-property relationship diagram, specifically as follows:
[0017] S2.1: Obtain the molecular skeleton similarity of each molecule-property relationship diagram in the data set, as follows: Based on the existing molecule-property relationship diagram, an open source chemical informatics software toolkit RDKit is used to process the chemical molecular structure and extract the molecular fingerprint of the molecular skeleton; the 2048-bit Morgan fingerprint and the 166-bit MACCSkeys are combined into a 2214-bit binary vector SF i , each bit of the molecular fingerprint indicates whether a specific structural feature exists, and the molecular skeleton structure similarity is calculated as follows:
[0018]
[0019] S2.2: Get the functional group similarity of the molecule-property relationship diagram in the data set, as follows: Based on the existing molecule-property relationship diagram, use RDKit to process the chemical molecular structure and extract the key information of the functional group; create a binary vector of length 49, each bit corresponds to one of the functional groups defined by RDKit, indicating whether this functional group exists in the structure of the molecule, thereby generating the functional group fingerprint of the molecule; use GF i and GF j Represent the functional group fingerprints of two molecules, calculate the ratio of the number of identical functional group fingerprints in the two molecules to the total number of functional group fingerprints, and use it as the functional group similarity between molecules i and j:
[0020]
[0021] S2.3: Based on the molecular skeleton similarity and functional group similarity obtained in step S2.1 and step S2.2, a molecule-property multi-relationship diagram is constructed, as follows: Using the two similarities obtained in S2.1 and S2.2, combined with the information of molecules and properties, a molecular property multi-relationship diagram is constructed that contains not only the information of molecules and properties but also the relationships between different molecules Where V and T are the sets of molecules and properties, and the relationship set R covers the relationships between molecules and between molecules and properties. Since the knowledge-guided molecule-property multi-relationship graph contains multiple types of relationships and has strong heterogeneity, traditional graph neural networks are difficult to directly apply to such complex graph structures. To meet this challenge, a subgraph is regarded as a set of layer graphs composed of multiple relationship-specific layer graphs. The relation-specific layers include the skeleton similarity relation layer G Sca , functional group similarity relationship layer G Gro and molecular properties Pro .
[0022] In step S3, based on the enhanced graph obtained in step S2, the target task is extracted from the training task set by random sampling, and a subgraph is extracted according to the selected target task to obtain a subgraph representation, which is specifically as follows: the target task is extracted from the training task set by random sampling, and the target property to be predicted is determined according to the selected target task, and a subgraph g containing the target property τ is extracted from the knowledge-guided molecule-property multi-relationship graph τ In this process, ensure that each subgraph contains 2K supporting molecules, one query molecule and one target property, that is, the subgraph contains a total of 2K+2 nodes; build a small sample molecular property prediction model, which includes graph neural network and multi-layer perceptron, and use molecular encoder, Embedding layer and RBF function to initialize node embedding and edge embedding h i,j, nodes are updated through graph neural network. For each relationship layer, the node embedding is updated as follows:
[0023]
[0024] in represents the embedding of node i after the lth iteration, N(i) represents the set of neighbor nodes of node i, and the graph neural network is used to obtain the node embedding of the property-skeleton similarity layer and the property-functional group similarity layer respectively. and Calculate the embedding z of molecule i i :
[0025]
[0026] Similarly, we can get the embedding z of the target property τ τ , based on the subgraph to obtain the target property subgraph representation , the formula is as follows:
[0027]
[0028] In step S4, sampling is performed through the auxiliary task sampler to obtain auxiliary tasks that are highly related to the target task, and a subgraph with richer relationships is reconstructed based on the subgraph obtained in S3 and the auxiliary tasks, as follows:
[0029] S4.1: Calculate the sampling probability of the auxiliary task, as follows: From formula (5), we can get the subgraph representation corresponding to the candidate auxiliary property: The target property subgraph representation and the candidate auxiliary property subgraph representation are concatenated and a multi-layer perceptron f ψ To predict the probability of each candidate auxiliary property being selected:
[0030]
[0031] S4.2: According to the probability obtained in S4.1, select auxiliary tasks that are highly related to the target task, and reconstruct a subgraph with richer relationships based on the subgraph and auxiliary tasks obtained in S3. The details are as follows: According to the calculated auxiliary task sampling probability, sample the auxiliary tasks that are highly related to the target task to obtain N a auxiliary properties and incorporate them into the subgraph to reconstruct a subgraph with richer relations:
[0032] g τ =(V,{τ∪T auxi},R,{G Sca ,G Gro ,G Pro}) (7)
[0033] Where Tauxi is the selected auxiliary task set, R represents the relationship set; the updated subgraph contains not only 2K+2 nodes, but also N a selected auxiliary properties, that is, there are 2K+N in total in the subgraph a +2 nodes; In this way, the updated subgraph not only contains direct information of the target task, but also incorporates relevant information of the auxiliary task; In addition, the auxiliary task sampler uses policy gradient optimization to learn how to select auxiliary tasks that are highly relevant to the target task; The value of the query set loss of the current target property is used as the reward signal R auxi , set the auxiliary task sampler learning rate lr auxi And dynamically calculate the average reward b auxi , update the policy parameter ψ by maximizing the expected reward. The parameter update formula is as follows:
[0034]
[0035] In step S5, based on the subgraph obtained in step S4, small sample molecular property prediction training is performed, the loss is calculated, and the model parameters are updated to improve the ability of the model to quickly generalize to new target properties. Specifically, the subgraph updated in step S4 is encoded using formulas (3)-(5) to obtain the molecular embedding z i and property embedding z τ , concatenate these two embeddings and pass them through a classifier consisting of two layers of MLP f clr Processing is performed to obtain the predicted value of the target property
[0036]
[0037] To evaluate the prediction performance, the cross entropy loss function is used to calculate the predicted values in the support set and query set. and the true label y i,τ The difference between them, the support set of the target property τ is denoted by S τ It means that the loss function for the support set is defined as:
[0038]
[0039] The loss of the support set is used to update the model so that it can quickly adapt to the target task; the updated model is used to predict the query set and calculate the loss of the query set. The query set of the target property τ is used by Q τ Indicates that the query set loss function is expressed as:
[0040]
[0041] By accumulating the query set losses of different tasks and updating the model parameters, the model can be improved to quickly adapt to the properties of new targets and enhance the generalization of the model to new target properties.
[0042] In step S6, the model trained in step S5 is used to adapt the target property parameters, thereby obtaining a generalized model oriented to the target property for molecular property prediction, specifically as follows: the trained model is adapted to the target property parameters, that is, the model is fine-tuned using the support set loss function under the small sample condition of only K positive / negative test samples in each category of the target task, thereby obtaining a generalized model oriented to the target property, so that it can accurately predict the target property on the new task.
[0043] The second aspect of the present invention relates to a small sample molecular property prediction device based on knowledge-guided molecular property relationship graph enhancement, including a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, they are used to implement the small sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement of the present invention.
[0044] The third aspect of the present invention relates to a computer-readable storage medium, characterized in that a program is stored thereon, and when the program is executed by a processor, the small sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement of the present invention is implemented.
[0045] The present invention is based on the molecule-property relationship diagram and constructs a knowledge-guided molecular property relationship diagram module by calculating the similarity of molecular skeletons and functional groups. Through this molecular fine-grained similarity measurement, the model can more accurately capture the differences between molecules and introduce an auxiliary task sampler to use known properties to assist in the prediction of new properties, thereby reducing information redundancy and improving the performance of the molecular property prediction model.
[0046] The innovative features of the present invention are:
[0047] (1) By proposing a knowledge-guided molecular property relationship diagram, based on the traditional molecule-property relationship diagram, the similarity of molecular skeletons and functional groups is used to obtain a knowledge-guided molecule-property multi-relationship diagram. This relationship diagram integrates the multi-dimensional relationship information between molecules and properties. Through the fine-grained molecular similarity measurement, the model can more accurately capture the differences between molecules.
[0048] (2) An auxiliary task sampler was proposed and designed to sample highly correlated auxiliary tasks, and the target properties were predicted using auxiliary properties that were highly correlated with the target properties. This fully explored the relationship between properties, reduced unnecessary noise and information redundancy, and optimized the molecular property prediction performance.
[0049] Therefore, the present invention realizes a small sample molecular property prediction method based on knowledge-guided molecular property relationship diagram enhancement, so as to improve the performance of the molecular property prediction model. Based on the molecule-property relationship diagram, the present invention emphasizes the local similarity between molecules, calculates the fine-grained molecular similarity of molecular skeletons and functional groups, thereby constructing a molecular property relationship diagram based on knowledge guidance, and designs an auxiliary task sampler to sample auxiliary properties that are highly correlated with the target property, effectively reducing information redundancy and improving the accuracy of molecular property prediction.
[0050] The advantages of the present invention are:
[0051] (1) Although the existing technical solutions all pay attention to the importance of the relationship between molecules, they do not accurately capture the property-oriented molecular similarity. The present invention emphasizes the key role of local molecular similarity, and uses the similarity of molecular skeletons and functional groups to obtain a knowledge-guided molecule-property multi-relationship graph. The relationship graph integrates the multi-dimensional relationship information between molecules and properties, effectively utilizes the fine-grained similarity measurement between molecules, and enables the model to more accurately capture the differences between molecules.
[0052] (2) The present invention proposes and designs an auxiliary task sampler to sample auxiliary properties that are highly correlated with the target properties, fully explore the property relationship, reduce unnecessary noise and information redundancy, and thus more effectively predict molecular properties. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 It is a framework diagram of the method of the present invention;
[0055] Figure 2 It is a schematic diagram of the knowledge-guided molecular property relationship diagram module generation of the method of the present invention;
[0056] Figure 3 is a schematic diagram of an auxiliary task sampler module of the method of the present invention;
[0057] Figure 4 It is a schematic diagram of model optimization and property prediction of the method of the present invention;
[0058] Figure 5 It is a schematic diagram of the device of the present invention. DETAILED DESCRIPTION
[0059] Various exemplary embodiments of the present invention will now be described in detail. This detailed description should not be considered as limiting the present invention, but should be understood as a more detailed description of certain aspects, features, and embodiments of the present invention.
[0060] It should be understood that the terms described in the present invention are only for describing special embodiments and are not intended to limit the present invention. In addition, for the numerical range in the present invention, it should be understood that each intermediate value between the upper and lower limits of the scope is also specifically disclosed. Each smaller range between the intermediate value in any stated value or stated range and any other stated value or intermediate value in the described range is also included in the present invention. The upper and lower limits of these smaller ranges can be independently included or excluded in the scope.
[0061] Unless otherwise indicated, all technical and scientific terms used herein have the same meanings as those generally understood by those skilled in the art. Although the present invention describes only preferred methods and materials, any methods and materials similar or equivalent to those described herein may also be used in the implementation or testing of the present invention. All documents mentioned in this specification are incorporated by reference to disclose and describe the methods and / or materials associated with the documents. In the event of a conflict with any incorporated document, the content of this specification shall prevail.
[0062] It will be apparent to those skilled in the art that various modifications and variations may be made to the specific embodiments of the present invention description without departing from the scope or spirit of the present invention. Other embodiments derived from the present invention description will be apparent to those skilled in the art. The present application description and examples are exemplary only.
[0063] The words “include,” “including,” “have,” “contain,” etc. used in this document are open-ended terms, meaning including but not limited to.
[0064] Unless otherwise specified, the "parts" described in the present invention are all based on mass parts.
[0065] Example 1
[0066] This embodiment provides a small sample molecular property prediction method based on knowledge relationship enhancement, such as Figure 1 As shown, taking the Tox21 dataset as an example, the implementation steps include the following:
[0067] Constructing a molecule-property relationship diagram:
[0068] Step S1: Construct a molecule-property relationship diagram.
[0069] Take molecules and properties as nodes, determine edges based on the relationship between molecules and properties, and the type of edge is determined by the label of the molecule on the property; if a molecule is marked with a certain property, an active edge is created between the corresponding molecule and property nodes; if the molecule does not have a certain property, an inactive edge is created; if the relationship between the molecule and the property is unknown, an unknown property edge is created; therefore, the molecule-property relationship graph is defined as G = (V, T, E, B), where V and T represent the set of molecule i and property τ, respectively, E = {(i, τ)|i∈V, τ∈T} covers the molecule and property information, and the edge weight set B = {b i,τ |(i,τ)∈E} represents the label of molecule i for property τ, where b i,τ The value range of is {0,1,2}, representing inactive, active and unknown states respectively; this structure represents the relationship between molecules and properties in a graphical way, enabling the model to effectively capture and utilize the information of molecules.
[0070] Construct a knowledge-guided molecular property relationship diagram module:
[0071] S2: Construct a knowledge-guided molecular property relationship diagram based on the molecule-property relationship diagram.
[0072] S2.1: Calculate the similarity of molecular skeletons.
[0073] Based on the existing molecule-property relationship diagram, an open source chemical informatics software toolkit RDKit is used to process the chemical molecular structure to extract the molecular skeleton; the Morgan fingerprint and MACCSkeys fingerprint of the molecular skeleton are extracted, and the 2048-bit Morgan fingerprint and 166-bit MACCSkeys are merged into a 2214-bit binary vector to generate a molecular skeleton fingerprint, and the ratio of the number of identical skeleton fingerprints in two molecules to the total number of molecular skeleton fingerprints is calculated, and this ratio is used as the skeleton similarity between the molecules, the molecular skeleton similarity S Sca The calculation method of (i,j) is as follows:
[0074]
[0075] Among them, SF i and SF j It is defined as the backbone fingerprint of two molecules, each bit indicates the presence or absence of a specific structural feature, SF i and The dot product of represents the number of common structural features of two molecules, reflecting their similarity in molecular skeleton structure.
[0076] S2.2: Calculate the similarity of functional groups.
[0077] Based on the existing molecule-property relationship diagram, RDKit is used to process the chemical molecular structure and extract the functional group information inside the molecule; a binary vector of length 49 is created, each bit corresponds to one of the functional groups defined by RDKit, indicating whether this functional group exists in the structure of the molecule, thereby generating the functional group fingerprint of the molecule; the ratio of the number of identical functional group fingerprints in two molecules to the total number of functional group fingerprints is calculated, and it is used as the functional group similarity between molecules i and j, and the formula is as follows:
[0078]
[0079] Among them GF i and GF j Represents the functional group fingerprints of two molecules.
[0080] S2.3: Construct a knowledge-guided molecular property relationship diagram.
[0081] By using the similarity of molecular skeleton and functional group, the information of molecules and properties is integrated to construct a molecule-property multi-relationship diagram Where C and T are the node sets of molecules and properties, and the relationship set R contains multiple relationships between molecules and between molecules and properties. Since the knowledge-guided molecule-property multi-relationship graph contains multiple types of relationships and has strong heterogeneity, traditional graph neural networks are difficult to directly apply to such complex graph structures. To meet this challenge, the subgraph is regarded as a multi-graph composed of multiple relationship-specific layer graphs. The relation-specific layers include the skeleton similarity layer G Sca , functional group similarity layer G Gro and property layer G Pro , each level of the graph contains super nodes across relations.
[0082] Auxiliary task sampling and subgraph reconstruction:
[0083] Step S3: extract subgraphs according to the selected target tasks and obtain subgraph representations.
[0084] The target task is extracted from the training task set by random sampling. Based on the selected target task, the paired subgraphs g containing the target properties are extracted from the knowledge-guided molecule-property multi-relation graph. τ In this process, ensure that each subgraph contains 2K supporting molecules, one query molecule and one target property, that is, the subgraph contains a total of 2K+2 nodes; build a small sample molecular property prediction model, which includes graph neural network and multi-layer perceptron, and use molecular encoder, Embedding layer and RBF function to initialize node embedding and edge embedding h i,j, nodes are updated through graph neural network. For each relationship layer, the node embedding is updated as follows:
[0085]
[0086] in represents the embedding of node i after the lth iteration, N(i) represents the set of neighbor nodes of node i; the graph neural network is used to obtain the node embedding of the property-skeleton similarity layer respectively and node embedding at the property-functional group similarity layer And calculate the embedding z of molecule i i :
[0087]
[0088] Similarly, we can get the embedding z of the target property τ τ , based on the subgraph to obtain the target property subgraph representation , the formula is as follows:
[0089]
[0090] In step S4, sampling is performed through the auxiliary task sampler to obtain auxiliary tasks that are highly relevant to the target task, and a subgraph with richer relationships is reconstructed.
[0091] S4.1: Calculate the auxiliary task sampling probability.
[0092] According to formula (5), the candidate auxiliary proton graph representation can be obtained: , by characterizing the target property graph and candidate auxiliary proton graph characterization Perform a concatenation operation and use the auxiliary task sampler to predict the probability of each candidate auxiliary property being selected:
[0093]
[0094] where f ψ is a function composed of a multi-layer perceptron, Represents a vector concatenation operation.
[0095] S4.2: Based on the probability obtained in S4.1, sample the auxiliary tasks and reconstruct the subgraph.
[0096] According to the calculated auxiliary task sampling probability, the auxiliary tasks that are highly related to the target task are sampled to obtain N a auxiliary properties and incorporate them into the subgraph to reconstruct a subgraph with richer relations:
[0097] g τ =(V,{τ∪Tauxi},R,{G Sca ,G Gro ,G Pro}) (7)
[0098] Where T auxi is the selected auxiliary task set, R represents the relationship set; the updated subgraph contains not only 2K+2 nodes, but also N a selected auxiliary properties, that is, there are 2K++2+N in total in the subgraph a nodes; in addition, the policy gradient method is used to optimize the auxiliary task sampler, and the query loss value is used as the reward signal R auxi , learn how to select the auxiliary tasks that are most relevant to the target task, and update the policy parameter ψ by maximizing the expected reward. The parameter update formula is as follows:
[0099]
[0100] Among them lr auxi is the auxiliary task sampler learning rate, b auxi Represents the average value of the dynamically calculated reward, which is used to stabilize the training process. Through this method, the auxiliary task sampler can learn how to select auxiliary tasks more effectively, which helps the model extract effective information from related tasks and reduce unnecessary noise.
[0101] Model optimization and property prediction:
[0102] Step S5: Based on the subgraph obtained in S4, small sample molecular property prediction training is performed, the loss is calculated, the model parameters are updated, and the model's ability to quickly generalize to new ones is improved.
[0103] Use formulas (3)-(5) to encode the subgraph updated in step 4 to obtain the molecular embedding z i and target property embedding z τ , embed the molecule and target properties for splicing, and obtain the molecule v i The predicted label for property τ
[0104]
[0105] where f clr It is a classifier consisting of two layers of MLP; to evaluate the prediction performance, the cross entropy loss function is used to calculate the predicted values in the support set and the query set. and the true label y i,τ The difference between , for the support set loss function is defined as:
[0106]
[0107] The loss of the support set is used for updating so that the model can quickly adapt to the target task; the updated model is used to predict the query set and calculate the loss of the query set. The query set loss function is expressed as:
[0108]
[0109] By accumulating the query set losses of different tasks and updating the model parameters, the model can be improved to quickly adapt to the properties of new targets and enhance the generalization of the model to new target properties.
[0110] Step S6: Use the model trained in step S5 to adapt the target property parameters, and then obtain a generalized model oriented to the target property for molecular property prediction.
[0111] The trained and optimized model is deployed on the test set to adapt the target property parameters to verify its performance under small sample conditions; that is, under the condition that only K positive / negative test samples are provided for each category of the target task, the target property loss function is used. Fine-tune the model:
[0112]
[0113] After fine-tuning, the model can adapt to the prediction of molecular properties of the target properties. For a new input molecule v query , we can combine the support set to construct a molecule-property relationship subgraph and input it into the graph neural network for learning to obtain the molecular and target property representation z query and z τ , and then use the classifier to predict the prediction results of the input molecule
[0114]
[0115] In summary, the present invention proposes a small sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement, which solves the problem that existing methods fail to capture the local similarities of molecular substructures and ignore the correlation between multiple properties of the same molecule, thereby limiting the model performance. This method significantly improves the accuracy and efficiency of the molecular property prediction model.
[0116] The present invention obtains the similarity of molecular skeletons and functional groups by constructing a knowledge-guided molecule-property relationship diagram, so that the model can more accurately capture the connection between molecules. An auxiliary task sampler is designed to sample auxiliary tasks that are highly related to the target task, and the known molecular properties that are highly related to the target properties are used to assist in the prediction of new properties, reduce unnecessary noise and information redundancy, and enhance factor characterization to improve the performance of the molecular property prediction model.
[0117] Example 2
[0118] like Figure 5 This embodiment relates to a small sample molecular property prediction device based on knowledge-guided molecular property relationship graph enhancement, including a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, it is used to implement the small sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement of Example 1.
[0119] Example 3
[0120] The present embodiment relates to a computer-readable storage medium, characterized in that a program is stored thereon, and when the program is executed by a processor, the small sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement of embodiment 1 is implemented.
[0121] The embodiments described above are only descriptions of the preferred modes of the present invention, and are not intended to limit the scope of the present invention. Without departing from the design spirit of the present invention, various modifications and improvements made to the technical solutions of the present invention by ordinary technicians in this field should all fall within the protection scope determined by the claims of the present invention.
Claims
1. A small sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement, characterized in that: The following steps are involved: S1: construct molecule-property relationship diagram; S2: Building a knowledge-guided molecule-property relationship diagram based on the molecule-property relationship diagram; S3: Based on the enhanced graph obtained in step S2, a target task is selected from the training task set by random sampling, and a subgraph is extracted according to the selected target task to obtain a subgraph representation; S4: Sampling is performed through the auxiliary task sampler to obtain auxiliary tasks that are highly related to the target task, and a subgraph with richer relationships is reconstructed based on the subgraph obtained in step S3 and the auxiliary tasks; S5: Perform small sample molecular property prediction training based on the subgraph obtained in step S4, calculate the loss, update the model parameters, and improve the model's ability to quickly generalize to new target properties; S6: Use the model trained in step S5 to adapt the target property parameters, and then obtain a generalized model oriented to the target property for molecular property prediction.
2. The small sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement according to claim 1 is characterized by: The construction of the molecule-property relationship graph described in step S1 specifically includes: using molecules and properties as nodes, and the relationship between molecules and properties as edges, and the type of edge can be determined according to the label of the molecule on the property; if a molecule is marked with a certain property, an active edge is created between the corresponding molecule node and the property node; if the molecule does not have a certain property, an inactive edge is created; if the relationship between the molecule and the property is unknown, an unknown property edge is created, and a molecule-property relationship graph G = (V, T, E, B) is obtained, where V and T represent the set of molecules i and properties τ respectively, E covers the molecule and property information, and the edge weight set B = {b i,τ |(i,τ)∈E} represents the label of molecule i for property τ, where b i,τ The value range of is {0,1,2}, representing inactive, active and unknown states respectively; this structure represents the relationship between molecules and properties in a graphical way, enabling the model to effectively capture and utilize the information of molecules.
3. The small sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement according to claim 1 is characterized by: The step S2 of constructing a knowledge-guided molecular property relationship diagram based on the molecule-property relationship diagram specifically includes: S2.1: Obtain the molecular skeleton similarity of each molecule-property relationship diagram in the data set, as follows: Based on the existing molecule-property relationship diagram, an open source chemical informatics software toolkit RDKit is used to process the chemical molecular structure and extract the key information of the molecular skeleton; the 2048-bit Morgan fingerprint and the 166-bit MACCSkeys are combined into a 2214-bit binary vector to generate a molecular skeleton fingerprint, and the ratio of the number of identical skeleton fingerprints in the two molecules to the total number of molecular skeleton fingerprints is calculated, and this ratio is used as the skeleton similarity between the molecules, and SF is used. i and SF j Represents the backbone fingerprint of two molecules, each bit indicates whether a specific structural feature exists, SF i and The dot product of represents the number of common structural features of two molecules, reflecting their similarity in molecular skeleton structure: S2.2: Obtain the functional group similarity of the molecule-property relationship diagram in the data set, specifically including: based on the existing molecule-property relationship diagram, use RDKit to process the chemical molecular structure and extract the key information of the functional group; create a binary vector of length 49, each bit corresponds to one of the functional groups defined by RDKit, indicating whether this functional group exists in the structure of the molecule, thereby generating the functional group fingerprint of the molecule; use GF i and GF j Represent the functional group fingerprints of two molecules, calculate the ratio of the number of identical functional group fingerprints in the two molecules to the total number of functional group fingerprints, and use it as the functional group similarity between molecules i and j: S2.3: Based on the molecular skeleton similarity and functional group similarity obtained in step S2.1 and step S2.2, a knowledge-guided molecule-property relationship diagram is obtained, which specifically includes: using the two similarities obtained in step S2.1 and step S2.2, and combining the information of molecules and properties, to construct a molecular property multi-relationship diagram that not only includes the information of molecules and properties but also includes the relationship between different molecules Where V, T are the sets of molecules and properties, and the relationship set R covers the relationships between molecules and between molecules and properties; the subgraph is regarded as a layer graph set composed of multiple relationship-specific layer graphs The relation-specific layers include the skeleton similarity layer G Sca , functional group similarity layer G Gro and property layer G Pro .
4. The small sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement according to claim 1 is characterized by: The enhanced graph obtained in step S2 described in step S3 extracts the target task from the training task set by random sampling, extracts the subgraph according to the selected target task, and obtains the subgraph representation, which specifically includes: extracting the target task from the training task set by random sampling, determining the target property to be predicted according to the selected target task, and extracting the subgraph g containing the target property τ from the knowledge-guided molecule-property multi-relationship graph τ In this process, ensure that each subgraph contains 2K supporting molecules, one query molecule and one target property, that is, the subgraph contains a total of 2K+2 nodes; build a small sample molecular property prediction model, which includes graph neural network and multi-layer perceptron, and use molecular encoder, Embedding layer and RBF function to initialize node embedding and edge embedding h i,j , nodes are updated through graph neural network. For each relationship layer, the node embedding is updated as follows: in represents the embedding of node i after the lth iteration, N(i) represents the set of neighbor nodes of node i, and the graph neural network is used to obtain the node embedding of the property-skeleton similarity layer and the property-functional group similarity layer respectively. and Calculate the embedding z of molecule i i : Similarly, we can get the embedding z of the target property τ τ , based on the subgraph to obtain the target property subgraph representation The formula is as follows: 。 5. The small sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement according to claim 4 is characterized by: In step S4, the auxiliary task sampler is used to sample and obtain auxiliary tasks that are highly related to the target task. A subgraph with richer relationships is reconstructed based on the subgraph obtained in step S3 and the auxiliary tasks, which specifically includes: S4.1: Calculate the sampling probability of the auxiliary task, specifically including: From formula (5), the subgraph representation corresponding to the candidate auxiliary property can be obtained The target property subgraph representation and the candidate auxiliary property subgraph representation are concatenated and a multi-layer perceptron f ψ To predict the probability of each candidate auxiliary property being selected: S4.2: According to the probability obtained in step S4.1, select auxiliary tasks that are highly relevant to the target task, and reconstruct a subgraph with richer relationships based on the subgraph and auxiliary tasks obtained in step S3, specifically including: according to the calculated auxiliary task sampling probability, sample the auxiliary tasks that are highly relevant to the target task, and obtain N a auxiliary properties and incorporate them into the subgraph to reconstruct a subgraph with richer relations: g τ =(V,{τ∪T auxi },R,{G Sca ,G Gro ,G Pro }) (7) Where T auxi is the selected auxiliary task set, R represents the relationship set; the updated subgraph contains not only 2K+2 nodes, but also N a selected auxiliary properties, that is, there are 2K+2+N in total in the subgraph a nodes; in this way, the updated subgraph not only contains direct information of the target task, but also incorporates relevant information of the auxiliary task; in addition, the auxiliary task sampler is optimized using policy gradients to learn how to select auxiliary tasks that are highly relevant to the target task; the value of the query set loss of the current target property is used as the reward signal R auxi , set the auxiliary task sampler learning rate lr auxi And dynamically calculate the average reward b auxi , update the policy parameter ψ by maximizing the expected reward. The parameter update formula is as follows: 。 6. The method for predicting small sample molecular properties based on knowledge-guided molecular property relationship graph enhancement according to claim 5, characterized in that: Use formulas (3)-(5) to encode the subgraph updated in step S4 to obtain the molecular embedding z i and property embedding z τ , concatenating the molecular and property embeddings and passing them through a classifier consisting of a two-layer MLP f clr Processing is performed to obtain the predicted value of the target property To evaluate the prediction performance, the cross entropy loss function is used to calculate the predicted values in the support set and query set. and the true label y i,τ The difference between them, the support set of the target property τ is denoted by S τ It means that the loss function for the support set is defined as: The loss of the support set is used to update the model so that it can quickly adapt to the target task; the updated model is used to predict the query set and calculate the loss of the query set. The query set of the target property τ is used by Q τ Indicates that the query set loss function is expressed as: By accumulating the query set losses of different tasks and updating the model parameters, the model can be improved to quickly adapt to the properties of new targets and enhance the generalization of the model to new target properties.
7. The small sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement according to claim 1 is characterized by: The step S6 described in which the model trained in step S5 is used to adapt the target property parameters, thereby obtaining a generalized model oriented to the target property for molecular property prediction, specifically includes: adapting the trained model to the target property parameters, that is, using the support set loss function to fine-tune the model under the small sample condition of only K positive / negative test samples in each category of the target task, thereby obtaining a generalized model oriented to the target property, so that it can accurately predict the target property on the new task.
8. A small sample molecular property prediction device based on knowledge-guided molecular property relationship graph enhancement, characterized in that: It includes a memory and one or more processors, wherein the memory stores executable code, and when the one or more processors execute the executable code, it is used to implement the small sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that: A program is stored thereon, and when the program is executed by a processor, the small sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement as described in any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Molecular diagram representation learning method based on contrast learning
CN112669916A
Meta learning molecule attribute prediction method based on sample-task relation graph
CN115394373A
Molecular network data enhancement method and system based on molecular skeleton
CN115620833A
Small sample molecule property prediction method based on hybrid relation network
CN116580782A
Molecular property prediction model training method, storage medium and property prediction device
CN117059199A