Attribute prediction model training method and device, computer equipment and storage medium
By maximizing the first mutual information and minimizing the second mutual information, the problem of inaccurate prediction in the prior art is solved, and more accurate learning and prediction of molecular structure and attribute relationships are achieved.
Patent Information
- Application Number
- CN202410116040.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-26
- Publication Date
- 2025-07-29
AI Technical Summary
The existing attribute prediction model can only obtain local optimal solutions and cannot accurately reflect the structure that determines the molecular attributes, resulting in inaccurate predictions.
The first sub-map is extracted from the topological map of the sample molecules through the attribute prediction model, maximizing the first mutual information and minimizing the second mutual information to train the model so that it can accurately learn the relationship between the molecular structure and the attributes.
The accuracy of the attribute prediction model is improved, so that it can accurately predict the properties of a molecule and output the molecular structure that determines the attribute, providing a more accurate basis for explaining the molecular properties.
Smart Images

Figure CN120388647A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and particularly to a method, apparatus, computer device, and storage medium for training an attribute prediction model. Background Art
[0002] In drug design, it is usually required that drug molecules need to meet specific attributes, such as water solubility, affinity for specific proteins, etc. This requires adding the molecular structure that determines this attribute to the designed drug. In the prior art, an attribute prediction model is used to predict the attributes of molecules and output the molecular structure that determines this attribute. How to improve the performance of the attribute prediction model is the focus of research in this field.
[0003] Currently, the commonly adopted method is: using the topological graph corresponding to the molecule as the input of the attribute prediction model. The attribute prediction model mainly finds a subgraph of the input topological graph and makes the predicted attribute based on this subgraph the same as the attribute to be detected. Then, this subgraph is output to explain that the structure corresponding to this subgraph in the molecule determines that the molecule has this attribute.
[0004] However, in the above technical solution, only a local optimal solution can be obtained, and the optimal subgraph cannot be obtained. For example, the finally determined subgraph only has the same predicted attribute as this attribute because it contains the structure that determines this attribute, but this subgraph cannot accurately reflect the structure that determines this attribute. That is, the molecular structure predicted by the attribute prediction model to determine this attribute is not accurate. Summary of the Invention
[0005] Embodiments of this application provide a method, apparatus, computer device, and storage medium for training an attribute prediction model, which can more precisely learn the relationship between the molecular structure and the attribute, so that the trained attribute prediction model can accurately predict the attributes possessed by the molecule and output the molecular structure that determines this attribute. The technical solution is as follows:
[0006] On the one hand, a method for training an attribute prediction model is provided. The method includes:
[0007] Sampling the topological graph of the sample molecule through an attribute prediction model to obtain a first subgraph. The topological graph includes multiple nodes and multiple edges. Each node is used to represent an atom in the sample molecule, and each edge is used to represent the connection relationship between the atoms corresponding to the nodes at both ends of the edge;
[0008] Based on the first sub-graph and the reference attributes, the property prediction model determines the first mutual information. The reference attributes are the attributes possessed by the sample molecule. The first mutual information is used to represent the correlation degree between the first sub-graph and the reference attributes, and the first mutual information is related to the attributes predicted by the property prediction model based on the first sub-graph.
[0009] Based on the first sub-graph and the topological graph, the property prediction model determines the second mutual information. The second mutual information is used to represent the correlation degree between the first sub-graph and the topological graph.
[0010] The property prediction model is trained with the goal of maximizing the first mutual information and minimizing the second mutual information.
[0011] On the other hand, a training device for a property prediction model is provided. The device includes:
[0012] A sampling module, which is used to sample the topological graph of the sample molecule through the property prediction model to obtain a first sub-graph. The topological graph includes multiple nodes and multiple edges. Each node is used to represent an atom in the sample molecule, and each edge is used to represent the connection relationship between the atoms corresponding to the nodes at both ends of the edge.
[0013] A first determination module, which is used to determine the first mutual information based on the first sub-graph and the reference attributes through the property prediction model. The reference attributes are the attributes possessed by the sample molecule. The first mutual information is used to represent the correlation degree between the first sub-graph and the reference attributes, and the first mutual information is related to the attributes predicted by the property prediction model based on the first sub-graph.
[0014] A second determination module, which is used to determine the second mutual information based on the first sub-graph and the topological graph through the property prediction model. The second mutual information is used to represent the correlation degree between the first sub-graph and the topological graph.
[0015] A first training module, which is used to train the property prediction model with the goal of maximizing the first mutual information and minimizing the second mutual information.
[0016] In some embodiments, the sampling module includes:
[0017] An extraction unit, which is used to extract features of multiple nodes in the topological graph of the sample molecule through the property prediction model to obtain node features of the multiple nodes. Each node contains attribute information of the corresponding atom, and each node feature is used to represent the atomic feature of the corresponding atom.
[0018] A first determination unit, configured to determine a sampling probability of any edge in the topology graph based on node features corresponding to nodes at both ends of the edge.
[0019] A sampling unit, configured to sample the topology graph of the sample molecule based on the sampling probabilities of the multiple edges in the topology graph to obtain the first sub-graph.
[0020] In some embodiments, the extraction unit is configured to, for any node in the multiple nodes, extract features of attribute information in the node through the attribute prediction model to obtain an initial node feature of the node; aggregate the initial node feature of the node and the initial node features of neighbor nodes of the node to obtain a node feature of the node, where the neighbor nodes are nodes having a connection relationship with the node.
[0021] In some embodiments, the first determination unit is configured to, for any edge in the topology graph, use an attention mechanism to determine an intermediate probability of the edge based on node features corresponding to nodes at both ends of the edge; process the intermediate probability of the edge through a reparameterized sampling method to obtain the sampling probability of the edge.
[0022] In some embodiments, the first determination module includes:
[0023] A prediction unit, configured to predict the first sub-graph through the attribute prediction model to obtain a first prediction result, where the first prediction result is used to represent the possibility that the molecular structure represented by the predicted first sub-graph has the reference attribute;
[0024] A second determination unit, configured to determine the first mutual information based on a gap between the first prediction result and the reference attribute, where the first mutual information is inversely correlated with the gap.
[0025] In some embodiments, the first sub-graph includes probabilities of the multiple edges in the topology graph, the probabilities of the multiple edges in the first sub-graph are continuous values, the multiple edges in the first sub-graph include first-type edges and second-type edges, the probability of the first-type edge is the sampling probability of the edge in the topology graph, and the probability of the second-type edge is the probability of not sampling the edge in the topology graph;
[0026] The prediction unit is configured to perform multiple samplings based on the probabilities of the multiple edges in the first subgraph through the attribute prediction model to obtain multiple second subgraphs. Each second subgraph includes the probabilities of the multiple edges, the probabilities of the edges in each second subgraph are discrete values, and the probability of each edge appearing in the multiple second subgraphs is equal to the probability of the edge in the first subgraph. Predict the multiple second subgraphs respectively to obtain multiple second prediction results, where each second prediction result is used to represent the possibility that the molecular structure represented by the corresponding second subgraph obtained by prediction has the reference attribute. Average the multiple second prediction results to obtain the first prediction result.
[0027] In some embodiments, the first subgraph includes the probabilities of the multiple edges in the topological graph, the probabilities of the multiple edges in the first subgraph are continuous values, the multiple edges in the first subgraph include first-class edges and second-class edges, the probability of the first-class edges is the sampling probability of the edges in the topological graph, and the probability of the second-class edges is the probability of not sampling the edges in the topological graph.
[0028] The second determination module is configured to sum the probabilities of the multiple edges in the first subgraph through the attribute prediction model to obtain a first probability sum; sum the sampling probabilities of the multiple edges in the topological graph to obtain a second probability sum; and determine the second mutual information based on the gap between the first probability sum and the second probability sum, where the second mutual information is negatively correlated with the gap.
[0029] In some embodiments, the first subgraph includes the probabilities of the multiple edges in the topological graph, the probabilities of the multiple edges in the first subgraph are continuous values, the multiple edges in the first subgraph can be divided into first-class edges and second-class edges, the probability of the first-class edges is the sampling probability of the edges in the topological graph, and the probability of the second-class edges is the probability of not sampling the edges in the topological graph.
[0030] The second determination module is configured to perform multiple samplings based on the probabilities of the multiple edges in the first subgraph through the attribute prediction model to obtain multiple second subgraphs. Each second subgraph includes the probabilities of the multiple edges, the probabilities of the edges in each second subgraph are discrete values, and the probability of each edge appearing in the multiple second subgraphs is equal to the probability of the edge in the first subgraph. For any second subgraph, sum the probabilities of the multiple edges in the second subgraph to obtain a third probability sum; average the multiple third probability sums to obtain a fourth probability sum, where the fourth probability sum is used to represent the number of sampled edges in the first subgraph; and determine the second mutual information based on the fourth probability sum, where the second mutual information is positively correlated with the fourth probability sum.
[0031] In some embodiments, the attribute prediction model includes a first prediction network and a second prediction network. The first prediction network is configured to make a prediction based on a plurality of second subgraphs sampled from the first subgraph, and the first prediction result is the output of the first prediction network.
[0032] The apparatus further includes:
[0033] A prediction module, configured to make a prediction on the first subgraph through the second prediction network to obtain a third prediction result. The second prediction network is configured to make a prediction based on the first subgraph itself, and the third prediction result is used to represent the possibility that the molecular structure represented by the predicted first subgraph has the reference attribute.
[0034] A second training module, configured to train the second prediction network with the goal of minimizing the gap between the first prediction result and the third prediction result.
[0035] On the other hand, a computer device is provided. The computer device includes a processor and a memory. The memory is used to store at least one segment of computer program, and the at least one segment of computer program is loaded and executed by the processor to implement the training method of the attribute prediction model in the embodiments of the present application.
[0036] On the other hand, a computer-readable storage medium is provided. At least one segment of computer program is stored in the computer-readable storage medium, and the at least one segment of computer program is loaded and executed by a processor to implement the training method of the attribute prediction model as in the embodiments of the present application.
[0037] On the other hand, a computer program product is provided, including a computer program. The computer program is stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the training method of the attribute prediction model provided in the above aspects or various optional implementation manners of the above aspects.
[0038] The embodiment of the present application provides a method for training an attribute prediction model. The attribute prediction model extracts a first subgraph from the topological graph of a sample molecule, and then determines the first mutual information between the first subgraph and a reference attribute. During the model training process, the first mutual information is maximized. Since the first mutual information reflects the correlation degree between the first subgraph and the reference attribute and is related to the attribute predicted by the attribute prediction model based on the first subgraph, the attribute prediction model can increasingly accurately extract from the topological graph of the sample molecule a subgraph that can accurately reflect the reference attribute. That is, by maximizing the first mutual information, the attribute prediction model can accurately learn the molecular structure that enables the sample molecule to have the reference attribute, understand the relationship between the molecular structure and the attribute, so that the trained attribute prediction model can accurately predict the attributes possessed by the molecule according to the molecular structure. On this basis, the attribute prediction model can also be trained according to the second mutual information between the first subgraph and the topological graph, so that the correlation between the extracted first subgraph and the topological graph is as small as possible. That is, in addition to ensuring that the attribute prediction model can accurately extract the molecular structure that determines a certain attribute, the extracted molecular structure is made as small as possible, so that the attribute prediction model can more precisely learn the relationship between the molecular structure and the attribute, so that the trained attribute prediction model can accurately predict the attributes possessed by the molecule according to the molecular structure and accurately output the molecular structure that determines the attribute, providing a more accurate basis for explaining why the molecule has this attribute. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the following drawings are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0040] Figure 1 It is a schematic diagram of the implementation environment of a method for training an attribute prediction model provided by an embodiment of the present application;
[0041] Figure 2 It is a flowchart of a method for training an attribute prediction model provided by an embodiment of the present application;
[0042] Figure 3 It is a flowchart of another method for training an attribute prediction model provided by an embodiment of the present application;
[0043] Figure 4 It is a framework diagram of an attribute prediction model provided by an embodiment of the present application;
[0044] Figure 5It is a block diagram of a training device for an attribute prediction model provided according to an embodiment of the present application;
[0045] Figure 6 It is a block diagram of another training device for an attribute prediction model provided according to an embodiment of the present application;
[0046] Figure 7 It is a block diagram of a terminal structure provided according to an embodiment of the present application;
[0047] Figure 8 It is a schematic diagram of a server structure provided according to an embodiment of the present application. Detailed implementation manners
[0048] To make the objectives, technical solutions, and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0049] In the present application, terms such as "first" and "second" are used to distinguish identical or similar items with basically the same functions and effects. It should be understood that there is no logical or temporal dependency between "first", "second", and "nth", nor are the quantity and execution order limited.
[0050] In the present application, the term "at least one" means one or more, and the meaning of "multiple" means two or more.
[0051] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data for analysis, stored data, displayed data, etc.), and signals involved in the present application are all authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant laws, regulations, and standards of relevant countries and regions. For example, the sample molecules involved in the present application are obtained under full authorization.
[0052] For the convenience of understanding, the terms related to the present application are explained below.
[0053] Artificial Intelligence (AI) is a theory, method, technology, and application system that uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science. It attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a way similar to human intelligence. Artificial intelligence also studies the design principles and implementation methods of various intelligent machines to enable the machines to have the functions of perception, reasoning, and decision-making.
[0054] Artificial intelligence technology is a comprehensive discipline with a wide range of fields involved, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, pre-trained model technology, operation / interaction systems, mechatronics, etc. Among them, the pre-trained model, also known as the large model or the foundation model, can be widely applied to downstream tasks in various directions of artificial intelligence after fine-tuning. The software technologies of artificial intelligence mainly include several major directions such as computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0055] Machine Learning (ML): It is an interdisciplinary subject involving multiple fields such as probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize the existing knowledge structure to continuously improve their own performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent, and its applications cover all fields of artificial intelligence. Machine learning and deep learning usually include technologies such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and rote learning. The pre-trained model is the latest development result of deep learning, integrating the above technologies.
[0056] Pre-Training Model (PTM): Also known as the foundation model or large model, it refers to a deep neural network (DNN) with a large number of parameters. It is trained on a large amount of unlabeled data, and uses the function approximation ability of the large-parameter DNN to enable the PTM to extract common features from the data. Through techniques such as fine-tuning, state-of-the-art parameter-efficient fine-tuning (PEFT), and prompt-tuning, it is applicable to downstream tasks. Therefore, the pre-training model can achieve ideal results in few-shot or zero-shot scenarios. PTMs can be classified into language models, vision models, speech models (VALL-E), and multimodal models according to the data modalities they process. Among them, language models can be ELMO (Embeddings from Language Models), BERT (Bidirectional Encoder Representations from Transformers), or GPT (Generative Pre-trained Transformer). Vision models can be swin-transformer, ViT (Vision Transformer), V-MOE (Vision Mixture of Experts). Multimodal models refer to models that establish feature representations of two or more data modalities. The pre-training model is an important tool for outputting artificial intelligence generated content (AIGC) and can also be used as a general interface connecting multiple specific task models. Multimodal models can be ViBERT (Vision-and-Language Bidirectional Encoder Representations from Transformers), CLIP (Contrastive Language-Image Pre-training), Flamingo, or Gato models, etc. The training of the attribute prediction model provided in the embodiments of this application can be applied to the above process of the pre-training model.
[0057] Model Compression and Quantization: It refers to using compression and quantization techniques to help reduce the model size and accelerate model inference, thereby reducing the costs of model storage and computing. Model compression usually includes pruning, low-rank decomposition, knowledge distillation, etc. Model quantization refers to converting the floating-point parameters in the model into fixed-point or integer parameters to reduce the model size and accelerate model inference. In the training method of the attribute prediction model provided in the embodiments of this application, knowledge distillation can be used for compression and quantization.
[0058] Graph Neural Network: It refers to a neural network whose input is graph data containing points and edges and performs predictions. The attribute prediction model in the embodiments of this application is a graph neural network. The input of the attribute prediction model is the topological graph of a molecule. The topological graph includes multiple nodes and multiple edges. Each node is used to represent an atom in the molecule. Each edge is used to represent the connection relationship between the atoms corresponding to the nodes at both ends of the edge. The attribute prediction model predicts the attributes of the molecule based on the topological graph of the molecule.
[0059] Interpretable Graph Neural Network: It refers to a graph neural network that can output a subgraph of the input graph data as the basis for prediction in addition to the prediction output. In the embodiments of this application, the attribute prediction model can output a subgraph corresponding to a partial structure in the molecule while outputting the predicted attribute to explain why the molecule has this attribute.
[0060] Multilinear Extension: It refers to extending a function for discrete inputs to continuous inputs.
[0061] Subgraph Multilinear Extension: It refers to extending a graph neural network for discrete subgraph inputs to a graph neural network for continuous subgraph inputs, where the continuous subgraph refers to a subgraph distribution. In the embodiments of this application, the first subgraph can be extended into multiple second subgraphs. The first subgraph refers to a continuous subgraph where the probability of the edge is a continuous value. The second subgraph refers to a discrete subgraph where the probability of the edge is a discrete value.
[0062] The training method of the attribute prediction model provided in the embodiments of this application can be executed by a computer device. In some embodiments, the computer device is a terminal or a server. First, taking the computer device as a server as an example, the implementation environment of the training method of the attribute prediction model provided in the embodiments of this application will be introduced. Figure 1 It is a schematic diagram of the implementation environment of a training method of an attribute prediction model provided according to the embodiments of this application. Refer to Figure 1, the implementation environment includes a terminal 101 and a server 102. The terminal 101 and the server 102 can be directly or indirectly connected through wired or wireless communication methods, and this application does not limit this here.
[0063] In some embodiments, the terminal 101 is a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, a smart voice interaction device, a smart home appliance, a vehicle-mounted terminal, etc., but is not limited thereto. An application program that supports molecular detection runs on the terminal 101. This application program can be a medical application program or a detection application program, and the embodiments of this application do not limit this. Schematically, the terminal 101 is a terminal used by a user. The terminal 101 can send the structural information of the sample molecule to the server 102. The structural information of the sample molecule can include information such as the positions of the atoms on the sample molecule on the sample molecule, the attributes of the atoms on the sample molecule, and the structure of the atoms.
[0064] Those skilled in the art can know that the number of the above terminals can be more or less. For example, the above terminal can be only one, or the above terminals are dozens or hundreds, or a larger number. The embodiments of this application do not limit the number and device type of the terminals.
[0065] In some embodiments, the server 102 is an independent physical server, and can also be a server cluster or a distributed system composed of multiple physical servers, and can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), big data, and artificial intelligence platforms. The server 102 is used to provide background services for the application program that supports molecular detection. The server 102 can construct a topological graph of the sample molecule according to the structural information of the sample molecule. Then, the server 102 trains the attribute prediction model according to the topological graph of the sample molecule. In some embodiments, the server 102 undertakes the main computing work, and the terminal 101 undertakes the secondary computing work; or, the server 102 undertakes the secondary computing work, and the terminal 101 undertakes the main computing work; or, the server 102 and the terminal 101 adopt a distributed computing architecture for collaborative computing.
[0066] Figure 2 is a flowchart of a method for training an attribute prediction model provided by an embodiment of this application. Refer to Figure 2 , in the embodiments of this application, it is described by taking the execution by the server as an example. The method for training the attribute prediction model includes the following steps:
[0067] 201. The server samples the topological graph of the sample molecule through an attribute prediction model to obtain a first sub-graph. The topological graph includes multiple nodes and multiple edges. Each node is used to represent an atom in the sample molecule, and each edge is used to represent the connection relationship between the atoms corresponding to the nodes at both ends of the edge.
[0068] In the embodiments of the present application, the attribute prediction model is a graph neural network, and the embodiments of the present application do not limit this. The sample molecule can be artificially synthesized or already exist in nature, and the embodiments of the present application do not limit the structure of the sample molecule. The sample molecule includes multiple atoms. The structure information of the sample molecule includes information such as the atoms in the sample molecule, the connection relationship between the atoms, and the attributes of the atoms. The server constructs the topological graph of the sample molecule according to the structure information of the sample molecule. Alternatively, the topological graph of the sample molecule can also be constructed by the terminal, and the embodiments of the present application do not limit this. After the server obtains the topological graph of the sample molecule, it samples the edges in the topological graph of the sample molecule through the attribute prediction model to obtain a first sub-graph.
[0069] 202. The server determines a first mutual information through the attribute prediction model based on the first sub-graph and a reference attribute. The reference attribute is an attribute possessed by the sample molecule, and the first mutual information is used to represent the degree of correlation between the first sub-graph and the reference attribute. The first mutual information is related to the attribute predicted by the attribute prediction model based on the first sub-graph.
[0070] In the embodiments of the present application, the server predicts the first sub-graph through the attribute prediction model to obtain a predicted attribute. Then, the server determines the first mutual information based on the predicted attribute and the reference attribute. The reference attribute is an attribute that the sample molecule truly possesses. The predicted attribute is an attribute predicted based on the molecular structure represented by the first sub-graph. The server can use the reference attribute as a reference to determine whether the molecular structure represented by the first sub-graph is a factor that determines that the sample molecule possesses the reference attribute. That is, the closer the predicted attribute obtained based on the first sub-graph is to the reference attribute, the greater the possibility that the molecular structure represented by the first sub-graph is a factor that determines that the sample molecule possesses the reference attribute. That is, the higher the degree of correlation between the first sub-graph and the reference attribute (the greater the first mutual information). The greater the gap between the predicted attribute obtained based on the first sub-graph and the reference attribute, the smaller the possibility that the molecular structure represented by the first sub-graph is a factor that determines that the sample molecule possesses the reference attribute. That is, the lower the degree of correlation between the first sub-graph and the reference attribute (the smaller the first mutual information).
[0071] 203. The server determines a second mutual information through the attribute prediction model based on the first sub-graph and the topological graph. The second mutual information is used to represent the degree of correlation between the first sub-graph and the topological graph.
[0072] In the embodiments of the present application, the server calculates the similarity between the first subgraph and the topological graph through an attribute prediction model to obtain the second mutual information. The larger the second mutual information is, the higher the correlation degree between the first subgraph and the topological graph is. That is, the greater the similarity between the first subgraph and the topological graph is. The smaller the second mutual information is, the lower the correlation degree between the first subgraph and the topological graph is. That is, the smaller the similarity between the first subgraph and the topological graph is. Since the topological graph of the sample molecule is unchanged and the first subgraph is a subgraph extracted from the topological graph, the greater the similarity between the first subgraph and the topological graph is, the larger the first subgraph is; the smaller the similarity between the first subgraph and the topological graph is, the smaller the first subgraph is.
[0073] 204. The server trains the attribute prediction model with the goal of maximizing the first mutual information and minimizing the second mutual information.
[0074] In the embodiments of the present application, during the process of training the attribute prediction model, the server gradually increases the first mutual information so that the first subgraph extracted from the topological graph is more and more relevant to the reference attribute. That is, as the training process of the attribute prediction model progresses, the attribute prediction model can more and more accurately extract the subgraph that determines the reference attribute from the topological graph. During the process of training the attribute prediction model, the server can also gradually reduce the second mutual information so that the first subgraph extracted from the topological graph is less and less relevant to the topological graph. That is, as the training process of the attribute prediction model progresses, on the premise of ensuring that the attribute prediction model can accurately extract the subgraph that determines the reference attribute, the extracted subgraph becomes smaller and smaller. In other words, as the training process of the attribute prediction model progresses, the subgraph extracted by the attribute prediction model that determines the reference attribute becomes more and more accurate, so that the trained attribute prediction model can accurately predict the attributes of the molecule and accurately output the partial molecular structure (subgraph) that determines the attribute to explain why the molecule has this attribute.
[0075] An embodiment of the present application provides a method for training an attribute prediction model. The attribute prediction model extracts a first subgraph from the topological graph of a sample molecule, and then determines the first mutual information between the first subgraph and a reference attribute. During the model training process, the first mutual information is maximized. Since the first mutual information reflects the correlation degree between the first subgraph and the reference attribute and is related to the attribute predicted by the attribute prediction model based on the first subgraph, the attribute prediction model can increasingly accurately extract from the topological graph of the sample molecule a subgraph that can accurately reflect the reference attribute. That is, by maximizing the first mutual information, the attribute prediction model can accurately learn the molecular structure that enables the sample molecule to have the reference attribute, understand the relationship between the molecular structure and the attribute, so that the trained attribute prediction model can accurately predict the attributes possessed by the molecule according to the molecular structure. On this basis, the attribute prediction model can also be trained according to the second mutual information between the first subgraph and the topological graph, so that the correlation between the extracted first subgraph and the topological graph is as small as possible. That is, in addition to ensuring that the attribute prediction model can accurately extract the molecular structure that determines a certain attribute, the extracted molecular structure is made as small as possible, so that the attribute prediction model can more precisely learn the relationship between the molecular structure and the attribute, so that the trained attribute prediction model can accurately predict the attributes possessed by the molecule according to the molecular structure and accurately output the molecular structure that determines the attribute, providing a more accurate basis for explaining why the molecule has this attribute.
[0076] Figure 3 is a flowchart of another method for training an attribute prediction model provided by an embodiment of the present application. Refer to Figure 3 , and in the embodiment of the present application, it is described by taking the execution by a server as an example. The method for training the attribute prediction model includes the following steps:
[0077] 301. The server extracts features of multiple nodes in the topological graph of the sample molecule through the attribute prediction model to obtain node features of the multiple nodes. The topological graph includes multiple nodes and multiple edges. Each node is used to represent an atom in the sample molecule, and each edge is used to represent the connection relationship between the atoms corresponding to the nodes at both ends of the edge. Each node contains attribute information of the corresponding atom, and each node feature is used to represent the atomic feature of the corresponding atom.
[0078] In the embodiments of the present application, the server can convert the structural information of the sample molecule into a topological graph through RDKit (an open-source toolkit for chemoinformatics). Among them, the server constructs multiple nodes in the topological graph according to the atoms in the sample molecule. The server constructs multiple edges in the topological graph according to the chemical bonds between the atoms in the sample molecule. That is, each node in the topological graph is used to represent an atom in the sample molecule, and each edge is used to represent the chemical bond (connection relationship) between the atoms corresponding to the nodes at both ends of the edge. For any node in the topological graph, the node contains the attribute information of the corresponding atom. The attribute information can include structural attributes and functional attributes. The structural attributes are used to reflect the structure of the atom, and can be information such as atomic number, formal charge of the atom, and position of the atom. The embodiments of the present application do not limit this. The functional attributes are used to reflect the function of the atom, and can be water solubility, affinity with a certain molecule, etc. The embodiments of the present application do not limit this. For any node in the topological graph, the server extracts features from the attribute information of the atom contained in the node through an attribute prediction model to obtain the node features of the node.
[0079] In some embodiments, the server can use the attribute prediction model to process the topological structure and atomic-level features of the molecule through multiple rounds of message passing and feature aggregation, so as to generate a comprehensive representation for each atom, that is, node features. Accordingly, the process of the server extracting features from multiple nodes in the topological graph of the sample molecule through the attribute prediction model to obtain the node features of the multiple nodes includes: for any node among the multiple nodes, the server extracts features from the attribute information in the node through the attribute prediction model to obtain the initial node features of the node. Then, the server aggregates the initial node features of the node and the initial node features of the neighboring nodes of the node to obtain the node features of the node. The neighboring nodes are the nodes having a connection relationship with the node. The embodiments of the present application do not limit the number of neighboring nodes of the node. The solution provided by the embodiments of the present application is such that since the attributes of the molecule not only depend on the features of each atom, but also are affected by the connection relationship between the atoms, for any node, the node features of the node and the node features of the neighboring nodes can be aggregated together to obtain the final features of the node, so that the node features of the node can accurately reflect the role of the corresponding atom in the sample molecule, providing a guarantee for subsequently sampling a subgraph that can determine the reference attributes from the topological graph.
[0080] In the process of aggregating features in any round, for any node, the server can perform a weighted sum of the node features of the adjacent nodes of the node to obtain the neighboring features of the node. Then, the server concatenates the neighboring features of the node and the node features (the node features obtained in the previous round) of the node to obtain the node features of the node in the current round.
[0081] In some embodiments, the server may calculate the neighbor features of the current node through the following formula (1).
[0082] Formula (1):
[0083]
[0084] Wherein, v is used to represent the current node; u is used to represent the neighbor node of the current node; N(v) is used to represent the set of neighbor nodes of the current node; AGGREGATE is used to represent an aggregation function for weighted summation of the node features to be calculated; is used to represent the neighbor features of the current node in the process of the k-th round of aggregated features; is used to represent the node features of the neighbor node u in the process of the (k - 1)-th round of aggregated features.
[0085] In some embodiments, the server may calculate the node features of the current node through the following formula (2).
[0086] Formula (2):
[0087]
[0088] Wherein, is used to represent the node features of the current node in the process of the (k - 1)-th round of aggregated features; is used to represent the neighbor features of the current node in the process of the k-th round of aggregated features; COMBINE is used to represent an aggregation function for splicing the node features to be calculated; is used to represent the node features of the current node in the process of the k-th round of aggregated features.
[0089] In some embodiments, the attribute prediction model includes a subgraph extraction network. The server extracts features of multiple nodes in the topological graph of the sample molecule through the subgraph extraction network to obtain the node features of the multiple nodes. Among them, the server inputs the training data G=(F, A) corresponding to the sample molecule into the subgraph extraction network of the attribute prediction model. F is used to represent the initial node features of multiple nodes in the topological graph of the sample molecule; A is used to represent the structural information of the sample molecule, which may be an adjacency matrix to reflect the connection relationship between atoms in the sample molecule.
[0090] 302. For any edge in the topological graph, the server determines the sampling probability of the edge based on the node features corresponding to the nodes at both ends of the edge.
[0091] In the embodiments of the present application, the server may calculate the sampling probability of each edge based on the node features corresponding to the nodes at both ends of the edge through an attention mechanism. The sampling probability of an edge refers to the probability of extracting the edge from the topological graph as an edge in the first subgraph. The non-sampling probability of an edge refers to the probability of not extracting the edge from the topological graph as an edge in the first subgraph.
[0092] In some embodiments, the server may adopt a reparameterized sampling method to make the sampling probability of the edge differentiable, which is conducive to the gradient backpropagation and training during the model training process. Correspondingly, for any edge in the topological graph, the process by which the server determines the sampling probability of the edge based on the node features corresponding to the nodes at both ends of the edge includes: for any edge in the topological graph, the server uses an attention mechanism to determine the intermediate probability of the edge based on the node features corresponding to the nodes at both ends of the edge. Then, the server processes the intermediate probability of the edge based on the reparameterized sampling method to obtain the sampling probability of the edge. The reparameterized sampling method may be the Gumbel-Softmax method, and the embodiments of the present application do not limit this.
[0093] In some embodiments, the server may calculate the intermediate probability of the edge through the following formula three.
[0094] Formula three:
[0095]
[0096] where a u,v is used to represent the intermediate probability of the edge (u, v) between node u and node v; sigmod is used to represent a normalization function; MLP is used to represent a multi-layer perceptron; is used to represent the node feature of node u after the k-th round of aggregated features; is used to represent the node feature of node v after the k-th round of aggregated features.
[0097] Then, the server may calculate the sampling probability of the edge through the following formula four.
[0098] Formula four:
[0099]
[0100] where p u,v is used to represent the sampling probability of the edge (u, v); a u,v is used to represent the intermediate probability of the edge (u, v) between node u and node v; z u,b is a value sampled from a Gumbel(0, 1) distribution; t is used to represent the temperature of the softmax function and may be 1, and the embodiments of the present application do not limit this.
[0101] 303. The server samples the topological graph of the sample molecule based on the sampling probabilities of multiple edges in the topological graph to obtain a first sub-graph.
[0102] In an embodiment of the present application, the server performs Bernoulli random sampling on the topological graph of the sample molecule based on the sampling probabilities of multiple edges in the topological graph to obtain a first sub-graph. The first sub-graph includes a first type of edge and a second type of edge. The first type of edge refers to the edge sampled from the topological graph. The probability of the first type of edge in the first sub-graph is the sampling probability of this edge in the topological graph. The second type of edge refers to the edge not sampled in the topological graph. The probability of the second type of edge in the first sub-graph is equal to 1 minus the sampling probability of this edge in the topological graph, that is, the probability of not sampling this edge.
[0103] In some embodiments, the server can obtain the representation of the first sub-graph through the following formula five.
[0104] Formula five:
[0105]
[0106] Wherein, is the representation of the first sub-graph, which can be regarded as the probability distribution of multiple edges in the first sub-graph; G is used to represent the topological graph of the sample molecule; is used to represent the first sub-graph; e is used to represent an edge; p e is used to represent the sampling probability of edge e; is used to represent the edge in the first sub-graph; is used to represent the edge not in the first sub-graph; Π is used to represent the product. That is, the first includes the probabilities of multiple edges in the topological graph. The probabilities of multiple edges in the first sub-graph are continuous values. The multiple edges in the first sub-graph include the first type of edge and the second type of edge In the first sub-graph, the probability of the first type of edge is the sampling probability of the edge in the topological graph; the probability of the second type of edge is the probability of not sampling this edge in the topological graph, that is, 1 minus the sampling probability of the edge.
[0107] For example, the topological graph includes edge a, edge b, edge c, and edge d. The sampling probabilities of edge a, edge b, edge c, and edge d are a1, b1, c1, and d1 respectively. If the attribute prediction model extracts edge a, edge b, and edge c from the topological graph as the edges in the first sub-graph, then the first sub-graph can be represented by a1 * b1 * c1 * (1 - d1). Edge a, edge b, and edge c are the first type of edge. Edge d is the second type of edge. (1 - d1) is the probability of not extracting (sampling) edge d. That is, in the first sub-graph, (1 - d1) is the probability of edge d. In other words, the first type of edge is used to represent the edge sampled from the topological graph, and the second type of edge is used to represent the edge not sampled from the topological graph.
[0108] 304. The server determines the first mutual information based on the first subgraph and the reference attribute through the attribute prediction model. The reference attribute is an attribute possessed by the sample molecule. The first mutual information is used to represent the correlation degree between the first subgraph and the reference attribute, and the first mutual information is related to the attribute predicted by the attribute prediction model based on the first subgraph.
[0109] In the embodiment of the present application, the server predicts the first subgraph through the attribute prediction model to obtain the first prediction result. The first prediction result is used to represent the possibility that the molecular structure represented by the predicted first subgraph has the reference attribute. Then, the server determines the first mutual information based on the gap between the first prediction result and the reference attribute. The first mutual information is inversely correlated with the gap. The greater the gap between the first prediction result and the reference attribute, the lower the correlation degree between the first subgraph and the reference attribute, that is, the smaller the first mutual information; the smaller the gap between the first prediction result and the reference attribute, the higher the correlation degree between the first subgraph and the reference attribute, that is, the larger the first mutual information.
[0110] Since the attribute prediction model is implemented by an ordinary graph neural network and can only receive discrete graph data distributions, while the first subgraph is actually a probability distribution of multiple edges in a topological graph, and each edge in the first subgraph is obtained based on the previous sampling probability. If the first subgraph with continuous edge information is directly used as the input and the information transfer process of the graph neural network is weighted with the sampling probability on each edge, it is inaccurate for any non-linear graph neural network, and thus the molecular attributes cannot be accurately predicted.
[0111] In some embodiments, the server can perform a multilinear expansion on the first subgraph to expand the first subgraph with continuous edge information into multiple second subgraphs with discrete information, so as to perform attribute analysis on the first subgraph according to the discrete multiple second subgraphs. Correspondingly, the process by which the server predicts the first subgraph through the attribute prediction model to obtain the first prediction result includes: the server performs multiple samplings based on the probabilities of multiple edges in the first subgraph through the attribute prediction model to obtain multiple second subgraphs. Then, the server predicts the multiple second subgraphs respectively to obtain multiple second prediction results. Then, the server averages the multiple second prediction results to obtain the first prediction result.
[0112] Among them, the server performs multiple samplings on the first subgraph through Monte Carlo simulation to obtain m second subgraphs The probability that each second sub - graph includes multiple edges. The probability of an edge in each second sub - graph is a discrete value. For example, the value of each edge in each second sub - graph is discretely 0 or 1. The probability that each edge appears in multiple second sub - graphs is equal to the probability of the edge in the first sub - graph. 0 is used to indicate that the edge does not exist in the second sub - graph. 1 is used to indicate that the edge exists in the second sub - graph. The server can use Straight - Through estimation to make the probability of the edge differentiable. The probability that each edge appears in multiple second sub - graphs is equal to the probability of the edge in the first sub - graph.
[0113] For example, the probabilities of edge a, edge b, edge c, and edge d in the first sub - graph are a1, b1, c1, and 1 - d1 in sequence. The server samples the first sub - graph m times through the attribute prediction model to obtain m second sub - graphs. The value of each edge in each second sub - graph is discretely 0 or 1. The probability that each edge appears in multiple second sub - graphs is equal to the probability of the edge in the first sub - graph. That is, in the m second sub - graphs, the number of occurrences of edge b / m=a1; the number of occurrences of edge b / m = b1; the number of occurrences of edge c / m = c1; the number of occurrences of edge d / m = 1 - d1.
[0114] After obtaining m discrete second sub - graphs After that, the server makes predictions on multiple second sub - graphs respectively to obtain multiple second prediction results. Each second prediction result is used to represent the possibility that the molecular structure represented by the corresponding second sub - graph obtained by prediction has the reference attribute. The solution provided in the embodiments of the present application expands the first sub - graph with continuous information into multiple discrete second sub - graphs. Since the probability of an edge in each second sub - graph is a discrete value, it can accurately reflect whether the edge exists in the second sub - graph, and there are only two cases: existence and non - existence. When predicting the second sub - graph, it is possible to accurately determine the molecular structure corresponding to the existing edge without considering the molecular structure corresponding to the non - existing edge, so as to accurately make predictions; then, since the probability that each edge appears in multiple second sub - graphs follows the probability of the edge in the first sub - graph, by averaging the prediction results corresponding to multiple second sub - graphs, it is possible to average the contribution of each edge to the prediction of the first sub - graph, so as to accurately obtain the prediction result of the first sub - graph.
[0115] Among them, the server can make predictions on each second sub - graph through the following formula six.
[0116] Formula six:
[0117]
[0118] Among them, is used to represent the second prediction result; is used to represent the second sub - graph; f cIt is used to represent the first prediction network in the attribute prediction network. The server can use the first prediction network to separately predict multiple second subgraphs and obtain multiple second prediction results.
[0119] Then, the server can aggregate the multiple second prediction results through the following formula seven.
[0120] Formula seven:
[0121]
[0122] Among them, G is used to represent the topological graph; is used to represent the second subgraph; is the representation method of the second subgraph. When the value of each edge in the second subgraph is discrete 0 or 1, e is used to represent the edge; p e is used to represent the sampling probability of edge e; is used to represent the second prediction result; is used to represent the aggregation result of multiple second prediction results. This method can better fit the distribution expectation of molecular attributes In contrast, the original solution directly uses the expected first subgraph as the input, which has a large deviation from the potential distribution expectation of molecular attributes. Then, the server can calculate the first prediction result of the first subgraph through the following formula eight.
[0123] Formula eight:
[0124]
[0125] Among them, is used to represent the second subgraph; is used to represent the second prediction result; m is used to represent the number of second subgraphs. As m increases, the accuracy of the first prediction result will be greatly improved. In the initial stage of training, emphasis is placed on training the network weights of the attribute prediction model, and the overhead of multiple subgraph samplings can be avoided. In the final stage of training, the subgraph sampling frequency can be increased to achieve better fine-tuning and obtain more accurate network weights.
[0126] In some embodiments, the attribute prediction model includes a first prediction network. The server can use the first prediction network to determine the first mutual information based on the first subgraph and the reference attribute. Among them, the first prediction network is used to make predictions according to multiple second subgraphs sampled from the first subgraph. The first prediction result is the output of the first prediction network.
[0127] 305. The server determines the second mutual information through the attribute prediction model based on the first subgraph and the topological graph. The second mutual information is used to represent the correlation degree between the first subgraph and the topological graph.
[0128] In the embodiments of the present application, the first sub-graph includes the probabilities of multiple edges in the topology graph. The probabilities of the multiple edges in the first sub-graph are continuous values. The multiple edges in the first sub-graph include the first type of edges and the second type of edges. The probability of the first type of edges is the sampling probability of the edges in the topology graph. The probability of the second type of edges is the probability of not sampling the edge in the topology graph. The server calculates the gap between the first sub-graph and the topology graph based on the probabilities of the edges in the first sub-graph through the attribute prediction model, and obtains the second mutual information.
[0129] In some embodiments, the server determines the second mutual information by calculating the sum of the probabilities of the edges in the first sub-graph and the topology graph. Accordingly, the process by which the server determines the second mutual information based on the first sub-graph and the topology graph through the attribute prediction model includes: the server sums the probabilities of the multiple edges in the first sub-graph through the attribute prediction model to obtain the first probability sum. Then, the server sums the sampling probabilities of the multiple edges in the topology graph to obtain the second probability sum. Then, the server determines the second mutual information based on the gap between the first probability sum and the second probability sum. The second mutual information is negatively correlated with the gap. That is, the server determines the second mutual information between the first sub-graph and the topology graph according to the gap between the probability sums of the first sub-graph and the topology graph. The greater the gap between the first probability sum and the second probability sum, the smaller the second mutual information; the smaller the gap between the first probability sum and the second probability sum, the greater the second mutual information. The solution provided by the embodiments of the present application can accurately determine the correlation degree between the first sub-graph and the topology graph by analyzing the gap between the sum of the probabilities of the edges in the first sub-graph and the sum of the probabilities of the edges in the topology graph, providing a guarantee for minimizing the correlation degree between the first sub-graph and the topology graph in the subsequent process to make the first sub-graph as small as possible.
[0130] For example, the topology graph includes edge a, edge b, edge c, and edge d. The sampling probabilities of edge a, edge b, edge c, and edge d are a1, b1, c1, and d1 respectively. Then the second probability sum is a1 + b1 + c1 + d1. If the attribute prediction model extracts edge a, edge b, and edge c from the topology graph as the first sub-graph, then the first probability sum = a1 + b1 + c1 + (1 - d1). The gap between the first probability sum and the second probability sum is (2d1 - 1). If fewer edges are sampled from the topology graph to form the first sub-graph, then there will be more probabilities corresponding to different edges between the first sub-graph and the topology graph, and thus the gap between the obtained probability sums gradually increases. Accordingly, the second mutual information will be smaller, the first sub-graph is smaller, and the correlation with the topology graph is less.
[0131] In some embodiments, the server determines the second mutual information by calculating the sum of the probabilities of the edges in multiple second subgraphs and the topology graph. Accordingly, the process by which the server determines the second mutual information based on the first subgraph and the topology graph through the attribute prediction model includes: The server performs multiple samplings based on the probabilities of multiple edges in the first subgraph through the attribute prediction model to obtain multiple second subgraphs. Each second subgraph includes the probabilities of multiple edges, and the probabilities of the edges in each second subgraph are discrete values. The probability of each edge appearing in multiple second subgraphs is equal to the probability of the edge in the first subgraph. Then, for any second subgraph, the server sums the probabilities of the multiple edges in the second subgraph to obtain a third probability sum. Then, the server averages the multiple third probability sums to obtain a fourth probability sum. The fourth probability sum is used to represent the number of edges sampled from the first subgraph. Then, the server determines the second mutual information based on the fourth probability sum. The second mutual information is positively correlated with the fourth probability sum. That is, since the probabilities of the edges in each second subgraph are discrete 0 or 1, summing the probabilities of the multiple edges in the second subgraph is equivalent to calculating the number of edges in each second subgraph. Then, averaging the multiple third probability sums is equivalent to estimating the number of edges in the first subgraph. The more edges there are in the first subgraph, the more edges are sampled from the topology graph, the more relevant it is to the topology graph, and the greater the second mutual information. This method can accurately determine the degree of correlation between the first subgraph and the topology graph, providing a guarantee for minimizing the degree of correlation between the first subgraph and the topology graph in the subsequent process to make the first subgraph as small as possible.
[0132] 306. The server trains the attribute prediction model with the goal of maximizing the first mutual information and minimizing the second mutual information.
[0133] In the embodiments of the present application, during the process of training the attribute prediction model, the server gradually increases the first mutual information and decreases the second mutual information, so that the first subgraph extracted from the topology graph is more and more relevant to the reference attribute and less and less relevant to the topology graph. That is, as the training process of the attribute prediction model progresses, the subgraph that determines the reference attribute extracted by the attribute prediction model becomes more and more accurate, so that the trained attribute prediction model can accurately predict the attributes of the molecule and accurately output the partial molecular structure (subgraph) that determines the attribute to explain why the molecule has this attribute.
[0134] In some embodiments, the server can represent the optimization goal during the process of training the attribute prediction model based on the following formula nine.
[0135] Formula nine:
[0136]
[0137] Among them, Y is used to represent the reference attribute; G cis used to represent the first sub-graph; G is used to represent the topological graph of the sample molecule; I(G c ; Y) is used to represent the first mutual information, and I(G c ; Y) is expected to maximize the mutual information between the recognized first sub-graph G c and the reference attribute Y; I(G c ; G) is used to represent the second mutual information, and I(G c ; G) is expected to minimize the mutual information between the recognized first sub-graph G c and the topological graph G; is used to represent I(G c ; Y) - βI(G c ; G) when it is maximized, and the first sub-graph adopted at this time can be called the key sub-graph of the topological graph of the sample molecule; β is used to represent the hyperparameter, and the embodiments of the present application do not limit this. The first mutual information and the second mutual information are linearly weighted by β to identify a minimum sufficient sub-graph of the topological graph G with respect to the reference attribute Y. The minimum sufficient sub-graph refers to the sub-graph corresponding to the minimum molecular structure that can determine the reference attribute.
[0138] In some embodiments, during the process of optimizing the above optimization objective, the server can maximize the first mutual information based on the following formula ten.
[0139] Formula ten:
[0140]
[0141] wherein, G is used to represent the topological graph of the sample molecule; D tr is used to represent the training data; |D tr | is used to represent the number of sample molecules in the training data; is used to represent the predicted attribute (the first prediction result); Y is used to represent the reference attribute. That is, for each training sample, we extract its predicted attribute regarding the molecular graph, and then calculate the loss of supervised learning through the cross-entropy loss function. By minimizing this loss (the gap between the predicted attribute and the reference attribute), the first mutual information is maximized.
[0142] To more clearly describe the training method of the attribute prediction model provided by the embodiments of the present application, the following will be further described with reference to the accompanying drawings. Figure 4 is a framework diagram of an attribute prediction model provided by the embodiments of the present application. See Figure 4, the attribute prediction model can be constructed based on the Graph Information Bottleneck framework. The attribute prediction model includes a subgraph extraction network and a first prediction network. The server inputs the topological graph of the sample molecule into the attribute prediction model. The server samples the topological graph of the sample molecule through the subgraph extraction network of the attribute prediction model to obtain a first subgraph. The first subgraph includes a first type of edge and a second type of edge. The first type of edge refers to the edge sampled from the topological graph. The probability of the first type of edge in the first subgraph is the sampling probability of this edge in the topological graph. The second type of edge refers to the edge not sampled in the topological graph. The probability of the second type of edge in the first subgraph is equal to 1 minus the sampling probability of this edge in the topological graph, that is, the probability of not sampling this edge. The attribute prediction model is a Graph Multilinear Network (GMT). Then, the server samples the first subgraph through the subgraph extraction network to obtain multiple second subgraphs. Then, the server predicts each of the multiple subgraphs through the first prediction network to obtain multiple second prediction results. Then, the server averages the multiple second prediction results to obtain a first prediction result.
[0143] The process of the server predicting the second subgraph is essentially a binary classification process to determine whether the molecular structure represented by the second subgraph has the reference attribute. The topological graph of the sample molecule can be regarded as composed of two parts of subgraphs. The molecular structure represented by one part of the subgraph can determine the possession of the reference attribute and is regarded as the key subgraph; the molecular structure represented by the other part of the subgraph has nothing to do with the reference attribute and is regarded as the non-key subgraph. Among them, the key subgraph can be divided into the "House" class and the "Cycle" class. The "House" class refers to a five-point subgraph in the shape of a house; the "Cycle" class refers to a five-point cyclic subgraph. During the prediction process, the server detects whether the above two types of subgraphs exist in the second subgraph through the attribute prediction network to determine the second prediction result corresponding to the second subgraph.
[0144] In some embodiments, although the above-mentioned random subgraph sampling can be improved through multiple rounds of Monte Carlo simulation-based random subgraph sampling during the training process The estimated accuracy rate achieves better interpretability. However, when actually deploying and applying, if m simulations are performed for each molecule, the required time and resources will increase significantly. For this reason, we further propose a knowledge distillation scheme. The attribute prediction model includes a first prediction network and a second prediction network. The first prediction network is used to make predictions based on multiple second subgraphs sampled from the first subgraph. The first prediction result is the output of the first prediction network. After the training of the first prediction network is completed, a new prediction network (the second prediction network) is trained through the trained first prediction network. Correspondingly, the server makes predictions on the first subgraph through the second prediction network to obtain a third prediction result. The second prediction network is used to make predictions based on the first subgraph itself, and the third prediction result is used to represent the possibility that the molecular structure represented by the predicted first subgraph has the reference attribute. Then, the server trains the second prediction network with the goal of minimizing the gap between the first prediction result and the third prediction result. The solution provided by the embodiments of the present disclosure trains the second prediction network through the trained first prediction network, so that the effect of directly predicting the first subgraph by the second prediction network can reach the prediction effect of the first prediction network. In the subsequent application process, the second prediction network is used for prediction. On the basis of ensuring the prediction effect, it is not necessary to perform m simulations on the first subgraph, which can improve the dependence efficiency.
[0145] In some embodiments, the server determines the gap between the first prediction result and the third prediction result through Formula XI below.
[0146] Formula XI:
[0147]
[0148] Where, is used to represent the first prediction result; is used to represent the third prediction result; d is used to represent the gap; is used to represent the second prediction result; m is used to represent the number of second subgraphs. In the application process, the subgraph extraction network and the second prediction network in the attribute prediction model are used for prediction, avoiding the overhead of multiple random subgraph samplings.
[0149] An embodiment of the present application provides a method for training an attribute prediction model. The attribute prediction model extracts a first subgraph from the topological graph of a sample molecule, and then determines the first mutual information between the first subgraph and a reference attribute. During the model training process, the first mutual information is maximized. Since the first mutual information reflects the correlation degree between the first subgraph and the reference attribute and is related to the attribute predicted by the attribute prediction model based on the first subgraph, the attribute prediction model can increasingly accurately extract from the topological graph of the sample molecule a subgraph that can accurately reflect the reference attribute. That is, by maximizing the first mutual information, the attribute prediction model can accurately learn the molecular structure that enables the sample molecule to have the reference attribute, understand the relationship between the molecular structure and the attribute, so that the trained attribute prediction model can accurately predict the attributes possessed by the molecule according to the molecular structure. On this basis, the attribute prediction model can also be trained according to the second mutual information between the first subgraph and the topological graph, so that the correlation between the extracted first subgraph and the topological graph is as small as possible. That is, while ensuring that the attribute prediction model can accurately extract the molecular structure that determines a certain attribute, the extracted molecular structure is made as small as possible, so that the attribute prediction model can more precisely learn the relationship between the molecular structure and the attribute, so that the trained attribute prediction model can accurately predict the attributes possessed by the molecule according to the molecular structure and accurately output the molecular structure that determines the attribute, providing a more accurate basis for explaining why the molecule has this attribute.
[0150] Although the solution provided by the embodiment of the present application takes ordinary graph-structured data (topological graph) as an example, due to the wide range and generality of the graph data structure, including images, natural language, and point cloud data can be represented as graphs. Especially for point cloud data, it has wide applications in many practical and scientific fields such as autonomous driving and high-energy physics. The training method of the attribute prediction model provided by the embodiment of the present application can be adapted to a wider data structure such as point cloud data. Only by simply preprocessing the point cloud data into graph-structured data through algorithms such as KNN (K-Nearest Neighbor), this solution can be used to discover key inputs and provide interpretable outputs.
[0151] Figure 5 It is a block diagram of a training device for an attribute prediction model according to an embodiment of the present application. The training device for the attribute prediction model is used to execute the steps when the above-mentioned training method of the attribute prediction model is executed. Refer to Figure 5 The training device for the attribute prediction model includes: a sampling module 501, a first determination module 502, a second determination module 503, and a first training module 504.
[0152] The sampling module 501 is configured to sample the topological graph of the sample molecule through the attribute prediction model to obtain a first sub-graph. The topological graph includes a plurality of nodes and a plurality of edges. Each node is used to represent an atom in the sample molecule, and each edge is used to represent the connection relationship between the atoms corresponding to the nodes at both ends of the edge.
[0153] The first determination module 502 is configured to determine a first mutual information through the attribute prediction model based on the first sub-graph and the reference attribute. The reference attribute is an attribute possessed by the sample molecule. The first mutual information is used to represent the correlation degree between the first sub-graph and the reference attribute, and the first mutual information is related to the attribute predicted by the attribute prediction model based on the first sub-graph.
[0154] The second determination module 503 is configured to determine a second mutual information through the attribute prediction model based on the first sub-graph and the topological graph. The second mutual information is used to represent the correlation degree between the first sub-graph and the topological graph.
[0155] The first training module 504 is configured to train the attribute prediction model with the goal of maximizing the first mutual information and minimizing the second mutual information.
[0156] In some embodiments, Figure 6 is a block diagram of another training device for the attribute prediction model provided by the embodiments of the present application. Refer to Figure 6 , the sampling module 501 includes:
[0157] The extraction unit 5011 is configured to extract features of a plurality of nodes in the topological graph of the sample molecule through the attribute prediction model to obtain node features of the plurality of nodes. Each node contains attribute information of the corresponding atom, and each node feature is used to represent the atomic feature of the corresponding atom.
[0158] The first determination unit 5012 is configured to determine the sampling probability of any edge in the topological graph based on the node features corresponding to the nodes at both ends of the edge.
[0159] The sampling unit 5013 is configured to sample the topological graph of the sample molecule based on the sampling probabilities of the plurality of edges in the topological graph to obtain a first sub-graph.
[0160] In some embodiments, continue to refer to Figure 6 , the extraction unit 5011 is configured to, for any one of the plurality of nodes, extract features of the attribute information in the node through the attribute prediction model to obtain an initial node feature of the node; aggregate the initial node feature of the node and the initial node features of the neighbor nodes of the node to obtain the node feature of the node. The neighbor nodes are the nodes having a connection relationship with the node.
[0161] In some embodiments, continue to refer to Figure 6, a first determination unit 5012, which is configured to, for any edge in the topological graph, adopt an attention mechanism to determine the intermediate probability of the edge based on the node features corresponding to the nodes at both ends of the edge; and process the intermediate probability of the edge by means of a reparameterized sampling method to obtain the sampling probability of the edge.
[0162] In some embodiments, referring further to Figure 6 , a first determination module 502 includes:
[0163] A prediction unit 5021, which is configured to predict the first sub-graph through an attribute prediction model to obtain a first prediction result, and the first prediction result is used to represent the possibility that the molecular structure represented by the predicted first sub-graph has a reference attribute;
[0164] A second determination unit 5022, which is configured to determine a first mutual information based on the gap between the first prediction result and the reference attribute, and the first mutual information is inversely correlated with the gap.
[0165] In some embodiments, the first sub-graph includes the probabilities of multiple edges in the topological graph. The probabilities of the multiple edges in the first sub-graph are continuous values. The multiple edges in the first sub-graph include first-class edges and second-class edges. The probability of a first-class edge is the sampling probability of the edge in the topological graph, and the probability of a second-class edge is the probability of not sampling the edge in the topological graph;
[0166] The prediction unit 5021 is configured to, through an attribute prediction model, perform multiple samplings based on the probabilities of multiple edges in the first sub-graph to obtain multiple second sub-graphs. Each second sub-graph includes the probabilities of multiple edges. The probabilities of the edges in each second sub-graph are discrete values. The probability of each edge appearing in the multiple second sub-graphs is equal to the probability of the edge in the first sub-graph; predict the multiple second sub-graphs respectively to obtain multiple second prediction results, and each second prediction result is used to represent the possibility that the molecular structure represented by the corresponding second sub-graph has a reference attribute; and average the multiple second prediction results to obtain the first prediction result.
[0167] In some embodiments, the first sub-graph includes the probabilities of multiple edges in the topological graph. The probabilities of the multiple edges in the first sub-graph are continuous values. The multiple edges in the first sub-graph include first-class edges and second-class edges. The probability of a first-class edge is the sampling probability of the edge in the topological graph, and the probability of a second-class edge is the probability of not sampling the edge in the topological graph;
[0168] A second determination module 503 is configured to sum the probabilities of multiple edges in the first sub-graph through an attribute prediction model to obtain a first probability sum; sum the sampling probabilities of multiple edges in the topological graph to obtain a second probability sum; and determine a second mutual information based on the gap between the first probability sum and the second probability sum, and the second mutual information is negatively correlated with the gap.
[0169] In some embodiments, the first sub-graph includes the probabilities of multiple edges in the topological graph. The probabilities of the multiple edges in the first sub-graph are continuous values. The multiple edges in the first sub-graph can be divided into a first type of edges and a second type of edges. The probability of the first type of edges is the sampling probability of the edges in the topological graph, and the probability of the second type of edges is the probability of not sampling the edge in the topological graph.
[0170] A second determination module 503 is configured to perform multiple samplings based on the probabilities of multiple edges in the first sub-graph through an attribute prediction model to obtain multiple second sub-graphs. Each second sub-graph includes the probabilities of multiple edges. The probabilities of the edges in each second sub-graph are discrete values. The probability of each edge appearing in the multiple second sub-graphs is equal to the probability of the edge in the first sub-graph. For any second sub-graph, the probabilities of the multiple edges in the second sub-graph are summed to obtain a third probability sum. The average of the multiple third probability sums is obtained to get a fourth probability sum. The fourth probability sum is used to represent the number of sampled edges in the first sub-graph. Based on the fourth probability sum, a second mutual information is determined, and the second mutual information is positively correlated with the fourth probability sum.
[0171] In some embodiments, the attribute prediction model includes a first prediction network and a second prediction network. The first prediction network is configured to make a prediction according to multiple second sub-graphs sampled from the first sub-graph, and the first prediction result is the output of the first prediction network.
[0172] Continue to refer to Figure 6 , the apparatus further includes:
[0173] A prediction module 505 is configured to make a prediction on the first sub-graph through the second prediction network to obtain a third prediction result. The second prediction network is configured to make a prediction based on the first sub-graph itself, and the third prediction result is used to represent the possibility that the molecular structure represented by the predicted first sub-graph has a reference attribute.
[0174] A second training module 506 is configured to train the second prediction network with the goal of minimizing the gap between the first prediction result and the third prediction result.
[0175] The embodiment of the present application provides a training device for an attribute prediction model. The attribute prediction model extracts a first sub-graph from the topological graph of a sample molecule, and then determines the first mutual information between the first sub-graph and a reference attribute. During the model training process, the first mutual information is maximized. Since the first mutual information reflects the correlation degree between the first sub-graph and the reference attribute and is related to the attribute predicted by the attribute prediction model based on the first sub-graph, the attribute prediction model can increasingly accurately extract from the topological graph of the sample molecule a sub-graph that can accurately reflect the reference attribute. That is, by maximizing the first mutual information, the attribute prediction model can accurately learn the molecular structure that enables the sample molecule to have the reference attribute, understand the relationship between the molecular structure and the attribute, so that the trained attribute prediction model can accurately predict the attributes of the molecule according to the molecular structure. On this basis, the attribute prediction model can also be trained according to the second mutual information between the first sub-graph and the topological graph, so that the correlation between the extracted first sub-graph and the topological graph is as small as possible. That is, while ensuring that the attribute prediction model can accurately extract the molecular structure that determines a certain attribute, the extracted molecular structure is made as small as possible, so that the attribute prediction model can more precisely learn the relationship between the molecular structure and the attribute, so that the trained attribute prediction model can accurately predict the attributes of the molecule according to the molecular structure and accurately output the molecular structure that determines the attribute, providing a more accurate basis for explaining why the molecule has this attribute.
[0176] It should be noted that when the training device for the attribute prediction model provided in the above embodiment runs an application program, only the division of the above functional modules is used for illustration. In actual applications, the above functions can be allocated to different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the training device for the attribute prediction model provided in the above embodiment and the embodiment of the training method for the attribute prediction model belong to the same concept. For the specific implementation process, refer to the method embodiment and will not be elaborated here.
[0177] In the embodiment of the present application, the computer device can be configured as a terminal or a server. When the computer device is configured as a terminal, the terminal can be used as the execution subject to implement the technical solution provided in the embodiment of the present application. When the computer device is configured as a server, the server can be used as the execution subject to implement the technical solution provided in the embodiment of the present application, or the technical solution provided in the present application can be implemented through the interaction between the terminal and the server. The embodiment of the present application does not make any limitations in this regard.
[0178] Figure 7It is a structural block diagram of a terminal 700 provided according to an embodiment of the present application. The terminal 700 may be a portable mobile terminal, such as: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV) player, a notebook computer or a desktop computer. The terminal 700 may also be referred to by other names such as user equipment, portable terminal, laptop terminal, desktop terminal, etc.
[0179] Generally, the terminal 700 includes: a processor 701 and a memory 702.
[0180] The processor 701 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 701 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), PLA (Programmable Logic Array). The processor 701 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 701 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 701 may also include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.
[0181] The memory 702 may include one or more computer-readable storage media, and the computer-readable storage media may be non-transitory. The memory 702 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices, flash storage devices. In some embodiments, the non-transitory computer-readable storage media in the memory 702 is used to store at least one computer program, and the at least one computer program is used to be executed by the processor 701 to implement the training method of the attribute prediction model provided in the method embodiments of the present application.
[0182] In some embodiments, the terminal 700 may further optionally include: a peripheral device interface 703 and at least one peripheral device. The processor 701, the memory 702, and the peripheral device interface 703 may be connected through a bus or signal lines. Each peripheral device may be connected to the peripheral device interface 703 through a bus, signal lines, or a circuit board. Specifically, the peripheral device includes at least one of: a radio frequency circuit 704, a display screen 705, a camera assembly 706, an audio circuit 707, and a power supply 708.
[0183] The peripheral device interface 703 can be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 701 and the memory 702. In some embodiments, the processor 701, the memory 702, and the peripheral device interface 703 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 701, the memory 702, and the peripheral device interface 703 can be implemented on a separate chip or circuit board, and this embodiment does not limit this.
[0184] The radio frequency circuit 704 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 704 communicates with a communication network and other communication devices through electromagnetic signals. The radio frequency circuit 704 converts an electrical signal into an electromagnetic signal for transmission, or converts the received electromagnetic signal into an electrical signal. In some embodiments, the radio frequency circuit 704 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so on. The radio frequency circuit 704 can communicate with other terminals through at least one wireless communication protocol. The wireless communication protocol includes but is not limited to: the World Wide Web, a metropolitan area network, an intranet, generations of mobile communication networks (2G, 3G, 4G, and 5G), a wireless local area network, and / or a WiFi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 704 may further include a circuit related to NFC (Near Field Communication), and this application does not limit this.
[0185] The display screen 705 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos, and any combination thereof. When the display screen 705 is a touch display screen, the display screen 705 also has the ability to collect touch signals on or above the surface of the display screen 705. The touch signal can be input to the processor 701 as a control signal for processing. At this time, the display screen 705 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there can be one display screen 705, which is provided on the front panel of the terminal 700; in other embodiments, there can be at least two display screens 705, which are respectively provided on different surfaces of the terminal 700 or are in a foldable design; in other embodiments, the display screen 705 can be a flexible display screen, which is provided on the curved surface or the folding surface of the terminal 700. Even, the display screen 705 can also be set to an irregular non-rectangular shape, that is, a special-shaped screen. The display screen 705 can be prepared from materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0186] The camera module 706 is used to collect images or videos. In some embodiments, the camera module 706 includes a front camera and a rear camera. Generally, the front camera is provided on the front panel of the terminal, and the rear camera is provided on the back of the terminal. In some embodiments, there are at least two rear cameras, which are respectively any one of a main camera, a depth-of-field camera, a wide-angle camera, and a telephoto camera, so as to realize the function of background blurring by fusing the main camera and the depth-of-field camera, the function of panoramic shooting by fusing the main camera and the wide-angle camera, and the VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, the camera module 706 can also include a flash. The flash can be a single-color-temperature flash or a two-color-temperature flash. A two-color-temperature flash refers to the combination of a warm-light flash and a cold-light flash, which can be used for light compensation under different color temperatures.
[0187] The audio circuit 707 may include a microphone and a speaker. The microphone is used to collect sound waves of the user and the environment, and convert the sound waves into electrical signals for input to the processor 701 for processing, or input to the radio frequency circuit 704 to enable voice communication. For the purpose of stereo collection or noise reduction, there may be multiple microphones, which are respectively arranged at different parts of the terminal 700. The microphone may also be an array microphone or an omnidirectional collection microphone. The speaker is used to convert the electrical signal from the processor 701 or the radio frequency circuit 704 into sound waves. The speaker may be a traditional thin film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into sound waves audible to humans, but also convert the electrical signal into sound waves inaudible to humans for uses such as ranging. In some embodiments, the audio circuit 707 may further include a headphone jack.
[0188] The power supply 708 is used to supply power to each component in the terminal 700. The power supply 708 may be alternating current, direct current, a primary battery or a rechargeable battery. When the power supply 708 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery charged through a wired line, and a wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0189] In some embodiments, the terminal 700 further includes one or more sensors 709. The one or more sensors 709 include but are not limited to: an acceleration sensor 710, a gyroscope sensor 711, a pressure sensor 712, an optical sensor 713, and a proximity sensor 714.
[0190] The acceleration sensor 710 can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established with the terminal 700. For example, the acceleration sensor 710 can be used to detect the components of the gravitational acceleration on the three coordinate axes. The processor 701 can control the display screen 705 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 710. The acceleration sensor 710 can also be used for collecting game or user's motion data.
[0191] The gyroscope sensor 711 can detect the body direction and rotation angle of the terminal 700. The gyroscope sensor 711 can cooperate with the acceleration sensor 710 to collect the 3D actions of the user on the terminal 700. According to the data collected by the gyroscope sensor 711, the processor 701 can achieve the following functions: motion sensing (such as changing the UI according to the user's tilt operation), image stabilization during shooting, game control, and inertial navigation.
[0192] The pressure sensor 712 can be disposed on the side frame of the terminal 700 and / or the lower layer of the display screen 705. When the pressure sensor 712 is disposed on the side frame of the terminal 700, it can detect the holding signal of the user for the terminal 700, and the processor 701 can perform left / right hand recognition or quick operation according to the holding signal collected by the pressure sensor 712. When the pressure sensor 712 is disposed on the lower layer of the display screen 705, the processor 701 can control the operable controls on the UI interface according to the pressure operation of the user on the display screen 705. The operable controls include at least one of a button control, a scroll bar control, an icon control, and a menu control.
[0193] The optical sensor 713 is used to collect the ambient light intensity. In one embodiment, the processor 701 can control the display brightness of the display screen 705 according to the ambient light intensity collected by the optical sensor 713. Specifically, when the ambient light intensity is high, the display brightness of the display screen 705 is increased; when the ambient light intensity is low, the display brightness of the display screen 705 is decreased. In another embodiment, the processor 701 can also dynamically adjust the shooting parameters of the camera assembly 706 according to the ambient light intensity collected by the optical sensor 713.
[0194] The proximity sensor 714, also known as a distance sensor, is usually disposed on the front panel of the terminal 700. The proximity sensor 714 is used to collect the distance between the user and the front of the terminal 700. In one embodiment, when the proximity sensor 714 detects that the distance between the user and the front of the terminal 700 is gradually decreasing, the processor 701 controls the display screen 705 to switch from the lit state to the off state; when the proximity sensor 714 detects that the distance between the user and the front of the terminal 700 is gradually increasing, the processor 701 controls the display screen 705 to switch from the off state to the lit state.
[0195] Those skilled in the art can understand that Figure 7 the structure shown in does not constitute a limitation on the terminal 700, and may include more or fewer components than shown in the figure, or combine certain components, or adopt a different component layout.
[0196] Figure 8It is a schematic structural diagram of a server provided according to an embodiment of the present application. The server 800 may vary greatly due to different configurations or performances, and may include one or more processors (Central Processing Units, CPUs) 801 and one or more memories 802. Among them, at least one computer program is stored in the memory 802, and the at least one computer program is loaded and executed by the processor 801 to implement the training method of the attribute prediction model provided in each of the above method embodiments. Of course, the server 800 may also have components such as wired or wireless network interfaces, keyboards, and input / output interfaces for input / output. The server 800 may also include other components for implementing the functions of the device, which will not be elaborated here.
[0197] An embodiment of the present application also provides a computer-readable storage medium in which at least one segment of computer program is stored, and the at least one segment of computer program is loaded and executed by a processor of a computer device to implement the operations performed by the computer device in the training method of the attribute prediction model in the above embodiment. For example, the computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a Compact Disc Read-Only Memory (CD-ROM), magnetic tape, floppy disk, and optical data storage device, etc.
[0198] An embodiment of the present application also provides a computer program product, including a computer program, which is stored in a computer-readable storage medium. The processor of the computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the training method of the attribute prediction model provided in the above various optional implementation manners.
[0199] Those of ordinary skill in the art can understand that all or part of the steps of implementing the above embodiments can be completed by hardware, or can be completed by a program instructing relevant hardware. The said program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a magnetic disk or an optical disc, etc.
[0200] The above are only optional embodiments of the present application and are not intended to limit the present application. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A training method for an attribute prediction model, characterized in that, The method includes: Sampling the topological graph of the sample molecule through an attribute prediction model to obtain a first sub-graph, where the topological graph includes a plurality of nodes and a plurality of edges, each node is used to represent an atom in the sample molecule, and each edge is used to represent the connection relationship between the atoms corresponding to the nodes at both ends of the edge; Determining a first mutual information through the attribute prediction model based on the first sub-graph and a reference attribute, where the reference attribute is an attribute possessed by the sample molecule, and the first mutual information is used to represent the correlation degree between the first sub-graph and the reference attribute, and the first mutual information is related to the attribute predicted by the attribute prediction model based on the first sub-graph; Determining a second mutual information through the attribute prediction model based on the first sub-graph and the topological graph, where the second mutual information is used to represent the correlation degree between the first sub-graph and the topological graph; Training the attribute prediction model with the goal of maximizing the first mutual information and minimizing the second mutual information.
2. The method according to claim 1, wherein The step of sampling the topological graph of the sample molecule through the attribute prediction model to obtain a first sub-graph includes: Extracting features of a plurality of nodes in the topological graph of the sample molecule through the attribute prediction model to obtain node features of the plurality of nodes, where each node contains attribute information of the corresponding atom, and each node feature is used to represent the atomic feature of the corresponding atom; For any edge in the topological graph, determining the sampling probability of the edge based on the node features corresponding to the nodes at both ends of the edge; Sampling the topological graph of the sample molecule based on the sampling probabilities of the plurality of edges in the topological graph to obtain the first sub-graph.
3. The method according to claim 2, wherein The step of extracting features of a plurality of nodes in the topological graph of the sample molecule through the attribute prediction model to obtain node features of the plurality of nodes includes: For any one of the plurality of nodes, extracting features of the attribute information in the node through the attribute prediction model to obtain an initial node feature of the node; Aggregating the initial node feature of the node and the initial node features of the neighbor nodes of the node to obtain the node feature of the node, where the neighbor nodes are nodes having a connection relationship with the node.
4. The method according to claim 2, wherein The step of determining the sampling probability of any edge in the topological graph based on the node features corresponding to the nodes at both ends of the edge includes: For any edge in the topological graph, using an attention mechanism to determine an intermediate probability of the edge based on the node features corresponding to the nodes at both ends of the edge; Processing the intermediate probability of the edge based on a reparameterized sampling method to obtain the sampling probability of the edge.
5. The method according to claim 1, characterized in that, The step of determining a first mutual information through the attribute prediction model based on the first sub-graph and a reference attribute includes: Predicting the first sub-graph through the attribute prediction model to obtain a first prediction result, where the first prediction result is used to represent the possibility that the molecular structure represented by the predicted first sub-graph has the reference attribute; Determine the first mutual information based on the gap between the first prediction result and the reference attribute, where the first mutual information is inversely correlated with the gap.
6. The method according to claim 5, wherein The first sub-graph includes the probabilities of the multiple edges in the topological graph. The probabilities of the multiple edges in the first sub-graph are continuous values. The multiple edges in the first sub-graph include first-class edges and second-class edges. The probability of the first-class edges is the sampling probability of the edges in the topological graph, and the probability of the second-class edges is the probability of not sampling the edges in the topological graph. The step of predicting the first sub-graph through the attribute prediction model to obtain a first prediction result includes: Through the attribute prediction model, based on the probabilities of the multiple edges in the first sub-graph, perform multiple samplings to obtain multiple second sub-graphs. Each second sub-graph includes the probabilities of the multiple edges. The probabilities of the edges in each second sub-graph are discrete values, and the probability of each edge appearing in the multiple second sub-graphs is equal to the probability of the edge in the first sub-graph. Predict the multiple second sub-graphs respectively to obtain multiple second prediction results. Each second prediction result is used to represent the possibility that the molecular structure represented by the corresponding second sub-graph obtained by prediction has the reference attribute. Average the multiple second prediction results to obtain the first prediction result.
7. The method according to claim 1, characterized in that, The first sub-graph includes the probabilities of the multiple edges in the topological graph. The probabilities of the multiple edges in the first sub-graph are continuous values. The multiple edges in the first sub-graph include first-class edges and second-class edges. The probability of the first-class edges is the sampling probability of the edges in the topological graph, and the probability of the second-class edges is the probability of not sampling the edges in the topological graph. The step of determining the second mutual information through the attribute prediction model based on the first sub-graph and the topological graph includes: Through the attribute prediction model, sum the probabilities of the multiple edges in the first sub-graph to obtain a first probability sum. Sum the sampling probabilities of the multiple edges in the topological graph to obtain a second probability sum. Determine the second mutual information based on the gap between the first probability sum and the second probability sum, where the second mutual information is negatively correlated with the gap.
8. The method according to claim 1, characterized in that, The first sub-graph includes the probabilities of the multiple edges in the topological graph. The probabilities of the multiple edges in the first sub-graph are continuous values. The multiple edges in the first sub-graph can be divided into first-class edges and second-class edges. The probability of the first-class edges is the sampling probability of the edges in the topological graph, and the probability of the second-class edges is the probability of not sampling the edges in the topological graph. The step of determining the second mutual information through the attribute prediction model based on the first sub-graph and the topological graph includes: Through the attribute prediction model, based on the probabilities of the multiple edges in the first sub-graph, perform multiple samplings to obtain multiple second sub-graphs. Each second sub-graph includes the probabilities of the multiple edges. The probabilities of the edges in each second sub-graph are discrete values, and the probability of each edge appearing in the multiple second sub-graphs is equal to the probability of the edge in the first sub-graph. For any second sub-graph, sum the probabilities of the multiple edges in the second sub-graph to obtain a third probability sum. Average the multiple third probability sums to obtain a fourth probability sum, where the fourth probability sum is used to represent the number of edges sampled from the first subgraph. Based on the fourth probability sum, determine the second mutual information, where the second mutual information is positively correlated with the fourth probability sum.
9. The method according to claim 6, wherein The attribute prediction model includes a first prediction network and a second prediction network. The first prediction network is used to make predictions based on multiple second subgraphs sampled from the first subgraph, and the first prediction result is the output of the first prediction network. The method further includes: Through the second prediction network, make a prediction on the first subgraph to obtain a third prediction result. The second prediction network is used to make predictions based on the first subgraph itself, and the third prediction result is used to represent the possibility that the molecular structure represented by the predicted first subgraph has the reference attribute. Train the second prediction network with the goal of minimizing the gap between the first prediction result and the third prediction result.
10. A training device for an attribute prediction model, characterized in that, The device includes: A sampling module, configured to sample the topological graph of the sample molecule through an attribute prediction model to obtain a first subgraph. The topological graph includes multiple nodes and multiple edges, each node is used to represent an atom in the sample molecule, and each edge is used to represent the connection relationship between the atoms corresponding to the nodes at both ends of the edge. A first determination module, configured to determine a first mutual information through the attribute prediction model based on the first subgraph and a reference attribute. The reference attribute is an attribute possessed by the sample molecule, and the first mutual information is used to represent the correlation degree between the first subgraph and the reference attribute. The first mutual information is related to the attribute predicted by the attribute prediction model based on the first subgraph. A second determination module, configured to determine a second mutual information through the attribute prediction model based on the first subgraph and the topological graph. The second mutual information is used to represent the correlation degree between the first subgraph and the topological graph. A first training module, configured to train the attribute prediction model with the goal of maximizing the first mutual information and minimizing the second mutual information.
11. A computer device, characterized in that, The computer device includes a processor and a memory. The memory is used to store at least one segment of computer program, and the at least one segment of computer program is loaded and executed by the processor to perform the training method of the attribute prediction model according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store at least one segment of computer program, and the at least one segment of computer program is used to perform the training method of the attribute prediction model according to any one of claims 1 to 9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the training method of the attribute prediction model according to any one of claims 1 to 9.