CN115588471B - Self-correction single-step inverse synthesis method, terminal, server and system under continuous learning - Google Patents

Self-correction single-step inverse synthesis method, terminal, server and system under continuous learning Download PDF

Info

Publication number
CN115588471B
CN115588471B CN202211472885.6A CN202211472885A CN115588471B CN 115588471 B CN115588471 B CN 115588471B CN 202211472885 A CN202211472885 A CN 202211472885A CN 115588471 B CN115588471 B CN 115588471B
Authority
CN
China
Prior art keywords
task
model
self
neural network
network model
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211472885.6A
Other languages
Chinese (zh)
Other versions
CN115588471A (en
Inventor
曹雪梅
杨柳青
王中健
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Yaorongyun Digital Technology Chengdu Co ltd
Original Assignee
Yaorongyun Digital Technology Chengdu Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Yaorongyun Digital Technology Chengdu Co ltd filed Critical Yaorongyun Digital Technology Chengdu Co ltd
Priority to CN202211472885.6A priority Critical patent/CN115588471B/en
Publication of CN115588471A publication Critical patent/CN115588471A/en
Application granted granted Critical
Publication of CN115588471B publication Critical patent/CN115588471B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16CCOMPUTATIONAL CHEMISTRY; CHEMOINFORMATICS; COMPUTATIONAL MATERIALS SCIENCE
    • G16C20/00Chemoinformatics, i.e. ICT specially adapted for the handling of physicochemical or structural data of chemical particles, elements, compounds or mixtures
    • G16C20/70Machine learning, data mining or chemometrics
    • GPHYSICS
    • G16INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR SPECIFIC APPLICATION FIELDS
    • G16CCOMPUTATIONAL CHEMISTRY; CHEMOINFORMATICS; COMPUTATIONAL MATERIALS SCIENCE
    • G16C20/00Chemoinformatics, i.e. ICT specially adapted for the handling of physicochemical or structural data of chemical particles, elements, compounds or mixtures
    • G16C20/10Analysis or design of chemical reactions, syntheses or processes
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/30Computing systems specially adapted for manufacturing

Landscapes

  • Chemical & Material Sciences (AREA)
  • Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Crystallography & Structural Chemistry (AREA)
  • Theoretical Computer Science (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Software Systems (AREA)
  • Artificial Intelligence (AREA)
  • Medical Informatics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Databases & Information Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Data Mining & Analysis (AREA)
  • Analytical Chemistry (AREA)
  • Chemical Kinetics & Catalysis (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention discloses a self-correction single-step inverse synthesis method, a terminal, a server and a system under continuous learning, belonging to the technical field of inverse synthesis prediction, wherein the method comprises the following steps: predicting a plurality of reactants input into a target product based on the model; calculating a Fisher information matrix of the model in the prediction task, and further consolidating based on the elastic weight to obtain a loss function of the self-correction task; constructing a data set of the self-correcting task based on the invalid reactants; and carrying out grammar correction training on the model according to the data set and the loss function. According to the invention, the loss function for carrying out grammar correction training on the same model is obtained by calculation according to the Fisher information matrix, and the grammar correction training is carried out on the model by combining the self-correction task data set constructed by invalid reactants, so that the model can still memorize important parameter information in a prediction task when the model executes the self-correction task, the grammar correction is realized while the calculation and memory expenditure is saved, and the prediction accuracy of the model is greatly improved.

Description

Self-correction single-step inverse synthesis method, terminal, server and system under continuous learning
Technical Field
The invention relates to the technical field of inverse synthesis prediction, in particular to a self-correction single-step inverse synthesis method, a terminal, a server and a system based on continuous learning.
Background
In the chemical field, organic synthesis is one of the basic props of modern chemical society, as it provides various compounds from drugs to materials. By recursively decomposing it into a set of available reaction building blocks, the synthetic route of the desired organic compound is widely established, and this analysis mode is called reverse synthesis. Inverse synthesis prediction is one of the fundamental challenges of organic synthesis, the task of which is to predict reactants efficiently given a core product.
Reverse synthesis requires a chemist to predict the reactant information for a given compound. Since molecules may have a variety of possible modes of decomposition, the inverse synthetic analysis of target compounds typically results in a large number of possible synthetic routes. Selecting the appropriate synthetic routes is challenging because the differences between routes are subtle and generally depend on the global architecture. Thus, planning an inverse synthetic route for complex molecules is challenging even for the most excellent chemist.
With the development of machine learning, computer-aided synthesis planning has received much attention because of its ability to greatly save time and effort in traditional inverse synthesis methods. In the related art, the template-based method relies on an external template database, which can automatically extract templates from a reaction database and apply rules to selected related templates, with good prediction accuracy. However, template-based methods suffer from incomplete coverage and cannot infer reactions outside of the chemical space covered by the template library, and are therefore limited in finding new chemical reactions.
To overcome the above problems, a machine learning-based method has appeared in recent years. It uses neural networks for end-to-end training of reactants and products of textual representations and does not require an atomic mapping reaction paradigm. Meanwhile, the molecular data form in the prediction method based on the neural network can be not only an image, but also a simplified molecular linear input specification (Simplified Molecular Input Line Entry System, SMILES) sequence representation. However, the reactant sequence generated by the model in the form of the SMILES sequence data has invalid output which obviously does not conform to the SMILES specification, so that the model prediction precision is reduced, and therefore, how to carry out grammar correction on the invalid output of the neural network model is a problem to be solved.
Disclosure of Invention
The invention aims to solve the problems in the prior art and provides a self-correction single-step inverse synthesis method, a terminal, a server and a system under continuous learning.
The aim of the invention is realized by the following technical scheme: a self-correcting single-step inverse synthesis method under continuous learning, the method comprising the steps of:
predicting a plurality of reactants input into a target product based on a neural network model;
calculating a Fisher information matrix of the neural network model in the prediction task, and further obtaining a loss function of the neural network model self-correction task based on elastic weight consolidation calculationL(θ)
Constructing a data set of a self-correcting task based on invalid reactants predicted by the neural network model;
based on the data set and loss function of the self-correcting taskL(θ)And carrying out grammar correction training on the neural network model for executing the prediction task to obtain a prediction target model.
In an example, the neural network model further includes a predictive task training sub-step before predicting the plurality of reactants input to the target product:
reading a chemical reaction dataset comprising a reduced molecular linear input specification for the target product and a reduced molecular linear input specification for the reactant;
training the neural network model based on the chemical reaction data set to obtain the neural network model for performing the prediction task.
In one example, the chemical reaction dataset is a data set that has been data enhancement processed as:
based on the reduced molecular linear input specification for the given molecule, a plurality of reduced molecular linear input specification representations for the given molecule are generated.
In one example, the cross-over loss function is based on the predicted performance of the cross-over loss function metric model of the neural network model when the neural network model is trained based on the chemical reaction data setL(y,m)The calculation formula of (2) is as follows:
Figure 15240DEST_PATH_IMAGE001
wherein, the liquid crystal display device comprises a liquid crystal display device, i,Kthe upper and lower limits of the summation symbol respectively represent the numbers;yrepresenting a predicted sequence of the neural network model;mrepresenting the sequence of the target molecule.
In an example, the fischer information matrix is calculated by:
and calculating the gradient of each model parameter in the neural network model prediction task, and taking the average gradient as a Fisher information matrix.
In an example, the loss functionL(θ)The calculation formula of (2) is as follows:
Figure 525856DEST_PATH_IMAGE002
wherein, the liquid crystal display device comprises a liquid crystal display device,L B (θ)representing a loss function of the neural network model in the predictive task training process;λrepresenting regularization coefficients;F i representing a fischer information matrix;θ i representing model parameters during training of a self-correcting task;
Figure 774434DEST_PATH_IMAGE003
and representing the optimal model parameters obtained by the prediction task.
It should be further noted that the technical features corresponding to the examples of the above method may be combined with each other or replaced to form a new technical scheme.
The invention also comprises a terminal which comprises a memory and a processor, wherein the memory is stored with computer instructions running on the processor, the terminal is also integrated with a neural network model, and the terminal is matched with the processor to execute the self-correction single-step inverse synthesis method under continuous learning formed by any one or more examples.
The invention also comprises a server which comprises a memory and a processor, wherein the memory is stored with computer instructions running on the processor, a neural network model is integrated on the server, and the self-correction single-step inverse synthesis method under continuous learning formed by any one or more examples is executed by matching with the processor.
The invention also comprises a self-correction single-step inverse synthesis system under continuous learning, wherein the system comprises a terminal and a server which are mutually connected; the terminal comprises a user terminal and a local terminal which are mutually connected; the server comprises training servers and storage servers which are mutually connected;
the user terminal inputs a target product into a neural network model in a storage server by accessing the storage server, so as to predict and obtain a plurality of reactants of the target product;
the local terminal is used for providing basic training information to the training server, and comprises a data set of self-correction tasks constructed based on invalid reactants predicted by the neural network model;
the training server is used for calculating a Fisher information matrix of the neural network model in the prediction task, and further obtaining a loss function of the neural network model self-correction task based on elastic weight consolidation calculationL(θ)And based on the data set and loss function of the self-correcting taskL(θ)Carrying out grammar correction training on a neural network model for executing a prediction task to obtain a prediction target model;
the storage server is used for storing the prediction target model.
In one example, the neural network model is a transducer model, including an encoder, a decoder, a linear layer, and a softmax layer (normalized index layer) connected in sequence.
It should be further noted that the technical features corresponding to the examples of the system may be combined with each other or replaced to form a new technical scheme.
Compared with the prior art, the invention has the beneficial effects that:
the invention utilizes the Fisher information matrix to measure the importance degree of model parameters in the prediction task, and obtains the loss function of the same neural network model for grammar correction training based on the Fisher information matrixL(θ)The model is subjected to grammar correction training by combining the data set of the self-correction task constructed by the invalid reactants, so that the important parameter information in the prediction task can still be remembered when the model executes the self-correction task, the grammar correction is realized while the memory expenditure is saved and calculated and stored, and the prediction accuracy of the model is greatly improved.
Drawings
The following detailed description of the present invention is further detailed in conjunction with the accompanying drawings, which are provided to provide a further understanding of the present application, and in which like reference numerals are used to designate like or similar parts throughout the several views, and in which the illustrative examples and descriptions thereof are used to explain the present application and are not meant to be unduly limiting.
FIG. 1 is a flow chart of a method in an example of the invention;
FIG. 2 is a block diagram of a system in an example of the invention;
FIG. 3 is a diagram of a transducer model architecture in accordance with an example of the present invention;
FIG. 4 is a diagram of coding layers in a transducer model according to an example of the present invention;
FIG. 5 is a diagram of a decoding layer in a transducer model according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of data set construction in an example of the invention.
In the figure: 11-a local terminal; 12-user terminals; 21-a training server; 22-storage server.
Detailed Description
The following description of the embodiments of the present invention will be made apparent and fully understood from the accompanying drawings, in which some, but not all embodiments of the invention are shown. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
In the description of the present invention, it should be noted that directions or positional relationships indicated as being "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. are directions or positional relationships described based on the drawings are merely for convenience of describing the present invention and simplifying the description, and do not indicate or imply that the apparatus or elements to be referred to must have a specific orientation, be constructed and operated in a specific orientation, and thus should not be construed as limiting the present invention. Further, ordinal words (e.g., "first and second," "first through fourth," etc.) are used to distinguish between objects, and are not limited to this order, but rather are not to be construed to indicate or imply relative importance.
In the description of the present invention, it should be noted that, unless explicitly specified and limited otherwise, terms "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the above terms in the present invention will be understood in specific cases by those of ordinary skill in the art.
In addition, the technical features of the different embodiments of the present invention described below may be combined with each other as long as they do not collide with each other.
The invention discloses a self-correction single-step inverse synthesis method under continuous learning, which is based on deep learning and continuous learning in machine learning. Among them, machine Learning (ML) is a part of artificial intelligence (Artificial Intelligence, AI), which is a multi-domain interdisciplinary, and involves multiple disciplines such as probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory, etc. The mode and structure of data are specially analyzed and interpreted to realize the aim of completing the actions such as learning, reasoning, decision and the like without manual interaction. In short, machine learning supports a user feeding a large amount of data to a computer algorithm, then letting the computer analyze the data and give data-driven recommendations and decisions based on the input data only.
Further, deep Learning (DL) is one branch of machine Learning. Many traditional machine learning algorithms have limited learning capabilities, and an increase in the amount of data does not continue to increase the amount of knowledge learned, while deep learning systems can improve performance by accessing more data. The deep learning network learns by finding intricate structures in the empirical data. By building a computational model containing multiple processing layers, the deep learning network can create multiple levels of abstraction layers to represent data. Because the deep learning method has far better performance than the conventional machine learning method, it is applied throughout various fields such as computer vision, speech recognition, machine translation, and the like.
Further, continuous learning (Continual Learning, CL) refers to training a model on a data stream of a sequence of tasks, with the training goal that the trained model can perform better on all learned tasks. Each task has its own training set, validation set and test set. The model can only contact the data of the current training task during training. The main challenge of continuous learning is to avoid catastrophic forgetfulness during learning, namely: as new tasks or domains increase, the performance of previously learned tasks or domains should not (significantly) degrade over time. Inspired by the neurobiological study, studies of neural networks' sustained learning ability can be divided into three categories: regularization method, modularization method, and sample playback method.
In one example, as shown in fig. 1, a self-correcting single-step inverse synthesis method under continuous learning specifically includes the following steps:
s1: predicting a plurality of reactants input into a target product based on the neural network model, namely executing a prediction task;
s2: calculating a Fisher information matrix of the neural network model in the prediction task, and further obtaining a loss function of the neural network model self-correction task based on elastic weight consolidation calculationL(θ)
S3: constructing a data set of a self-correcting task based on invalid reactants predicted by the neural network model;
s4: based on the data set and loss function of the self-correcting taskL(θ)And carrying out grammar correction training on the neural network model for executing the prediction task to obtain a prediction target model.
As an option, steps S2, S3 may be permuted or performed synchronously.
Specifically, the neural network model in step S1 is a neural network model that has been trained by the existing prediction task, including but not limited to a transducer model, a classical Seq2Seq model, etc., and is capable of outputting reactants corresponding to a plurality of different synthetic routes according to the input target product.
Further, in step S2, fisher information matrix (Fisher information) is an index for measuring information amount. Assuming that the parameter used for modeling is θ based on the distribution of the random variable x, the Fisher information indicates that the amount of information carried by x for θ is measured. Thus, when the value of θ is fixed, with x as an argument, fisher information indicates how much information this value of x can contribute to θ. The larger the value of Fisher information, the larger the amount of information representing x versus θ. Conversely, the smaller the amount of information representing x for θ. Starting from the visual definition, the invention calculates important parameters at the end of model training based on Fisher information matrix. Further, elastic weight consolidation (Elastic Weight Consolidation, EWC) is introduced to carry out grammar correction training on the model, so that the model can memorize important parameter information of the model in a prediction task, further the self-correction task is effectively restrained, and further the memory overhead is saved.
Further, in step S3, the invalid reactant is a reactant with a grammar error, and a self-correction task data set for retraining the neural network model is constructed through the reactant, so as to achieve the purpose of grammar correction, thereby improving the prediction accuracy of the model and obtaining a prediction target model with the prediction accuracy greater than a threshold value. At this time, only the target molecule SMILES is input into the predicted target model, and the corrected reactant SMILES can be output.
In one example, the neural network model further includes a predictive task training sub-step before predicting the plurality of reactants input to the target product:
s01: reading a chemical reaction data set comprising the SMILES of a target product and the SMILES of a reactant, wherein the SMILES of the target product and the SMILES of the reactant have corresponding mapping relations, and the SMILES of a target product corresponds to the SMILES of a plurality of reactants and is used for corresponding to different synthesis route results.
S02: training the neural network model based on the chemical reaction data set to obtain the neural network model for performing the prediction task.
Among them, SMILES is a simplified molecular linear input specification (Simplified Molecular Input Line Entry System), which is a specification that explicitly describes molecular structure with ASCII strings. The symbol of SMILES is composed of a series of characters not containing spaces, the hydrogen atom can be omitted, and the aromatic structure can be directly designated or expressed by a Kevlar expression. While there are only a few simple words (symbols of atoms and chemical bonds) and a few grammatical rules, SMILES is a true language whose representation of chemical structures can also be analogous to "words" in other languages by which logical relationships for storing chemical information and chemical structures are designed. Further, in step S02, the training step is the prior art, and aims to continuously learn the feature information of the target object and the reactant in the chemical reaction dataset and the mapping relation between the target object and the reactant through the neural network model, continuously adjust model parameters such as learning rate, iteration number and the like, and improve the prediction performance of the model, so that the model can output the SMILES of the reactant corresponding to the target object outside the chemical reaction dataset.
In one example, the chemical reaction dataset is a data set that has been data enhancement processed as: based on the simplified molecular linear input specification for the given molecule, a plurality of SMILES representations of the given molecule are generated. Wherein, the generation of a given molecule can be artificially extended, or a plurality of additional SMILES can be randomly generated for each standard SMILES by an SMILES enumerator. It should be further noted that, when the target reactant input to the neural network model is an image, the data enhancement processing includes a data processing method such as clipping, flipping, and stitching the image.
In one example, when training the neural network model based on the chemical reaction dataset, the cross-loss function measures the predictive performance of the model according to the cross-loss function of the neural network modelL(y,m)The calculation formula of (2) is as follows:
Figure 763119DEST_PATH_IMAGE001
wherein, the liquid crystal display device comprises a liquid crystal display device, i,Kthe upper and lower limits of the summation symbol respectively represent the numbers;yrepresenting a predicted sequence of the neural network model;mrepresenting the sequence of the target molecule.
In one example, fisher information matrixFThe calculation formula of (2) is as follows:
Figure 46333DEST_PATH_IMAGE004
wherein, the liquid crystal display device comprises a liquid crystal display device,Nrepresenting the total number of training data;θrepresenting a model parameter vector;
Figure 462271DEST_PATH_IMAGE005
representing a probability distribution;
Figure 198145DEST_PATH_IMAGE006
a gradient expressed as a log-likelihood function;Trepresenting the transpose. The above equation is understood to mean the calculation of the gradients by calculating the gradients of the model parameters in the neural network model prediction task, and taking the average gradient as the fischer information matrix. Of course, the average calculation here may be a simple sum average, or may be a weighted average or the like. Further, on the basis of obtaining the Fisher information matrix, the L2 norm regularization is utilized to restrict important network parameters in the old prediction task when the self-correction task is trained.
In one example, the self-correcting task is to build a grammar corrector based on the predictive task to automatically correct the grammar of unreasonable SMILES strings to improve the performance of the model. In order to save memory overhead, the present embodiment utilizes a neural network model of a trained predictive task to accomplish a self-correcting task. However, training multiple tasks simultaneously by a model is a challenge in itself, because it can lead to catastrophic forgetfulness, i.e., only remembering the knowledge of the most recently trained task and forgetting the knowledge of the first trained task. In order to solve the problem, the invention adopts a continuous learning method based on EWC to train the model. Specifically, the EWC constrains the self-correcting task during training by remembering important parameters of the predicted task so as to achieve the ability of not forgetting or slightly forgetting knowledge learned by the predicted task after learning the self-correcting task. From the probability point of view, the EWC essence creatively provides that the Fisher information matrix is utilized to measure the importance degree of completing the network parameters of the old task (predicted task), the L2 norm penalty is utilized as a penalty term, and a loss function formula when the EWC is used for training a new task (self-correcting task) is as follows:
Figure 990521DEST_PATH_IMAGE002
wherein, the liquid crystal display device comprises a liquid crystal display device,L B (θ)representing a loss function of the neural network model in the predictive task training process;λrepresenting regularization coefficients;F i representing a fischer information matrix;θ i representing model parameters during training of a self-correcting task;
Figure 128241DEST_PATH_IMAGE003
and representing the optimal model parameters obtained by the prediction task.
The above examples are combined to obtain a preferred example of the present invention, and specifically include the following steps:
s1': reading a chemical reaction data set expressed by SMILES in a database, wherein the chemical reaction data set comprises SMILES of a target product and SMILES of a reactant;
s2': enhancing the data set by using a SMILES enumerator, randomly generating nine additional SMILES for each standard SMILES;
s3': training a target model prediction task (a prediction task with invalid output) based on the enhanced data to obtain a neural network model for executing the prediction task, wherein the model is used for predicting n reactant SMILES according to an input target product SMILES;
s4': calculating to obtain Fisher information matrix of model parameters when training the neural network model is completed;
s5': calculating a loss function of a target model self-correcting task by using a Fisher information matrixL(θ)
S6': constructing a new data set based on SMILES of n reactants predicted by a neural network model, and training a target model self-correction task;
s7': based on new data sets and loss functionsL(θ)Training the self-correction task to obtain a final inverse synthesis prediction target model, wherein the target model is used for outputting a reactant SMILES with grammar correction according to the input target molecule SMILES.
The invention also includes a terminal, which has the same inventive concept as the self-correction single-step inverse synthesis method under continuous learning formed by any one or more examples, and comprises a memory and a processor, wherein the memory stores computer instructions capable of running on the processor, the terminal is further integrated with a neural network model, the neural network model is used for executing a prediction task, and the processor is used for executing other steps in the self-correction single-step inverse synthesis method under continuous learning formed by any one or more examples, such as steps S2-S4 in the first example, so as to obtain a prediction target model. The processor may be a single or multi-core central processing unit or a specific integrated circuit, or one or more integrated circuits configured to implement the invention. The functional units in the embodiments provided in the present invention may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The invention also includes a server, which has the same inventive concept as the self-correction single-step inverse synthesis method under continuous learning formed by any one or more examples, and comprises a memory and a processor, wherein the memory stores computer instructions capable of running on the processor, a neural network model is integrated on the server, the neural network model is used for executing a prediction task, and the processor is used for executing other steps in the self-correction single-step inverse synthesis method under continuous learning formed by any one or more examples, such as steps S2-S4 in the first example, so as to obtain a prediction target model.
The invention also comprises a self-correction single-step inverse synthesis system under continuous learning, as shown in figure 2, which comprises a terminal and a server which are mutually connected; the terminals comprise a user terminal 12 and a local terminal 11 which are mutually interconnected; the server comprises a training server 21 and a storage server 22 which are mutually connected, and can be independent physical servers or server clusters. Alternatively, the server can be capable of hosting a Linux operating system and GPU computing resources.
User terminals include, but are not limited to, desktop computers, smart phones, tablet computers, notebook computers, etc., which access a storage server in a server directly or indirectly through a wired connection or a wireless network. When a user accesses the storage server, the molecular expression information is input to the neural network model in the storage server, namely the graph structure of the molecules, the simplified linear input specification of the molecules, the substance digital identification number (CAS) and the like, and the number n of expected feedback results of the target model can be input, so that the neural network model outputs a plurality of reactants for inputting the target product. It is noted that the users here may be tens or hundreds or more bulky, and thus are not limited to a specific number.
Further, the local terminal is a local PC, and transmits training basic information with a training server in the server through an SSH protocol. The basic information includes, but is not limited to, a data set of a prediction task, a data set of a self-correction task constructed based on invalid reactants predicted by the neural network model, a target model development code, and the like.
Further, the training server is used for calculating a Fisher information matrix of the neural network model in the prediction task, and further obtaining a loss function of the neural network model self-correction task based on elastic weight consolidation calculationL(θ)And based on the data set and loss function of the self-correcting taskL(θ)And carrying out grammar correction training on the neural network model for executing the prediction task to obtain a prediction target model. As an option, the training server is further configured to perform predictive task training on the model based on the basic information provided by the local terminal, so that the neural network model predicts the reactant according to the input target product.
Further, the storage server is used for storing the prediction target model, and aims to store an execution model of the self-correction single-step inverse synthesis method under continuous learning which is trained by the training server, and the execution model is accessed by the user terminal.
In one example, the neural network model is a transducer model, comprising an encoder, a decoder, a linear layer, and a softmax layer (normalized index layer) connected in sequence. The transducer model is a deep learning model that employs a self-attention mechanism that can be assigned different weights depending on the importance of the various parts of the input data. The architecture of its model follows the so-called encoder-decoder paradigm, training in an end-to-end fashion. Wherein the encoder and decoder are each composed of a plurality of blocks connected in series, each block in the encoder is composed of a multi-head attention mechanism layer and a feed-forward neural network, and the decoder has more coding-decoding attention mechanisms than the encoder. In the model of the application scene of the invention, the input of the encoder is a product in chemical reaction, the input of the decoder is a reactant in chemical reaction, and the output of the decoder is a predicted reactant.
Specifically, the architecture diagram of the transducer model is shown in fig. 3, where the encoder includes a plurality of coding layers that are sequentially connected, the example preferably includes 6 coding layers, each coding layer has the same structure, as shown in fig. 4, each coding layer includes a first self-attention sub-layer, a first residual connection and layer normalization sub-layer, a first position feedforward network (FNN) module, and a second residual connection and layer normalization sub-layer (Add & normal), where the first position feedforward network module is a first position feedforward network sub-layer and a second position feedforward network sub-layer that are disposed in parallel, and the first residual connection and layer normalization sub-layer is connected to an input end of the first self-attention sub-layer, and the second residual connection and layer normalization sub-layer is connected to an input end of the first position feedforward network module, that is, in the invention, the first self-attention sub-layer and the first position feedforward network module are integrated by adopting a residual connection and layer normalization method.
The decoder comprises a plurality of decoding layers connected in sequence, the example preferably comprises 6 decoding layers, and the last coding layer (coding layer 6) in the encoder is correspondingly connected with the 6 decoding layers respectively. Further, each decoding layer has the same structure, as shown in fig. 5, and each decoding layer includes a second self-attention sub-layer, a third residual connection and layer normalization sub-layer, an encoder-decoder attention sub-layer, a fourth residual connection and layer normalization sub-layer, a second position feedforward network module, and a fifth residual connection and layer normalization sub-layer, where the second position feedforward network module is a third position feedforward network sub-layer and a fourth position feedforward network sub-layer that are arranged in parallel, and the third residual connection and layer normalization sub-layer is connected with an input end of the second self-attention sub-layer, the fourth residual connection and layer normalization sub-layer is connected with an input end of the encoder-decoder attention sub-layer, and the fifth residual connection and layer normalization sub-layer is connected with an input end of the second position feedforward network module. It can be seen that the inventive decoder consists of two types of attention multi-headed attention layers: 1) Decoder self-attention (corresponding to the second self-attention sub-layer); 2) Encoder-decoder attention (corresponding to encoder-decoder attention sub-layer). The self-attention of the decoder is focused on the reactant predictions made in the previous step, masked by a location. Encoder-decoder attention establishes a connection between the final encoder representation and the decoder representation. It integrates the information of source molecule embedding with the reactant strings predicted so far, helping the decoder to focus on the proper position in the input sequence.
Further, a multi-headed attention unit (corresponding to the self-attention sub-layer) itself contains several scaled point attention layers that perform the attention mechanism in parallel, which are then connected and projected to the final value. The zoom point attention layer employs three matrices: query Q (Query), key K (Key), and Value V (Value). The Query, key and Value matrices are created by multiplying the input molecular insert M by three weight matrices, which are also trained during the training process. Then calculate the attention weight of each mark in SMILES character stringAttention(Q,K,V)) The specific calculation formula is as follows:
Figure 980660DEST_PATH_IMAGE007
wherein, the liquid crystal display device comprises a liquid crystal display device,K T representation matrixKIs a transposed matrix of (a);softmaxthe function is a normalized exponential function, and the numerical value is mapped between (0, 1);d k is the number of columns of the Q, K matrix, i.e. the vector dimension. Through the attention weighting calculation process, the encoder extracts key features from the source sequence and then queries by the decoder based on its previous outputs. Thus, the model canThe global level information is learned from the input molecular embedding and a semantic connection is established between the encoder and decoder.
The invention adopts a continuous learning method while training the inverse synthesis prediction model, and the model has the characteristic of self-correction on the premise of not increasing extra memory expenditure. In contrast, this improvement not only makes reasonable use of memory overhead, but also effectively improves the prediction accuracy of the inverse synthesis, as will now be described by way of example.
Specifically, to specify the SMILES sequence for invalid predictions, the model predictions for the general template-free direct-to-reactant are shown in Table 1, demonstrating the reactant of 5 before prediction:
Figure 203831DEST_PATH_IMAGE008
from Table 1, it is clear that in predicting the first result "C1CCOC" cannot be deduced as an effective structure, since it lacks a marker "1" indicating the end of the heterocycle. The prior art relies entirely on the original output obtained from the default beam search, ignoring intuitive SMILES specification errors. If this error is corrected in the predicted first result, a "1", i.e. "C1CCOC1", is added at the appropriate location, this predicted result is completely consistent with the actual reactant. Therefore, it is very practical to have the target model function to correct these errors.
The two tasks to be trained of the target model are respectively defined as task A and task B. The training sequence of task a and task B is critical to the target model. Since task B needs to use the output of task a as an input, task a needs to be completed first.
In task a, the inverse synthesis prediction is considered as a translation process of the product and reactant SMILES. Existing data is trained using a transducer network model. The data set is enhanced using a SMILES enumerator prior to training, whereby nine additional SMILES are randomly generated for each standard SMILES, thereby enhancing the data to improve the accuracy of prediction of unordered SMILES. The product is used as the input of the encoder in the transducer model, and the reactant corresponding to the product is used as the output of the decoder. It is noted that the sequence of the input model is first position coded by a sine and cosine function to memorize the sequence order.
Task B is to build a grammar appliance based on task A. In this embodiment, task B is completed by using a trained transducer model of task A, and specifically, the Fisher information matrix of the model in task A is used to calculate the loss function of task BL(θ)The new data set is constructed based on the SMILES of n reactants predicted by the neural network model, as shown in FIG. 6, and the specific construction method is as follows:
first, the first ten candidate products are predicted from a set of target compounds in a given training set using a model trained from a predictive task. The number of target compounds in a given set of compounds herein can be customized. In this example, ten thousand pieces of data were randomly selected from the training set of target compounds. Inverse synthesis prediction is performed on the ten-thousand target compounds using a model trained by the prediction task, generating ten most likely reactant sequences for each piece of input data. Second, candidate reactants are filtered by deleting the true reactants corresponding to the target molecule, since the nature of the self-correction task is to make grammar corrections, i.e., to correct the sequence that is grammar-inactive, and therefore to let the target model recognize the inactive sequence and correct it. For ten thousand pieces of data randomly extracted, the predicted task predicts that the ten candidate reactants would be highly likely to predict the true reactant sequence. Thus, the set of predicted reactant sequences needs to be screened, i.e., the actual reactant sequences are deleted, leaving the invalid reactant sequences. In other words, the input of the self-correcting task needs to be the invalid output of the prediction task, so that a grammatical correspondence relationship, i.e. an encoder input-decoder input pair, can be formed between the real reactant. Finally, according to the previous steps, a self-correcting task data set is constructed that is required by a set of encoders and decoders, wherein the encoder input is the predicted invalid reactant and the decoder input is the true reactant. And finally, training a self-correction task based on new input data and a loss function, wherein after the self-correction task training is finished, the model at the moment can repair grammar errors of invalid SMILES predicted by the prediction task to obtain a final inverse synthesis prediction target model, and further finish the task B.
After the task a and the task B are completed, the model is the target model in this embodiment. The model can predict more accurate reactants by grammar self-correction according to the product information input by a user. The memory overhead pairs of the embodiment model and the related model are shown in table 2:
Figure 540177DEST_PATH_IMAGE009
further, the model of this embodiment and the correlation model predict top-n (n=1, 3,5, 10) accuracy pairs over a standard dataset as shown in table 3:
Figure 532404DEST_PATH_IMAGE011
the Top-n accuracy is the most general evaluation standard of the single-step inverse synthesis model, specifically, the model is enabled to output n ordered candidate reactants for one product at the same time, and if the reactants recorded in the data set are included in the prediction result of the Top n rank, the n prediction results have sequences consistent with the real reactants, namely, the Top-n prediction hits. For example, when n=1, the first ranked reactant of the model prediction needs to hit the correct answer to calculate the prediction success, and when n=10, the same prediction result as the correct answer exists in the first 10 results of the model prediction, that is, the prediction success. From tables 2 and 3, it can be seen that, compared with the related methods, the method of the present invention has a small difference from the general seq2seq model in memory overhead, but the accuracy is significantly higher than that of the model. And compared with an SCROP model with a correction function, the accuracy is not poor in the whole, but the memory overhead is saved by half.
The foregoing detailed description of the invention is provided for illustration, and it is not to be construed that the detailed description of the invention is limited to only those illustration, but that several simple deductions and substitutions can be made by those skilled in the art without departing from the spirit of the invention, and are to be considered as falling within the scope of the invention.

Claims (9)

1. A self-correction single-step inverse synthesis method under continuous learning is characterized in that: which comprises the following steps:
predicting a plurality of reactants input into a target product based on a neural network model;
calculating a Fisher information matrix of the neural network model in the prediction task, and further obtaining a loss function L (theta) of the neural network model self-correction task based on elastic weight consolidation calculation; specifically, the importance degree of the predicted task network parameters is finished by using the Fisher information matrix measurement, and the L2 norm penalty is used as a penalty term, so that the training self-correction task is consolidated by using the elastic weight; introducing elastic weight consolidation to carry out grammar correction training on the model, so that the model can memorize important parameter information of the model in a prediction task, and further effectively restrict a self-correction task;
calculating the fischer information matrix of the neural network model in the prediction task comprises:
calculating gradients of model parameters in a neural network model prediction task, and taking the average gradients as a Fisher information matrix;
constructing a data set of a self-correcting task based on invalid reactants predicted by the neural network model;
and carrying out grammar correction training on the neural network model for executing the prediction task according to the data set of the self-correction task and the loss function L (theta) to obtain a prediction target model.
2. The self-correcting single-step inverse synthesis method under continuous learning of claim 1, wherein: the neural network model further comprises a prediction task training sub-step before predicting a plurality of reactants input into a target product:
reading a chemical reaction dataset comprising a reduced molecular linear input specification for the target product and a reduced molecular linear input specification for the reactant;
training the neural network model based on the chemical reaction data set to obtain the neural network model for performing the prediction task.
3. The self-correcting single-step inverse synthesis method under continuous learning of claim 2, wherein: the chemical reaction data set is a data set subjected to data enhancement processing, and the data enhancement processing is as follows:
based on the reduced molecular linear input specification for the given molecule, a plurality of reduced molecular linear input specification representations for the given molecule are generated.
4. The self-correcting single-step inverse synthesis method under continuous learning of claim 2, wherein: when the neural network model is trained based on the chemical reaction data set, according to the prediction performance of the cross loss function measurement model of the neural network model, the calculation formula of the cross loss function L (y, m) is as follows:
Figure FDA0004107765900000021
wherein i, K are the upper and lower limits of the summation symbol, respectively, and represent the numbers; y represents a predicted sequence of the neural network model; m represents the target molecule sequence.
5. The self-correcting single-step inverse synthesis method under continuous learning of claim 1, wherein: the calculation formula of the loss function L (theta) of the self-correcting task is as follows:
Figure FDA0004107765900000022
wherein L is B (θ) represents a loss function of the neural network model during the predictive task training; λ represents a regularization coefficient; f (F) i Representing a fischer information matrix; θ i Representing training self-correcting tasksModel parameters at the time;
Figure FDA0004107765900000023
and representing the optimal model parameters obtained by the prediction task.
6. A terminal comprising a memory and a processor, the memory having stored thereon computer instructions that are executed on the processor, characterized by: the terminal is also integrated with a neural network model, and the neural network model is matched with a processor to execute the self-correction single-step inverse synthesis method under continuous learning of any one of claims 1 to 5.
7. A server comprising a memory and a processor, the memory having stored thereon computer instructions that execute on the processor, characterized by: the server is also integrated with a neural network model, and the neural network model is matched with a processor to execute the self-correction single-step inverse synthesis method under continuous learning of any one of claims 1 to 5.
8. A self-correcting single-step inverse synthesis system under continuous learning is characterized in that: the system comprises a terminal and a server which are mutually connected; the terminal comprises a user terminal and a local terminal which are mutually connected; the server comprises training servers and storage servers which are mutually connected;
the user terminal inputs a target product into a neural network model in a storage server by accessing the storage server, so as to predict and obtain a plurality of reactants of the target product;
the local terminal is used for providing basic training information to the training server, and comprises a data set of self-correction tasks constructed based on invalid reactants predicted by the neural network model;
the training server is used for calculating a Fisher information matrix of the neural network model in the prediction task, further consolidating the calculation based on the elastic weight to obtain a loss function L (theta) of the neural network model self-correcting task, and carrying out grammar correction training on the neural network model executing the prediction task according to a data set of the self-correcting task and the loss function L (theta) to obtain a prediction target model;
calculating the fischer information matrix of the neural network model in the prediction task comprises: calculating gradients of model parameters in a neural network model prediction task, and taking the average gradients as a Fisher information matrix;
the loss function L (theta) of the neural network model self-correction task obtained based on the elastic weight consolidation calculation comprises the following steps: finishing the importance degree of the predicted task network parameters by using the Fisher information matrix measurement, and consolidating the training self-correction task by using the elastic weight by using the L2 norm penalty as a penalty term; introducing elastic weight consolidation to carry out grammar correction training on the model, so that the model can memorize important parameter information of the model in a prediction task, and further effectively restrict a self-correction task;
the storage server is used for storing the prediction target model.
9. The self-correcting single-step inverse synthesis system under continuous learning of claim 8, wherein: the neural network model is a transducer model and comprises an encoder, a decoder, a linear layer and a normalized index layer which are sequentially connected.
CN202211472885.6A 2022-11-23 2022-11-23 Self-correction single-step inverse synthesis method, terminal, server and system under continuous learning Active CN115588471B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211472885.6A CN115588471B (en) 2022-11-23 2022-11-23 Self-correction single-step inverse synthesis method, terminal, server and system under continuous learning

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211472885.6A CN115588471B (en) 2022-11-23 2022-11-23 Self-correction single-step inverse synthesis method, terminal, server and system under continuous learning

Publications (2)

Publication Number Publication Date
CN115588471A CN115588471A (en) 2023-01-10
CN115588471B true CN115588471B (en) 2023-05-05

Family

ID=84783492

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211472885.6A Active CN115588471B (en) 2022-11-23 2022-11-23 Self-correction single-step inverse synthesis method, terminal, server and system under continuous learning

Country Status (1)

Country Link
CN (1) CN115588471B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116959613B (en) * 2023-09-19 2023-12-12 烟台国工智能科技有限公司 Compound inverse synthesis method and device based on quantum mechanical descriptor information
CN117521767B (en) * 2023-12-29 2024-05-17 中国科学技术大学 Gradient calibration-based continuous learning method, system, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988785A (en) * 2021-05-10 2021-06-18 浙江大学 SQL conversion method and system based on language model coding and multitask decoding
WO2022222231A1 (en) * 2021-04-23 2022-10-27 平安科技(深圳)有限公司 Drug-target interaction prediction method and apparatus, device, and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104391286B (en) * 2014-12-10 2017-05-24 中国电子科技集团公司第二十研究所 Retrosynthetic aperture radar azimuth calibration method
US20210057050A1 (en) * 2019-08-23 2021-02-25 Insilico Medicine Ip Limited Workflow for generating compounds with biological activity against a specific biological target
CN112329924A (en) * 2020-11-25 2021-02-05 四川大学 Method for improving prediction performance of neural network
US11354582B1 (en) * 2020-12-16 2022-06-07 Ro5 Inc. System and method for automated retrosynthesis
CN114822703A (en) * 2021-01-27 2022-07-29 腾讯科技(深圳)有限公司 Inverse synthesis prediction method of compound molecule and related device
CN113782109A (en) * 2021-09-13 2021-12-10 烟台国工智能科技有限公司 Reactant derivation method and reverse synthesis derivation method based on Monte Carlo tree
CN114220496A (en) * 2021-11-30 2022-03-22 华南理工大学 Deep learning-based inverse synthesis prediction method, device, medium and equipment
CN114496105A (en) * 2022-01-24 2022-05-13 武汉大学 Single-step inverse synthesis method and system based on multi-semantic network
CN115206450B (en) * 2022-09-15 2022-12-06 药融云数字科技(成都)有限公司 Synthetic route recommendation method and terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022222231A1 (en) * 2021-04-23 2022-10-27 平安科技(深圳)有限公司 Drug-target interaction prediction method and apparatus, device, and storage medium
CN112988785A (en) * 2021-05-10 2021-06-18 浙江大学 SQL conversion method and system based on language model coding and multitask decoding

Also Published As

Publication number Publication date
CN115588471A (en) 2023-01-10

Similar Documents

Publication Publication Date Title
CN115588471B (en) Self-correction single-step inverse synthesis method, terminal, server and system under continuous learning
CN113299354B (en) Small molecule representation learning method based on transducer and enhanced interactive MPNN neural network
CN113535984B (en) Knowledge graph relation prediction method and device based on attention mechanism
Guo et al. Context-aware poly (a) signal prediction model via deep spatial–temporal neural networks
JP7262539B2 (en) Conversation recommendation method, device and equipment
Gao et al. Autobert-zero: Evolving bert backbone from scratch
Li et al. RLINK: Deep reinforcement learning for user identity linkage
CN116802741A (en) Inverse synthesis system and method
Zhu et al. Representation learning with ordered relation paths for knowledge graph completion
Liu et al. Representation learning with multi-level attention for activity trajectory similarity computation
CN116126341A (en) Model compiling method, device, computer equipment and computer readable storage medium
CN114817508A (en) Sparse graph and multi-hop attention fused session recommendation system
CN112420125A (en) Molecular attribute prediction method and device, intelligent equipment and terminal
CN108475346A (en) Neural random access machine
Wang et al. Robust Recommendation with Adversarial Gaussian Data Augmentation
Lin et al. Spatial attention and syntax rule enhanced tree decoder for offline handwritten mathematical expression recognition
CN115206421B (en) Drug repositioning method, and repositioning model training method and device
CN116208399A (en) Network malicious behavior detection method and device based on metagraph
CN116109449A (en) Data processing method and related equipment
CN110516109A (en) Correlating method, device and the storage medium of music label
US20230177261A1 (en) Automated notebook completion using sequence-to-sequence transformer
Qiang et al. Bridging the gap between chemical reaction pretraining and conditional molecule generation with a unified model
Fu et al. Ea reader: Enhance attentive reader for cloze-style question answering via multi-space context fusion
Liu et al. Object detection via inner-inter relational reasoning network
CN117994397B (en) Digital human text action generation method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant