Small sample molecular property prediction method and device based on knowledge-guided molecular property relationship graph enhancement
By constructing a knowledge-guided molecular property relationship graph and combining the similarity of molecular skeleton and functional groups, an auxiliary task sampler was designed, which solved the problem of insufficient information utilization in the prediction of molecular properties in small samples and improved the accuracy and generalization ability of the model.
Patent Information
- Application Number
- CN202411926429.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-10-28
- Estimated Expiration
- 2044-12-25
AI Technical Summary
Existing methods for predicting molecular properties in small samples fail to effectively capture local similarities between molecules and ignore the correlation between multiple properties of the same molecule, resulting in insufficient information utilization and affecting the model's predictive performance.
We construct a knowledge-guided molecular property relationship graph, calculate the similarity between the molecular skeleton and functional groups, and combine it with an auxiliary task sampler to enhance the molecular-property relationship graph, reduce information redundancy, and improve model performance.
By using fine-grained molecular similarity metrics and auxiliary task sampling, the model can more accurately capture molecular differences, reduce noise, and improve the accuracy and generalization ability of molecular property prediction.
Smart Images

Figure CN119920353B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method and apparatus for predicting small-sample molecular properties based on knowledge-guided molecular property relationship graph enhancement, belonging to the fields of molecular property prediction and graph neural networks. Background Technology
[0002] Molecular property prediction is a crucial task in drug development, aiming to predict the physicochemical properties and biological activities of molecules. Traditional methods for molecular property prediction are costly, time-consuming, and carry inherent risks when conducting wet experiments. In recent years, machine learning has made significant strides, particularly deep learning methods, demonstrating immense application potential. For example, it allows for 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 in practical applications by data dependence and the scarcity of labeled data, leading to challenges in molecular property prediction. Essentially, this is a few-shot learning problem, requiring the development of more efficient algorithms to overcome the data shortage.
[0003] In recent years, researchers have explored this problem from both data and model perspectives, proposing a series of small-sample molecular property prediction models. From a model perspective, researchers optimize small-sample molecular property algorithms by designing new neural network architectures, training frameworks, or parameter update mechanisms. Similarly, from a data perspective, researchers have developed a series of methods by mining 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 in small-sample molecular property prediction; therefore, researchers focus on extracting useful information from molecule-molecule and property-property relationships.
[0004] Regarding molecular-molecular relationships, existing methods focus on quantifying the similarity between molecules. For example, position-aware relationship graphs emphasize the importance of relationships between different molecules and propose property-aware relationships. While these methods acknowledge the relationships between molecules, they neglect the importance of local similarities. Although existing methods have noted intermolecular relationships, they lack exploration of property-property relationships. Some methods integrate relationships between known and target properties, as well as their relationships with molecular structure. However, these methods do not quantify the relationships between different molecular properties; they simply randomly select some known properties as auxiliary tasks. This leads to underutilization of useful properties and introduces unnecessary information redundancy, thereby reducing model prediction performance.
[0005] Existing methods for predicting molecular properties in small samples, such as the one disclosed in publication number CN116580782A based on a hybrid relational network, firstly process the data to create multiple sub-tasks. For each task, the RDkit tool and a graph neural network are used to generate three different relational graphs, constructing a hybrid relational network model and a hybrid prior relational graph. Finally, the hybrid relational network model is learned under the constraints of the hybrid prior relational graph to obtain molecular representation vectors for molecular property prediction. However, this invention fails to explore the correlations between properties of the same molecule, leading to insufficient information utilization and a loss of accuracy in molecular property prediction.
[0006] To address the aforementioned problems, this invention proposes a method for predicting small-sample molecular properties using a knowledge-guided molecular property relationship graph enhancement. Specifically, to address the issue of neglecting local similarities between molecules, a knowledge-guided molecular property relationship graph module is designed to focus on capturing these local similarities. Furthermore, to address the problem of ignoring the correlation between multiple properties of the same molecule, an auxiliary task sampler is designed to utilize known properties to assist in predicting new properties. The representation of molecules and properties is learned by updating the knowledge-guided molecular property relationship graph module. Summary of the Invention
[0007] This invention aims to overcome the aforementioned shortcomings of existing technologies by proposing a small-sample molecular property prediction method and apparatus based on knowledge-guided molecular property relationship graph enhancement. This invention constructs a knowledge-guided molecular property relationship graph by calculating the similarity between the molecular skeleton and functional groups. It utilizes an auxiliary task sampler to reduce information redundancy and improve information utilization, fully mining the molecular-property relationship graph to enhance the performance of the molecular property prediction model.
[0008] The first aspect of this 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 a molecular-property relationship diagram;
[0010] S2: Construct a knowledge-guided molecular-property relationship diagram based on the molecular-property relationship diagram;
[0011] S3: Based on the augmented graph obtained in step S2, target tasks are randomly sampled from the training task set, and subgraphs are extracted according to the selected target tasks to obtain subgraph representations;
[0012] S4: Sample through the auxiliary task sampler to obtain auxiliary tasks that are highly related to the target task. Reconstruct a more complex subgraph based on the subgraph obtained in S3 and the auxiliary tasks.
[0013] S5: Based on the subgraph obtained in S4, perform small-sample molecular property prediction training, 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, thereby obtaining a generalized model oriented towards the target property for molecular property prediction.
[0015] In step S1, a molecule-property relationship graph is constructed as follows: Molecules and properties are used as nodes, and the relationships between molecules and properties are used as edges. The type of edge can be determined based on the label of the molecule on that property. If a molecule is labeled as having a certain property, an active edge is created between the corresponding molecule node and 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, resulting in a molecule-property relationship graph G = (V, T, E, B), where V and T represent the sets of molecule i and property τ, respectively, E encompasses the information about molecules and properties, and the edge weight set B = {b i,τ |(i,τ)∈E} denotes 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 molecular information.
[0016] In step S2: a knowledge-guided molecular property relationship diagram is constructed based on the molecular-property relationship diagram, as follows:
[0017] S2.1: Obtain the molecular backbone similarity of each molecule-property relationship graph in the dataset, specifically as follows: Based on the existing molecule-property relationship graph, use an open-source cheminformatics software toolkit, RDKit, to process chemical molecular structures and extract molecular fingerprints of the molecular backbone; merge the 2048-bit Morgan fingerprint and the 166-bit MACCSkeys into a 2214-bit binary vector SF. i Each bit of the molecular fingerprint indicates the presence or absence of a specific structural feature. The molecular backbone structural similarity is calculated as follows:
[0018]
[0019] S2.2: Obtain the functional group similarity of the molecular-property relationship graph in the dataset, specifically as follows: Based on the existing molecular-property relationship graph, use RDKit to process chemical molecular structures and extract key information of functional groups; create a binary vector of length 49, where each bit corresponds to one of the functional groups defined by RDKit, indicating whether this functional group exists in the molecular structure, thereby generating the functional group fingerprint of the molecule; use GF... i and GF j Representing the functional group fingerprints of two molecules, the proportion of fingerprints with the same functional groups in the two molecules to the total number of functional group fingerprints is calculated and used 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 steps S2.1 and S2.2, a molecular-property multi-relationship graph is constructed, as follows: Using the two similarity values obtained in S2.1 and S2.2, and combining them with information on molecules and properties, a molecular-property multi-relationship graph is constructed that includes not only information on molecules and properties but also the relationships between different molecules. Where V and T are sets of molecules and properties, and the relation set R covers the relationships between molecules and between molecules and properties; since knowledge-guided molecular-property multi-relationship graphs contain various types of relationships and have strong heterogeneity, traditional graph neural networks are difficult to apply directly to such complex graph structures. To address this challenge, subgraphs are viewed as layer graph sets composed of multiple relation-specific layer graphs. The relationship-specific layer includes the skeleton similarity relationship layer G. Sca Functional group similarity layer G Gro Relationship with molecular properties layer G Pro .
[0022] In step S3, based on the enhanced graph obtained in step S2, a target task is randomly sampled from the training task set, and a subgraph is extracted according to the selected target task to obtain the subgraph representation. Specifically, the target task is randomly sampled from the training task set, and the target property to be predicted is determined based on the selected target task. A subgraph g containing the target property τ is extracted from the knowledge-guided molecular-property multi-relationship graph. τ In this process, it is ensured that each subgraph contains 2K supporting molecules, one query molecule, and one target property, meaning that the subgraph contains a total of 2K+2 nodes. A small-sample molecular property prediction model is constructed, which includes graph neural networks and multilayer perceptrons. Molecular encoders, embedding layers, and RBF functions are used to initialize node embeddings. and edge embedding h i,jThe nodes are updated using a graph neural network. For each relation layer, the node embedding is updated as follows:
[0023]
[0024] in Let N(i) represent the embedding of node i after the l-th iteration, and let N(i) represent the set of neighboring nodes of node i. Graph neural networks are used to obtain the node embeddings 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, the embedding of the target property τ can be obtained z. τ Obtaining target property subgraph representations based on subgraphs The formula is as follows:
[0027]
[0028] In step S4, sampling is performed using an auxiliary task sampler to obtain auxiliary tasks highly related to the target task. Based on the subgraph obtained in S3 and the auxiliary tasks, a more complex subgraph is reconstructed, as follows:
[0029] S4.1: Calculate the sampling probability of the auxiliary task, as follows: The subgraph representation corresponding to the candidate auxiliary property can be obtained from formula (5). The target property graph representation and the candidate auxiliary property graph representation are concatenated, and then processed using a multilayer perceptron f. ψ To predict the probability of each candidate auxiliary property being selected:
[0030]
[0031] S4.2: Based on the probabilities obtained in S4.1, select auxiliary tasks that are highly relevant to the target task. Reconstruct a more complex subgraph based on the subgraph obtained in S3 and the auxiliary tasks, as follows: Based on the calculated sampling probabilities of the auxiliary tasks, sample the auxiliary tasks that are highly relevant to the target task to obtain N. a We can use these auxiliary properties to reconstruct a more relationally rich subgraph by incorporating them into the subgraph.
[0032] g τ =(V,{τ∪T) auxi},R,{G Sca G Gro G Pro}) (7)
[0033] Where Tauxi The selected set of auxiliary tasks, R, represents the relation set; the updated subgraph contains not only 2K+2 nodes, but also N nodes. a There are 2K+N selected auxiliary properties, meaning the total number of subgraphs is 2K+N. a +2 nodes; In this way, the updated subgraph not only contains direct information about the target task but also incorporates relevant information about the auxiliary tasks; Furthermore, 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 based on the current target properties is used as the reward signal R. auxi Set the learning rate lr for the auxiliary task sampler auxi And dynamically calculate the average reward b auxi The policy parameter ψ is updated by maximizing the expected reward, and the formula for parameter update is as follows:
[0034]
[0035] In step S5, small-sample molecular property prediction training is performed based on the subgraph obtained in S4, the loss is calculated, the model parameters are updated, and the ability of the model to quickly generalize to new target properties is improved. Specifically, the updated subgraph in step S4 is encoded using formulas (3)-(5) to obtain the molecular embedding z. i and property embedding z τ The two embeddings are concatenated and passed through a classifier f consisting of two MLP layers. clr The process is performed to obtain the predicted value of the target property.
[0036]
[0037] To evaluate prediction performance, the cross-entropy loss function is used to compute the predicted values in the support set and query set. With real label y i,τ The difference between them, the support set of the target property τ using S τ This means that the support set loss function is defined as follows:
[0038]
[0039] The model is updated using the loss from the support set, allowing it to quickly adapt to the target task. The updated model is then used to predict the query set and calculate its loss. Query sets with target property τ are represented by Q. τ The query set loss function is expressed as:
[0040]
[0041] By accumulating query set losses from different tasks, the model parameters are updated to improve the model's ability to quickly adapt to new target properties and enhance its generalization ability 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 towards the target property for molecular property prediction. Specifically, 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 condition that there are only K positive / negative test samples for each category of the target task, thereby obtaining a generalized model oriented towards the target property, which can accurately predict the target property on the new task.
[0043] A second aspect of the present invention relates to a small-sample molecular property prediction device based on knowledge-guided molecular property graph enhancement, comprising a memory and one or more processors, wherein the memory stores executable code, and the one or more processors execute the executable code to implement the small-sample molecular property prediction method based on knowledge-guided molecular property graph enhancement of the present invention.
[0044] A third aspect of the present invention relates to a computer-readable storage medium, characterized in that it stores a program thereon, which, when executed by a processor, implements the knowledge-guided molecular property relationship graph-enhanced small-sample molecular property prediction method of the present invention.
[0045] This invention is based on a molecular-property relationship graph. It constructs a knowledge-guided molecular property relationship graph module by calculating the similarity between the molecular skeleton and functional groups. Through this fine-grained molecular similarity measurement, the model can more accurately capture the differences between molecules. An auxiliary task sampler is introduced to use known properties to help predict new properties, thereby reducing information redundancy and improving the performance of the molecular property prediction model.
[0046] The innovation of this invention is:
[0047] (1) By proposing a knowledge-guided molecular property relationship graph, this graph is based on the traditional molecular-property relationship graph. It utilizes the similarity of molecular skeleton and functional groups to obtain a knowledge-guided molecular-property multi-relationship graph. This graph integrates multi-dimensional relationship information between molecules and properties. Through 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 auxiliary properties that are highly correlated with the target properties were used to predict 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, this invention implements a small-sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement, thereby improving the performance of molecular property prediction models. Based on the molecular-property relationship graph, this invention emphasizes local similarity between molecules. By calculating fine-grained molecular similarity of the molecular skeleton and functional groups, a knowledge-guided molecular property relationship graph is constructed. An auxiliary task sampler is designed to sample auxiliary properties 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 existing technical solutions all focus on the importance of relationships between molecules, they are not accurate in capturing property-oriented molecular similarity. This invention emphasizes the key role of local molecular similarity and uses the similarity of molecular skeleton and functional groups to obtain a knowledge-guided molecular-property multi-relationship graph. This graph integrates multi-dimensional relationship information between molecules and properties, effectively utilizes fine-grained molecular similarity measurement, and enables the model to capture the differences between molecules more accurately.
[0052] (2) This invention proposes and designs an auxiliary task sampler to sample auxiliary properties that are highly correlated with the target properties, fully explore the property relationships, reduce unnecessary noise and information redundancy, and thus more effectively predict molecular properties. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a framework diagram of the method of the present invention;
[0055] Figure 2 This is a schematic diagram illustrating the generation of the knowledge-guided molecular property relationship graph module in the method of this invention;
[0056] Figure 3 This is a schematic diagram of the auxiliary task sampler module of the method of the present invention;
[0057] Figure 4 This is a schematic diagram illustrating the model optimization and property prediction of the method of the present invention;
[0058] Figure 5 This is a schematic diagram of the device of the present invention. Detailed Implementation
[0059] Various exemplary embodiments of the present invention will now be described in detail. This detailed description should not be considered as a limitation of the present invention, but rather as a more detailed description of certain aspects, features, and embodiments of the present invention.
[0060] It should be understood that the terminology used in this invention is merely for describing particular embodiments and is not intended to limit the invention. Furthermore, with respect to numerical ranges in this invention, it should be understood that each intermediate value between the upper and lower limits of the range is also specifically disclosed. Every smaller range between any stated value or intermediate value within a stated range, and any other stated value or intermediate value within said range, is also included in this invention. The upper and lower limits of these smaller ranges may be independently included or excluded from the range.
[0061] Unless otherwise stated, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art. While only preferred methods and materials have been described herein, any methods and materials similar or equivalent to those described herein may be used in the implementation or testing of this invention. All references to this specification are incorporated by way of citation to disclose and describe methods and / or materials associated with those references. In the event of any conflict with any incorporated reference, the content of this specification shall prevail.
[0062] Various modifications and variations can be made to the specific embodiments described in this specification without departing from the scope or spirit of the invention, as will be apparent to those skilled in the art. Other embodiments derived from this specification will also be readily apparent to those skilled in the art. This application specification and embodiments are merely exemplary.
[0063] The terms “include,” “including,” “have,” “contain,” etc., used in this article are all open-ended terms, meaning that they include but are not limited to.
[0064] Unless otherwise specified, the term "parts" in this invention refers to parts by weight.
[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 molecular-property relationship diagram.
[0069] Molecules and properties are used as nodes. Edges are determined based on the relationship between molecules and properties, and the type of an edge is determined by the label of the molecule on that property. If a molecule is labeled as having 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 edge for unknown property is created. Therefore, the molecule-property relationship graph is defined as G = (V, T, E, B), where V and T represent the sets of molecule i and property τ, respectively, E = {(i, τ) | i ∈ V, τ ∈ T} encompasses the information of molecules and properties, and the edge weight set B = {b i,τ |(i,τ)∈E} denotes 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 molecular information.
[0070] Constructing a knowledge-guided molecular property relationship graph module:
[0071] S2: Construct a knowledge-guided molecular property relationship diagram based on the molecular-property relationship diagram.
[0072] S2.1: Calculate the similarity of the molecular skeleton.
[0073] Based on existing molecular-property relationship diagrams, the molecular structure is processed using the open-source cheminformatics software toolkit RDKit to extract the molecular skeleton. Morgan fingerprints and MACCSkeys fingerprints of the molecular skeleton are extracted, and the 2048-bit Morgan fingerprint and 166-bit MACCSkeys fingerprint are merged into a 2214-bit binary vector to generate the molecular skeleton fingerprint. The proportion of identical skeleton fingerprints between two molecules to the total number of molecular skeleton fingerprints is calculated, and this ratio is used as the skeleton similarity between molecules. The molecular skeleton similarity S is... Sca The calculation method for (i,j) is as follows:
[0074]
[0075] Among them, SF i and SF j Defined as a skeletal fingerprint of two molecules, where each bit indicates the presence or absence of a specific structural feature, SF i and The dot product represents the number of structural features shared by two molecules, reflecting their similarity in molecular skeleton structure.
[0076] S2.2: Calculate the similarity of functional groups.
[0077] Based on existing molecule-property relationship diagrams, RDKit is used to process chemical molecular structures and extract functional group information within molecules. A 49-bit binary vector is created, with each bit corresponding to one of the functional groups defined by RDKit, indicating the presence of this functional group in the molecule's structure, thus generating a functional group fingerprint. The proportion of identical functional group fingerprints between two molecules is calculated to represent the total number of functional group fingerprints, and this proportion is used as the functional group similarity between molecules i and j, as shown in the following formula:
[0078]
[0079] Among them, GF i and GF j Fingerprints representing functional groups of two molecules.
[0080] S2.3: Construct a knowledge-guided molecular property relationship diagram.
[0081] By utilizing both molecular skeleton and functional group similarity, a molecular-property multi-relationship graph is constructed to integrate information about molecules and properties. Where C and T are the sets of nodes for molecules and properties, and the relation set R contains multiple relations between molecules and between molecules and properties; since the knowledge-guided molecule-property multi-relationship graph contains multiple types of relations and has strong heterogeneity, traditional graph neural networks are difficult to apply directly to such complex graph structures. To address this challenge, the subgraph is regarded as a multigraph composed of multiple relation-specific layer graphs. The relationship-specific layer includes the skeleton similarity layer G. Sca Functional group similarity layer G Gro and property layer G Pro Each layer of the graph contains supernodes that cross relationships.
[0082] Auxiliary task sampling and subgraph reconstruction:
[0083] Step S3: Extract subgraphs based on the selected target task and obtain subgraph representations.
[0084] Target tasks are randomly selected from the training task set. Based on the selected target tasks, paired subgraphs containing the target properties are extracted from the knowledge-guided molecular-property multi-relationship graph. τ In this process, it is ensured that each subgraph contains 2K supporting molecules, one query molecule, and one target property, meaning that the subgraph contains a total of 2K+2 nodes. A small-sample molecular property prediction model is constructed, which includes graph neural networks and multilayer perceptrons. Molecular encoders, embedding layers, and RBF functions are used to initialize node embeddings. and edge embedding h i,jThe nodes are updated using a graph neural network. For each relation layer, the node embedding is updated as follows:
[0085]
[0086] in Let N(i) represent the embedding of node i after the l-th iteration, and N(i) represent the set of neighboring nodes of node i. Graph neural networks are used to obtain the node embeddings for the property-skeleton similarity layers. and node embedding of the property-functional group similarity layer And calculate the embedding z of molecule i. i :
[0087]
[0088] Similarly, the embedding of the target property τ can be obtained z. τ Obtaining target property subgraph representations based on subgraphs The formula is as follows:
[0089]
[0090] In step S4, sampling is performed using an auxiliary task sampler to obtain auxiliary tasks that are highly related to the target task, and a subgraph with richer relationships is reconstructed.
[0091] S4.1: Calculate the sampling probability of the auxiliary task.
[0092] The candidate auxiliary property graph representation can be obtained from formula (5). By representing the target property graph and candidate auxiliary property graph representation Perform a concatenation operation and use an auxiliary task sampler to predict the probability of each candidate auxiliary property being selected:
[0093]
[0094] Where f ψ It is a function composed of multilayer sensing mechanisms. This indicates a vector concatenation operation.
[0095] S4.2: Based on the probabilities obtained in S4.1, sample the auxiliary task and reconstruct the subgraph.
[0096] Based on the calculated auxiliary task sampling probability, auxiliary tasks highly correlated with the target task are sampled to obtain N. a We can use these auxiliary properties to reconstruct a more relationally rich subgraph by incorporating them into the subgraph.
[0097] g τ =(V,{τ∪T)auxi},R,{G Sca G Gro G Pro}) (7)
[0098] Where T auxi The selected set of auxiliary tasks, R, represents the relation set; the updated subgraph contains not only 2K+2 nodes, but also N nodes. a There are 2K++2+N selected auxiliary properties, meaning the total number of subgraphs is 2K++2+N. a There are several nodes; furthermore, the auxiliary task sampler is optimized using a policy gradient approach, with the query loss value used as the reward signal R. auxi Learn how to select auxiliary tasks most relevant to the target task, and update the policy parameter ψ by maximizing expected reward. The formula for parameter update is as follows:
[0099]
[0100] lr auxi It is the learning rate of the auxiliary task sampler, b auxi This represents the average value of the dynamically calculated reward, used to stabilize the training process. This method enables the auxiliary task sampler to learn how to select auxiliary tasks more effectively, helping the model extract useful information from relevant tasks and reducing unnecessary noise.
[0101] Model optimization and property prediction:
[0102] Step S5: Based on the subgraph obtained in S4, perform small-sample molecular property prediction training, calculate the loss, update the model parameters, and improve the model's ability to quickly generalize to new models.
[0103] The molecular embedding z is obtained by encoding the updated subgraph in step 4 using formulas (3)-(5). i embedding z with target properties τ By embedding and splicing molecules and target properties, a molecule v is obtained. i Predicted label for property τ
[0104]
[0105] Where f clr It is a classifier consisting of two MLP layers; to evaluate prediction performance, the cross-entropy loss function is used to compute predicted values in the support set and query set. With real label y i,τ The difference between them is defined for the support set loss function as:
[0106]
[0107] The model is updated using the support set loss, enabling it to quickly adapt to the target task. The updated model is then used to predict the query set and calculate the query set loss, which is expressed as:
[0108]
[0109] By accumulating query set losses from different tasks, the model parameters are updated to improve the model's ability to quickly adapt to new target properties and enhance its generalization ability to new target properties.
[0110] Step S6: Use the model trained in step S5 to adapt the target property parameters, thereby obtaining a generalized model oriented towards 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, thereby verifying its performance in a small sample situation; that is, under the condition that only K positive / negative test samples are provided for each class 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 property. For a new input molecule v query It is possible to combine support sets to construct a molecular-property relationship subgraph, which is then input into a graph neural network for learning, to obtain molecular and target property representations z. query and z τ Then, a classifier is used to predict the prediction result of the input molecule.
[0114]
[0115] In summary, this invention proposes a small-sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement. This method addresses the problem that existing methods fail to capture the local similarity of molecular substructures and ignore the correlation between multiple properties of the same molecule, thus limiting model performance. This method significantly improves the accuracy and efficiency of molecular property prediction models.
[0116] This invention constructs a knowledge-guided molecular-property relationship graph to obtain the similarity between molecular skeletons and functional groups, enabling the model to more accurately capture the connections between molecules. An auxiliary task sampler is designed to sample auxiliary tasks that are highly related to the target task. Known molecular properties that are highly related to the target properties are used to assist in predicting new properties, reducing unnecessary noise and information redundancy, enhancing element representation, and improving 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 attribute graph enhancement, including a memory and one or more processors. 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 attribute graph enhancement of Embodiment 1.
[0119] Example 3
[0120] This embodiment relates to a computer-readable storage medium, characterized in that it stores a program thereon, which, when executed by a processor, implements the small-sample molecular property prediction method based on knowledge-guided molecular attribute relationship graph enhancement of Embodiment 1.
[0121] The embodiments described above are merely preferred embodiments of the present invention and are not intended to limit the scope of the present invention. Various modifications and improvements made by those skilled in the art to the technical solutions of the present invention without departing from the spirit of the present invention should fall within the protection scope defined by the claims of the present invention.
Claims
1. A small-sample molecular property prediction method based on knowledge-guided molecular attribute relationship graph enhancement, characterized in that, Includes the following steps: S1: Construct a molecular-property relationship diagram; S2: Construct a knowledge-guided molecular-property relationship diagram based on the molecular-property relationship diagram; specifically including: S2.1: Obtain the molecular skeleton similarity for each molecule-property relationship graph in the dataset, specifically as follows: Based on the existing molecule-property relationship graph, use an open-source cheminformatics software toolkit, RDKit, to process chemical molecular structures and extract key information of the molecular skeleton; merge the 2048-bit Morgan fingerprint and the 166-bit MACCSkeys into a 2214-bit binary vector to generate the molecular skeleton fingerprint, and calculate the proportion of identical skeleton fingerprints between two molecules to the total number of molecular skeleton fingerprints. This ratio is used as the skeleton similarity between molecules, measured using SF. i and SF j This represents the skeletal fingerprint of two molecules, where each bit indicates the presence or absence of a specific structural feature, SF. i and The dot product represents the number of structural features shared by two molecules, reflecting their similarity in molecular skeletal structure: S2.2: Obtain the functional group similarity of the molecular-property relationship graph in the dataset. Specifically, this includes: based on the existing molecular-property relationship graph, using RDKit to process chemical molecular structures and extract key information of functional groups; creating a binary vector of length 49, where each bit corresponds to one of the functional groups defined by RDKit, indicating whether this functional group exists in the molecular structure, thereby generating the functional group fingerprint of the molecule; using GF... i and GF j Representing the functional group fingerprints of two molecules, the proportion of fingerprints with the same functional groups in the two molecules to the total number of functional group fingerprints is calculated and used as the functional group similarity between molecules i and j: S2.3: Based on the molecular skeleton similarity and functional group similarity obtained in steps S2.1 and S2.2, a knowledge-guided molecular-property relationship graph is obtained. Specifically, this includes: using the two similarity values obtained in steps S2.1 and S2.2, and combining them with molecular and property information, a multi-relationship graph of molecular properties is constructed that includes not only molecular and property information but also the relationships between different molecules. Where V and T are sets of molecules and properties, and the relation set R covers the relationships between molecules and between molecules and properties; a subgraph is considered as a set of layer graphs composed of multiple relation-specific layer graphs. Relationship-specific layers include the skeleton similarity layer G. Sca Functional group similarity layer G Gro and property layer G Pro ; S3: Based on the enhanced graph obtained in step S2, target tasks are randomly sampled from the training task set, and subgraphs are extracted according to the selected target tasks to obtain subgraph representations; S4: Sample using the auxiliary task sampler to obtain auxiliary tasks that are highly related to the target task. Reconstruct a more complex subgraph based on the subgraph obtained in step S3 and the auxiliary tasks. S5: Based on the subgraph obtained in step S4, perform small-sample molecular property prediction training, 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, thereby obtaining a generalized model oriented towards the target property for molecular property prediction.
2. The small-sample molecular property prediction method based on knowledge-guided molecular attribute relationship graph enhancement according to claim 1, characterized in that: Step S1, which involves constructing a molecular-property relationship graph, specifically includes: using molecules and properties as nodes, and the relationships between molecules and properties as edges. The type of edge can be determined based on the label of the molecule on the property. If a molecule is labeled as having a certain property, an active edge is created between the corresponding molecule node and 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, resulting in a molecular-property relationship graph G = (V, T, E, B), where V and T represent the sets of molecule i and property τ, respectively, E encompasses the information about molecules and properties, and the edge weight set B = {b i,τ |(i,τ)∈E} denotes 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 molecular information.
3. The small-sample molecular property prediction method based on knowledge-guided molecular attribute relationship graph enhancement according to claim 1, characterized in that: Step S3, based on the enhanced graph obtained in step S2, involves randomly sampling the target task from the training task set, extracting a subgraph based on the selected target task, and obtaining the subgraph representation. Specifically, this includes: randomly sampling the target task from the training task set, determining the target property to be predicted based on the selected target task, and extracting a subgraph g containing the target property τ from the knowledge-guided molecular-property multi-relationship graph. τ In this process, it is ensured that each subgraph contains 2K supporting molecules, one query molecule, and one target property, meaning that the subgraph contains a total of 2K+2 nodes. A small-sample molecular property prediction model is constructed, which includes graph neural networks and multilayer perceptrons. Molecular encoders, embedding layers, and RBF functions are used to initialize node embeddings. and edge embedding h i,j The nodes are updated using a graph neural network. For each relation layer, the node embedding is updated as follows: in Let N(i) represent the embedding of node i after the l-th iteration, and let N(i) represent the set of neighboring nodes of node i. Graph neural networks are used to obtain the node embeddings of the property-skeleton similarity layer and the property-functional group similarity layer, respectively. and Calculate the embedding z of molecule i i : Similarly, the embedding of the target property τ can be obtained z. τ Obtaining target property subgraph representations based on subgraphs The formula is as follows:
4. The small-sample molecular property prediction method based on knowledge-guided molecular attribute relationship graph enhancement according to claim 3, characterized in that: Step S4 involves sampling using an auxiliary task sampler to obtain auxiliary tasks highly relevant to the target task. Based on the subgraph obtained in step S3 and the auxiliary tasks, a more complex subgraph is then reconstructed, specifically including: S4.1: Calculate the sampling probability of the auxiliary task, specifically including: the subgraph representation corresponding to the candidate auxiliary property can be obtained from formula (5). The target property graph representation and the candidate auxiliary property graph representation are concatenated, and then processed using a multilayer perceptron f. ψ To predict the probability of each candidate auxiliary property being selected: S4.2: Based on the probabilities obtained in step S4.1, select auxiliary tasks highly relevant to the target task. Reconstruct a more complex subgraph based on the subgraph obtained in step S3 and the auxiliary tasks. Specifically, this includes sampling the auxiliary tasks highly relevant to the target task based on the calculated sampling probabilities, obtaining N. a We can use these auxiliary properties to reconstruct a more relationally rich subgraph by incorporating them into the subgraph. g τ =(V,{τ∪T auxi },R,{G Sca ,G Gro ,G Pro }) (7) Where T auxi The selected set of auxiliary tasks, R, represents the relation set; the updated subgraph contains not only 2K+2 nodes, but also N nodes. a There are 2K+2+N selected auxiliary properties, meaning the total number of subgraphs is 2K+2+N. a The updated subgraph contains not only direct information about the target task but also information about the auxiliary tasks. Furthermore, the auxiliary task sampler is optimized using policy gradients to learn how to select auxiliary tasks highly relevant to the target task. The value of the query set loss based on the current target property is used as the reward signal R. auxi Set the learning rate lr for the auxiliary task sampler auxi And dynamically calculate the average reward b auxi The policy parameter ψ is updated by maximizing the expected reward, and the formula for parameter update is as follows:
5. The small-sample molecular property prediction method based on knowledge-guided molecular attribute relationship graph enhancement according to claim 4, characterized in that: Using formulas (3)-(5), the updated subgraphs in step S4 are encoded to obtain the molecular embedding z. i and property embedding z τ The molecules and properties are embedded and spliced together, and then passed through a classifier consisting of two MLP layers. clr The process is performed to obtain the predicted value of the target property. To evaluate prediction performance, the cross-entropy loss function is used to compute the predicted values in the support set and query set. With real label y i,τ The difference between them, the support set of the target property τ using S τ This means that the support set loss function is defined as follows: The model is updated using the loss from the support set, allowing it to quickly adapt to the target task. The updated model is then used to predict the query set and calculate its loss. Query sets with target property τ are represented by Q. τ The query set loss function is expressed as: By accumulating query set losses from different tasks, the model parameters are updated to improve the model's ability to quickly adapt to new target properties and enhance its generalization ability to new target properties.
6. The small-sample molecular property prediction method based on knowledge-guided molecular attribute relationship graph enhancement according to claim 1, characterized in that: Step S6 describes using the model trained in step S5 to adapt the target property parameters, thereby obtaining a generalized model oriented towards the target property for molecular property prediction. Specifically, this includes adapting the trained model to the target property parameters, that is, fine-tuning the model using the support set loss function under the condition that there are only K positive / negative test samples for each category of the target task, thereby obtaining a generalized model oriented towards the target property, which can accurately predict the target property on the new task.
7. A small-sample molecular property prediction device based on knowledge-guided molecular attribute relationship graph enhancement, characterized in that, The method includes a memory and one or more processors, wherein the memory stores executable code, and the one or more processors execute the executable code to implement the knowledge-guided molecular property relationship graph-enhanced small sample molecular property prediction method according to any one of claims 1-6.
8. A computer-readable storage medium, characterized in that, It stores a program that, when executed by a processor, implements the small-sample molecular property prediction method based on knowledge-guided molecular property relationship graph enhancement as described in any one of claims 1-6.
Citation Information
Patent Citations
Small sample molecule property prediction method based on hybrid relation network
CN116580782A
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