Method, application method, device and equipment for adjusting parameters of reaction product prediction model
Through the self-supervised auxiliary network, the high cost problem caused by relying on artificial labels in the prior art is solved, and the accuracy and efficiency of reaction product prediction are improved.
Patent Information
- Application Number
- CN202210826462.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-14
- Publication Date
- 2025-06-27
- Estimated Expiration
- 2042-07-14
AI Technical Summary
The prior art relies on a large number of manual tags when using deep learning to predict organic chemical reaction products, resulting in high costs and excessive human resources consumption.
Automatic annotation of data is achieved by mining and constructing positive and negative sample sets and atomic labels from the data characteristics of the sample reaction data set by using the first auxiliary network, the second auxiliary network and the third auxiliary network with self-supervised nature.
The cost of the reaction product prediction task is reduced, the accuracy of the prediction model for the reaction product is improved, and the ability to learn the relationship between multiple molecules is enhanced.
Smart Images

Figure CN115204370B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of artificial intelligence technology, and in particular, to a method for adjusting parameters of a reaction product prediction model, an application method, a device, and a device. Background Art
[0002] The task of predicting organic chemical reaction products is of great significance to fields such as computational chemistry and pharmaceuticals.
[0003] However, traditional methods for predicting organic chemical reactions rely on common reaction templates to predict the possible structures of reaction products. However, there are a large number of types of organic chemical reactions, and new reactions emerge continuously with the increasing sophistication of chemical research, resulting in reaction templates being difficult to cover all reaction types and unable to be used for newly emerging reaction types. Therefore, with the development of deep learning technology, it is particularly important to use deep learning technology to learn potential reaction rules from organic chemical reaction data.
[0004] However, currently used technologies for deep learning of organic chemical reaction data usually rely on a large number of artificial labels to complete the training task of the prediction model. Artificial label data is often very expensive, and as the amount of chemical reaction data increases, a large amount of manual annotation is required to support it, which will consume a large amount of human and time costs, resulting in high costs for the task of predicting organic chemical reaction products. Summary of the Invention
[0005] The embodiments of the present application provide a method for adjusting parameters of a reaction product prediction model, an application method, a device, and a device, which are used to mine and construct positive and negative sample sets and atomic labels from the characteristics of the data itself of a sample reaction data set through a first auxiliary network, a second auxiliary network, and a third auxiliary network with self-supervised properties, so as to realize automatic annotation of the data of the sample reaction data set without relying on manual annotation, thereby reducing the cost of the reaction product prediction task. And, through self-supervised auxiliary tasks, the learning of the relationships between multiple molecules is increased, the relevance to the reaction product prediction task is enhanced, and the prediction accuracy of the reaction product prediction model for reaction products is improved.
[0006] One aspect of the embodiments of the present application provides a method for adjusting parameters of a reaction product prediction model, including:
[0007] Input the sample reaction data set into the reaction product prediction model, and perform vector transformation on each reaction array in the sample reaction data set through the encoding network of the reaction product prediction model to obtain a sample reactant vector and a sample reaction product vector. The sample reaction data set includes multiple reaction arrays, and each reaction array includes a sample reactant and a sample reaction product;
[0008] Input the sample reactant vector into the first auxiliary network, and construct a positive sample reactant set and a negative sample reactant set through the first auxiliary network;
[0009] Calculate the reaction prediction loss value based on the positive sample reactant set and the negative sample reactant set;
[0010] Input the sample reactant vector and the sample reaction product vector into the second auxiliary network, and construct a positive sample reaction group set and a negative sample reaction group set through the second auxiliary network;
[0011] Calculate the reaction relationship prediction loss value based on the positive sample reaction group set and the negative sample reaction group set;
[0012] Input the sample reactant vector and the sample reaction product vector into the third auxiliary network, and obtain the predicted probability value and the atomic label of the atoms in the sample reactants existing in the main product through the third auxiliary network;
[0013] Calculate the atomic prediction loss value based on the predicted probability value and the atomic label;
[0014] Adjust the parameters of the reaction product prediction model based on the reaction prediction loss value, the reaction relationship prediction loss value, and the atomic prediction loss value to obtain the target reaction product prediction model.
[0015] On the other hand, the present application provides a method for applying a reaction product prediction model, including:
[0016] Input the reactant to be measured into the above-mentioned target reaction product prediction model, and output the predicted change probability of the adjacency matrix through the target reaction product prediction model;
[0017] Calculate the predicted change amount of the adjacency matrix based on the predicted change probability of the adjacency matrix;
[0018] Determine the target reaction product based on the predicted change amount of the adjacency matrix and the adjacency matrix of the reactant to be measured.
[0019] On the other hand, the present application provides a device for adjusting the parameters of a reaction product prediction model, including:
[0020] An acquisition unit, configured to input the sample reaction data set into the reaction product prediction model, and perform vector transformation on each reaction array in the sample reaction data set through the encoding network of the reaction product prediction model to obtain a sample reactant vector and a sample reaction product vector. The sample reaction data set includes multiple reaction arrays, and each reaction array includes a sample reactant and a sample reaction product;
[0021] The acquisition unit is further configured to input the sample reactant vector into the first auxiliary network, and construct a positive sample reactant set and a negative sample reactant set through the first auxiliary network;
[0022] A processing unit, configured to calculate a reaction prediction loss value based on a set of positive sample reactants and a set of negative sample reactants;
[0023] An obtaining unit, configured to input a sample reactant vector and a sample reaction product vector into a second auxiliary network, and construct a set of positive sample reaction groups and a set of negative sample reaction groups through the second auxiliary network;
[0024] The processing unit is further configured to calculate a reaction relationship prediction loss value based on the set of positive sample reaction groups and the set of negative sample reaction groups;
[0025] An obtaining unit, configured to input a sample reactant vector and a sample reaction product vector into a third auxiliary network, and obtain a predicted probability value and an atomic label of an atom in the sample reactants existing in the main product through the third auxiliary network;
[0026] The processing unit is further configured to calculate an atomic prediction loss value based on the predicted probability value and the atomic label;
[0027] A determining unit, configured to adjust parameters of the reaction product prediction model based on the reaction prediction loss value, the reaction relationship prediction loss value, and the atomic prediction loss value, to obtain a target reaction product prediction model.
[0028] In a possible design, in an implementation manner of another aspect of the embodiments of the present application,
[0029] The processing unit is further configured to perform data augmentation processing on the sample reaction data set to obtain a sample composite reaction data set;
[0030] The processing unit is further configured to aggregate the sample reaction data set and the sample composite reaction data set into an extended sample reaction data set;
[0031] The obtaining unit may specifically be configured to: input the extended sample reaction data set into the reaction product prediction model, and perform vector transformation on each reaction array in the extended sample reaction data set through an encoding network of the reaction product prediction model, to obtain a sample reactant vector and a sample reaction product vector.
[0032] In a possible design, in an implementation manner of another aspect of the embodiments of the present application, the obtaining unit may specifically be configured to:
[0033] Sample any two sample reactant vectors from the same reaction array as a positive sample reactant combination, and aggregate them into the set of positive sample reactants;
[0034] Sample any two sample reactant vectors from different reaction arrays as a negative sample reactant combination, and aggregate them into the set of negative sample reactants.
[0035] In a possible design, in an implementation of another aspect of the embodiments of the present application, the obtaining unit may specifically be configured to:
[0036] Use the sample reactant vectors and sample reaction product vectors corresponding to all reaction arrays as the positive sample reaction group set;
[0037] Mismatch the sample reactant vectors and sample reaction product vectors to obtain a negative sample reaction group set.
[0038] In a possible design, in an implementation of another aspect of the embodiments of the present application, the obtaining unit may specifically be configured to:
[0039] Predict the sample reactants through a third auxiliary network to obtain the predicted probability values of the atoms in the sample reactants existing in the main product;
[0040] Based on the sample reactant vectors and sample reaction product vectors, perform atom comparison between the sample reactants and sample products to obtain an atom comparison result;
[0041] Determine atom labels based on the atom comparison result.
[0042] In a possible design, in an implementation of another aspect of the embodiments of the present application, the obtaining unit may specifically be configured to:
[0043] For each reaction array, interact the information within each molecule of the sample reactants among the atoms to obtain sample reactant interaction information;
[0044] Based on the sample reactant interaction information, interact among different sample reactants to obtain sample reactant vectors;
[0045] For each reaction array, interact the information within each molecule of the sample reaction products among the atoms to obtain sample reaction product interaction information;
[0046] Based on the sample reaction product interaction information, interact among different sample reactants to obtain sample reaction product vectors.
[0047] In a possible design, in an implementation of another aspect of the embodiments of the present application, the processing unit may specifically be configured to:
[0048] Randomly select two reaction arrays from the sample reaction data set;
[0049] Combine the sample reactants in the two selected reaction arrays to obtain sample composite reactants;
[0050] Combine the sample reaction products in the two selected reaction arrays to obtain a sample composite reaction product;
[0051] Based on the sample composite reactants and the sample composite reaction product, obtain a composite reaction array to acquire a sample composite reaction data set.
[0052] In a possible design, in an implementation manner of another aspect of the embodiments of the present application, the determining unit may specifically be used for:
[0053] Obtain a reconstruction loss value and a divergence loss value;
[0054] Based on the reconstruction loss value, the divergence loss value, the reaction prediction loss value, the reaction relationship prediction loss value, and the atom prediction loss value, adjust the parameters of the reaction product prediction model to obtain a target reaction product prediction model.
[0055] In a possible design, in an implementation manner of another aspect of the embodiments of the present application, the determining unit may specifically be used for:
[0056] Apply an attention mechanism to the sample reactant vector and the sample reaction product vector to obtain a first hidden vector;
[0057] Calculate a second hidden vector based on the first hidden vector and the sample reactant vector;
[0058] Input the second hidden vector into the decoding network of the reaction product prediction model, and output the sample prediction change probability of the adjacency matrix through the decoding network;
[0059] Based on the sample prediction change probability, determine the sample prediction reaction product adjacency matrix;
[0060] Perform loss calculation based on the reaction product adjacency matrix of the sample reaction product and the sample prediction reaction product adjacency matrix to obtain a reconstruction loss value and a divergence loss value.
[0061] In a possible design, in an implementation manner of another aspect of the embodiments of the present application, the determining unit may specifically be used for:
[0062] Calculate the sample prediction change amount of the adjacency matrix based on the sample prediction change probability;
[0063] Calculate the sample prediction reaction product adjacency matrix based on the sample prediction change amount of the adjacency matrix and the adjacency matrix of the sample reactant.
[0064] In a possible design, in an implementation manner of another aspect of the embodiments of the present application, the determining unit may specifically be used for:
[0065] Based on the reaction prediction loss value, adjust the parameters of the first auxiliary network to obtain a first sub-model;
[0066] Adjust the parameters of the second auxiliary network based on the reaction relationship prediction loss value to obtain a second sub-model;
[0067] Adjust the parameters of the third auxiliary network based on the atomic prediction loss value to obtain a third sub-model;
[0068] Migrate the first sub-model, the second sub-model, and the third sub-model to the reaction product prediction model to obtain a target reaction product prediction model.
[0069] On the other hand, the present application provides an application device for a reaction product prediction model, including:
[0070] An acquisition unit, configured to input a reactant to be measured into the target reaction product prediction model, and output the predicted change probability of the adjacency matrix through the target reaction product prediction model;
[0071] A processing unit, configured to calculate the predicted change amount of the adjacency matrix based on the predicted change probability of the adjacency matrix;
[0072] A determination unit, configured to determine the target reaction product based on the predicted change amount of the adjacency matrix and the adjacency matrix of the reactant to be measured.
[0073] In a possible design, in an implementation manner of the other aspect of the embodiments of the present application, the determination unit may specifically be configured to:
[0074] Calculate the predicted reaction product adjacency matrix based on the predicted change amount of the adjacency matrix and the adjacency matrix of the reactant to be measured;
[0075] Perform a symmetrization process on the predicted reaction product adjacency matrix to obtain the target reaction product adjacency matrix;
[0076] Determine the target reaction product based on the target reaction product adjacency matrix.
[0077] On the other hand, the present application provides a computer device, including: a memory, a processor, and a bus system;
[0078] Wherein, the memory is used to store a program;
[0079] The processor is configured to implement the methods in the above aspects when executing the program in the memory;
[0080] The bus system is used to connect the memory and the processor to enable the memory and the processor to communicate with each other.
[0081] On the other hand, the present application provides a computer-readable storage medium, in which instructions are stored, and when the instructions are run on a computer, the computer is enabled to execute the methods in the above aspects.
[0082] As can be seen from the above technical solutions, the embodiments of the present application have the following beneficial effects:
[0083] By obtaining the sample reactant vector and the sample reaction product vector, constructing the positive sample reactant set and the negative sample reactant set through the first auxiliary network, calculating the reaction prediction loss value based on the positive sample reactant set and the negative sample reactant set, at the same time, constructing the positive sample reaction group set and the negative sample reaction group set through the second auxiliary network, and calculating the reaction relationship prediction loss value based on the positive sample reaction group set and the negative sample reaction group set, and obtaining the prediction probability value and the atomic label of the atoms in the sample reactants existing in the main product through the third auxiliary network, and calculating the atomic prediction loss value based on the prediction probability value and the atomic label, then, the parameters of the reaction product prediction model can be adjusted based on the reaction prediction loss value, the reaction relationship prediction loss value, and the atomic prediction loss value to obtain the target reaction product prediction model. In the above manner, it is possible to mine and construct positive and negative sample sets and atomic labels, etc. from the data itself characteristics of the sample reaction data set based on the first auxiliary network, the second auxiliary network, and the third auxiliary network with self-supervised properties, so as to realize the automatic annotation of the data of the sample reaction data set without relying on manual annotation, thereby reducing the cost of the reaction product prediction task. Moreover, the first auxiliary network helps the reaction product prediction model to better learn the distance relationship between reactants, enabling the reaction product prediction model to have the ability to predict whether the reactants can react, and the second auxiliary network helps the reaction product prediction model to better learn the distance relationship between reactants and products, enabling the reaction product prediction model to have the ability to predict the corresponding relationship between reactants and products, and the third auxiliary network helps the reaction product prediction model to better learn the changes in the bond positions between atoms in the reactants during the reaction process, enabling the reaction product prediction model to have the ability to predict whether the atoms are still in the main product after the reaction occurs. Therefore, based on the auxiliary learning of these auxiliary networks, the prediction accuracy of the reaction product prediction model for the reaction product can be improved. Description of the Drawings
[0084] Figure 1 is a schematic architecture diagram of the reaction data control system in the embodiments of the present application;
[0085] Figure 2 is a flowchart of an embodiment of the method for adjusting the parameters of the reaction product prediction model in the embodiments of the present application;
[0086] Figure 3 is another flowchart of an embodiment of the method for adjusting the parameters of the reaction product prediction model in the embodiments of the present application;
[0087] Figure 4It is another flowchart of the method for adjusting the parameters of the reaction product prediction model in the embodiments of the present application;
[0088] Figure 5 It is another flowchart of the method for adjusting the parameters of the reaction product prediction model in the embodiments of the present application;
[0089] Figure 6 It is another flowchart of the method for adjusting the parameters of the reaction product prediction model in the embodiments of the present application;
[0090] Figure 7 It is another flowchart of the method for adjusting the parameters of the reaction product prediction model in the embodiments of the present application;
[0091] Figure 8 It is another flowchart of the method for adjusting the parameters of the reaction product prediction model in the embodiments of the present application;
[0092] Figure 9 It is another flowchart of the method for adjusting the parameters of the reaction product prediction model in the embodiments of the present application;
[0093] Figure 10 It is another flowchart of the method for adjusting the parameters of the reaction product prediction model in the embodiments of the present application;
[0094] Figure 11 It is another flowchart of the method for adjusting the parameters of the reaction product prediction model in the embodiments of the present application;
[0095] Figure 12 It is another flowchart of the method for adjusting the parameters of the reaction product prediction model in the embodiments of the present application;
[0096] Figure 13 It is a flowchart of an embodiment of the application method of the reaction product prediction model in the embodiments of the present application;
[0097] Figure 14 It is another flowchart of the application method of the reaction product prediction model in the embodiments of the present application;
[0098] Figure 15 It is a schematic diagram of an auxiliary network of the method for adjusting the parameters of the reaction product prediction model in the embodiments of the present application;
[0099] Figure 16 It is a schematic diagram of the principle framework of the reaction product prediction model of the method for adjusting the parameters of the reaction product prediction model in the embodiments of the present application;
[0100] Figure 17 It is a schematic diagram of an embodiment of the device for adjusting the parameters of the reaction product prediction model in the embodiments of the present application;
[0101] Figure 18 It is a schematic diagram of an embodiment of an application device of a reaction product prediction model in an embodiment of the present application;
[0102] Figure 19 It is a schematic diagram of an embodiment of a computer device in an embodiment of the present application. Detailed implementation manners
[0103] The embodiments of the present application provide a method for adjusting parameters of a reaction product prediction model, an application method, a device and a device, which are used to mine and construct positive and negative sample sets and atomic labels from the data characteristics of a sample reaction data set through a first auxiliary network, a second auxiliary network and a third auxiliary network with self-supervised properties, so as to realize automatic annotation of the data of the sample reaction data set without relying on manual annotation, thereby reducing the cost of the reaction product prediction task. Moreover, through self-supervised auxiliary tasks, the learning of the relationships between multiple molecules is increased, the relevance with the reaction product prediction task is enhanced, and the prediction accuracy of the reaction product prediction model for reaction products is improved.
[0104] The terms "first", "second", "third", "fourth", etc. (if any) in the specification, claims and drawings of the present application are used to distinguish similar objects and do not have to be used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "corresponding to" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device including a series of steps or units does not have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0105] For ease of understanding, some terms or concepts related to the embodiments of the present application are first explained.
[0106] 1. Transformer
[0107] The Transformer is composed of an encoder part and a decoder part, and can use the self-attention mechanism without adopting the sequential structure of the Recurrent Neural Network (RNN) and the Long Short-Term Memory (LSTM), so that the model can be trained in parallel and can have global information.
[0108] 2. Contrastive Learning
[0109] Contrastive learning is a self-supervised learning method that, in the absence of labels, enables the model to learn the general features of a dataset by learning which data points are similar or different.
[0110] 3. Graph Neural Networks
[0111] Graph neural networks include graph convolutional networks, graph attention networks, graph auto-encoders, graph generative networks, and graph spatial-temporal networks. Compared with the most basic network structure of neural networks, the fully connected layer (MLP), where the feature matrix is multiplied by the weight matrix, graph neural networks have an additional adjacency matrix.
[0112] 4. Auxiliary Task
[0113] In reinforcement learning, using auxiliary tasks to assist in the learning of the main task is an important class of methods. During the learning of the main task, due to the sparsity of rewards and the difficulty of the task, auxiliary tasks can be used to help learn feature representations.
[0114] It can be understood that in the specific implementation of this application, when dealing with relevant data such as sample reaction data sets, when the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use, and processing of relevant data need to comply with the relevant laws, regulations, and standards of the relevant countries and regions.
[0115] It can be understood that, as the reaction product prediction model parameter adjustment method disclosed in this application, it also involves artificial intelligence (AI) technology. The following further introduces artificial intelligence technology. Artificial intelligence uses digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, and is a theory, method, technology, and application system that perceives the environment, acquires knowledge, and uses knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that 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.
[0116] Artificial intelligence technology is an interdisciplinary subject that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, and mechatronics. 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.
[0117] Secondly, Natural Language Processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between humans and computers in natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, the research in this field will involve natural language, that is, the language people use in daily life, so it has a close connection with the research of linguistics. Natural language processing technologies usually include text processing, semantic understanding, machine translation, robot question answering, knowledge graph, and other technologies.
[0118] Secondly, Machine Learning (ML) is an interdisciplinary subject that involves multiple disciplines 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.
[0119] With the research and progress of artificial intelligence technology, artificial intelligence technology has been studied and applied in multiple fields. For example, common ones include smart homes, smart wearable devices, virtual assistants, smart speakers, smart marketing, driverless, autonomous driving, drones, robots, smart healthcare, smart customer service, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0120] It should be understood that the method for adjusting the parameters of the reaction product prediction model provided in this application can be applied to various scenarios, including but not limited to artificial intelligence, cloud technology, computational chemistry, pharmaceuticals, etc., for optimizing the reaction product prediction task by training a powerful reaction product prediction model, so as to be applied to scenarios such as drug retrosynthesis verification, scientific law mining, and pharmaceutical research and development.
[0121] To solve the above problems, the present application proposes a method for adjusting parameters of a reaction product prediction model, which is applied to Figure 1 the reaction data control system shown in Figure 1 , Figure 1 which is a schematic architecture diagram of the reaction data control system in an embodiment of the present application. As shown in Figure 1 , the server obtains a sample reactant vector and a sample reaction product vector by obtaining a sample reaction data set provided by a terminal device, constructs a positive sample reactant set and a negative sample reactant set through a first auxiliary network, calculates a reaction prediction loss value based on the positive sample reactant set and the negative sample reactant set. At the same time, a positive sample reaction group set and a negative sample reaction group set are constructed through a second auxiliary network, and a reaction relationship prediction loss value is calculated based on the positive sample reaction group set and the negative sample reaction group set, and a predicted probability value and an atomic label of an atom in the sample reactant existing in the main product are obtained through a third auxiliary network, and an atomic prediction loss value is calculated based on the predicted probability value and the atomic label. Then, the parameters of the reaction product prediction model can be adjusted based on the reaction prediction loss value, the reaction relationship prediction loss value, and the atomic prediction loss value to obtain a target reaction product prediction model. Through the above method, it is possible to mine and construct positive and negative sample sets and atomic labels from the data characteristics of the sample reaction data set based on the first auxiliary network, the second auxiliary network, and the third auxiliary network with self-supervised properties, so as to realize automatic annotation of the sample reaction data set without relying on manual annotation, thereby reducing the cost of the reaction product prediction task. Moreover, the first auxiliary network helps the reaction product prediction model to better learn the distance relationship between reactants, enabling the reaction product prediction model to have the ability to predict whether reactants can react, and the second auxiliary network helps the reaction product prediction model to better learn the distance relationship between reactants and products, enabling the reaction product prediction model to have the ability to predict the corresponding relationship between reactants and products, and the third auxiliary network helps the reaction product prediction model to better learn the change in the bond position relationship between atoms of reactants during the reaction process, enabling the reaction product prediction model to have the ability to predict whether an atom is still in the main product after the reaction occurs. Therefore, based on the auxiliary learning of these auxiliary networks, the prediction accuracy of the reaction product prediction model for reaction products can be improved.
[0122] It can be understood that Figure 1 only one type of terminal device is shown in Figure 1A server is shown, but in an actual scenario, multiple servers can also be involved. Especially in the scenario of multi-model training interaction, the number of servers depends on the actual scenario and is not specifically limited here.
[0123] It should be noted that in this embodiment, the server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers. It 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, content delivery network (CDN), and big data and artificial intelligence platforms. The terminal device and the server can be directly or indirectly connected through wired or wireless communication methods. The terminal device and the server can be connected to form a blockchain network, which is not limited in this application.
[0124] Combined with the above introduction, the method for adjusting the parameters of the reaction product prediction model in this application will be introduced below. Please refer to Figure 2 , an embodiment of the method for adjusting the parameters of the reaction product prediction model in the embodiment of this application includes:
[0125] In step S101, the sample reaction data set is input into the reaction product prediction model. Through the encoding network of the reaction product prediction model, each reaction array in the sample reaction data set is vectorized to obtain the sample reactant vector and the sample reaction product vector. The sample reaction data set includes multiple reaction arrays, and each reaction array includes sample reactants and sample reaction products;
[0126] It can be understood that the sample reaction data set includes multiple reaction arrays, and each reaction array can be expressed as (G r , G p ). Each reaction array is used to represent an organic chemical reaction data R1 + R2 +... → P1 + P2 +..., where G r represents a series of sample reactants, and G p represents a series of products, that is, sample reaction products.
[0127] Among them, in the molecular graph G = (V, E), V represents the set of atoms and the set size is the number of atoms |V| = N. Each atom v ∈ V is associated with an atomic feature, including the type, charge, aromaticity, etc. of the atom. represents the set of edges, and each edge is associated with a bond type, including single bond, double bond, triple bond, aromatic bond, etc. The goal of organic chemical reaction prediction is to predict the product given the reactants.
[0128] Furthermore, due to the atom-mapping principle in organic chemical reactions, atoms in reactants and products correspond one by one. Therefore, mainly the changes in the connections between atoms occur before and after the reaction, that is, the changes in the adjacency matrix A, and the atoms involved do not change. Thus, to predict the product (i.e., the reaction product), it is only necessary to predict its corresponding adjacency matrix to restore the entire structure of the product. Among them, the adjacency matrix used in this embodiment is different from the ordinary adjacency matrix. Also, since predicting the change in the adjacency matrix A, i.e., ΔA, is easier than directly predicting the product A, this embodiment can transform the problem of predicting organic chemical reactions into modeling the probability distribution P(ΔA|G r ).
[0129] Thus, in order to better model the probability distribution P(ΔA|G r ) subsequently, a sample reaction data set will be obtained first, and the sample reaction data set will be input into the reaction product prediction model. Then, through the encoding network of the reaction product prediction model, each reaction array in the sample reaction data set will be vector-transformed to obtain the sample reactant vector and the sample reaction product vector.
[0130] Among them, the reaction product prediction model can specifically be a VAE architecture that satisfies the conservation of electron transfer as Figure 16 shown, or it can also be other models, such as a flow-based model, maximum likelihood training, deep VAE, etc. There is no specific limitation here.
[0131] Furthermore, if the reaction product prediction model uses a VAE architecture that satisfies the conservation of electron transfer as Figure 16 shown, then through a graph neural network GNN and a Transformer as Figure 16 shown, each reaction array in the sample reaction data set can be vector-transformed to obtain the sample reactant vector and the sample reaction product vector.
[0132] In step S102, the sample reactant vector is input into the first auxiliary network, and a positive sample reactant set and a negative sample reactant set are constructed through the first auxiliary network;
[0133] In this embodiment, since the prediction of reaction products during the modeling process assumes that given reactants will definitely react, but in actual scenarios, not all reactants will react. Therefore, a correct reaction product prediction model should have the ability to distinguish whether reactants can react. Also, in the embedding space, molecules that cannot react should be far apart, and molecules that can react should be close to each other. Thus, in this embodiment, an auxiliary task for predicting whether reactants can react, namely the first auxiliary network, is constructed to construct a positive sample reactant set and a negative sample reactant set, so as to help the reaction product prediction model learn the distances between molecules, thereby learning the ability to distinguish whether reactants can react and enhancing the generalization ability of molecular representation. Accordingly, after obtaining the sample reactant vectors, the sample reactant vectors are input into the first auxiliary network, and the positive sample reactant set and the negative sample reactant set are constructed through the first auxiliary network.
[0134] Specifically, the sample reactant vectors are input into Task1, namely the first auxiliary network, as shown in Figure 15 . Any two sample reactant vectors are sampled from the same reaction array, such as R 11 +R 12 +R 13 →P 11 as a positive sample reactant combination, such as R 11 +R 12 , R 11 +R 13 and R 12 +R 13 etc., so as to be aggregated into the positive sample reactant set positive;
[0135] Further, any two sample reactant vectors can be sampled from different reaction arrays, such as R 11 +R 12 +R 13 →P 11 and R 21 +R 22 +R 23 →P 21 as a negative sample reactant combination, such as R 11 +R 22 , R 12 +R 23 and R 21 +R 13 etc., so as to be aggregated into the negative sample reactant set negative.
[0136] In step S103, the reaction prediction loss value is calculated based on the positive sample reactant set and the negative sample reactant set;
[0137] In this embodiment, the reaction prediction loss value is used to represent the ability of the reaction product prediction model to distinguish whether reactants can react.
[0138] Specifically, after obtaining the positive sample reactant set and the negative sample reactant set, the following loss function formula (1) can be used to calculate the reaction prediction loss value:
[0139]
[0140] where D pos represents the positive sample reactant set, D neg represents the negative sample reactant set, (i, j) are respectively used to represent the positive sample reactant combination or the negative sample reactant combination sampled from the corresponding sample reactant set, ε and γ are two margin hyperparameters, h i and h j are the sample reactant vectors of sample reactants i and j. It can be understood that the first term of the above loss function formula (1) can be used to reduce the embedding distance between positive sample molecules, and the second term can be used to increase the embedding distance between negative sample molecules.
[0141] In step S104, the sample reactant vector and the sample reaction product vector are input into the second auxiliary network, and the positive sample reaction group set and the negative sample reaction group set are constructed through the second auxiliary network;
[0142] In this embodiment, since the ranking of candidate products is an important piece of information and the reaction product prediction model can receive the likelihood scores of different candidate products, this embodiment constructs an auxiliary task for predicting whether the reactants and products are in the correct corresponding relationship, that is, the second auxiliary network, to help the reaction product prediction model learn the relationship between reactants and reaction products, so that the ability to distinguish whether the reactants and reaction products are in the correct relationship can be learned, thereby enhancing the generalization ability of molecular representation. Thus, after obtaining the sample reactant vector and the sample reaction product vector, the sample reactant vector and the sample reaction product vector are input into the second auxiliary network, and the positive sample reaction group set and the negative sample reaction group set are constructed through the second auxiliary network.
[0143] Specifically, the sample reactant vector and the sample reaction product vector are input into Task2 shown as Figure 15 i.e., the second auxiliary network, and the sample reactant vectors and the sample reaction product vectors corresponding to all reaction arrays, for example, in a group of reaction arrays, R 11 +R 12 +R 13→P 11 ,the reactant R 11 +R 12 +R 13 and the reaction product P 11 are in the correct relationship and can be used as the set of positive sample reaction groups.
[0144] Furthermore, the set of negative sample reaction groups can be constructed by mismatching the reactants and reaction products to make the matching scores between the reactants and reaction products with incorrect relationships lower. For example, in a set of reaction arrays, R 11 +R 12 +R 13 →P 11 ,the reactant R 11 +R 12 +R 13 and the reaction product P 11 are in the correct relationship, and in another set of reaction arrays, R 21 +R 22 +R 23 →P 21 ,the reactant R 21 +R 22 +R 23 and the reaction product P 21 are in the correct relationship. By mismatching the reactants and reaction products, negative sample reaction groups with incorrect relationships between reactants and reaction products such as R 11 +R 12 +R 13 →P 21 and R 21 +R 22 +R 23 →P 11 can be obtained as the set of negative sample reaction groups.
[0145] Mismatch the sample reactant vector and the sample reaction product vector to obtain the set of negative sample reaction groups.
[0146] In step S105, calculate the reaction relationship prediction loss value based on the set of positive sample reaction groups and the set of negative sample reaction groups;
[0147] In this embodiment, the reaction relationship prediction loss value is used to represent the ability of the reaction product prediction model to distinguish whether the relationship between the reactant and the reaction product is correct.
[0148] Specifically, after obtaining the set of positive sample reaction groups and the set of negative sample reaction groups, the following loss function formula (2) can be used to calculate the reaction relationship prediction loss value:
[0149]
[0150] where G θis the reactant network, is the reaction product network, G θ and They have the same architecture but different parameters, and both networks satisfy permutation invariance. r is the eigenvector embedding corresponding to the reactant atom, h p is the feature vector embedding corresponding to the reaction product atom, and ε and γ are two margin hyperparameters. The first term of this function is used to bring the sample reactant vector and the sample reaction product vector in the same reaction array, i.e., the positive sample reaction group set, closer, and the second term pushes the sample reactant vector and the sample reaction product vector in the mismatched reaction array, i.e., the negative sample reaction group set, further away. It can be understood that since the model training can be an online construction task, the sample size of the objective function can be set to B.
[0151] In step S106, the sample reactant vector and the sample reaction product vector are input into the third auxiliary network, and the predicted probability value and the atomic label of the atom in the sample reactant existing in the main product are obtained through the third auxiliary network;
[0152] In this embodiment, since the reaction data in massive data sets such as the public data set USPTO-480K often ignores the by-products, it is easy to increase the prediction error of the reaction products. Therefore, in the modeling process, this embodiment can add a third auxiliary network that can be used to predict whether the atom is in the main product and is not equivalent to the predicted reaction center, which can supplement the information of some by-products to a certain extent, thereby improving the prediction ability of the reaction products. Therefore, after obtaining the sample reactant vector and the sample reaction product vector, the sample reactant vector and the sample reaction product vector are input into the third auxiliary network, and the predicted probability value and the atomic label of the atom in the sample reactant that exists in the main product are obtained through the third auxiliary network.
[0153] Specifically, the sample reactant vector and the sample reaction product vector are input into Figure 15 In the illustrated task Task3, i.e., the third auxiliary network, the sample reactants are predicted through the third auxiliary network to obtain the predicted probability values of the atoms in the sample reactants existing in the main products. At the same time, based on the sample reactant vector and the sample reaction product vector, the atoms in the sample reactants are compared with the atoms in the sample products to obtain the atomic comparison results, and the atomic labels are determined based on the atomic comparison results.
[0154] In step S107, the atomic prediction loss value is calculated based on the prediction probability value and the atomic label;
[0155] In this embodiment, the atomic prediction loss value is used to represent the ability of the reaction product prediction model to distinguish whether an atom is still in the main product after the atom reacts.
[0156] Specifically, after obtaining the prediction probability value and the atomic label, the following loss function formula (3) can be used to calculate the atomic prediction loss value:
[0157]
[0158] where y j ∈{0,1} represents the atomic label of atom j, indicating whether the atom is still in the main product after the reaction, and s j ∈[0,1] represents the prediction probability value of the model based on the atomic embedding.
[0159] In step S108, the reaction product prediction model is adjusted based on the reaction prediction loss value, the reaction relationship prediction loss value, and the atomic prediction loss value to obtain the target reaction product prediction model.
[0160] Specifically, when the reaction prediction loss value, the reaction relationship prediction loss value, and the atomic prediction loss value are obtained, on the one hand, a multi-task learning training method can be used to directly add the target functions such as the reaction prediction loss value, the reaction relationship prediction loss value, and the atomic prediction loss value to the total target function in a weighted manner. Then, the reaction product prediction model is adjusted based on the total target function value. Specifically, the parameter adjustment can be carried out by using the iterative method of backpropagation, or other methods, which are not specifically limited here, to obtain the target reaction product prediction model.
[0161] On the other hand, this embodiment can also adopt a pre-training strategy to pre-train the first auxiliary network, the second auxiliary network, and the third auxiliary network based on the reaction prediction loss value, the reaction relationship prediction loss value, and the atomic prediction loss value respectively. Then, the pre-trained networks are migrated to the reaction product prediction model to obtain the target reaction product prediction model.
[0162] In an embodiment of the present application, a method for adjusting parameters of a reaction product prediction model is provided. Through the above method, based on the first auxiliary network, the second auxiliary network, and the third auxiliary network with self-supervised properties, it is possible to mine and construct positive and negative sample sets and atomic labels from the characteristics of the sample reaction data set itself, so as to realize the automatic annotation of the sample reaction data set without relying on manual annotation, thereby reducing the cost of the reaction product prediction task. Moreover, the first auxiliary network helps the reaction product prediction model to better learn the distance relationship between reactants, enabling the reaction product prediction model to have the ability to predict whether the reactants can react. The second auxiliary network helps the reaction product prediction model to better learn the distance relationship between reactants and products, enabling the reaction product prediction model to have the ability to predict the corresponding relationship between reactants and products. The third auxiliary network helps the reaction product prediction model to better learn the changes in the bond positions between atoms of reactants during the reaction process, enabling the reaction product prediction model to have the ability to predict whether the atoms are still in the main product after the reaction. Therefore, based on the auxiliary learning of these auxiliary networks, the prediction accuracy of the reaction product prediction model for reaction products can be improved.
[0163] Optionally, on the basis of the above Figure 2 corresponding embodiment, in another optional embodiment of the method for adjusting parameters of the reaction product prediction model provided by the embodiment of the present application, as Figure 3 shown, before step S101 inputs the sample reaction data set into the reaction product prediction model and vectorizes each reaction array in the sample reaction data set through the encoding network of the reaction product prediction model to obtain the sample reactant vector and the sample reaction product vector, the method further includes: steps S301 to S302; step S101 includes: step S303;
[0164] In step S301, data augmentation processing is performed on the sample reaction data set to obtain a sample composite reaction data set;
[0165] In step S302, the sample reaction data set and the sample composite reaction data set are aggregated into an extended sample reaction data set;
[0166] In step S303, the extended sample reaction data set is input into the reaction product prediction model, and each reaction array in the extended sample reaction data set is vectorized through the encoding network of the reaction product prediction model to obtain the sample reactant vector and the sample reaction product vector.
[0167] In this embodiment, although a general reaction product prediction model can predict simple chemical reactions such as one reactant or two or three reactants, it is difficult to predict multiple reactants or complex chemical reactions. Therefore, in this embodiment, by means of data augmentation for the sample reaction data set during the modeling process, a sample composite reaction data set is obtained, and the sample reaction data set and the sample composite reaction data set are aggregated into an extended sample reaction data set. Then, the extended sample reaction data set is input into the reaction product prediction model, and each reaction array in the extended sample reaction data set is vector-transformed through the encoding network of the reaction product prediction model to obtain the sample reactant vector and the sample reaction product vector, which can not only expand the sample reaction data set, but also enhance the complexity of the sample reaction data set to a certain extent, so as to help the reaction product prediction model learn the ability to predict complex chemical reactions, thereby improving the accuracy of predicting reaction products to a certain extent.
[0168] Specifically, as Figure 15 shown in Task4 of the task diagram, when performing data augmentation processing on the sample reaction data set, specifically, two reaction arrays can be randomly selected from the sample reaction data set, the sample reactants in the two selected reaction arrays are combined to obtain the sample composite reactants, and the sample reaction products in the two selected reaction arrays are combined to obtain the sample composite reaction products. Then, based on the sample composite reactants and the sample composite reaction products, a composite reaction array is obtained to obtain the sample composite reaction data set. Other augmentation methods can also be used, which are not specifically limited here. For example, for the reactants R 11 +R 12 +R 13 →P 11 in a group of reaction arrays and the reactant R 11 +R 12 +R 13 and the reaction product P 11 in it, and the reactants R 21 +R 22 +R 23 →P 21 in another group of reaction arrays and the reaction product P 21 +R 22 +R 23 and the reaction product P 21 in it are combined, a composite reaction array such as R 11 +R 12 +R 13 +R 21 +R 22 +R 23 →P 11 +P 21。
[0169] Further, the obtained sample reaction data set is fused into the sample composite reaction data set to form an extended sample reaction data set, so as to facilitate subsequent training of the reaction product prediction model using the extended sample reaction data set, and help the reaction product prediction model learn the ability to predict complex chemical reactions. That is, the extended sample reaction data set is input into the reaction product prediction model, and each reaction array in the extended sample reaction data set is vector-transformed through the encoding network of the reaction product prediction model to obtain the sample reactant vector and the sample reaction product vector, so that subsequent training of the reaction product prediction model can be performed based on the sample reactant vector and the sample reaction product vector in combination with the above-mentioned first auxiliary network, second auxiliary network, and third auxiliary network.
[0170] Optionally, based on the above Figure 2 or Figure 3 corresponding embodiment, in another optional embodiment of the reaction product prediction model parameter adjustment method provided by the embodiments of the present application, as Figure 4 shown, in step S102, the sample reactant vector is input into the first auxiliary network, and the positive sample reactant set and the negative sample reactant set are constructed through the first auxiliary network, including:
[0171] In step S401, any two sample reactant vectors are sampled from the same reaction array as the positive sample reactant combination and summarized into the positive sample reactant set;
[0172] In step S402, any two sample reactant vectors are sampled from different reaction arrays as the negative sample reactant combination and summarized into the negative sample reactant set.
[0173] Specifically, since in the embedding space, molecules that cannot react should be far apart, and molecules that can react should be close together. Therefore, after obtaining the sample reactant vectors corresponding to each reaction array, according to the chemical reaction data, such as where and etc. are used to represent the sample reactants, and etc. are used to represent the sample reaction products, and reactant combination data is constructed by pairwise reactants.
[0174] Further, as Figure 15 shown, for the sake of convenience of representation, in this embodiment, a batch of reaction data B is given, and two spaces are constructed, where one is the positive sample space, that is, the positive sample reactant set, and the other is the negative sample space, that is, the negative sample reactant set. The sample reactant vector is input into as Figure 15The task Task1 shown in the figure is the first auxiliary network, for the positive sample reactant set D pos It is constructed based on the reaction data given in the chemical data B, that is, any two sample reactant vectors are sampled from the same reaction array and combined. Assuming that each reaction has R reactants, then R (R-1) combinations of positive sample reactant combinations can be obtained. Negative sample reactant set D neg It can be obtained by mismatching two sample reactants from different reaction arrays, that is, sampling any two sample reactant vectors from different reaction arrays and combining them.
[0175] For example, Figure 15 As shown, from the same reaction array R 11 +R 12 +R 13 →P 11 Sample any two sample reactant vectors from as positive sample reactant combinations, such as R 11 +R 12 , R 11 +R 13 and R 12 +R 13 Etc., so that they can be summarized into the positive sample reactant set positive;
[0176] Furthermore, it is possible to select from different reaction groups such as R 11 +R 12 +R 13 →P 11 and R 21 +R 22 +R 23 →P 21 Sample any two sample reactant vectors as negative sample reactant combinations, such as R 11 +R 22 , R 12 +R 23 and R 21 +R 13 Etc., and thus summarized into the negative sample reactant set negative.
[0177] Optionally, in the above Figure 2 or Figure 3 Based on the corresponding embodiment, in another optional embodiment of the reaction product prediction model parameter adjustment method provided in the embodiment of the present application, as Figure 5 As shown, step S104 inputs the sample reactant vector and the sample reaction product vector into the second auxiliary network, and constructs a positive sample reaction group set and a negative sample reaction group set through the second auxiliary network, including:
[0178] In step S501, the sample reactant vectors and sample reaction product vectors corresponding to all reaction arrays are used as the positive sample reaction group set;
[0179] In step S502, the sample reactant vectors and sample reaction product vectors are mismatched to obtain the negative sample reaction group set.
[0180] Specifically, by giving a batch of chemical reaction data B = {R1→P1, R2→P2,...}, and taking the combination of the given reactant such as R1 and the reaction product P1 in this batch as the positive sample reaction group, that is, R1→P1, the chemical reaction data B can be used as the positive sample reaction group set. Specifically, the sample reactant vectors and sample reaction product vectors can be input into the task Task2 shown as Figure 15 the second auxiliary network. The sample reactant vectors and sample reaction product vectors corresponding to all reaction arrays, for example, in a set of reaction arrays, R 11 +R 12 +R 13 →P 11 , the reactant R 11 +R 12 +R 13 and the reaction product P 11 are in the correct relationship and can be used as a positive sample in the positive sample reaction group set.
[0181] Furthermore, the negative sample reaction group set is constructed by mismatching the combinations of reactants and reaction products in the chemical reaction data B = {R1→P1, R2→P2,...}, that is, by mismatching the sample reactant vectors and sample reaction product vectors to obtain the negative sample reaction group set, so that the matching scores between reactants and reaction products with incorrect relationships are lower. For example, Figure 15 as shown, in a set of reaction arrays, R 11 +R 12 +R 13 →P 11 , the reactant R 11 +R 12 +R 13 and the reaction product P 11 are in the correct relationship, and, in another set of reaction arrays, R 21 +R 22 +R 23 →P 21 , the reactant R 21 +R 22 +R 23 and the reaction product P 21 are in the correct relationship. By mismatching the reactants and reaction products, it is possible to obtain, for example, R 11 +R 12 +R13 →P 21 and R 21 +R 22 +R 23 →P 11 a set of negative sample reaction groups with incorrect relationships between reactants and reaction products such as
[0182] Optionally, based on the above Figure 2 or Figure 3 corresponding embodiments, in another optional embodiment of the reaction product prediction model parameter adjustment method provided by the embodiments of the present application, as Figure 6 shown, in step S106, the sample reactant vector and the sample reaction product vector are input into the third auxiliary network, and the prediction probability value and the atomic label of the atoms in the sample reactants existing in the main product are obtained through the third auxiliary network, including:
[0183] In step S601, the sample reactants are predicted through the third auxiliary network to obtain the prediction probability value of the atoms in the sample reactants existing in the main product;
[0184] In step S602, based on the sample reactant vector and the sample reaction product vector, the atoms in the sample reactants and the sample products are compared to obtain an atomic comparison result;
[0185] In step S603, the atomic label is determined based on the atomic comparison result.
[0186] In this embodiment, since predicting whether an atom is in the main product and predicting the reaction center are two non-equivalent tasks. Among them, predicting the reaction center only knows which bond positions will break, and still cannot know which of the two atoms connected by the bond position will appear in the by-products. Therefore, the third network that can be used to predict whether an atom is in the main product can enable the reaction product prediction model to learn the relative importance of atoms in the reaction. Thus, the sample reactants can be predicted through the third auxiliary network to obtain the prediction probability value of the atoms in the sample reactants existing in the main product. At the same time, based on the sample reactant vector and the sample reaction product vector, the atoms in the sample reactants and the atoms in the sample products are compared to obtain the corresponding atomic comparison result. Then, the atomic label can be determined based on the atomic comparison result.
[0187] Specifically, the sample reactants are predicted by the third auxiliary network to obtain the predicted probability values of the atoms in the sample reactants existing in the main product. Specifically, the task of predicting whether an atom is in the main product can be regarded as known information and used as a masking matrix to cover the by-product information, so that the reaction product prediction model can only focus on the information of the main product. In fact, this masking matrix is also the content that the reaction product prediction model should predict.
[0188] Furthermore, the way to obtain the ground-truth labels of atomic labels can be specifically based on comparing the atoms in the sample reactants and the atoms in the sample products using the sample reactant vector and the sample reaction product vector. Then, the atoms that are lost in the reactants compared to the reaction products can be marked as 0, and the atoms that are still in the reaction products can be marked as 1. Other labeling methods can also be used, and no specific restrictions are imposed here.
[0189] Optionally, based on the above Figure 2 or Figure 3 corresponding embodiments, in another optional embodiment of the reaction product prediction model parameter adjustment method provided by the embodiments of the present application, as Figure 7 shown, in step S101, the sample reaction data set is input into the reaction product prediction model, and each reaction array in the sample reaction data set is vector-transformed through the encoding network of the reaction product prediction model to obtain the sample reactant vector and the sample reaction product vector, including:
[0190] In step S701, for each reaction array, the information within each molecule of the sample reactants is interacted between atoms to obtain the sample reactant interaction information;
[0191] In step S702, based on the sample reactant interaction information, interaction is performed between different sample reactants to obtain the sample reactant vector;
[0192] In step S703, for each reaction array, the information within each molecule of the sample reaction products is interacted between atoms to obtain the sample reaction product interaction information;
[0193] In step S704, based on the sample reaction product interaction information, interaction is performed between different sample reactants to obtain the sample reaction product vector.
[0194] Specifically, when the reaction product prediction model uses the VAE architecture with electron transfer conservation as Figure 16 shown, the encoding network for vector-transforming each reaction array in the sample reaction data set in this embodiment is composed of a graph neural network GNN and a Transformer.
[0195] Among them, the Transformer consists of an encoding part (encoder) and a decoding part (decoder). It can use the self-attention mechanism and does not adopt the sequential structure of the recurrent neural network (RNN) and the long short-term memory network (LSTM), enabling the model to be trained in parallel and having global information.
[0196] Among them, the graph neural network (GNN) includes graph convolutional network, graph attention network, graph autoencoder, graph generation network, graph spatio-temporal network, etc. Compared with the fully connected layer (MLP), which is the most basic network structure of the neural network where the feature matrix is multiplied by the weight matrix, the graph neural network has an additional adjacency matrix.
[0197] Therefore, the following formula (4) can be used. First, let the information within each molecule interact between atoms through the GNN, that is, for each reaction array, let the information within each molecule of the sample reactants interact between atoms to obtain the sample reactant interaction information. Then, let the information interact between different reactants through the Transformer, that is, interact between different sample reactants based on the sample reactant interaction information to obtain the sample reactant vector:
[0198] h R = Transformer(GNN(G R )) (4);
[0199] Among them, h R is used to represent the sample reactant vector, and G R is used to represent the sample reactants.
[0200] Similarly, the following formula (5) can be used. First, let the information within each molecule interact between atoms through the GNN, that is, for each reaction array, let the information within each molecule of the sample reaction products interact between atoms to obtain the sample reaction product interaction information. Then, let the information interact between different reaction products through the Transformer, that is, interact between different sample reaction products based on the sample reaction product interaction information to obtain the sample reaction product vector:
[0201] h P = Transformer(GNN(G P )) (5);
[0202] Among them, h P is used to represent the sample reaction product vector, and G P is used to represent the sample reaction products.
[0203] Optionally, in the above Figure 3Based on the corresponding embodiments, in another alternative embodiment of the reaction product prediction model parameter adjustment method provided by the embodiments of the present application, as Figure 8 shown, in step S301, data augmentation processing is performed on the sample reaction data set to obtain a sample composite reaction data set, including:
[0204] In step S801, two reaction arrays are randomly selected from the sample reaction data set;
[0205] In step S802, the sample reactants in the two selected reaction arrays are combined to obtain a sample composite reactant;
[0206] In step S803, the sample reaction products in the two selected reaction arrays are combined to obtain a sample composite reaction product;
[0207] In step S804, based on the sample composite reactant and the sample composite reaction product, a composite reaction array is obtained to obtain the sample composite reaction data set.
[0208] In this embodiment, performing data augmentation processing on the sample reaction data set may be randomly selecting two reaction arrays from the sample reaction data set, combining the sample reactants in the two selected reaction arrays to obtain a sample composite reactant, and at the same time, combining the sample reaction products in the two selected reaction arrays to obtain a sample composite reaction product. Then, based on the sample composite reactant and the sample composite reaction product, a composite reaction array is obtained to obtain the sample composite reaction data set. Although this data augmentation method cannot combine to obtain completely accurate chemical reactions. For example, among the new reactant combinations, it is no longer A and B, E and F that react. It may be A and E, B and F, or other combination methods. Or, even if it is still A and B, E and F that react, it may only be an intermediate product and can further react to obtain the final product. That is, the new reactions obtained by the data augmentation method of random combination are not necessarily accurate, but can still enhance the generalization ability of the reaction product prediction model. Moreover, there are often incorrect reaction data in the commonly used USPTO-480K data (such as the ground-truth product given is an intermediate product rather than the final product). Therefore, the inaccuracies in the new reaction combinations obtained by the above data augmentation method have little impact on the prediction accuracy of the reaction product prediction model. Therefore, the sample composite reaction data set obtained after data augmentation can be added to the original sample reaction data set to expand and obtain an expanded sample reaction data set, which is applied to subsequent reaction product prediction model parameter adjustment to enhance the robustness and generalization performance of the reaction product prediction model, and also has strong scalability for larger data sets, and performs a supervised task that does not rely on manual annotation.
[0209] Specifically, as shown in the task Task4 Figure 15 indicated, data augmentation processing is performed on the sample reaction data set. Specifically, two reaction arrays can be randomly selected from the sample reaction data set, and the sample reactants in the two selected reaction arrays are combined to obtain a sample composite reactant, and the sample reaction products in the two selected reaction arrays are combined to obtain a sample composite reaction product. Then, based on the sample composite reactant and the sample composite reaction product, a composite reaction array is obtained to obtain a sample composite reaction data set. Other augmentation methods can also be used, which are not specifically limited here. For example, in a group of reaction arrays R 11 +R 12 +R 13 →P 11 the reactants R 11 +R 12 +R 13 and the reaction product P 11 , are combined with the reactants R 21 +R 22 +R 23 →P 21 in another group of reaction arrays and the reaction product P 21 +R 22 +R 23 . A composite reaction array such as R 21 +R 11 +R 12 +R 13 +R 21 +R 22 +R 23 →P 11 +P 21 can be obtained.
[0210] Optionally, on the basis of the corresponding embodiment above Figure 2 , in another optional embodiment of the reaction product prediction model parameter adjustment method provided by the embodiments of the present application, as Figure 9 shown, step S108 adjusts the parameters of the reaction product prediction model based on the reaction prediction loss value, the reaction relationship prediction loss value, and the atom prediction loss value to obtain the target reaction product prediction model, including:
[0211] In step S901, a reconstruction loss value and a divergence loss value are obtained;
[0212] In step S902, the parameters of the reaction product prediction model are adjusted based on the reconstruction loss value, the divergence loss value, the reaction prediction loss value, the reaction relationship prediction loss value, and the atom prediction loss value to obtain the target reaction product prediction model.
[0213] Specifically, when the reaction product prediction model uses the VAE architecture with electron transfer conservation as shown in Figure 16 this embodiment can adopt a training method of multi-task learning, and based on the VAE architecture, a reconstruction loss value and a divergence loss value can be obtained.
[0214] Furthermore, based on the following total objective function formula (6), the objective functions such as the reconstruction loss value, the divergence loss value, the reaction prediction loss value, the reaction relationship prediction loss value, and the atomic prediction loss value can be directly added to the total objective function in a weighted manner to obtain the total objective function value:
[0215] L tatal = L reconstruct + αL KL + βL A + λL B + θL C (6);
[0216] wherein, L tatal represents the total objective function value, L reconstruct represents the reconstruction loss value, L KL represents the divergence loss value, L A represents the reaction prediction loss value, L B represents the reaction relationship prediction loss value, and L C represents the atomic prediction loss value. α, β, λ, and θ are weight parameters set according to actual application requirements and are not specifically limited here.
[0217] Furthermore, the parameters of the reaction product prediction model can be adjusted based on the total objective function value. Specifically, the parameters can be adjusted by using an iterative method of backpropagation, or other methods, which are not specifically limited here, to obtain the target reaction product prediction model.
[0218] Optionally, on the basis of the above Figure 9 corresponding embodiment, in another optional embodiment of the reaction product prediction model parameter adjustment method provided by the embodiments of the present application, as shown in Figure 10 step S901 of obtaining the reconstruction loss value and the divergence loss value includes:
[0219] In step S1001, an attention mechanism is applied to the sample reactant vector and the sample reaction product vector to obtain a first hidden vector;
[0220] In step S1002, a second hidden vector is calculated based on the first hidden vector and the sample reactant vector;
[0221] In step S1003, the second hidden vector is input into the decoding network of the reaction product prediction model, and the sample prediction change probability of the adjacency matrix is output through the decoding network;
[0222] In step S1004, based on the sample prediction change probability, determine the sample predicted reaction product adjacency matrix;
[0223] In step S1005, calculate the loss based on the reaction product adjacency matrix of the sample reaction product and the sample predicted reaction product adjacency matrix to obtain the reconstruction loss value and the divergence loss value.
[0224] Specifically, as Figure 16 shown, the attention mechanism is adopted for the sample reactant vector and the sample reaction product vector, that is, the reactant embedding and the product embedding can pass through a layer of cross-attention mechanism (crossattention). Among them, the cross-attention can be directly implemented by the Transformer Decoder based on the following formulas (7), (8), and (9) to obtain the parameter vectors μ and logσ of the Gaussian distribution. At the same time, the first hidden vector conforming to the Gaussian distribution is obtained through the reparameterization technique:
[0225] h z = Mean(TransformerDecoder(h R , h P )) (7);
[0226] μ = W μ ReLU(h z ) + b μ (8);
[0227] logσ = W σ ReLU(h z ) + b σ (9);
[0228] Among them, h z represents the first hidden vector, and W μ , b μ , W σ , b σ represent model parameters.
[0229] Furthermore, calculate the second hidden vector based on the first hidden vector and the sample reactant vector. Specifically, it can be to add the first hidden vector and the sample reactant vector according to the following formula (10) and pass through a layer of Transformer to obtain a new hidden vector, that is, the second hidden vector h L :
[0230] h L = Transformer(h R + h z) (10);
[0231] Further, as Figure 16 shown, the second hidden vector is input into the decoding network of the reaction product prediction model, and the second hidden vector h L is decoded by the decoding network. Among them, the decoding network decoder is mainly composed of two separate self-attention mechanisms. One self-attention mechanism outputs an attention matrix as the probability of increased shared electrons between two atoms, and the other self-attention mechanism outputs an attention matrix as the probability of decreased shared electrons between two atoms. Since the transfer of electrons is conserved, the weight matrix characteristics of the self-attention mechanism are used to model this property. The specific decoding operations include the following formulas (11) and (12) to obtain the sample prediction change probability of the adjacency matrix:
[0232] W +d = SelfAttention(h L ) (11);
[0233] W -d = SelfAttention(h L ) (12);
[0234] Among them, W +d represents a sample prediction change probability, that is, the probability matrix of increased electrons between each pair of atoms, and W -d represents another sample prediction change probability, that is, the probability matrix of decreased electrons between each pair of atoms.
[0235] Further, based on the sample prediction change probability, calculate the sample prediction reaction product adjacency matrix. Specifically, it can be to calculate the sample prediction change amount of the adjacency matrix based on the sample prediction change probability, and based on the sample prediction change amount of the adjacency matrix and the adjacency matrix of the sample reactants, calculate the sample prediction reaction product adjacency matrix. Then, based on the reaction product adjacency matrix of the sample reaction product and the sample prediction reaction product adjacency matrix, calculate the cross-entropy loss to obtain the reconstruction loss value and the divergence loss value.
[0236] It should be noted that each value in the adjacency matrix in this embodiment is not just 0 or 1 (0 represents no connection between the corresponding atom pairs, and 1 represents a connection between the corresponding atom pairs), but four values of 0, 1, 2, and 3, representing no connection, single bond connection, double bond connection, and triple bond connection respectively. Aromatic bond connection is represented as 1, and the connected atoms are marked as aromatic atoms to distinguish them from single bond connections.
[0237] Optionally, on the basis of the above Figure 10 corresponding embodiment, in another optional embodiment of the reaction product prediction model parameter adjustment method provided by the embodiments of the present application, as Figure 11As shown, step S1004 determines the adjacent matrix of the sample predicted reaction product based on the sample predicted change probability, including:
[0238] In step S1101, calculate the sample predicted change amount of the adjacent matrix based on the sample predicted change probability;
[0239] In step S1102, calculate the adjacent matrix of the sample predicted reaction product based on the sample predicted change amount of the adjacent matrix and the adjacent matrix of the sample reactant.
[0240] Specifically, after obtaining the sample predicted change probability, the following formula (13) can be used to calculate the sample predicted change amount of the adjacent matrix based on the sample predicted change probability, that is, based on the probability matrix W of the electron increase between each pair of atoms +d and the probability matrix W of the electron decrease between each pair of atoms -d Subtract them and multiply by 4 to obtain the predicted sample predicted change amount ΔA between each pair of atoms:
[0241] ΔA = (W +d - W -d ) × 4 (13);
[0242] Among them, 4 represents the maximum change amount between each pair of atoms.
[0243] Furthermore, the following formula (14) is used to calculate the adjacent matrix of the sample predicted reaction product based on the sample predicted change amount of the adjacent matrix and the adjacent matrix of the sample reactant:
[0244] A P = A R + ΔA (14);
[0245] Among them, A P represents the adjacent matrix of the sample predicted reaction product, and A R represents the adjacent matrix of the sample reactant.
[0246] Furthermore, the adjacent matrix must be symmetric, so the following formula (15) can be used to symmetrize the adjacent matrix of the sample predicted reaction product:
[0247]
[0248] Optionally, on the basis of the above Figure 2 corresponding embodiment, in another optional embodiment of the reaction product prediction model parameter adjustment method provided by the embodiments of the present application, as Figure 12 shown, step S108 adjusts the parameters of the reaction product prediction model based on the reaction prediction loss value, the reaction relationship prediction loss value, and the atom prediction loss value to obtain the target reaction product prediction model, including:
[0249] In step S1201, the parameters of the first auxiliary network are adjusted based on the reaction prediction loss value to obtain the first sub-model;
[0250] In step S1202, the parameters of the second auxiliary network are adjusted based on the reaction relationship prediction loss value to obtain the second sub-model;
[0251] In step S1203, the parameters of the third auxiliary network are adjusted based on the atom prediction loss value to obtain the third sub-model;
[0252] In step S1204, the first sub-model, the second sub-model, and the third sub-model are migrated to the reaction product prediction model to obtain the target reaction product prediction model.
[0253] Specifically, this embodiment can also adopt a pre-training strategy, and pre-train the first auxiliary network, the second auxiliary network, and the third auxiliary network respectively based on the reaction prediction loss value, the reaction relationship prediction loss value, and the atom prediction loss value. That is, the parameters of the first auxiliary network are adjusted based on the reaction prediction loss value to obtain the first sub-model, and the parameters of the second auxiliary network are adjusted based on the reaction relationship prediction loss value to obtain the second sub-model, and the parameters of the third auxiliary network are adjusted based on the atom prediction loss value to obtain the third sub-model. Then, the first sub-model, the second sub-model, and the third sub-model are migrated to the reaction product prediction model. Specifically, the backbone networks of the first sub-model, the second sub-model, and the third sub-model can be migrated to the reaction product prediction model, and then a decoder network layer for reaction product prediction is connected after the layer that outputs the embedding of the backbone network to obtain the target reaction product prediction model.
[0254] Next, the application method of the reaction product prediction model in this application will be introduced. Please refer to Figure 13 , an embodiment of the application method of the reaction product prediction model in this embodiment of the application includes:
[0255] In step S1301, the reactant to be measured is input into the target reaction product prediction model, and the predicted change probability of the adjacency matrix is output through the target reaction product prediction model;
[0256] In step S1302, the predicted change amount of the adjacency matrix is calculated based on the predicted change probability of the adjacency matrix;
[0257] In step S1303, the target reaction product is determined based on the predicted change amount of the adjacency matrix and the adjacency matrix of the reactant to be measured.
[0258] In this embodiment, after obtaining the reactant to be measured, the reactant to be measured can be input into the target reaction product prediction model. The prediction change probability of the adjacency matrix is output by the target reaction product prediction model, and the prediction change amount of the adjacency matrix is calculated based on the prediction change probability of the adjacency matrix. Then, based on the prediction change amount of the adjacency matrix and the adjacency matrix of the reactant to be measured, the target reaction product can be determined, so that the obtained target reaction product can be applied to scenarios such as scientific pharmaceutical manufacturing or drug verification in the subsequent process.
[0259] It can be understood that the target reaction product prediction model can be used as an effective verification tool for drug retrosynthesis, improving the research efficiency of new drug synthesis routes; the target reaction product prediction model can reveal some hidden scientific laws and provide new scientific knowledge; the target reaction product prediction model can provide more accurate predictions than experts. It can not only predict reliable candidate products even when known templates cannot be used, but also predict new reactions, thus greatly improving the R & D efficiency of new drugs, etc.
[0260] Specifically, the reactant to be measured is input into the target reaction product prediction model, and the prediction change probability of the adjacency matrix is output by the target reaction product prediction model, that is, based on the probability matrix W of the increase in electrons between each pair of atoms +d and the probability matrix W of the decrease in electrons between each pair of atoms -d , and then, the prediction change amount ΔA of the adjacency matrix can be calculated using the above formula (13).
[0261] Optionally, on the basis of the corresponding embodiment above Figure 13 , in another optional embodiment of the application method of the reaction product prediction model provided by the embodiment of the present application, as Figure 14 shown, step S1303 determines the target reaction product based on the prediction change amount of the adjacency matrix and the adjacency matrix of the reactant to be measured, including:
[0262] In step S1401, the adjacency matrix of the predicted reaction product is calculated based on the prediction change amount of the adjacency matrix and the adjacency matrix of the reactant to be measured;
[0263] In step S1402, the adjacency matrix of the predicted reaction product is symmetrized to obtain the adjacency matrix of the target reaction product;
[0264] In step S1403, the target reaction product is determined based on the adjacency matrix of the target reaction product.
[0265] Specifically, the adjacency matrix of the predicted reaction product can be calculated using the above formula (14) based on the prediction change amount of the adjacency matrix and the adjacency matrix of the reactant to be measured, where A P represents the adjacency matrix of the predicted reaction product, and A RAn adjacency matrix representing the reactant to be measured.
[0266] Furthermore, since the adjacency matrix must be symmetric, the above formula (15) can be used to symmetrize the adjacency matrix of the predicted reaction product to obtain the target reaction product adjacency matrix. Then, based on the target reaction product adjacency matrix A P , the target reaction product can be deduced.
[0267] The reaction product prediction model parameter adjustment device in the present application will be described in detail below. Please refer to Figure 17 , Figure 17 which is a schematic diagram of an embodiment of the reaction product prediction model parameter adjustment device in the embodiment of the present application. The reaction product prediction model parameter adjustment device 20 includes:
[0268] An acquisition unit 201, configured to input a sample reaction data set into the reaction product prediction model, and perform vector transformation on each reaction array in the sample reaction data set through the encoding network of the reaction product prediction model to obtain a sample reactant vector and a sample reaction product vector. The sample reaction data set includes multiple reaction arrays, and each reaction array includes a sample reactant and a sample reaction product;
[0269] The acquisition unit 201 is further configured to input the sample reactant vector into the first auxiliary network to construct a positive sample reactant set and a negative sample reactant set through the first auxiliary network;
[0270] A processing unit 202, configured to calculate a reaction prediction loss value based on the positive sample reactant set and the negative sample reactant set;
[0271] The acquisition unit 201 is configured to input the sample reactant vector and the sample reaction product vector into the second auxiliary network to construct a positive sample reaction group set and a negative sample reaction group set through the second auxiliary network;
[0272] The processing unit 202 is further configured to calculate a reaction relationship prediction loss value based on the positive sample reaction group set and the negative sample reaction group set;
[0273] The acquisition unit 201 is configured to input the sample reactant vector and the sample reaction product vector into the third auxiliary network to obtain the predicted probability value and atom label of the atoms in the sample reactant existing in the main product;
[0274] The processing unit 202 is further configured to calculate an atom prediction loss value based on the predicted probability value and the atom label;
[0275] A determination unit 203, configured to adjust the parameters of the reaction product prediction model based on the reaction prediction loss value, the reaction relationship prediction loss value, and the atom prediction loss value to obtain a target reaction product prediction model.
[0276] Optionally, based on the above Figure 17 In another embodiment of the reaction product prediction model parameter adjustment device provided by the embodiments of the present application, on the basis of the corresponding embodiment,
[0277] The processing unit 202 is further configured to perform data augmentation processing on the sample reaction data set to obtain a sample composite reaction data set;
[0278] The processing unit 202 is further configured to aggregate the sample reaction data set and the sample composite reaction data set into an extended sample reaction data set;
[0279] The obtaining unit 201 may specifically be configured to: input the extended sample reaction data set into the reaction product prediction model, and perform vector transformation on each reaction array in the extended sample reaction data set through the encoding network of the reaction product prediction model to obtain a sample reactant vector and a sample reaction product vector.
[0280] Optionally, based on the above Figure 17 In another embodiment of the reaction product prediction model parameter adjustment device provided by the embodiments of the present application, on the basis of the corresponding embodiment, the obtaining unit 201 may specifically be configured to:
[0281] Sample any two sample reactant vectors from the same reaction array as a positive sample reactant combination to be aggregated into the positive sample reactant set;
[0282] Sample any two sample reactant vectors from different reaction arrays as a negative sample reactant combination to be aggregated into the negative sample reactant set.
[0283] Optionally, based on the above Figure 17 In another embodiment of the reaction product prediction model parameter adjustment device provided by the embodiments of the present application, on the basis of the corresponding embodiment, the obtaining unit 201 may specifically be configured to:
[0284] Use all the sample reactant vectors and sample reaction product vectors corresponding to the reaction arrays as the positive sample reaction group set;
[0285] Mismatch the sample reactant vectors and the sample reaction product vectors to obtain a negative sample reaction group set.
[0286] Optionally, based on the above Figure 17 In another embodiment of the reaction product prediction model parameter adjustment device provided by the embodiments of the present application, on the basis of the corresponding embodiment, the obtaining unit 201 may specifically be configured to:
[0287] Predict the sample reactants through a third auxiliary network to obtain the predicted probability values of the atoms in the sample reactants existing in the main product;
[0288] Based on the comparison of atoms in the sample reactant and the sample product by using the sample reactant vector and the sample reaction product vector, an atomic comparison result is obtained;
[0289] Determine atomic tags based on the atomic comparison result.
[0290] Optionally, on the basis of the corresponding embodiment above, in another embodiment of the reaction product prediction model parameter adjustment device provided by the embodiments of the present application, the obtaining unit 201 may specifically be used for: Figure 17 For each reaction array, interact the information within each molecule of the sample reactant among atoms to obtain sample reactant interaction information;
[0291] Interact the sample reactant interaction information among different sample reactants to obtain a sample reactant vector;
[0292] Based on the sample reactant interaction information, interact among different sample reactants to obtain a sample reactant vector;
[0293] For each reaction array, interact the information within each molecule of the sample reaction product among atoms to obtain sample reaction product interaction information;
[0294] Interact the sample reaction product interaction information among different sample reactants to obtain a sample reaction product vector.
[0295] Optionally, on the basis of the corresponding embodiment above, in another embodiment of the reaction product prediction model parameter adjustment device provided by the embodiments of the present application, the processing unit 202 may specifically be used for: Figure 17 Randomly select two reaction arrays from the sample reaction data set;
[0296] Combine the sample reactants in the two selected reaction arrays to obtain a sample composite reactant;
[0297] Combine the sample reaction products in the two selected reaction arrays to obtain a sample composite reaction product;
[0298] Based on the sample composite reactant and the sample composite reaction product, obtain a composite reaction array to obtain a sample composite reaction data set.
[0299] Based on the sample composite reactant and the sample composite reaction product, obtain a composite reaction array to obtain a sample composite reaction data set.
[0300] Optionally, on the basis of the corresponding embodiment above, in another embodiment of the reaction product prediction model parameter adjustment device provided by the embodiments of the present application, the determining unit 203 may specifically be used for: Figure 17 Obtain a reconstruction loss value and a divergence loss value;
[0301] Obtain a reconstruction loss value and a divergence loss value;
[0302] Adjust the parameters of the reaction product prediction model based on the reconstruction loss value, divergence loss value, reaction prediction loss value, reaction relationship prediction loss value, and atomic prediction loss value to obtain the target reaction product prediction model.
[0303] Optionally, based on the above Figure 17 corresponding embodiment, in another embodiment of the reaction product prediction model parameter adjustment device provided by the embodiments of the present application, the determination unit 203 can specifically be used for:
[0304] Apply the attention mechanism to the sample reactant vector and the sample reaction product vector to obtain the first hidden vector;
[0305] Calculate the second hidden vector based on the first hidden vector and the sample reactant vector;
[0306] Input the second hidden vector into the decoding network of the reaction product prediction model, and output the sample prediction change probability of the adjacency matrix through the decoding network;
[0307] Determine the sample prediction reaction product adjacency matrix based on the sample prediction change probability;
[0308] Calculate the reconstruction loss value and the divergence loss value based on the reaction product adjacency matrix of the sample reaction product and the sample prediction reaction product adjacency matrix.
[0309] Optionally, based on the above Figure 17 corresponding embodiment, in another embodiment of the reaction product prediction model parameter adjustment device provided by the embodiments of the present application, the determination unit 203 can specifically be used for:
[0310] Calculate the sample prediction change amount of the adjacency matrix based on the sample prediction change probability;
[0311] Calculate the sample prediction reaction product adjacency matrix based on the sample prediction change amount of the adjacency matrix and the adjacency matrix of the sample reactant.
[0312] Optionally, based on the above Figure 17 corresponding embodiment, in another embodiment of the reaction product prediction model parameter adjustment device provided by the embodiments of the present application, the determination unit 203 can specifically be used for:
[0313] Adjust the parameters of the first auxiliary network based on the reaction prediction loss value to obtain the first sub-model;
[0314] Adjust the parameters of the second auxiliary network based on the reaction relationship prediction loss value to obtain the second sub-model;
[0315] Adjust the parameters of the third auxiliary network based on the atomic prediction loss value to obtain the third sub-model;
[0316] Migrate the first sub-model, the second sub-model, and the third sub-model to the reaction product prediction model to obtain the target reaction product prediction model.
[0317] The following will describe in detail the application device of the reaction product prediction model in this application. Please refer to Figure 18 , Figure 18 FIG. is a schematic diagram of an embodiment of the application device of the reaction product prediction model in an embodiment of this application. The application device 30 of the reaction product prediction model includes:
[0318] An acquisition unit 301, configured to input a reactant to be measured into the target reaction product prediction model, and output the predicted change probability of the adjacency matrix through the target reaction product prediction model;
[0319] A processing unit 302, configured to calculate the predicted change amount of the adjacency matrix based on the predicted change probability of the adjacency matrix;
[0320] A determination unit 303, configured to determine the target reaction product based on the predicted change amount of the adjacency matrix and the adjacency matrix of the reactant to be measured.
[0321] Optionally, on the basis of the above Figure 18 corresponding embodiment, in another embodiment of the application device of the reaction product prediction model provided in the embodiment of this application, the determination unit 303 may specifically be configured to:
[0322] Calculate the predicted reaction product adjacency matrix based on the predicted change amount of the adjacency matrix and the adjacency matrix of the reactant to be measured;
[0323] Perform a symmetrization process on the predicted reaction product adjacency matrix to obtain the target reaction product adjacency matrix;
[0324] Determine the target reaction product based on the target reaction product adjacency matrix.
[0325] On the other hand, this application provides another schematic diagram of a computer device, as Figure 19 shown, Figure 19It is a schematic structural diagram of a computer device provided by an embodiment of the present application. The computer device 300 may vary greatly due to different configurations or performances, and may include one or more central processing units (CPUs) 310 (for example, one or more processors) and a memory 320, and one or more storage media 330 (for example, one or more mass storage devices) storing application programs 331 or data 332. Among them, the memory 320 and the storage media 330 may be transient storage or persistent storage. The program stored in the storage media 330 may include one or more modules (not shown in the figure), and each module may include a series of instruction operations on the computer device 300. Further, the central processor 310 may be set to communicate with the storage media 330 and execute a series of instruction operations in the storage media 330 on the computer device 300.
[0326] The computer device 300 may further include one or more power supplies 340, one or more wired or wireless network interfaces 350, one or more input / output interfaces 360, and / or one or more operating systems 333, such as Windows Server TM , Mac OS X TM , Unix TM , Linux TM , FreeBSD TM and so on.
[0327] The above computer device 300 is also used to execute the steps in the Figures 2 to 13 corresponding embodiments, and Figure 14 the steps in the corresponding embodiments.
[0328] On the other hand, the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, it implements the steps in the method described in the Figures 2 to 13 illustrated embodiment, and Figure 14 the steps in the method described in the illustrated embodiment.
[0329] On the other hand, the present application provides a computer program product including a computer program. When the computer program is executed by a processor, it implements the steps in the method described in the Figures 2 to 13 illustrated embodiment, and Figure 14 the steps in the method described in the illustrated embodiment.
[0330] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the above-described systems, devices, and units can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.
[0331] In several embodiments provided in the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces, and the indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.
[0332] The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0333] In addition, in each embodiment of the present application, the functional units can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.
[0334] If the above-mentioned integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present application. And the aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs and other various media that can store program codes.
Claims
1. A method for adjusting parameters of a reaction product prediction model, characterized in that, Including: Input the sample reaction data set into the reaction product prediction model, and perform vector transformation on each reaction array in the sample reaction data set through the encoding network of the reaction product prediction model to obtain the sample reactant vector and the sample reaction product vector. The sample reaction data set includes a plurality of the reaction arrays, and each reaction array includes a sample reactant and a sample reaction product; Input the sample reactant vector into the first auxiliary network, and construct a positive sample reactant set and a negative sample reactant set through the first auxiliary network; Calculate the reaction prediction loss value based on the positive sample reactant set and the negative sample reactant set; Input the sample reactant vector and the sample reaction product vector into the second auxiliary network, and construct a positive sample reaction group set and a negative sample reaction group set through the second auxiliary network; Calculate the reaction relationship prediction loss value based on the positive sample reaction group set and the negative sample reaction group set; Input the sample reactant vector and the sample reaction product vector into the third auxiliary network, and obtain the predicted probability value and the atomic label of the atoms in the sample reactants existing in the main product through the third auxiliary network; Calculate the atomic prediction loss value based on the predicted probability value and the atomic label; Adjust the parameters of the reaction product prediction model based on the reaction prediction loss value, the reaction relationship prediction loss value, and the atomic prediction loss value to obtain the target reaction product prediction model.
2. The method according to claim 1, wherein Before inputting the sample reaction data set into the reaction product prediction model and performing vector transformation on each reaction array in the sample reaction data set through the encoding network of the reaction product prediction model to obtain the sample reactant vector and the sample reaction product vector, the method further includes: Perform data augmentation processing on the sample reaction data set to obtain a sample composite reaction data set; Summarize the sample reaction data set and the sample composite reaction data set into an extended sample reaction data set; The step of inputting the sample reaction data set into the reaction product prediction model and performing vector transformation on each reaction array in the sample reaction data set through the encoding network of the reaction product prediction model to obtain the sample reactant vector and the sample reaction product vector includes: Input the extended sample reaction data set into the reaction product prediction model, and perform vector transformation on each reaction array in the extended sample reaction data set through the encoding network of the reaction product prediction model to obtain the sample reactant vector and the sample reaction product vector.
3. The method according to any one of claims 1 or 2, characterized in that The step of inputting the sample reactant vector into the first auxiliary network and constructing a positive sample reactant set and a negative sample reactant set through the first auxiliary network includes: Sample any two of the sample reactant vectors from the same reaction array as a positive sample reactant combination and summarize them into the positive sample reactant set; Sample any two of the sample reactant vectors from different reaction arrays as a negative sample reactant combination and summarize them into the negative sample reactant set.
4. The method according to any one of claims 1 or 2, characterized in that, Inputting the sample reactant vector and the sample reaction product vector into a second auxiliary network, and constructing a positive sample reaction group set and a negative sample reaction group set through the second auxiliary network, includes: Regarding the sample reactant vectors and the sample reaction product vectors corresponding to all reaction arrays as the positive sample reaction group set; Mismatching the sample reactant vector and the sample reaction product vector to obtain the negative sample reaction group set.
5. The method according to any one of claims 1 or 2, characterized in that Inputting the sample reactant vector and the sample reaction product vector into a third auxiliary network, and obtaining the predicted probability value and atomic label of the atoms in the sample reactant existing in the main product through the third auxiliary network, includes: Performing prediction on the sample reactant through the third auxiliary network to obtain the predicted probability value of the atoms in the sample reactant existing in the main product; Based on the sample reactant vector and the sample reaction product vector, performing atomic comparison between the sample reactant and the sample reaction product to obtain an atomic comparison result; Determining the atomic label based on the atomic comparison result.
6. The method according to any one of claims 1 or 2, characterized in that, Inputting the sample reaction data set into a reaction product prediction model, and performing vector transformation on each reaction array in the sample reaction data set through the encoding network of the reaction product prediction model to obtain a sample reactant vector and a sample reaction product vector, includes: For each reaction array, interacting the information within each molecule of the sample reactant among atoms to obtain sample reactant interaction information; Based on the sample reactant interaction information, interacting among different sample reactants to obtain the sample reactant vector; For each reaction array, interacting the information within each molecule of the sample reaction product among atoms to obtain sample reaction product interaction information; Based on the sample reaction product interaction information, interacting among different sample reactants to obtain the sample reaction product vector.
7. The method according to claim 2, characterized in that, Performing data augmentation processing on the sample reaction data set to obtain a sample composite reaction data set, includes: Randomly selecting two reaction arrays from the sample reaction data set; Combining the sample reactants in the two selected reaction arrays to obtain a sample composite reactant; Combining the sample reaction products in the two selected reaction arrays to obtain a sample composite reaction product; Based on the sample composite reactant and the sample composite reaction product, obtaining a composite reaction array to obtain the sample composite reaction data set.
8. The method according to claim 1, characterized in that, Based on the reaction prediction loss value, the reaction relationship prediction loss value, and the atomic prediction loss value, adjusting the parameters of the reaction product prediction model to obtain a target reaction product prediction model, includes: Obtaining a reconstruction loss value and a divergence loss value; Based on the reconstruction loss value, the divergence loss value, the reaction prediction loss value, the reaction relationship prediction loss value, and the atomic prediction loss value, adjusting the parameters of the reaction product prediction model to obtain the target reaction product prediction model.
9. The method according to claim 8, characterized in that, The obtaining of the reconstruction loss value and the divergence loss value includes: Applying an attention mechanism to the sample reactant vector and the sample reaction product vector to obtain a first hidden vector; Calculating a second hidden vector based on the first hidden vector and the sample reactant vector; Inputting the second hidden vector into the decoding network of the reaction product prediction model, and outputting the sample prediction change probability of the adjacency matrix through the decoding network; Determining the sample prediction reaction product adjacency matrix based on the sample prediction change probability; Performing loss calculation based on the reaction product adjacency matrix of the sample reaction product and the sample prediction reaction product adjacency matrix to obtain the reconstruction loss value and the divergence loss value.
10. The method according to claim 9, wherein The determining of the sample prediction reaction product adjacency matrix based on the sample prediction change probability includes: Calculating the sample prediction change amount of the adjacency matrix based on the sample prediction change probability; Calculating the sample prediction reaction product adjacency matrix based on the sample prediction change amount of the adjacency matrix and the adjacency matrix of the sample reactant.
11. The method according to claim 1, characterized in that, The parameter adjustment of the reaction product prediction model based on the reaction prediction loss value, the reaction relationship prediction loss value, and the atom prediction loss value to obtain the target reaction product prediction model includes: Performing parameter adjustment on the first auxiliary network based on the reaction prediction loss value to obtain a first sub-model; Performing parameter adjustment on the second auxiliary network based on the reaction relationship prediction loss value to obtain a second sub-model; Performing parameter adjustment on the third auxiliary network based on the atom prediction loss value to obtain a third sub-model; Migrating the first sub-model, the second sub-model, and the third sub-model to the reaction product prediction model to obtain the target reaction product prediction model.
12. A method for applying a reaction product prediction model, characterized in that, It includes: Inputting the reactant to be measured into the target reaction product prediction model according to any one of claims 1 to 11, and outputting the prediction change probability of the adjacency matrix through the target reaction product prediction model; Calculating the prediction change amount of the adjacency matrix based on the prediction change probability of the adjacency matrix; Determining the target reaction product based on the prediction change amount of the adjacency matrix and the adjacency matrix of the reactant to be measured.
13. The method according to claim 12, wherein The determining of the target reaction product based on the prediction change amount of the adjacency matrix and the adjacency matrix of the reactant to be measured includes: Calculating the predicted reaction product adjacency matrix based on the prediction change amount of the adjacency matrix and the adjacency matrix of the reactant to be measured; Performing a symmetrization process on the predicted reaction product adjacency matrix to obtain the target reaction product adjacency matrix; Determining the target reaction product based on the target reaction product adjacency matrix.
14. A device for adjusting parameters of a reaction product prediction model, characterized in that, It includes: An obtaining unit, configured to input a sample reaction data set into a reaction product prediction model, and perform vector transformation on each reaction array in the sample reaction data set through an encoding network of the reaction product prediction model to obtain a sample reactant vector and a sample reaction product vector, where the sample reaction data set includes a plurality of the reaction arrays, and each reaction array includes a sample reactant and a sample reaction product; The obtaining unit is further configured to input the sample reactant vector into a first auxiliary network, and construct a positive sample reactant set and a negative sample reactant set through the first auxiliary network; The processing unit is configured to calculate a reaction prediction loss value based on the positive sample reactant set and the negative sample reactant set; The obtaining unit is configured to input the sample reactant vector and the sample reaction product vector into a second auxiliary network, and construct a positive sample reaction group set and a negative sample reaction group set through the second auxiliary network; The processing unit is further configured to calculate a reaction relationship prediction loss value based on the positive sample reaction group set and the negative sample reaction group set; The obtaining unit is configured to input the sample reactant vector and the sample reaction product vector into a third auxiliary network, and obtain a predicted probability value and an atomic label of the atoms in the sample reactants that exist in the main product through the third auxiliary network; The processing unit is further configured to calculate an atomic prediction loss value based on the predicted probability value and the atomic label; The determination unit is configured to perform parameter adjustment on the reaction product prediction model based on the reaction prediction loss value, the reaction relationship prediction loss value, and the atomic prediction loss value to obtain a target reaction product prediction model.
15. An application device for a reaction product prediction model, characterized in that, including: The obtaining unit is configured to input a to-be-detected reactant into the target reaction product prediction model according to any one of claims 1 to 11, and output a predicted change probability of an adjacency matrix through the target reaction product prediction model; The processing unit is configured to calculate a predicted change amount of the adjacency matrix based on the predicted change probability of the adjacency matrix; The determination unit is configured to determine a target reaction product based on the predicted change amount of the adjacency matrix and the adjacency matrix of the to-be-detected reactant.
16. A computer device, comprising a memory, a processor, and a bus system, the memory storing a computer program, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented, and the steps of the method according to any one of claims 12 to 13 are implemented; The bus system is used to connect the memory and the processor, so that the memory and the processor communicate with each other.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 11 are implemented, and the steps of the method according to any one of claims 12 to 13 are implemented.
18. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 11 are implemented, and the steps of the method according to any one of claims 12 to 13 are implemented.