Inverse synthesis processing method and device, electronic equipment and storage medium
By acquiring the isomer and dual graphs of the target molecule and combining them with neural networks and conditional diffusion models, the problem of not fully utilizing the planar and three-dimensional information of the molecular graph in existing technologies is solved, and more accurate retrosynthetic processing is achieved.
Patent Information
- Application Number
- CN202410867792.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2025-12-30
AI Technical Summary
Existing retrosynthetic processing methods typically process atoms of a given target molecule, which is less effective and fails to fully utilize the planar structure and three-dimensional information in the molecular diagram.
By acquiring the isomerogram and dual graph of the target molecule, and combining the isomerogram neural network and the dual graph neural network, the feature vectors of multiple atoms in the target molecule are determined, including planar structural features. Then, the conditional diffusion model and the isovariant graph neural network are used for retrosynthesis.
It improves the accuracy of retrosynthetic processing, enabling more accurate generation of reactant molecules and enhancing processing efficiency.
Smart Images

Figure CN121237235A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of retrosynthesis technology, and in particular to a retrosynthesis processing method, apparatus, electronic device and storage medium. Background Technology
[0002] The development of computer technology, molecular biology, and other technologies has driven progress in computer-aided retrosynthetic processing of chemical molecules, leading to the emergence of numerous computer-aided retrosynthetic methods. Retrosynthetic processing refers to the process of predicting a set (or more) of reactant molecules for a given target (or given product).
[0003] However, current retrosynthetic methods typically perform retrosynthetic processes based on atoms in a given target molecule, resulting in poor retrosynthetic efficiency. Summary of the Invention
[0004] This application provides a retrosynthetic processing method, apparatus, electronic device, and storage medium to improve the effect of retrosynthetic processing.
[0005] To achieve the above objectives, the embodiments of this application provide the following technical solutions:
[0006] Firstly, a reverse synthesis processing method is provided. This method can be executed by an electronic device, or by a component of the electronic device, such as a processor, chip, or chip system. It can also be implemented by a logic module or software capable of realizing all or part of the functions of the electronic device. The method includes:
[0007] Obtain the isomer map of the target molecule to be retrosynthesized and its corresponding dual map. In the isomer map, nodes represent atoms in the target molecule, and edges represent chemical bonds connecting two atoms. Nodes in the dual map correspond to planar structures in the isomer map; that is, each node in the dual map corresponds to a plane in the isomer map. A planar structure, also known as a ring structure, is a plane consisting of at least three nodes.
[0008] Based on the first node features and the second node features, feature vectors of multiple atoms in the target molecule are determined. The first node features include feature vectors of multiple first nodes in the heterogeneity graph; in this embodiment, "first node" refers to a node in the heterogeneity graph. The second node features include feature vectors of multiple second nodes in the dual graph; in this embodiment, "second node" refers to a node in the dual graph. The feature vectors can be vector matrices that encode or represent nodes.
[0009] Based on the characteristic vectors of multiple atoms in the target molecule, the target molecule is retrosynthesized to obtain the reactant molecule of the target molecule.
[0010] In the above technical solution, by acquiring the isomer map of the target molecule and its corresponding dual map, the feature vectors of multiple atoms in the target molecule are determined by referencing not only the feature vectors of multiple first nodes in the isomer map but also the feature vectors of multiple second nodes in the dual map. Since the nodes in the dual map correspond to the planar structures in the isomer map, the feature vectors of the determined atoms in the target molecule also include the feature information of the planar structure, enabling a more accurate characterization of the target molecule. Furthermore, performing retrosynthesis based on the feature vectors of multiple atoms in the target molecule yields more accurate reactant molecules, effectively improving the accuracy of the retrosynthesis process and thus enhancing its overall effect.
[0011] In conjunction with the first aspect described above, in one possible implementation, before determining the feature vectors of multiple atoms in the target molecule based on the first node features and the second node features, the method further includes:
[0012] The heterogeneous graph is input into a heterogeneous graph neural network (HBRNN) to obtain the first node features output by the HBRNN. The HBRNN is used to extract features from the nodes in the heterogeneous graph. In other words, after inputting the heterogeneous graph into the HBRNN, the HBRNN processes the graph and outputs feature vectors for multiple first nodes, i.e., the first node features.
[0013] The dual graph is input into a dual graph neural network to obtain the second node features output by the dual graph neural network. The dual graph neural network is used to extract features from the nodes in the dual graph. In other words, after inputting the dual graph into the dual graph neural network, the network processes the dual graph and outputs feature vectors for multiple second nodes in the dual graph, i.e., it outputs the second node features.
[0014] In the above implementation, a heterogeneous graph neural network and a dual graph neural network are configured. The heterogeneous graph neural network extracts features from the nodes in the heterogeneous graph to obtain first node features, and the dual graph neural network extracts features from the nodes in the dual graph to obtain second node features. Then, the first and second node features are fused through feature concatenation to obtain feature vectors for multiple atoms in the target molecule. In this way, the feature vectors of multiple atoms in the determined target molecule reference not only the feature vectors of multiple first nodes in the heterogeneous graph but also the feature vectors of multiple second nodes in the dual graph, enabling a more accurate representation of the target molecule.
[0015] In conjunction with the first aspect described above, in one possible implementation, determining the feature vectors of multiple atoms in the target molecule based on the first node features and the second node features includes:
[0016] By concatenating the features of the first node and the features of the second node, a feature vector of multiple atoms in the target molecule is obtained; or,
[0017] The first node feature is aggregated to obtain the whole graph feature of the heterogeneous graph; the whole graph feature is concatenated with the second node feature to obtain the feature vector of multiple atoms in the target molecule.
[0018] The above implementation provides two methods for feature concatenation. In one method, feature vectors for multiple atoms in the target molecule are obtained by directly concatenating the features of the first and second nodes. This allows for fast and efficient feature concatenation. In the other method, the first node features are first aggregated to obtain the overall features of the heterogeneous graph. These overall features are then concatenated with the second node features to obtain feature vectors for multiple atoms in the target molecule. This not only allows for fast and efficient feature concatenation but also, by determining the overall graph-level feature vectors, incorporates feature information from distant atoms, increasing the amount of information referenced in subsequent inverse synthesis processing and effectively improving the accuracy of inverse synthesis.
[0019] In conjunction with the first aspect above, in one possible implementation, the dual graph neural network is used to determine the planar structure in the heterogeneous graph corresponding to each second node in the dual graph, and to determine the initial feature vector of the second node based on the feature vectors of the plurality of first nodes included in the planar structure; and to obtain the features of the second node based on the initial feature vector of the second node.
[0020] In other words, through the dual graph neural network, for each second node in the dual graph, the planar structure in the heterogeneous graph corresponding to the second node is determined; based on the feature vectors of the multiple first nodes included in the planar structure, the initial feature vector of the second node is determined; and the initial feature vector of the second node is passed through multiple network layers of the dual graph neural network to obtain the features of the second node.
[0021] The above implementation provides a method for determining the features of the second node. Specifically, the planar structure in the heterogeneous graph corresponding to each second node is determined by the correspondence between the second nodes in the dual graph and the planar structures in the heterogeneous graph. Then, based on the feature vectors of the multiple first nodes included in the planar structure, the initial feature vector of the second node is determined. Finally, the initial feature vector of the second node is passed through multiple layers of a dual graph neural network to output the features of the second node.
[0022] In conjunction with the first aspect described above, in one possible implementation, based on the characteristic vectors of multiple atoms in the target molecule, retrosynthetic processing is performed on the target molecule to obtain the reactant molecule of the target molecule, including:
[0023] Based on the characteristic vectors of every two atoms in the target molecule, determine whether a reaction center exists between those two atoms. Determining whether a reaction center exists between two atoms can be understood as judging whether a chemical reaction has occurred between the chemical bonds of the two atoms.
[0024] If a reaction center exists between the two atoms, the target molecule can be decomposed based on this reaction center to obtain a synthetic fragment of the target molecule. For example, the synthetic fragment of the target molecule can be obtained by breaking the chemical bond between the two atoms.
[0025] Based on the characteristic vectors and coordinate vectors of multiple atoms in the synthetic fragment, the reactant molecule of the target molecule is determined; the coordinate vector is used to indicate the spatial position of the atom in the target molecule, such as three-dimensional coordinates.
[0026] Among the above implementation methods, a retrosynthetic processing method is provided. This method involves determining whether a reaction center exists between every two atoms in the target molecule, and then decomposing the target molecule based on the two atoms with such reaction centers to obtain synthetic sub-fractions. Furthermore, using the feature vectors and coordinate vectors of multiple atoms in the synthetic sub-fractions, reactant molecules of the target molecule are generated. Thus, during retrosynthetic processing, not only the feature vectors of multiple atoms in the synthetic sub-fractions are referenced, but also their coordinate vectors, introducing three-dimensional information from the target molecule. This increases the amount of information referenced in the retrosynthetic processing, effectively improving its accuracy and overall performance.
[0027] In conjunction with the first aspect above, in one possible implementation, the reactant molecule of the target molecule is determined based on the feature vectors and coordinate vectors of multiple atoms in the synthetic sub-fragment, including:
[0028] The feature vectors and coordinate vectors of multiple atoms in the synthetic sub-fragment are input into a conditional diffusion model to obtain the feature vector and coordinate vector of the target atom output by the conditional diffusion model. In other words, after inputting the feature vectors and coordinate vectors of multiple atoms in the synthetic sub-fragment into the conditional diffusion model, the model processes these vectors to obtain the feature vector and coordinate vector of the target atom. This target atom indicates the atom in the synthetic sub-fragment that needs to be completed; it can be understood as the atom missing from the synthetic sub-fragment compared to the final determined reactant molecule.
[0029] The reactant molecule is obtained by completing the synthetic sub-fraction based on the characteristic vector and coordinate vector of the target atom. In other words, the reactant molecule can be obtained by adding the target atom to the synthetic sub-fraction.
[0030] In the above implementation, a conditional diffusion model is set up to process the feature vectors and coordinate vectors of multiple atoms, thereby obtaining the feature vectors and coordinate vectors of the atoms to be completed in the synthetic sub-fraction. This allows for the rapid and efficient acquisition of relevant information about the atoms to be completed in the synthetic sub-fraction. Furthermore, by completing the synthetic sub-fraction, reactant molecules can be obtained.
[0031] In conjunction with the first aspect above, in one possible implementation, the conditional diffusion model is used to add noise data to the feature vector and coordinate vector of each atom in the synthetic sub-fragment to obtain noise-added vector data; and to perform denoising processing on the noise-added vector data to obtain the feature vector and coordinate vector of the target atom.
[0032] In other words, after inputting the feature vectors and coordinate vectors of multiple atoms in the synthetic sub-fragment into the conditional diffusion model, the conditional diffusion model adds noise data to the feature vectors and coordinate vectors of each atom to obtain the vector data with added noise.
[0033] The vector data after adding noise is denoised to obtain the feature vector and coordinate vector of the target atom.
[0034] The above implementation provides the process of implementing the conditional diffusion model. Specifically, the structure and characteristics of the synthons are disrupted by progressively adding noise data, thereby gradually converting the original data into noisy vector data. Then, through denoising, the noisy vector data is gradually restored to the original data, thus outputting the reactant molecules.
[0035] In conjunction with the first aspect described above, in one possible implementation, the method further includes:
[0036] The noisy vector data is input into an equivariant graph neural network to obtain the target vector data output by the network. The equivariant graph neural network ensures the equivariance of the vector data in three-dimensional space.
[0037] The conditional diffusion model is specifically used to denoise the target vector data to obtain the feature vector and coordinate vector of the target atom.
[0038] In the above implementation, during the denoising process, an equivariant graph neural network is used to process the vector data to obtain the target vector data. This ensures the equivariance of the vector data in three-dimensional space, specifically the equivariance of the coordinate vectors within the vector data, meaning that the three-dimensional coordinates change accordingly with different conditions. Furthermore, denoising the target vector data yields the feature vectors and coordinate vectors of the target atoms, ensuring the accuracy of the denoising process.
[0039] In conjunction with the first aspect above, in one possible implementation, determining whether a reaction center exists between two atoms based on the characteristic vectors of every two atoms in the target molecule includes:
[0040] The feature vectors of every two atoms in the target molecule and the feature vectors of the edges between the two atoms are concatenated to obtain the comprehensive features of the two atoms.
[0041] Based on the combined characteristics of the two atoms, the reactivity fractions corresponding to the two atoms are determined. These reactivity fractions are used to indicate whether there is a reaction center between the two atoms.
[0042] Based on the reactivity fraction, determine whether a reaction center exists between the two atoms.
[0043] The above implementation provides a method for identifying reaction centers. This involves concatenating the feature vectors of every two atoms and the feature vectors of the edges between them to achieve feature fusion, thus obtaining a comprehensive feature of the two atoms. Furthermore, by determining the reactivity fractions corresponding to these two atoms, it is possible to determine whether a reaction center exists between them.
[0044] Secondly, an inverse synthesis processing apparatus is provided for implementing any of the methods provided in the first aspect. This inverse synthesis processing apparatus includes modules, units, or means corresponding to the aforementioned methods. The actions performed by these modules, units, or means can be implemented in hardware, software, or by hardware executing corresponding software. The hardware or software includes one or more modules or units corresponding to the aforementioned functions.
[0045] In one possible implementation, the device may include an acquisition module, a determination module, and a processing module; wherein:
[0046] The acquisition module is used to acquire the isomer map of the target molecule to be retrosynthesized and the dual map corresponding to the isomer map; the nodes in the isomer map represent the atoms in the target molecule, and the nodes in the dual map correspond to the planar structure in the isomer map.
[0047] The determination module is used to determine the feature vectors of multiple atoms in the target molecule based on the first node features and the second node features; the first node features include the feature vectors of multiple first nodes in the isomer graph; the second node features include the feature vectors of multiple second nodes in the dual graph.
[0048] The processing module is used to perform retrosynthetic processing on the target molecule based on the characteristic vectors of multiple atoms in the target molecule to obtain the reactant molecule of the target molecule.
[0049] Thirdly, an electronic device is provided, comprising: a memory and a processor, the memory and the processor being connected; the memory being used to store computer-executed instructions; and the processor being used to invoke the computer-executed instructions, thereby implementing the method of the first aspect above or any implementation thereof.
[0050] The electronic device in the third aspect can be: the electronic device in the first aspect or any implementation thereof, or a device containing the electronic device, or a device contained in the electronic device, such as a chip.
[0051] Fourthly, a chip is provided, comprising: a processor and an interface circuit; the interface circuit for receiving computer execution instructions and transmitting them to the processor; and the processor for executing the computer execution instructions to perform the method of the first aspect or any implementation thereof.
[0052] Fifthly, a computer-readable storage medium is provided, comprising computer-executable instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect or any implementation thereof.
[0053] In a sixth aspect, a computer program product is provided, comprising computer execution instructions that, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect or any implementation thereof.
[0054] It should be noted that the technical effects of any of the implementation methods in aspects two through six can be found in the technical effects of the corresponding implementation methods in aspect one, and will not be repeated here.
[0055] It should be noted that any of the possible implementations of any of the above aspects can be combined, provided that the solutions do not contradict each other. Attached Figure Description
[0056] Figure 1 A schematic diagram of MEGAN-based retrosynthetic processing provided for related technologies;
[0057] Figure 2 A schematic diagram of a G2Gs-based retrosynthetic process provided for related technologies;
[0058] Figure 3 A schematic diagram of the system architecture of an inverse synthesis processing method provided in an embodiment of this application;
[0059] Figure 4 A schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application;
[0060] Figure 5 A schematic flowchart of a retrosynthetic processing method provided in an embodiment of this application;
[0061] Figure 6 A schematic flowchart of another retrosynthetic processing method provided in an embodiment of this application;
[0062] Figure 7 A schematic diagram illustrating the construction of a dual graph provided in an embodiment of this application;
[0063] Figure 8 A schematic diagram of a heterogeneous graph and a dual graph provided for embodiments of this application;
[0064] Figure 9 This is a schematic diagram of a retrosynthetic process provided in an embodiment of this application;
[0065] Figure 10 This is a schematic diagram illustrating the effect of a retrosynthetic process provided in an embodiment of this application;
[0066] Figure 11 This is a schematic diagram of a retrosynthetic processing apparatus provided in an embodiment of this application. Detailed Implementation
[0067] In the description of this application, unless otherwise stated, " / " indicates that the objects before and after are in an "or" relationship. For example, A / B can mean A or B. "And / or" in this application is merely a description of the relationship between the related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. A and B can be singular or plural.
[0068] In the description of this application, unless otherwise stated, "multiple" means two or more. "At least one of the following or similar expressions" refers to any combination of these items, including any combination of single or multiple items. For example, at least one of a, b and / or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0069] Furthermore, to facilitate a clear description of the technical solutions in the embodiments of this application, the terms "first" and "second" are used in the embodiments of this application to distinguish identical or similar items with substantially the same function and effect. Those skilled in the art will understand that the terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.
[0070] In the embodiments of this application, the words "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplarily" or "for example" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or design solutions. Specifically, the use of the words "exemplarily" or "for example" is intended to present the relevant concepts in a specific manner to facilitate understanding.
[0071] It is understood that the term "embodiment" used throughout the specification means that a specific feature, structure, or characteristic related to an embodiment is included in at least one embodiment of this application. Therefore, throughout the specification, various embodiments do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It is understood that in the various embodiments of this application, the sequence number of each process does not imply the order of execution; the execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0072] It is understood that some optional features in the embodiments of this application can be implemented independently in certain scenarios without relying on other features, such as the current solution on which they are based, to solve the corresponding technical problems and achieve the corresponding effects. Alternatively, they can be combined with other features as needed in certain scenarios. Correspondingly, the apparatus given in the embodiments of this application can also implement these features or functions, which will not be elaborated here.
[0073] In this application, unless otherwise specified, the same or similar parts between the various embodiments can be referred to each other. In the various embodiments of this application, unless otherwise specified or logically conflicting, the terminology and / or descriptions between different embodiments are consistent and can be mutually referenced. Technical features in different embodiments can be combined to form new embodiments based on their inherent logical relationships. The following embodiments of this application do not constitute a limitation on the scope of protection of this application.
[0074] To facilitate understanding of the technical solutions of the embodiments of this application, the application scenarios of the embodiments of this application will be described exemplarily below.
[0075] The development of computer technology, molecular biology, and other technologies has driven progress in computer-aided retrosynthetic processing of chemical molecules, leading to the emergence of numerous computer-aided retrosynthetic methods. Retrosynthetic processing refers to the process of predicting a set (or more) of reactant molecules for a given target (or given product). Reactants are the starting materials for a chemical reaction, which undergo chemical changes to form products. Products are substances formed due to the chemical reactions between reactants. It should be understood that retrosynthetic processing is the process of reducing a complex given target to a simple precursor.
[0076] Currently, benefiting from the rapid development of deep learning, using deep learning-based models to achieve efficient inverse synthesis has gradually become the preferred method for inverse synthesis. The following section uses related technologies one and two as examples to illustrate the process of implementing inverse synthesis using deep learning-based models.
[0077] Related technology 1: Retrosynthetic processing based on molecular edit graph attention network (MEGAN).
[0078] MEGAN is an end-to-end encoder-decoder neural network model used to generate a graphically edited sequence to represent chemical reactions. It's worth noting that MEGAN builds upon chemists' use of arrow derivation mechanisms (such as arrow derivation) to describe chemical reactions, proposing a novel method for representing chemical reactions. Specifically, it uses graphically edited sequences to describe chemical reactions, thereby improving the accuracy of retrosynthetic processing on benchmark datasets and large datasets.
[0079] Thus, by adopting MEGAN technology, on the one hand, the concept that "chemical reactions can be represented as sequence editing" is extended to the field of retrosynthesis processing; on the other hand, an end-to-end encoder-decoder neural network model is introduced and applied to large datasets.
[0080] For example, Figure 1 This diagram illustrates a MEGAN-based retrosynthetic process for related technologies. (See also...) Figure 1 The retrosynthetic process based on MEGAN can be represented as molecular editing operations based on graphical sequence editing. These molecular editing operations can include atom deletion, atom editing, and atom addition.
[0081] like Figure 1 As shown, for the target molecule 101 to be retrosynthesized, after embedding, the encoder and decoder output enhanced representations of the target molecule 101. Then, based on these enhanced representations, an atom deletion operation is performed, such as deleting the (C:1) atom, to obtain intermediate substrates 102. After embedding intermediate substrates 102, the decoder outputs their enhanced representations, and then an atom editing operation is performed, such as replacing the N atom with an HN atom, to obtain intermediate substrates 103. After embedding intermediate substrates 103, the decoder outputs their enhanced representations, and then an atom addition operation is performed, such as adding an I atom, to obtain final substrates 104.
[0082] However, in the aforementioned MEGAN-based retrosynthetic processing schemes, MEGAN uses graphically edited sequences to describe chemical reactions, which may limit its ability to handle more complex or unconventional chemical reactions. For example, if the characteristics of a chemical reaction cannot be fully described by graphically edited sequences, the accuracy of MEGAN is likely to be affected. Furthermore, regarding applying the model to large datasets, the accuracy of MEGAN may also be affected because the coverage and quality of these datasets cannot be guaranteed. For example, if the dataset is biased or fails to adequately represent all possible chemical reactions, the model's generalization ability may be limited.
[0083] Related technology 2: Inverse synthesis based on graph-to-graph (G2Gs) processing.
[0084] G2Gs is a semi-template-based molecular retrosynthesis prediction model that divides the retrosynthetic process into a reaction center identification stage and a reactant generation stage. The G2Gs-based retrosynthetic process is described below based on steps one and two.
[0085] Step 1: Reaction Center Identification Stage.
[0086] Reaction center identification is a binary linking prediction task used to identify whether a reaction center exists between two atoms, for example, to determine whether a chemical reaction has occurred between them. A chemical reaction is the process by which a molecule breaks down into atoms, and the atoms rearrange and recombine to form a new molecule. It should be understood that if a chemical reaction occurs between two atoms, it indicates that a reaction center exists between them. If no chemical reaction occurs between two atoms, it indicates that a reaction center does not exist between them.
[0087] In some possible implementations, a graph neural network (GNN), such as a relational graph convolutional network (RGCN), can be used to identify reaction centers during the reaction center identification stage. For example, an RGCN-based reaction center identification process may include: outputting a vector representation of each atom in a given target through the convolutional layers of the RGCN; then processing the vector representations of every two atoms using the activation function of the RGCN to output a reaction centerscoring score, which represents the probability (e.g., the likelihood) that a reaction center exists between the two atoms.
[0088] Step 2: Reactant formation stage.
[0089] After identifying the reaction center of a given target based on step one above, the given target can be decomposed into one or two non-functional synthetic fragments by breaking chemical bonds. Then, based on the decomposed synthetic fragments, the corresponding reactant molecules are generated.
[0090] In some possible implementations, reactant molecules can be synthesized in the reactant generation stage using methods such as sequence generation or molecular editing. The principle is to predict the generation or editing operations of the next step or multiple steps based on known synthetic sub-fragments, and then complete the synthetic sub-fragments into a reactant with molecular function through sequential processing.
[0091] For example, Figure 2 A schematic diagram illustrating a G2Gs-based retrosynthetic process for related technologies. See also Figure 2 In the reaction center identification phase, G2Gs first use RGCN to predict the locations where bond breaking is required, in order to break a given target (such as...). Figure 2 The product shown is decomposed into a set of synthetic sub-fragments. During the reactant formation stage, G2Gs transform these synthetic sub-fragments into the final reactant molecules using a variational graph transformation framework. This variational graph transformation framework is used to generate reactant molecules based on the obtained synthetic sub-fragments through a series of graph transformations. See also Figure 2 The final reactant molecules can be Figure 2 The portion enclosed by the rectangle.
[0092] However, the aforementioned retrosynthetic processing schemes based on G2Gs still have many areas for improvement. On the one hand, G2Gs only focus on nodes (i.e., atoms) in the molecular diagram, ignoring features related to surfaces (i.e., planar structures). Surface features play a crucial role in identifying reaction centers. For example, in a benzene ring, all carbon atoms reside on a single surface, and the bonds connecting these carbons are highly stable, making them unlikely to be reaction centers. On the other hand, G2Gs generate reactants based solely on two-dimensional molecular diagrams, while real-world molecular diagrams possess three-dimensional properties, and their three-dimensional structural fragments often elucidate the reaction's operational mechanism. Therefore, relying solely on two-dimensional diagram structures may lead to the generated reactants ignoring, to some extent, the three-dimensional structural information of the molecule, thus failing to generate reasonable reactants.
[0093] In view of this, embodiments of this application provide a retrosynthetic processing method applicable to retrosynthetic scenarios of chemical molecules based on graph modeling. Specifically, by acquiring the isomer graph of the target molecule and its corresponding dual graph, when determining the feature vectors of multiple atoms in the target molecule, not only the feature vectors of multiple first nodes in the isomer graph are referenced, but also the feature vectors of multiple second nodes in the dual graph. Since the nodes in the dual graph correspond to the planar structures in the isomer graph, the determined feature vectors of multiple atoms in the target molecule also include the feature information of the planar structure, enabling a more accurate characterization of the target molecule. Therefore, performing retrosynthetic processing based on the feature vectors of multiple atoms in the target molecule yields more accurate reactant molecules, effectively improving the accuracy of the retrosynthetic processing and thus enhancing its effectiveness.
[0094] For example, the retrosynthetic processing method provided in this application embodiment can be applied to retrosynthetic scenarios of new drug design, new material design, or pesticide and agricultural chemical design.
[0095] In one example of this application, the retrosynthetic processing method provided can be applied to retrosynthetic scenarios in new drug design. For instance, in the field of drug development, molecular retrosynthetic processing can be used to design new drug molecules with specific biological activities. For example, if it is necessary to design a compound with specific pharmacological activity, the retrosynthetic processing method provided in this application can be used to determine the reactant molecules of the compound, thereby determining the possible routes for synthesizing the compound. Specifically, machine learning techniques can be used to predict the most probable drug synthesis pathway using known chemical reaction data and drug molecule structures.
[0096] In another example of this application, the retrosynthetic processing method provided can be applied to retrosynthetic scenarios in the design of new materials. For instance, in the field of materials science, molecular retrosynthetic processing can be used to design materials with specific properties. For example, if it is necessary to design a material with specific electrical conductivity or optical properties, the retrosynthetic processing method provided in this application can be used to determine the reactant molecules of the material, thereby finding possible pathways for synthesizing the material. Specifically, machine learning techniques can be used to predict the most probable material synthesis pathway using known chemical reaction data and material molecular structures.
[0097] In another example of this application, the retrosynthetic processing method provided can be applied to retrosynthetic scenarios in the design of pesticides and agricultural chemicals. For instance, in the agricultural field, molecular retrosynthetic processing can be used to design novel pesticides or agricultural chemicals. For example, if it is necessary to design a pesticide with highly effective killing action against specific pests or pathogens, the retrosynthetic processing method provided in this application can be used to determine the reactant molecules of the pesticide, thereby finding possible pathways for synthesizing the pesticide. Specifically, machine learning techniques can be used to predict the most probable pesticide synthesis pathway using known chemical reaction data and molecular structure information.
[0098] It is worth noting that, in other examples, the inverse synthesis processing method provided in this application embodiment can also be applied to other types of inverse synthesis scenarios, and this application embodiment does not limit this.
[0099] To facilitate understanding of the embodiments of this application, the following points will be explained before introducing the embodiments of this application.
[0100] 1. In the embodiments of this application, "instruction" can include direct instruction and indirect instruction, as well as explicit instruction and implicit instruction. The information indicated by a certain piece of information is called the information to be instructed. In the specific implementation process, there are many ways to instruct the information to be instructed, such as, but not limited to, directly instructing the information to be instructed, such as the information to be instructed itself or its index. It can also indirectly instruct the information to be instructed by instructing other information, where there is a relationship between the other information and the information to be instructed. It can also instruct only a part of the information to be instructed, while the other parts are known or pre-agreed upon. For example, the instruction of specific information can be achieved by using a pre-agreed (e.g., protocol-defined) arrangement order of various pieces of information, thereby reducing instruction overhead to some extent. At the same time, the common parts of various pieces of information can be identified and uniformly indicated to reduce the instruction overhead caused by individually indicating the same information.
[0101] Furthermore, the specific indication method can also be any existing indication method, such as, but not limited to, the above-mentioned indication methods and their various combinations. Specific details of various indication methods can be found in existing technologies, and will not be repeated here. As can be seen from the above, for example, when multiple pieces of information of the same type need to be indicated, the indication methods for different pieces of information may differ. In the specific implementation process, the required indication method can be selected according to specific needs. This application embodiment does not limit the selected indication method; therefore, the indication methods involved in this application embodiment should be understood to cover various methods that enable the party to be indicated to obtain the information to be indicated.
[0102] It should be understood that the information to be indicated can be sent as a whole or divided into multiple sub-information messages, and the sending period and / or timing of these sub-information messages can be the same or different. The specific sending method is not limited in this application embodiment. The sending period and / or timing of these sub-information messages can be predefined, for example, predefined according to a protocol, or configured by the transmitting device by sending configuration information to the receiving device. This configuration information can include, for example, but not limited to, radio resource control signaling, such as Radio Resource Control (RRC) signaling, Media Access Control (MAC) layer signaling, physical layer signaling, sidelink control information (SCI), or downlink control information (DCI), or a combination of at least two of these.
[0103] 2. "Predefined" or "pre-configured" can be achieved by pre-saving corresponding codes, tables, or other means that can be used to indicate relevant information in the device (e.g., electronic device). This application does not limit the specific implementation method. "Saving" can refer to saving in one or more memories. The one or more memories can be separate settings or integrated into the encoder or decoder, processor, or inverse synthesis processing device. Alternatively, some memories can be separately set up, while others are integrated into the decoder, processor, or inverse synthesis processing device. The type of memory can be any form of storage medium, and this application does not limit this.
[0104] 3. In the embodiments of this application, the descriptions such as "when," "under the circumstances," "if," and "if" all refer to the fact that the device (such as an electronic device) will make corresponding processing under certain objective circumstances. They are not time limits, nor do they require the device (such as an electronic device) to have a judgment action when it is implemented, nor do they mean that there are other limitations.
[0105] Furthermore, the system architecture and business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of system architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0106] Furthermore, the actions, terms, etc., involved in the various embodiments of this application can be referenced interchangeably without limitation. The message names or parameter names in the messages exchanged between the various devices in the embodiments of this application are merely examples, and other names may be used in specific implementations without limitation.
[0107] It should be noted that, in this embodiment of the application, a chemical molecule containing n atoms and q types of chemical bonds is used as an example. This chemical molecule can be represented as M = {A, X}. Here, X is an n×d vector matrix used to characterize the features of the n atoms, where the feature dimension of each atom is d. A is an n×n×q adjacency matrix used to characterize the type of chemical bond between every two atoms, and the total number of chemical bond types can be q. For example, if there is a chemical bond of type k between atom i and atom j, then A... i,j,k =1, if there is no chemical bond of type k between atom i and atom j, then A i,j,k =0. The embodiments of this application will subsequently use the chemical molecule M = {A, X} as an example to illustrate the scheme.
[0108] Based on this, chemical reactions can be described as set pairs (G r Gp ), of which G r ={M i r}| i=1 l It is a collection containing l reactants, G p ={M j p}| j=1 m It is a set containing m products. The embodiments of this application will subsequently illustrate the scheme using a single-output chemical reaction as an example, i.e., |G p Chemical reactions when | = 1. For single-output chemical reactions, the goal of retrosynthetic treatment is to achieve the desired outcome given a product M. p In the case of predicting the reactant set {M}, i r}| i=1 l .
[0109] The system architecture of the embodiments of this application will be described below as an example.
[0110] In some embodiments, the retrosynthetic processing method provided in this application can be applied to, for example... Figure 3 In the system architecture shown. For example, Figure 3 This is a schematic diagram of the system architecture of a reverse synthesis processing method provided in an embodiment of this application.
[0111] See Figure 3 The system architecture may include terminal device 301 and electronic device 302.
[0112] Among them, the terminal device 301 can be at least one of the following devices: smartphone, smartwatch, desktop computer, laptop, virtual reality terminal, augmented reality terminal, wireless terminal, and laptop computer.
[0113] In this embodiment, terminal device 301 is used to trigger the retrosynthesis task of the target molecule. For example, in some possible implementations, terminal device 301 sends the target molecule to be retrosynthesized to electronic device 302 in response to a user uploading the target molecule to be retrosynthesized. In this embodiment, the term "target molecule" will be used to refer to the molecule to be retrosynthesized.
[0114] In one possible implementation, terminal device 301 and electronic device 302 can communicate and connect via a wired or wireless network. Electronic device 302 can be a server deployed in the cloud. In another possible implementation, electronic device 302 can be a server or server cluster deployed in the cloud, capable of providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and big data or artificial intelligence platforms.
[0115] In this embodiment, the electronic device 302 is used to acquire the isomer map of the target molecule to be retrosynthesized and the corresponding dual map; determine the feature vectors of multiple atoms in the target molecule based on the feature vectors of multiple first nodes in the isomer map and the feature vectors of multiple second nodes in the dual map; and perform retrosynthetic processing on the target molecule based on the feature vectors of the multiple atoms in the target molecule to obtain the reactant molecule of the target molecule. Thus, by acquiring the isomer map of the target molecule and the corresponding dual map, when determining the feature vectors of multiple atoms in the target molecule, not only the feature vectors of multiple first nodes in the isomer map are referenced, but also the feature vectors of multiple second nodes in the dual map. Since the nodes in the dual map correspond to the planar structures in the isomer map, the determined feature vectors of multiple atoms in the target molecule also include the feature information of the planar structure, enabling a more accurate characterization of the target molecule. Furthermore, performing retrosynthetic processing based on the feature vectors of multiple atoms in the target molecule yields a more accurate reactant molecule, effectively improving the accuracy of the retrosynthetic processing and thus enhancing the effect of the retrosynthetic processing.
[0116] Furthermore, in some possible implementations, the electronic device 302 may also return the reactant molecules of the target molecule to the terminal device 301 for display.
[0117] In this embodiment of the application, the electronic device 302 may include a dual graph construction module 3021, a model training module 3022, and a storage center module 3023.
[0118] The dual graph construction module 3021 provides the function of constructing a dual graph. The model training module 3022 provides the function of model training. The storage center module 3023 provides the function of data storage, such as storing the model's training data.
[0119] In some possible implementations, the model training module 3022 is used to train the initial model to obtain a graph neural network, such as a heterogeneous graph neural network or a dual graph neural network. The heterogeneous graph neural network is used to extract features from nodes in the heterogeneous graph. The dual graph neural network is used to extract features from nodes in the dual graph.
[0120] In some possible implementations, the model training module 3022 is used to train the initial model to obtain a classification neural network. This classification neural network is used to determine whether a reaction center exists between any two atoms in the target molecule.
[0121] In some other possible implementations, the model training module 3022 is used to train the initial model to obtain a conditional diffusion model. This conditional diffusion model is used to reduce the synthetic sub-fragments to reactant molecules.
[0122] See Figure 3 In some embodiments, a user can upload the model's training data to an electronic device 302 by operating on a terminal device 301. The electronic device 302 then stores the model's training data in a storage center module 3023. The dual graph construction module 3021 extracts the training data from the storage center module 3023 to construct the dual graph of each molecule in the training data. Then, the model training module 3022 performs model training to obtain the aforementioned graph neural network, classification neural network, and conditional diffusion model, etc.
[0123] Furthermore, when a user needs to perform retrosynthetic processing on a target molecule, they can operate on the terminal device 301. After the terminal device 301 sends the target molecule to be retrosynthesized to the electronic device 302, the electronic device 302 can use the trained graph neural network, classification neural network, and conditional diffusion model to execute the retrosynthetic processing method provided in this application embodiment to obtain the reactant molecule of the target molecule.
[0124] In one example of this application, Figure 3 The structural diagram of the electronic device in the diagram is as follows: Figure 4 As shown. Figure 4 This is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of this application. See also... Figure 4 , Figure 4 The electronic device shown may include a processor 401, a memory 402, a communication interface 403, and a bus 404. The processor 401, the memory 402, and the communication interface 403 can be connected via the bus 404.
[0125] The processor 401 is the control center of the electronic device. It can be a general-purpose central processing unit (CPU) or other general-purpose processors. The general-purpose processor can be a microprocessor or any conventional processor.
[0126] As an example, processor 401 may include one or more CPUs, for example Figure 4CPU 0 and CPU 1 are shown in the diagram.
[0127] The memory 402 may be a read-only memory (ROM) or other type of static storage device capable of storing static information and instructions, random access memory (RAM) or other type of dynamic storage device capable of storing information and instructions, or electrically erasable programmable read-only memory (EEPROM), disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code in the form of instructions or data structures and accessible by a computer, but is not limited thereto.
[0128] In one possible implementation, the memory 402 may exist independently of the processor 401. The memory 402 can be connected to the processor 401 via a bus 404 and is used to store data, instructions, or program code. When the processor 401 calls and executes the instructions or program code stored in the memory 402, it can implement the inverse synthesis processing method provided in the embodiments of this application.
[0129] In another possible implementation, the memory 402 can also be integrated with the processor 401.
[0130] Communication interface 403 is used for connecting the electronic device to other devices via a communication network, which may be Ethernet, radio access network (RAN), wireless local area network (WLAN), etc. Communication interface 403 may include a receiving unit for receiving data and a transmitting unit for transmitting data.
[0131] Bus 404 can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0132] It should be pointed out that, Figure 4The structure shown does not constitute a limitation on the electronic device, except... Figure 4 In addition to the components shown, the electronic device may include more or fewer components than illustrated, or combine certain components, or have different component arrangements.
[0133] For ease of understanding, the inverse synthesis processing method provided in this application is illustrated below with reference to the above system architecture and accompanying drawings. It should be noted that the names of the parameters or information in the following embodiments of this application are merely examples, and may be other names in other embodiments. The inverse synthesis processing method provided in this application does not specifically limit these names.
[0134] It is understood that in the embodiments of this application, the electronic device may perform some or all of the steps in the embodiments of this application. These steps or operations are merely examples, and the embodiments of this application may also perform other operations or variations thereof. Furthermore, the steps may be performed in different orders as presented in the embodiments of this application, and it is not necessarily necessary to perform all the operations in the embodiments of this application.
[0135] Based on the above Figure 3 The system architecture shown illustrates the inverse synthesis processing method provided in this application.
[0136] Figure 5 This is a flowchart illustrating a reverse synthesis method provided in an embodiment of this application. In some possible implementations, the method can be derived from the above... Figure 3 The electronic device shown performs this action. See also Figure 5 The method includes the following S501-S503.
[0137] S501. Obtain the isomer map of the target molecule to be retrosynthesized and the corresponding dual map.
[0138] In the isomer diagram, nodes represent atoms in the target molecule, and edges represent chemical bonds in the target molecule that connect two atoms.
[0139] Each node in the dual graph corresponds to a planar structure in the heterogeneous graph; that is, each node in the dual graph corresponds to a plane in the heterogeneous graph. A planar structure, also known as a ring structure, is a plane consisting of at least three nodes.
[0140] S502. Based on the features of the first node and the features of the second node, determine the feature vectors of multiple atoms in the target molecule.
[0141] The first node features include feature vectors of multiple first nodes in the heterogeneous graph. In this embodiment, "first node" refers to a node in the heterogeneous graph. The second node features include feature vectors of multiple second nodes in the dual graph. In this embodiment, "second node" refers to a node in the dual graph. In this embodiment, the feature vectors can be vector matrices that encode or represent nodes.
[0142] S503. Based on the characteristic vectors of multiple atoms in the target molecule, perform retrosynthesis on the target molecule to obtain the reactant molecule of the target molecule.
[0143] The technical solution provided in this application obtains the isomer map of the target molecule and its corresponding dual map. When determining the feature vectors of multiple atoms in the target molecule, it references not only the feature vectors of multiple first nodes in the isomer map but also the feature vectors of multiple second nodes in the dual map. Since the nodes in the dual map correspond to the planar structures in the isomer map, the determined feature vectors of multiple atoms in the target molecule also include the feature information of the planar structure, enabling a more accurate characterization of the target molecule. Furthermore, performing retrosynthesis based on the feature vectors of multiple atoms in the target molecule yields more accurate reactant molecules, effectively improving the accuracy of the retrosynthesis process and thus enhancing its effectiveness.
[0144] Figure 6 A schematic flowchart illustrating another retrosynthetic processing method provided in this application embodiment. See also... Figure 6 , with the above Figure 3 Taking the interaction flow between the terminal device and the electronic device as an example, the inverse synthesis processing method is explained. The method includes the following steps S601-S608:
[0145] S601, In response to the user uploading the target molecule to be reverse synthesized, the terminal device sends the target molecule to be reverse synthesized to the electronic device.
[0146] The target molecule refers to a chemical molecule, specifically the chemical molecule of a given target (or a given product).
[0147] In some possible implementations, users can trigger a terminal device to send the target molecule to an electronic device by uploading a descriptor of the molecule to be retrosynthesized. Here, the descriptor refers to a numerical indicator derived from physicochemical properties or molecular structure. In other words, the descriptor of the target molecule describes its physicochemical properties or molecular structure.
[0148] For example, the terminal device can provide an interactive interface, which may include a molecule input box for inputting a descriptor of the target molecule to be retrosynthesized. Accordingly, the user can input the descriptor of the target molecule into the text input box by performing an input operation (such as an editing operation). The terminal device, responding to the user's input operation, can then obtain the descriptor of the target molecule, thus completing the uploading of the target molecule's descriptor.
[0149] For example, the interactive interface of the terminal device may include multiple candidate molecules and options for those candidate molecules. Accordingly, the user can perform a selection operation (such as a checkmark operation) among the multiple candidate molecules. In response to the user's selection operation, the terminal device will identify the selected candidate molecule as the target molecule, and then obtain the descriptor of the target molecule, thus completing the uploading of the target molecule's descriptor.
[0150] It is worth noting that in other possible implementations, the terminal device may also use other methods to upload the target molecule to be retrosynthesized. This application does not limit this approach.
[0151] S602. The electronic device receives the target molecule to be retrosynthesized and obtains the isomer map of the target molecule and the dual map corresponding to the isomer map.
[0152] In the embodiments of this application, the nodes in the isomorphism diagram represent atoms in the target molecule, and the edges in the isomorphism diagram represent chemical bonds in the target molecule used to connect two atoms.
[0153] In some possible implementations, the process of obtaining the isomer map of the target molecule can be as follows: nodes are used to represent the atoms of the target molecule, edges are used to represent the chemical bonds of the target molecule, and the nodes and edges are connected according to the interconnection between the atoms in the target molecule to obtain the isomer map of the target molecule.
[0154] In this embodiment, the nodes in the dual graph correspond to planar structures in the heterogeneous graph; that is, each node in the dual graph corresponds to a plane in the heterogeneous graph. The planar structure, also known as a ring structure, refers to a plane composed of at least three nodes.
[0155] In some possible implementations, the process of obtaining the dual graph corresponding to the heterogeneous graph can be as follows: use nodes to represent the planar structure in the heterogeneous graph. For a new planar structure formed by nodes, if the planar structure is separated by one or more edges in the heterogeneous graph, then connect the two separated nodes in the dual graph.
[0156] For example, Figure 7 This is a schematic diagram illustrating the construction of a dual graph, as provided in an embodiment of this application. See also... Figure 7 In the isomerism graph of the target molecule, it can include planar structure 1, planar structure 2, and planar structure 3. When constructing the dual graph, planar structure 1 can be represented by node 1′, planar structure 2 by node 2′, and planar structure 3 by node 3′. In the dual graph, the planar structures formed by nodes 1′, 2′, and 3′ are separated by 6 edges in the isomerism graph. Therefore, connecting the two separated nodes in the dual graph yields... Figure 7 The dual graph shown.
[0157] In this embodiment of the application, by constructing the dual graph corresponding to the heteromorphic graph, since the nodes in the dual graph correspond to the planar structures in the heteromorphic graph, the feature vectors of multiple atoms in the target molecule can be determined by subsequently using the heteromorphic graph and the dual graph corresponding to the heteromorphic graph. This allows the feature vectors of multiple atoms in the target molecule to also include the feature information of the planar structure, thus enabling a more accurate characterization of the target molecule.
[0158] S603, the electronic device determines the feature vectors of multiple atoms in the target molecule based on the features of the first node and the features of the second node.
[0159] The first node features include feature vectors of multiple first nodes in the heterogeneous graph. In this embodiment, "first node" refers to a node in the heterogeneous graph. The second node features include feature vectors of multiple second nodes in the dual graph. In this embodiment, "second node" refers to a node in the dual graph. In this embodiment, the feature vectors can be vector matrices that encode or represent nodes.
[0160] In some possible implementations, the process by which the electronic device in S603 determines the feature vectors of multiple atoms in the target molecule based on the first node features and the second node features may include the following steps (1-1) to (1-3).
[0161] Step (1-1): The electronic device inputs the heterogeneous graph into the heterogeneous graph neural network to obtain the first node feature output by the heterogeneous graph neural network.
[0162] Heterogeneous graph neural networks are used to extract features from nodes in heterogeneous graphs. For example, a heterogeneous graph neural network can be an RGCN, such as an encoder built based on an RGCN.
[0163] In some possible implementations, after the electronic device inputs the heterogeneous graph into the heterogeneous graph neural network, the heterogeneous graph is processed by the heterogeneous graph neural network, which can output the feature vectors of multiple first nodes in the heterogeneous graph, that is, output the features of the first nodes.
[0164] In this embodiment of the application, the heterogeneous graph neural network is used to obtain the initial feature vector of each first node in the heterogeneous graph, and to obtain the features of the first node based on the initial feature vector of the first node.
[0165] Accordingly, the processing procedure performed by the heterogeneous graph neural network can be as follows: for each first node in the heterogeneous graph, obtain the initial feature vector of the first node, and then pass the initial feature vector of the first node through the multi-layer network of the heterogeneous graph neural network to obtain the features of the first node.
[0166] For example, taking a heterogeneous graph neural network as an example, and assuming the RGCN includes L network layers, where L is a positive integer greater than or equal to 1. For the heterogeneous graph M of the target molecule... p ={A p ,X p The process of determining the features of the first node can be as follows: For each first node in the heterogeneous graph, the initial feature vector of the first node is obtained according to the following feature calculation formula (1), and the initial feature vector of the first node is passed through the L-layer network of the heterogeneous graph neural network to obtain the features of the first node.
[0167]
[0168] In the formula, H L The first node features are represented by the feature vectors of multiple first nodes in the heterogeneous graph. X represents the node representation of the first node i at level 0, which is also the initial feature vector X of the first node i. p [i,:]; This represents the l-th layer node representation of the first node i, which is also the feature of the first node i output by the l-th layer in RGCN; The first node i represents the (l-1)th layer node representation, which is also the feature of the first node i output by the (l-1)th layer in RGCN; R represents the set of chemical bond types in the target molecule, which is also the set of edge types in the isomer graph; This represents the set of neighboring nodes of the first node i under the connection relationship of edge type r (chemical bond type is r); This represents the (l-1)th layer node representation of all neighboring nodes of the first node i, which is also the feature of all neighboring nodes of the first node i output by the (l-1)th layer in RGCN; It is a learnable weight parameter matrix corresponding to the edge type r, used to perform linear transformation on neighbor nodes of the same edge type; σ is a learnable weight parameter matrix of self-loop edges, used to perform a linear transformation on the first node i; σ() is the activation function.
[0169] It should be noted that H in the above feature calculation formula (1) L Based on The constructed vector matrix. Wherein, This represents the L-th layer node representation of the first node i, which is also the feature of the first node i output by the L-th (last) layer in RGCN. It should be understood that H... L One row in the graph corresponds to the feature vector of the first node in the heterogeneous graph.
[0170] It should also be noted that in the above feature calculation formula (1) Through A p [:,:,r] is obtained. Among them, A... p [:,:,r] represents the interconnections between atoms in the target molecule under the connection relationship of edge type r. It should be understood that, according to A... p [:,:,r] can determine which atoms in the target molecule are connected to each other by chemical bonds r, thereby determining the set of neighboring nodes of the first node i under the connection relationship of edge type r.
[0171] In the above feature calculation formula (1), the feature vector of the current node is updated by aggregating the information of the neighboring nodes, thereby determining the feature vectors of multiple first nodes in the heterogeneous graph to obtain the features of the first node.
[0172] In step (1-2), the electronic device inputs the dual graph into the dual graph neural network to obtain the second node features output by the dual graph neural network.
[0173] The dual graph neural network is used to extract features from nodes in the dual graph. For example, the dual graph neural network can be an RGCN, such as an encoder built based on RGCN.
[0174] In some possible implementations, the electronic device inputs the dual graph into a dual graph neural network, processes the dual graph through the dual graph neural network, and can output the feature vectors of multiple second nodes in the dual graph, that is, output the features of the second nodes.
[0175] In this embodiment of the application, the dual graph neural network is used to determine the planar structure in the heterogeneous graph corresponding to each second node in the dual graph, and to determine the initial feature vector of the second node based on the feature vectors of the multiple first nodes included in the planar structure; and to obtain the features of the second node based on the initial feature vector of the second node.
[0176] Accordingly, the processing procedure performed by the dual graph neural network can be as follows: for each second node in the dual graph, determine the planar structure in the heterogeneous graph corresponding to the second node; determine the initial feature vector of the second node based on the feature vectors of the multiple first nodes included in the planar structure; and then pass the initial feature vector of the second node through multiple network layers of the dual graph neural network to obtain the features of the second node.
[0177] For example, for each second node in the dual graph, the initial feature vector of the second node can be determined based on the feature vectors of the multiple first nodes included in the planar structure of the heterogeneous graph corresponding to the second node and the feature calculation formula (2) below.
[0178]
[0179] In the formula, S represents the initial eigenvector of the second node i; i X represents the set of all nodes included in the planar structure of the heterogeneous graph corresponding to the second node i; p [j,:] represents the feature vector of the first node j included in the planar structure of the heterogeneous graph corresponding to the second node i. It should be understood that S i Essentially, it is a set of nodes in a heterogeneous graph.
[0180] For example, Figure 8 This is a schematic diagram of a heterogeneous graph and a dual graph provided for an embodiment of this application. See also... Figure 8 Taking the second node E in the dual graph as an example, the planar structure of the heterogeneous graph corresponding to the second node E is plane ABD, and the set of nodes included in plane ABD is {A,B,D}, so S i=E ={A,B,D}, therefore, according to the above feature calculation formula (2), the initial feature vector of the second node E is (feature vector of A + feature vector of B + feature vector of D) / 3.
[0181] For example, taking the dual graph neural network RGCN as an example, and assuming that the RGCN includes L network layers, where L is a positive integer greater than or equal to 1, the dual graph of the target molecule... The process of determining the features of the second node can be as follows: for each second node in the dual graph, the initial feature vector of the second node is obtained according to the following feature calculation formula (3), and the initial feature vector of the second node is passed through the L-layer network of the dual graph neural network to obtain the features of the second node.
[0182]
[0183] In the formula, D LThe second node features are represented by the feature vectors of multiple second nodes in the dual graph. This represents the 0th-level node representation of the second node i, which is also the initial feature vector of the second node i. This represents the l-th layer node representation of the second node i, which is also the feature of the second node i output by the l-th layer in RGCN; The first node represents the (l-1)th layer node representation of the second node i, which is the feature of the second node i output by the (l-1)th layer in RGCN; R represents the set of chemical bond types in the target molecule, which is the set of edge types in the dual graph. This represents the set of neighboring nodes of the second node i under the connection relationship of edge type r (chemical bond type r); This represents the (l-1)th layer node representation of all neighboring nodes of the second node i, which is also the feature of all neighboring nodes of the second node i output by the (l-1)th layer in RGCN; It is a learnable weight parameter matrix corresponding to the edge type r, used to perform linear transformation on neighbor nodes of the same edge type; σ is a learnable weight parameter matrix of self-loop edges, used to perform a linear transformation on the second node i; σ() is the activation function.
[0184] It should be noted that D in the above feature calculation formula (3) L Based on The constructed vector matrix. Wherein, This represents the L-th layer node representation of the second node i, which is also the feature of the second node i output by the L-th (last) layer in RGCN. It should be understood that D... L One row in D corresponds to the eigenvector of a second node in the dual graph, that is, D L One row in the graph corresponds to the feature vector of a planar structure in the heterogeneous graph.
[0185] In the above feature calculation formula (3), the feature vector of the current node is updated by aggregating the information of the neighboring nodes, thereby determining the feature vectors of multiple second nodes in the dual graph to obtain the features of the second nodes.
[0186] The above implementation provides a method for determining the features of the second node. Specifically, the planar structure in the heterogeneous graph corresponding to each second node is determined by the correspondence between the second nodes in the dual graph and the planar structures in the heterogeneous graph. Then, based on the feature vectors of the multiple first nodes included in the planar structure, the initial feature vector of the second node is determined. Finally, the initial feature vector of the second node is passed through multiple layers of a dual graph neural network to output the features of the second node.
[0187] Step (1-3): The electronic device determines the feature vectors of multiple atoms in the target molecule based on the features of the first node and the features of the second node.
[0188] In some possible implementations, electronic devices can determine the feature vectors of multiple atoms in a target molecule by feature splicing. The corresponding process can be: splicing the features of the first node and the features of the second node to obtain the feature vectors of multiple atoms in the target molecule.
[0189] In the above implementation, feature vectors of multiple atoms in the target molecule can be obtained by directly concatenating the features of the first node and the features of the second node. This allows for fast and efficient feature concatenation of the first and second node features.
[0190] In some other possible implementations, the electronic device can first aggregate the feature vectors of multiple first nodes in the heterogeneous graph, and then determine the feature vectors of multiple atoms in the target molecule by feature splicing. The corresponding process can be: aggregate the features of the first nodes to obtain the whole graph features of the heterogeneous graph, and then splice the whole graph features with the features of the second nodes to obtain the feature vectors of multiple atoms in the target molecule.
[0191] For example, the electronic device can aggregate the features of the first node according to the following feature calculation formula (4) to obtain the whole graph features of the heterogeneous graph.
[0192]
[0193] In the formula, This represents the overall graph features of a heterogeneous graph, i.e., the feature vector of the entire graph; the Readout function is used to obtain the overall graph features by aggregating node features; H L This represents the features of the first node, including the feature vectors of multiple first nodes in the heterogeneous graph.
[0194] It should be noted that for RGCNs with L layers, the feature calculation formula (1) above can only aggregate information from the first node within the L hops. Considering that the reactivity of the reaction center may also be related to more distant nodes, the influence of distant atoms can be introduced by calculating the feature vector at the whole graph level, thereby improving the accuracy of subsequent reaction center identification.
[0195] Thus, based on the aforementioned feature calculation formulas (1) and (4), the first node feature can be obtained, thereby obtaining the overall feature of the heteromorphic graph. Simultaneously, based on the aforementioned feature calculation formulas (2) and (3), the second node feature can be obtained. Furthermore, based on the following feature calculation formula (5), the overall feature of the heteromorphic graph and the second node feature can be concatenated to obtain the feature vectors of multiple atoms in the target molecule.
[0196]
[0197] In the formula, m i F represents the final feature of the first node i after dual graph enhancement, which is also the feature vector of atom i in the target molecule; i Let F represent the set of all nodes on the dual graph corresponding to the planar structure containing the first node i; it should be understood that F i Essentially, it is the set of nodes in the dual graph; D L [j,:] represents the eigenvector of node j in the dual graph corresponding to the planar structure containing the first node i; || represents the overall features of a heterogeneous graph, i.e., the feature vector of the entire graph; || represents feature concatenation.
[0198] For example, see Figure 8 Taking the first node A in the heterogeneous graph as an example, the planar structures in the heterogeneous graph containing the first node A are plane ABC, plane ABD, and plane ACD. The corresponding set of nodes in the dual graph is {E, F, G}, so F i=A ={E,F,G}, therefore, according to the above feature calculation formula (5), the final feature of the first node A after dual graph enhancement is (E feature vector + F feature vector + G feature vector) / 3.
[0199] In the above implementation, the overall features of the heterogeneous graph can be obtained by first aggregating the features of the first node, and then concatenating the overall features with the features of the second node to obtain the feature vectors of multiple atoms in the target molecule. This not only enables fast and efficient feature concatenation of the first and second node features, but also, by determining the feature vectors at the overall graph level, introduces feature information from distant atoms, increasing the amount of information referenced in subsequent inverse synthesis processing, thereby effectively improving the accuracy of inverse synthesis.
[0200] In this embodiment, the feature vectors of multiple atoms in the target molecule are features obtained after dual graph enhancement.
[0201] In the above embodiments, by setting up a heterogeneous graph neural network and a dual graph neural network, the heterogeneous graph neural network extracts features from the nodes in the heterogeneous graph to obtain first node features, and the dual graph neural network extracts features from the nodes in the dual graph to obtain second node features. Then, by feature concatenation, the first node features and the second node features are fused to obtain feature vectors for multiple atoms in the target molecule. In this way, the feature vectors of multiple atoms in the determined target molecule reference not only the feature vectors of multiple first nodes in the heterogeneous graph but also the feature vectors of multiple second nodes in the dual graph, enabling a more accurate representation of the target molecule.
[0202] It should be noted that, regarding the aforementioned heterogeneous graph neural network, before implementing this scheme, iterative training of the initial model based on image training data is required to obtain the heterogeneous graph neural network. The image training data includes a sample heterogeneous graph and the vector labels of each node in that graph. The vector labels are used to indicate the feature vectors of each node in the sample heterogeneous graph. In some possible implementations, these vector labels can be manually labeled real labels. In other words, iterative training of the initial model is performed based on the sample heterogeneous graph and the vector labels of each node in that graph to obtain the aforementioned heterogeneous graph neural network.
[0203] Specifically, during any iteration of training, the image training data is input into the model obtained after the previous iteration. The heterogeneous graph is processed to obtain the vector representation of each node in the graph. Based on the vector representation and vector label of each node in the heterogeneous graph, the model loss value is determined, and the model parameters are adjusted based on this loss value. At the end of the iterative training of the model, the trained model is obtained as the heterogeneous graph neural network.
[0204] The model loss value represents the distance between the vector representation and the vector label output by the model, and can also be understood as the difference between the vector representation and the vector label. For example, the model loss value can be any one or more of the following: connectionist temporal classification (CTC) loss value, recurrent neural network-transducer (RNNT) loss value, or other loss values. This application does not limit this.
[0205] In some possible implementations, after adjusting the model parameters based on the model's loss value, it can be determined whether the model in this iteration meets the iteration termination condition, such as whether the model's loss value is less than or equal to the target threshold, or whether the model's iteration count has reached the preset number of iterations. Then, if the model meets the iteration termination condition, the iterative training stops, and the model trained in this iteration is obtained as a heterogeneous graph neural network. If the model does not meet the iteration termination condition, the next iteration is performed based on the model with adjusted parameters, until the model meets the iteration termination condition.
[0206] Thus, through iterative training of the initial model, a heterogeneous graph neural network with superior feature extraction capabilities can be obtained. Specifically, during any iteration of training, adjusting the model parameters using the model loss value can enhance the model's learning ability, thereby training a heterogeneous graph neural network with even better learning capabilities.
[0207] It should also be noted that, regarding the aforementioned dual graph neural network, before implementing this scheme, iterative training of the initial model based on image training data is required to obtain the dual graph neural network. The image training data includes a sample dual graph and the vector labels of each node in the sample dual graph. The vector labels are used to indicate the feature vectors of each node in the sample dual graph. In some possible implementations, these vector labels can be manually labeled real labels. That is, iterative training of the initial model is performed based on the sample dual graph and the vector labels of each node in the sample dual graph to obtain the aforementioned dual graph neural network.
[0208] Specifically, during any iteration of training, the image training data is input into the model obtained after the previous iteration. The sample dual graph is processed to obtain the vector representation of each node in the sample dual graph. Based on the vector representation and vector label of each node in the sample dual graph, the model loss value is determined, and the model parameters are adjusted based on the model loss value. At the end of the iterative training of the model, the trained model is obtained as the dual graph neural network.
[0209] The model loss value represents the distance between the vector representation and the vector label output by the model, and can also be understood as the difference between the vector representation and the vector label. For example, the model loss value can be any one or more of the CTC loss value, RNNT loss value, or other loss values. This application does not limit this.
[0210] In some possible implementations, after adjusting the model parameters based on the model's loss value, it can be determined whether the model in this iteration meets the iteration termination condition, such as whether the model's loss value is less than or equal to the target threshold, or whether the model's iteration count has reached the preset number of iterations. Then, if the model meets the iteration termination condition, iterative training stops, and the model trained in this iteration is obtained as a dual graphical neural network. If the model does not meet the iteration termination condition, the next iteration is performed based on the model with adjusted parameters, until the model meets the iteration termination condition.
[0211] Thus, through iterative training of the initial model, a dual graph neural network with superior feature extraction capabilities can be obtained. Specifically, during any iteration of training, adjusting the model parameters using the model loss value can enhance the model's learning ability, thereby training a dual graph neural network with even better learning capabilities.
[0212] S604. Electronic equipment determines whether a reaction center exists between two atoms based on the characteristic vectors of every two atoms in the target molecule.
[0213] In the embodiments of this application, determining whether a reaction center exists between two atoms can be understood as determining whether a chemical reaction has occurred between the chemical bonds of the two atoms.
[0214] In some possible implementations, after the electronic device determines the feature vectors of multiple atoms in the target molecule, it can input the feature vectors of multiple atoms in the target molecule into a classification neural network to obtain the reaction center identification result output by the classification neural network.
[0215] Specifically, the electronic device inputs the feature vectors of multiple atoms in the target molecule into a classification neural network. The classification neural network then processes the feature vectors of every two atoms in the target molecule to determine whether there is a reaction center between every two atoms, and can output the reaction center identification result.
[0216] In this system, the classification neural network is used to determine whether a reaction center exists between any two atoms in the target molecule. For example, the classification neural network could be an RGCN, such as a classification network built based on RGCN.
[0217] In some possible implementations, the process of processing the feature vectors of every two atoms in the target molecule through a classification neural network to determine whether there is a reaction center between every two atoms in the target molecule may include the following steps (2-1) to (2-3).
[0218] Step (2-1) involves concatenating the feature vectors of every two atoms in the target molecule with the feature vectors of the edges between those two atoms to obtain the combined features of the two atoms.
[0219] The combined features of two atoms include the feature vectors of the two atoms and the edge feature vector between the two atoms.
[0220] In some possible implementations, taking atoms i and j in the target molecule as an example, the process of determining the comprehensive features of atoms i and j is as follows: according to the following feature calculation formula (6), the feature vectors of atoms i, the feature vectors of atoms j, and the edge feature vectors between atoms i and j are spliced together to obtain the comprehensive features of atoms i and j.
[0221] e ij =m i ||m j ||A p [i,j,:] (6)
[0222] In the formula, e ij This represents the combined characteristics of atoms i and j; m i m represents the eigenvector of atom i in the target molecule; j A represents the eigenvector of atom j in the target molecule; p [i,j,:] represents the edge feature vector between atom i and atom j; || represents feature concatenation.
[0223] Step (2-2) Determine the reactivity fractions corresponding to the two atoms based on their combined characteristics.
[0224] The reactivity fraction can be used to indicate the probability that a reaction center exists between the two atoms. It should be understood that a higher probability value indicates a greater likelihood that a reaction center exists between the two atoms. Furthermore, a higher probability suggests that a given target requires breaking the chemical bond between these two atoms to generate a synthon.
[0225] In some possible implementations, the reactivity fraction can be determined based on the combined characteristics of the two atoms and the following formula (7).
[0226]
[0227] In the formula, s ij Represents the reactivity fractions corresponding to atoms i and j; Sigmoid() represents the activation function; e ij This represents the combined characteristics of atoms i and j; This is used to convert the composite feature into a scalar fraction that indicates whether there is a reaction center between the two nodes.
[0228] Step (2-3) determines whether a reaction center exists between the two atoms based on the reactivity fraction.
[0229] In some possible implementations, if the reactivity fractions corresponding to the two atoms are greater than or equal to a preset probability threshold, it is determined that a reaction center exists between the two atoms. If the reactivity fractions corresponding to the two atoms are less than the preset probability threshold, it is determined that no reaction center exists between the two atoms. The preset probability threshold is a pre-set fixed probability threshold, such as 90%. The setting of the preset probability threshold is not limited in the embodiments of this application.
[0230] The above implementation, using a pre-set fixed probability threshold as an example, illustrates how to determine whether a reaction center exists between two atoms. In other possible implementations, after determining multiple reactivity fractions corresponding to every two atoms in the target molecule, these fractions are arranged in descending order of value. A preset number of reactivity fractions with the highest values are then determined, and the two atoms corresponding to these preset number of reactivity fractions are considered to have a reaction center. Here, the preset number is a fixed number set in advance, such as 3. This application does not limit the setting of the preset number.
[0231] For example, assuming the target molecule consists of 10 atom pairs (atoms are paired in twos), then 10 reactivity fractions can be determined through steps (2-1) to (2-3) above. These multiple reactivity fractions are arranged in descending order of value, and the top 3 reactivity fractions are determined. It is determined that there is a reaction center between the two atoms corresponding to these 3 reactivity fractions.
[0232] It is worth noting that in some possible implementations, other methods can be used to determine whether there is a reaction center between the two atoms, and the embodiments of this application do not limit this.
[0233] The above implementation provides a method for identifying reaction centers. This involves concatenating the feature vectors of every two atoms and the feature vectors of the edges between them to achieve feature fusion, thus obtaining a comprehensive feature of the two atoms. Furthermore, by determining the reactivity fractions corresponding to these two atoms, it is possible to determine whether a reaction center exists between them.
[0234] It should be noted that, before implementing this scheme, the initial model needs to be iteratively trained based on molecular training data to obtain the aforementioned classification neural network. The molecular training data includes feature vectors of multiple atoms in the sample molecule and the class label of the sample molecule. The class label is used to indicate the reaction center of the sample molecule. In some possible implementations, this class label can be a human-labeled real label. In other words, iterative training of the initial model is performed based on the sample molecule and its class label to obtain the aforementioned classification neural network.
[0235] Specifically, during any iteration of training, the molecular training data is input into the model obtained after the previous iteration. The feature vectors of every two atoms in the sample molecule are processed to obtain the classification result of every two atoms in the sample molecule. Based on the classification result of every two atoms in the sample molecule and the category label, the model loss value is determined, and the model parameters are adjusted based on the model loss value. At the end of the model's iterative training, the trained model is obtained as the classification neural network.
[0236] The model loss value represents the distance between the classification result output by the model and the category label, and can also be understood as the difference between the classification result and the category label. For example, the model loss value can be any one or more of the CTC loss value, RNNT loss value, or other loss values. This application does not limit this.
[0237] For example, the model loss value can be determined based on the classification result of every two atoms in the sample molecule, the category label, and the loss function (8) below.
[0238]
[0239] In the formula, L (1) P represents the model loss value. r It is the set of all reaction centers in the molecular training data; Y ij This is a category label, that is, a real label used to indicate whether a reaction center exists between atom i and atom j; s ij λ represents the reactivity scores corresponding to atoms i and j, which is the classification result of atoms i and j in the sample molecule; λ represents the hyperparameter used to alleviate the class imbalance problem.
[0240] It should be noted that during the model training phase, model optimization can be performed by minimizing the aforementioned model loss value. In some possible implementations, after adjusting the model parameters based on this model loss value, it can be determined whether the model loss value of this iteration meets the iteration termination condition, such as whether the model loss value is less than or equal to the target threshold. Furthermore, if the model loss value is less than or equal to the target threshold, the iterative training stops, and the model trained in this iteration is taken as the classification neural network. If the model loss value is greater than the target threshold, the next iteration of training is performed based on the model with adjusted parameters, until the model loss value meets the iteration termination condition.
[0241] Thus, through iterative training of the initial model, a classification neural network with superior classification ability can be obtained. Specifically, during any iteration of training, adjusting the model parameters using the model loss value can improve the model's learning ability, thereby training a classification neural network with even better learning capabilities.
[0242] S605. If there is a reaction center between the two atoms, the electronic device decomposes the target molecule according to the reaction center to obtain the synthetic sub-fragments of the target molecule.
[0243] In some possible implementations, if a reaction center exists between the two atoms, the chemical bond between the two atoms is broken in the target molecule to obtain a synthetic fragment of the target molecule.
[0244] It is worth noting that the synthetic fragments are not effective chemical molecules.
[0245] S606 The electronic device inputs the feature vectors and coordinate vectors of multiple atoms in the synthesized sub-fragment into the conditional diffusion model, and obtains the feature vectors and coordinate vectors of the target atom output by the conditional diffusion model.
[0246] The coordinate vector is used to indicate the spatial position of atoms in the target molecule, such as three-dimensional coordinates. In some possible implementations, after the user uploads the target molecule to be reverse synthesized to the terminal device, the user can use the atom positioning tool set on the terminal device to determine the coordinate vectors of multiple atoms. This atom positioning tool is used to determine the three-dimensional coordinates of the atoms in the target molecule.
[0247] In this embodiment, the synthesized sub-fragment can be represented using the feature vectors and coordinate vectors of the multiple atoms included in the synthesized sub-fragment. For example, the coordinate vector of an atom can be a three-dimensional feature, such as represented as u. (x) ∈R 3 The eigenvectors of an atom can be d-dimensional features, such as u. (h) ∈R d Accordingly, an atom can be represented as [u (x),u (h) ].
[0248] Conditional diffusion is a deep learning generative model used to generate data based on the concept of diffusion. Specifically, it involves a forward diffusion process that gradually transforms the original data into noisy data, followed by a backward diffusion process that gradually restores the noisy data back to the original data. In essence, the forward diffusion process adds Gaussian noise progressively to disrupt the structure and characteristics of the synthesizer, thus transforming the original data into noisy data. The backward diffusion process, through denoising, gradually restores the noisy data back to the original data, ultimately outputting reactant molecules.
[0249] In this embodiment, the conditional diffusion model is used to add noise data to the feature vector and coordinate vector of each atom in the synthetic sub-fragment, obtaining noise-added vector data. The noise-added vector data is then denoised to obtain the feature vector and coordinate vector of the target atom. The target atom indicates the atom to be completed in the synthetic sub-fragment, which can be understood as the missing atom in the synthetic sub-fragment compared to the final determined reactant molecule.
[0250] In some possible implementations, the electronic device inputs the feature vectors and coordinate vectors of multiple atoms in the synthetic sub-fragment into a conditional diffusion model, and then uses the conditional diffusion model to predict the size of the complete molecule in retrosynthesis, such as predicting the number of atoms to be added in the synthetic sub-fragment. Based on the number of atoms to be added in the synthetic sub-fragment, the feature vectors and coordinate vectors of multiple atoms are processed to obtain the feature vectors and coordinate vectors of the target atom.
[0251] The process of determining the eigenvectors and coordinate vectors of the target atom using the conditional diffusion model is explained below, based on the forward diffusion process (3-1) and the reverse diffusion process (3-2).
[0252] (3-1) Forward diffusion process: For each of the multiple atoms, noise data is added to the feature vector and coordinate vector of the atom to obtain the vector data after adding noise.
[0253] The noise data can be Gaussian noise. It is worth noting that the noise data can also be other types of noise, but this application does not limit this.
[0254] For example, taking Gaussian noise as the noise data, for each of the multiple atoms, Gaussian sampling can be performed according to the following Gaussian noise formula (9). Gaussian noise is added to the feature vector and coordinate vector of the atom to obtain the vector data after adding noise.
[0255]
[0256] In the formula, q(z) t |z0) represents the vector data z obtained by adding Gaussian noise sequentially from time step 0 to time step t based on the original data z0. t It should be understood that q(z) t |z0) represents the noise addition process, where the original data z0 can be the feature vector and coordinate vector of the atom; t represents the current time step, and the value of t is (1, 2, ..., T); T represents the maximum time step; Represents vector data z t It follows a Gaussian distribution with a mean of α. t z0, the covariance of this Gaussian distribution is in, Let I represent the variance, and let α represent the unit covariance matrix. t Used to control the proportion of original data z0 retained; it should be noted that α t It is a preset value that changes with the number of time steps; It should be noted that, used to control the intensity of the added Gaussian noise, It is a preset value that changes with the number of time steps.
[0257] Regarding α in the above Gaussian noise formula (9) t In some possible implementations, α can be determined based on the variance of the Gaussian distribution and the following formula (10). t .
[0258]
[0259] In the formula, α t Used to control the proportion of original data z0 retained; Let α represent the variance. Thus, α is determined using the above calculation formula (10). t It can achieve noise addition while preserving variance.
[0260] Alternatively, in some other possible implementations, α can be determined based on the time step and the following calculation formula (11). t .
[0261]
[0262] In the formula, α t Used to control the proportion of original data z0 retained; t represents the current time step, with values ranging from (1, 2, ..., T); T represents the maximum time step; s is a preset fixed value, such as 10. -5To ensure numerical stability, α is determined using the above calculation formula (11). t It not only takes into account the time factor, but also uses a numerically stable polynomial control parameter α. t Adjusting the added noise can effectively improve the forward diffusion process.
[0263] (3-2) Reverse diffusion process: The vector data after adding noise is denoised to obtain the feature vector and coordinate vector of the target atom.
[0264] The reverse diffusion process in this embodiment of the application uses vector data z t Starting with the model, a neural network with θ as a trainable parameter is learned through model training to perform denoising.
[0265] For example, Gaussian sampling can be performed according to the following Gaussian noise formula (12) to denoise the vector data after adding noise, and obtain the feature vector and coordinate vector of the target atom.
[0266] p θ (z t-1 |z t )=N(z t-1 μ θ (z t ,t),R θ (z t ,t),t=1,2,…,T (12)
[0267] In the formula, p θ (z t-1 |z t ) indicates that in vector data z t Based on this, the original data z0 is obtained by sequentially removing Gaussian noise from time step 0 to time step t; it should be understood that p θ (z t-1 |z t N(z) represents the denoising process, where the original data z0 can be the feature vector and coordinate vector of the target atom; t represents the current time step, and the value of t is (1, 2, ..., T); T represents the maximum time step; N(z) represents the maximum time step. t-1 μ θ (z t ,t),R θ (z t ,t)) represents vector data z t-1 It follows a Gaussian distribution with a mean of μ. θ (z t The covariance of this Gaussian distribution is R(t). θ (z t It should be noted that μ θ (zt ,t) and R θ (z t ,t) is a vector data obtained from a neural network parameterized by θ through model training, used to determine the previous time step.
[0268] In some possible implementations, when denoising the noisy vector data, the noisy vector data can be input into an equivariant graph neural network to obtain the target vector data output by the equivariant graph neural network. Then, the target vector data is denoised using a conditional diffusion model to obtain the feature vectors and coordinate vectors of the target atoms.
[0269] Equivariant graph neural networks are used to ensure the equivariance of vector data in three-dimensional space. In some possible implementations, equivariant graph neural networks can be EGNNs.
[0270] For example, in the denoising time step t, atom i can be represented by the following expression (13).
[0271]
[0272] In the formula, z i,t This represents the input features of atom i at time step t; This represents the coordinate vector of atom i at time step t; Let represent the eigenvector of atom i at time step t.
[0273] For example, taking the equivariant graph neural network EGNN as an example, and taking EGNN as having L network layers as an example, where L is a positive integer greater than or equal to 1. The process of determining the target vector data can be as follows: for each atom in the vector data after adding noise, the vector data is processed based on the following vector calculation formula (14) to obtain the target vector data.
[0274]
[0275] In the formula, This represents the vector data of atom i output by the Lth (last) layer in EGNN, which is also the target vector data.
[0276] In the formula, m ij It is an intermediate variable used for calculation. and This represents the feature vector of atom i output by the (l-1)th layer in EGNN; This represents the feature vector of atom j output by the (l-1)th layer in EGNN; It is a coordinate difference, representing the difference between the coordinate vector output by atom i in layer l-1 and the coordinate vector output by atom j in layer l-1; This represents the coordinate vector of atom i output by the (l-1)th layer in EGNN; This represents the coordinate vector of atom j output by the (l-1)th layer in EGNN; v i The node representing atom i in the heterogeneity graph is essentially atom i; V represents the set of m atoms in a synthetic sub-fragment; i ∈S indicates that atom i belongs to a composite sub-fragment; This indicates that atom i does not belong to the synthetic sub-fragment; it should be understood that if an atom belongs to the synthetic sub-fragment, it means that the atom is an original atom in the synthetic sub-fragment. In this case, it is not necessary to generate a coordinate vector for the atom. Instead, it is sufficient to generate the coordinate vector of the part of the atom missing from the final reactant in the synthetic sub-fragment. and All of them are multilayer perceptrons.
[0277] In the above vector calculation formula (14), the coordinates of the atoms belonging to S are kept unchanged, which is equivalent to retaining the coordinate vectors of the original atoms in the synthetic sub-fraction. Then, noise reduction is performed on the basis of the coordinate vectors of the original atoms in the synthetic sub-fraction, which helps to make the generation process more controllable.
[0278] For example, suppose the final reactant R containing n atoms is represented as in, This represents the set of m atoms in a synthon. This represents the set of nm atoms to be generated. It should be understood that Q is obtained from the denoising stage.
[0279] In the above implementation, during the denoising process, an equivariant graph neural network is used to process the vector data to obtain the target vector data. This ensures the equivariance of the vector data in three-dimensional space, specifically the equivariance of the coordinate vectors within the vector data, meaning that the three-dimensional coordinates change accordingly with different conditions. Furthermore, denoising the target vector data yields the feature vectors and coordinate vectors of the target atoms, ensuring the accuracy of the denoising process.
[0280] It should be noted that, regarding the aforementioned equivariant graph neural network, before implementing this scheme, iterative training of the initial model based on vector training data is required to obtain the equivariant graph neural network. The vector training data includes sample vector data and vector labels derived from the equivariant processing of these sample vector data. The vector labels are used to indicate the feature vectors of the sample vector data after equivariant processing. In some possible implementations, these vector labels can be manually labeled real labels. In other words, iterative training of the initial model is performed based on the sample vector data and its equivariantly processed vector labels to obtain the aforementioned equivariant graph neural network.
[0281] Specifically, during any iteration of training, the training vector data is input into the model obtained after the previous iteration. The sample vector data is processed to obtain its vector representation after isovariant processing. Based on the vector representation and the vector labeling of the sample vector data after isovariant processing, the model loss value is determined, and the model parameters are adjusted based on this loss value. At the end of the model's iterative training, the trained model is obtained as the isovariant graph neural network.
[0282] The model loss value represents the distance between the vector representation and the vector label output by the model, and can also be understood as the difference between the vector representation and the vector label. For example, the model loss value can be any one or more of the CTC loss value, RNNT loss value, or other loss values. This application does not limit this.
[0283] In some possible implementations, after adjusting the model parameters based on the model's loss value, it can be determined whether the model in this iteration meets the iteration termination condition, such as whether the model's loss value is less than or equal to the target threshold, or whether the model's iteration count has reached the preset number of iterations. Then, if the model meets the iteration termination condition, iterative training stops, and the model trained in this iteration is obtained as an isovariant graph neural network. If the model does not meet the iteration termination condition, the next iteration is performed based on the model with adjusted parameters, until the model meets the iteration termination condition.
[0284] Thus, through iterative training of the initial model, a superior equivariant graph neural network can be obtained. Specifically, adjusting the model parameters using the model loss value during any given training iteration can enhance the model's learning ability, thereby training an equivariant graph neural network with even better learning capabilities.
[0285] It should also be noted that, regarding the conditional diffusion model described above, before implementing this scheme, iterative training of the initial model based on vector training data is required to obtain the conditional diffusion model. The vector training data includes the feature vectors and coordinate vectors of multiple atoms in the sample synthesizer, as well as the corresponding atom labels for that sample synthesizer. Atom labels are used to indicate the feature vectors and coordinate vectors of the target atom to be completed in the sample synthesizer. In some possible implementations, these atom labels can be real labels annotated manually. In other words, iterative training of the initial model is performed based on the feature vectors and coordinate vectors of multiple atoms in the sample synthesizer, as well as the corresponding atom labels for that sample synthesizer, to obtain the aforementioned conditional diffusion model.
[0286] Specifically, during any iteration of training, the training data of this vector is input into the model obtained after the previous iteration. The feature vectors and coordinate vectors of multiple atoms in the sample synthesizer are processed to obtain the processing result of the sample synthesizer. Based on the processing result of the sample synthesizer and the atom label, the model loss value is determined, and the model parameters are adjusted based on the model loss value. At the end of the iterative training of the model, the trained model is obtained as the conditional diffusion model.
[0287] The model loss value represents the distance between the processing result output by the model and the atomic labels, and can also be understood as the difference between the processing result and the atomic labels. For example, the model loss value can be any one or more of the CTC loss value, RNNT loss value, or other loss values. This application does not limit this.
[0288] For example, using the maximization of the likelihood of the model's input data as the optimization objective, the model loss value can be determined according to the following optimization formula (15). Here, likelihood refers to the probability of an event occurring. Variational lower bound is an index used to evaluate the quality of an approximate probability distribution, used to solve for the optimal approximate distribution.
[0289]
[0290] In the formula, -logp θ (z0) represents the optimization objective; p θ (z 0:T ) represents (z0, z1, z2, ..., z T The joint distribution of the input data p of the model. θ (z0,z1,z2,…,z T That is, the feature vectors and coordinate vectors of multiple atoms in the sample synthesizer; Describing the differential operator, that is Indicates that in q(z) 1:T |z0) on Calculate the expectation; q(z) 1:T |z0) represents the result obtained by adding Gaussian noise sequentially from time step 0 to time step T to the original data z0, resulting in (z1, z2, ..., z). T The joint distribution of ); D KL p is a function used to calculate the KL divergence, where the KL divergence characterizes the distance between two distributions; the smaller the distance, the closer the distributions are. θ (z t-1 |z t ) represents the processing result output by the model; q(z) t-1 |z t (z0) represents the atomic label, i.e., the true label value; it should be noted that the goal of model training is to expect q(z0) to be the true label value. t-1 |z t ,z0) and p θ (z t-1 |z t The distribution should be as close as possible to the probability density function.
[0291] By simplifying the above optimization formula (15), we can obtain the following expression (16).
[0292]
[0293] In the formula, μ θ (z t ,t) represents the model prediction; μ q (z t Let z(0,t) represent the true label values. It should be noted that the goal of model training is to make the model's predicted values as close as possible to the true label values, that is... The value should be as small as possible.
[0294] The simplification process of the above optimization formula (15) is explained below. Wherein, q(z) t-1 |z t z0) is essentially a Gaussian distribution, such as Where, μ q (z t The expression (17) for z0,t) The expression (18).
[0295]
[0296] Where, μ θ (z t ,t) is related to z t Functions related to z0 and t, due to μ θ (z tThe input of ,t) does not include z0, therefore, z0 is learned by introducing a learnable θ network.
[0297]
[0298] In the formula, This represents the output z0 of a learnable theta network.
[0299] Furthermore, by substituting the above expressions (17), (18) and (19) into the optimization objective (16), we can obtain the following expression (20).
[0300]
[0301] It should be noted that, considering z t It can be reparameterized to z t =α t +σ t ∈, correspondingly, z0=z t / α t +(σ t / α t )∈, in, This represents z0, which is the output of a learnable theta network, while z... t α t and σ t All of these are known. Therefore, we learn them by introducing a learnable theta network. That's all. Indicates network input z t The noise predicted under the condition of t.
[0302] For example, taking ∈~N(0,1) as a Gaussian noise, Substituting z0 into the above expression (20), we can get L t It can be simplified to the following expression (21).
[0303]
[0304] In α T Given that α = 0 and α1 ≈ 1, and considering that z0 is discrete noise data, the L in the above optimization formula (15) is... p =D KL (q(z T |z0)||p θ (z T ))and All are close to 0. Among them, α T =0, indicating that z T=∈, which means that time T (the last time) corresponds to Gaussian noise. Therefore, q(z) T |z0) and p θ (z T The noise distributions are the same, i.e., Gaussian distributions ∈ ~N(0,1). Furthermore, since D... KL Used to calculate the distance between two distributions, therefore L p ≈0. α1≈1, indicating z1≈z0. Considering that z0 is discrete noise data, z1 can be directly used as the prediction data for z0. Therefore, p θ The value of (z0|z1) is close to 1, so L0≈0.
[0305] Furthermore, research has shown that removing weights helps improve sample quality. Therefore, the expression for the model loss value is obtained (22).
[0306]
[0307] Regarding the above It can be written as:
[0308]
[0309] In the formula, It refers to the optimization objective, represented by z. i,t ,t is the input, and the predicted noise data; It is the feature of node i output by the L-layer EGNN at time step t.
[0310] Among them, the use of the Equivariant Graph Neural Network (EGNN) can maintain Isovariability with respect to coordinate rotation and translation.
[0311] It should be noted that S604 to S606 above correspond to Figure 5 This paper proposes a method for retrosynthetic processing of a target molecule by using the feature vectors of multiple atoms within the target molecule to obtain the reactant molecules. Specifically, it determines whether a reaction center exists between any two atoms in the target molecule, and then decomposes the target molecule based on the two atoms with such centers, obtaining synthetic sub-fractions. Furthermore, the reactant molecules are generated using the feature vectors and coordinate vectors of multiple atoms within these sub-fractions. Thus, during retrosynthetic processing, not only the feature vectors but also the coordinate vectors of multiple atoms within the sub-fractions are referenced, introducing three-dimensional information from the target molecule and increasing the amount of information considered in the retrosynthetic process. This effectively improves the accuracy and overall performance of the retrosynthetic process.
[0312] S607: The electronic device completes the synthesized fragments based on the characteristic vector and coordinate vector of the target atom to obtain the reactant molecule.
[0313] It should be noted that S606 to S607 above describe the process of determining the reactant molecule of the target molecule based on the feature vectors and coordinate vectors of multiple atoms in the synthetic sub-fraction. Specifically, a conditional diffusion model is set up to process the feature vectors and coordinate vectors of multiple atoms, thereby obtaining the feature vectors and coordinate vectors of the atoms to be completed in the synthetic sub-fraction. This allows for the rapid and efficient acquisition of relevant information about the atoms to be completed in the synthetic sub-fraction. Furthermore, by completing the synthetic sub-fraction, the reactant molecule can be obtained.
[0314] S608, the electronic device returns the reactant molecules of the target molecule to the terminal device.
[0315] In some possible implementations, the terminal device receives the reactant molecules of the target molecule returned by the electronic device and displays the reactant molecules of the target molecule on the display interface of the terminal device.
[0316] For example, Figure 9 This is a schematic flowchart illustrating a retrosynthetic process provided in an embodiment of this application. See also... Figure 9 This paper presents a molecular retrosynthetic process based on GDiff Retro, including reaction center identification based on dual graph enhancement and reactant generation based on conditional diffusion model.
[0317] The reaction center identification based on dual graph enhancement includes the following steps S901 to S905:
[0318] S901. Construct the isomer diagram and dual diagram of the product molecules.
[0319] After obtaining the isomer map of the product molecule, the dual graph corresponding to the isomer map can be obtained by performing a dual graph transform on the isomer map of the product molecule.
[0320] S902. Input the isomer map of the product molecule into the isomer map encoder to obtain the feature vectors of multiple nodes in the isomer map; input the dual map corresponding to the isomer map into the dual map encoder to obtain the feature vectors of multiple nodes in the dual map.
[0321] S903. Based on the eigenvectors of multiple nodes in the heterogeneous graph and the eigenvectors of multiple nodes in the dual graph, determine the eigenvectors of multiple atoms in the target molecule after the dual graph enhancement.
[0322] S904. Based on the eigenvectors of multiple atoms in the target molecule after duality graph enhancement, calculate the reactivity scores to obtain multiple reactivity scores corresponding to every two atoms in the target molecule; arrange these multiple reactivity scores in descending order of value, determine the top k reactivity scores (top k candidates), and determine that there is a reaction center between the two atoms corresponding to these k reactivity scores.
[0323] S905. Break the chemical bond between the two atoms that contain the reaction center to obtain the synthetic fragment of the target molecule.
[0324] Reactant generation based on the conditional diffusion model includes the following S906 to S908:
[0325] S906. Obtain the feature vectors and coordinate vectors of multiple atoms in the synthetic sub-fragment.
[0326] S907. Input the feature vectors and coordinate vectors of multiple atoms in the synthesized sub-fragment into the conditional diffusion model. Process the feature vectors and coordinate vectors of multiple atoms through the conditional diffusion model to obtain the feature vectors and coordinate vectors of the target atom.
[0327] S908. Complete the synthesizer fragments based on the characteristic vectors and coordinate vectors of the target atoms to obtain the reactant molecules.
[0328] For example, reactant 1 can be generated based on synthetic fragment 1, and reactant 2 can be generated based on synthetic fragment 2.
[0329] In the above embodiments, an innovative retrosynthetic processing framework, GDiff Retro, is proposed. In the reaction center identification stage, isomer maps are combined with their corresponding dual maps to determine feature vectors that characterize molecular structures, helping to guide the model to focus on planar structures within the molecule. In the reactant generation stage, a conditionally isovariant diffusion model in three dimensions (3D) is employed to assist reactant generation, further transforming the synthon judgments obtained in the previous stage into complete reactant molecules. Thus, by introducing a graph neural network enhanced with dual maps and a conditionally isovariant diffusion model, Gdiff Retro learns planar, graph, and three-dimensional features from the molecular map, enabling it to better learn information from chemical reactions and provide more accurate and diverse reactant predictions without relying on extensive prior knowledge (such as reactant template libraries).
[0330] The technical solution provided in this application obtains the isomer map of the target molecule and its corresponding dual map. When determining the feature vectors of multiple atoms in the target molecule, it references not only the feature vectors of multiple first nodes in the isomer map but also the feature vectors of multiple second nodes in the dual map. Since the nodes in the dual map correspond to the planar structures in the isomer map, the determined feature vectors of multiple atoms in the target molecule also include the feature information of the planar structure, enabling a more accurate characterization of the target molecule. Furthermore, performing retrosynthesis based on the feature vectors of multiple atoms in the target molecule yields more accurate reactant molecules, effectively improving the accuracy of the retrosynthesis process and thus enhancing its effectiveness.
[0331] It should be noted that the embodiments of this application illustrate the scheme using a single-output chemical reaction (i.e., retrosynthetic processing for a single product molecule) as an example. However, in other embodiments, the embodiments of this application are also applicable to multi-output chemical reactions, i.e., retrosynthetic processing for multiple product molecules. For example, retrosynthetic processing for multiple product molecules can be divided into multiple iterative retrosynthetic processes, i.e., multi-step retrosynthetic processing. This can cover most cases of chemical reactions or more complex cases, such as compound reactions and protein reactions. The retrosynthetic processing method provided in the embodiments of this application, combined with multiple iterative processes, can effectively solve the retrosynthetic processing of more complex chemical molecules.
[0332] This application also provides a set of experimental test data based on the USPTO-50k dataset, which preliminarily verifies that performing retrosynthetic processing based on this application embodiment can bring the expected advantages and effects. The USPTO-50k dataset is a standard single-step synthetic retrosynthetic benchmark dataset, containing 50,000 chemical reactions that can be divided into 10 different reaction types. In some possible implementations, the dataset can be divided into a training set, a validation set, and a test set, with a ratio of 8:1:1.
[0333] In the experimental tests, three types of inverse synthesis methods were provided: template-based methods, template-free methods, and semi-template methods.
[0334] Template-based methods can include GLN, Local Retro, Graph Retro, and Dual-TB. Template-free methods can include Transformer, SCROP, Retroformer, GTA, Graph2 SMILES (D-GCN), Transformer (Aug), Dual-TF, and Chemformer. Semi-template-based methods can include MEGAN, G2Gs, and RetroXpert.
[0335] The accuracy of the above retrosynthetic methods was evaluated using top-k accuracy (k = 1, 3, 5, 10) as the evaluation metric, and the results are shown in Table 1. Top-k accuracy was determined by comparing the simplified molecular input line entry system (SMILES) strings of the reactant molecules obtained through retrosynthesis with the actual data of the reactant molecules. SMILES is a specification that explicitly describes the molecular structure using ASCII strings.
[0336] Table 1
[0337]
[0338] As shown in Table 1, for the first candidate result Top-1 (56.8) output by GDiff Retro, GDiff Retro has the highest accuracy compared to all other methods, and its accuracy even surpasses template-based methods such as Dual-TB. This indicates that even without an external knowledge database, GDiff Retro can provide the most accurate inverse synthesis results with only one inverse synthesis process.
[0339] When dealing with the top-3 (76.8) and top-5 (79.9) candidate results output by GDiffRetro, its accuracy is comparable to template-free and semi-template-based methods. Specifically, GDiffRetro outperforms all template-free methods in both the top-3 and top-5 categories. It's worth noting that some methods, such as MEGAN, may exhibit significantly higher performance when dealing with the top 10 candidate results. This is because they require a sufficient number of sampling iterations, which translates to more processing time.
[0340] For example, Figure 10 This is a schematic diagram illustrating the effect of a retrosynthetic process provided in an embodiment of this application. See also... Figure 10Three molecules to be retrosynthesized are shown to the left of the dashed line, such as molecule 1, molecule 2, and molecule 3. The reaction centers in the molecules to be retrosynthesized are represented by circular dashed boxes. Furthermore, based on the technical solution provided in the embodiments of this application, it is possible to generate three candidate reactant molecules corresponding to each of these three molecules, such as... Figure 10 Candidate 1, Candidate 2, and Candidate 3 are shown to the right of the dashed line. In other words, based on the technical solution provided in this application, not only can highly accurate reactant molecules be generated in retrosynthetic processing, but also results with many valuable candidate reactant molecules can be provided, ensuring the effectiveness of retrosynthetic processing while increasing its diversity.
[0341] Furthermore, the differences between the embodiments of this application and related technologies 1 (MEGAN) and 2 (G2Gs) are shown in Table 2. Referring to Table 2, a comparison is provided, both technically and in terms of applicability, between the inverse synthesis processing method provided in the embodiments of this application and the inverse synthesis processing methods shown in related technologies.
[0342] Table 2
[0343]
[0344] At the technical level, one related technology provides an inverse synthesis processing scheme for an encoder-decoder neural network model based on graph editing sequences, and another related technology provides an inverse synthesis processing scheme for a prediction model based on RGCN and a variational graph transformation framework. The embodiment of this application provides an inverse synthesis processing scheme based on a dual graph-enhanced RGCN prediction model and a conditional diffusion model.
[0345] In terms of applicability, one related technology provides a reverse synthesis processing scheme for two-dimensional molecular diagrams, another related technology also provides a reverse synthesis processing scheme for two-dimensional molecular diagrams, while the embodiments of this application provide a reverse synthesis processing scheme for three-dimensional molecular diagrams.
[0346] It should be noted that the above description is for the purpose of more clearly illustrating the reverse synthesis processing method described in the embodiments of this disclosure, and should not be construed as a limitation on the specific implementation of this application.
[0347] The above mainly describes the solutions provided in the embodiments of this application from the perspective of the retrosynthetic processing flow of the target molecule. Correspondingly, the embodiments of this application also provide a retrosynthetic processing apparatus for implementing the various methods described above. This retrosynthetic processing apparatus can be one of the apparatuses described in the above method embodiments, or it can include the aforementioned apparatus, or it can be a component that can be used. It is understood that, in order to achieve the above functions, the retrosynthetic processing apparatus includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should readily recognize that, in conjunction with the units and algorithm steps of the various examples described in the embodiments disclosed herein, this application can be implemented in hardware or a combination of hardware and computer software. Whether a function is executed in hardware or by computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0348] This application embodiment can divide the inverse synthesis processing device into functional modules according to the above method embodiment. For example, each function can be divided into a separate functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be understood that the module division in this application embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0349] For example, Figure 11 This is a schematic diagram of a retrosynthetic processing apparatus provided in an embodiment of this application. See also... Figure 11 The inverse synthesis processing apparatus includes an acquisition module 1101, a determination module 1102, and a processing module 1103. Wherein:
[0350] Module 1101 is used to perform the above. Figure 5 The S501 or shown Figure 6 S602 as shown;
[0351] Determine module 1102, used to perform the above. Figure 5 S502 or shown Figure 6 S603 as shown;
[0352] Processing module 1103 is used to perform the above. Figure 5 The S503 or shown Figure 6 S604 to S607 are shown.
[0353] The technical solution provided in this application obtains the isomer map of the target molecule and its corresponding dual map. When determining the feature vectors of multiple atoms in the target molecule, it references not only the feature vectors of multiple first nodes in the isomer map but also the feature vectors of multiple second nodes in the dual map. Since the nodes in the dual map correspond to the planar structures in the isomer map, the determined feature vectors of multiple atoms in the target molecule also include the feature information of the planar structure, enabling a more accurate characterization of the target molecule. Furthermore, performing retrosynthesis based on the feature vectors of multiple atoms in the target molecule yields more accurate reactant molecules, effectively improving the accuracy of the retrosynthesis process and thus enhancing its effectiveness.
[0354] In one possible implementation, the determining module 1102 is further configured to:
[0355] The heterogeneous graph is input into the heterogeneous graph neural network to obtain the first node feature output by the heterogeneous graph neural network. The heterogeneous graph neural network is used to extract features from the nodes in the heterogeneous graph.
[0356] The dual graph is input into the dual graph neural network to obtain the second node features output by the dual graph neural network. The dual graph neural network is used to extract features from the nodes in the dual graph.
[0357] In one possible implementation, module 1102 is specifically used for:
[0358] By concatenating the features of the first node and the features of the second node, a feature vector of multiple atoms in the target molecule is obtained; or,
[0359] The first node feature is aggregated to obtain the whole graph feature of the heterogeneous graph; the whole graph feature is concatenated with the second node feature to obtain the feature vector of multiple atoms in the target molecule.
[0360] In one possible implementation, the dual graph neural network is used to determine the planar structure in the heterogeneous graph corresponding to each second node in the dual graph, and to determine the initial feature vector of the second node based on the feature vectors of the multiple first nodes included in the planar structure; and to obtain the features of the second node based on the initial feature vector of the second node.
[0361] In one possible implementation, processing module 1103 is specifically used for:
[0362] Based on the characteristic vectors of every two atoms in the target molecule, determine whether there is a reaction center between the two atoms;
[0363] If the reaction center exists between the two atoms, the target molecule is decomposed based on the reaction center to obtain the synthetic fragment of the target molecule;
[0364] Based on the characteristic vectors and coordinate vectors of multiple atoms in the synthetic fragment, the reactant molecule of the target molecule is determined; the coordinate vector is used to indicate the spatial position of the atom in the target molecule.
[0365] In one possible implementation, processing module 1103 is specifically used for:
[0366] The feature vectors and coordinate vectors of multiple atoms in the synthetic sub-fragment are input into the conditional diffusion model to obtain the feature vector and coordinate vector of the target atom output by the conditional diffusion model; the target atom is used to indicate the atom to be completed in the synthetic sub-fragment;
[0367] The synthesizer fragment is completed by using the characteristic vector and coordinate vector of the target atom to obtain the reactant molecule.
[0368] In one possible implementation, the conditional diffusion model is used to add noise data to the feature vector and coordinate vector of each atom in the synthetic sub-fragment to obtain noise-added vector data; and to perform denoising processing on the noise-added vector data to obtain the feature vector and coordinate vector of the target atom.
[0369] In one possible implementation, the processing module 1103 is further configured to:
[0370] The vector data with added noise is input into the equivariant graph neural network to obtain the target vector data output by the equivariant graph neural network.
[0371] The conditional diffusion model is specifically used to denoise the target vector data to obtain the feature vector and coordinate vector of the target atom.
[0372] In one possible implementation, processing module 1103 is specifically used for:
[0373] The feature vectors of every two atoms in the target molecule and the feature vectors of the edges between the two atoms are concatenated to obtain the comprehensive features of the two atoms.
[0374] Based on the combined characteristics of the two atoms, the reactivity fractions corresponding to the two atoms are determined. These reactivity fractions are used to indicate whether there is a reaction center between the two atoms.
[0375] Based on the reactivity fraction, determine whether a reaction center exists between the two atoms.
[0376] For a detailed description of the above-mentioned optional methods, please refer to the foregoing method embodiments, which will not be repeated here. Furthermore, the explanation of any of the retrosynthetic processing apparatuses provided above, as well as the description of their beneficial effects, can be found in the corresponding method embodiments described above, and will not be repeated here.
[0377] As an example, combined Figure 4 The above Figure 11 The functions implemented by some or all of the acquisition module 1101, determination module 1102, and processing module 1103 in the inverse synthesis processing apparatus shown can be achieved through Figure 4 Processor 401 in the middle executes Figure 4 The computer executes instructions in memory 402.
[0378] In this embodiment, the inverse synthesis processing apparatus is presented as an integrated unit divided into functional modules. Here, "module" can refer to a specific ASIC, circuitry, a processor and memory executing one or more software or firmware programs, integrated logic circuitry, and / or other devices that can provide the aforementioned functions. In a simplified embodiment, those skilled in the art will recognize that the inverse synthesis processing apparatus can employ... Figure 3 The form of the electronic device shown.
[0379] for example, Figure 4 The processor 401 in the illustrated electronic device can execute the inverse synthesis processing method in the above method embodiment by calling computer execution instructions stored in the memory 402.
[0380] Specifically, the above Figure 11 The functions / implementation processes of the acquisition module 1101, determination module 1102, and processing module 1103 in the inverse synthesis processing apparatus shown can be obtained through... Figure 4 The processor 401 in the illustrated electronic device calls computer execution instructions stored in memory 402 to achieve this.
[0381] Since the retrosynthetic processing apparatus provided in this application embodiment can perform the above-described retrosynthetic processing method, the technical effects it can achieve can be referred to the above-described method embodiment, and will not be repeated here.
[0382] It should be understood that one or more of the above modules or units can be implemented by software, hardware, or a combination of both. When any of the above modules or units are implemented by software, the software exists as computer program instructions and is stored in memory. The processor can be used to execute the program instructions and implement the above method flow. The processor can be built into a SoC (System-on-a-Chip) or ASIC, or it can be a separate semiconductor chip. In addition to the core that executes software instructions for computation or processing, the processor may further include necessary hardware accelerators, such as field-programmable gate arrays (FPGAs), PLDs (Programmable Logic Devices), or logic circuits that implement dedicated logic operations.
[0383] When the above modules or units are implemented in hardware, the hardware can be any one or any combination of a CPU, microprocessor, digital signal processing (DSP) chip, microcontroller unit (MCU), artificial intelligence processor, ASIC, SoC, FPGA, PLD, application-specific digital circuit, hardware accelerator, or non-integrated discrete device, which can run the necessary software or perform the above method flow independently of software.
[0384] Optionally, embodiments of this application also provide an electronic device (e.g., the server may be a chip or a chip system), which includes a processor for implementing the methods in any of the above method embodiments. In one possible design, the electronic device further includes a memory. The memory is used to store necessary program instructions and data, and the processor can call the program code stored in the memory to instruct the electronic device to execute the methods in any of the above method embodiments. Of course, the memory may not be present in the electronic device. When the electronic device is a chip system, it may be composed of chips or may contain chips and other discrete devices; embodiments of this application do not specifically limit this.
[0385] This application also provides a computer-readable storage medium storing computer-executable instructions that, when executed on an electronic device, cause the electronic device to perform the method executed by any of the inverse synthesis processing apparatuses provided above.
[0386] For explanations of the relevant content and descriptions of the beneficial effects in any of the computer-readable storage media provided above, please refer to the corresponding embodiments described above, which will not be repeated here.
[0387] This application also provides a chip. The chip integrates a control circuit for implementing the functions of the aforementioned inverse synthesis processing apparatus and one or more ports. Optionally, the functions supported by the chip can be referred to above, and will not be repeated here. Those skilled in the art will understand that all or part of the steps of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium. The aforementioned storage medium can be a read-only memory, random access memory, etc. The aforementioned processing unit or processor can be a central processing unit, a general-purpose processor, an application-specific integrated circuit (ASIC), a microprocessor (digital signal processor, DSP), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof.
[0388] This application also provides a computer program product containing computer-executable instructions, which, when executed on an electronic device, cause the electronic device to perform any of the methods described in the above embodiments. The computer program product includes one or more computer-executable instructions. When the computer-executable instructions are loaded and executed on the electronic device, all or part of the flow or function according to the embodiments of this application is generated. The electronic device may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer-executable instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer-executable instructions may be transmitted from one website, computer, electronic device, or data center to another website, computer, electronic device, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium accessible to the electronic device or a data storage device including one or more electronic devices, data centers, etc., that can be integrated with the medium. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
[0389] It should be noted that the devices for storing computer instructions or computer programs provided in the embodiments of this application, such as but not limited to the memory, computer-readable storage medium and communication chip, are all non-transitory.
[0390] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product.
[0391] Although this application has been described herein in conjunction with various embodiments, those skilled in the art, by reviewing the accompanying drawings, the disclosure, and the appended claims, will understand and implement other variations of the disclosed embodiments in carrying out the claimed application. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple instances. A single processor or other unit can implement several functions listed in the claims. While different dependent claims may recite certain measures, this does not mean that these measures cannot be combined to produce good results.
[0392] Although this application has been described in conjunction with specific features and embodiments, it is obvious that various modifications and combinations can be made thereto without departing from the spirit and scope of this application. Accordingly, this specification and drawings are merely exemplary illustrations of this application as defined by the appended claims, and are considered to cover any and all modifications, variations, combinations, or equivalents within the scope of this application. Clearly, those skilled in the art can make various alterations and modifications to this application without departing from the spirit and scope of this application. Thus, if such modifications and modifications of this application fall within the scope of the claims of this application and their equivalents, this application is also intended to include such modifications and modifications.
Claims
1. A method of reverse synthetic processing, characterized by, The method comprises the following steps: obtain an isomerism graph of a target molecule to be retrosynthesized and a dual graph corresponding to the isomerism graph; nodes in the isomerism graph represent atoms in the target molecule, and nodes in the dual graph correspond to planar structures in the isomerism graph; determine feature vectors of a plurality of atoms in the target molecule according to first node features and second node features; the first node features include feature vectors of a plurality of first nodes in the isomerism graph; the second node features include feature vectors of a plurality of second nodes in the dual graph; perform retrosynthesis processing on the target molecule according to the feature vectors of the plurality of atoms in the target molecule to obtain reactant molecules of the target molecule.
2. The method of claim 1, wherein, Before the step of determining the feature vectors of the plurality of atoms in the target molecule according to the first node features and the second node features, the method further comprises: input the isomerism graph into an isomerism graph neural network to obtain the first node features output by the isomerism graph neural network, the isomerism graph neural network being used for feature extraction on nodes in the isomerism graph; input the dual graph into a dual graph neural network to obtain the second node features output by the dual graph neural network, the dual graph neural network being used for feature extraction on nodes in the dual graph.
3. The method according to claim 1 or 2, characterized in that, The step of determining the feature vectors of the plurality of atoms in the target molecule according to the first node features and the second node features comprises: perform feature splicing on the first node features and the second node features to obtain the feature vectors of the plurality of atoms in the target molecule; or perform aggregation processing on the first node features to obtain an integral graph feature of the isomerism graph; perform feature splicing on the integral graph feature and the second node features to obtain the feature vectors of the plurality of atoms in the target molecule.
4. The method of claim 2, wherein, The dual graph neural network is used to determine a planar structure in the isomerism graph corresponding to each second node in the dual graph, and determine an initial feature vector of the second node according to feature vectors of a plurality of first nodes included in the planar structure; and obtain the second node features according to the initial feature vector of the second node.
5. The method according to any one of claims 1 to 4, characterized in that, The step of performing retrosynthesis processing on the target molecule according to the feature vectors of the plurality of atoms in the target molecule to obtain reactant molecules of the target molecule comprises: determine whether there is a reaction center between each two atoms in the target molecule according to their feature vectors; if there is a reaction center between the two atoms, decompose the target molecule according to the reaction center to obtain a synthetic sub-fragment of the target molecule; determine the reactant molecules of the target molecule according to feature vectors and coordinate vectors of a plurality of atoms in the synthetic sub-fragment; the coordinate vectors are used to indicate spatial positions of the atoms in the target molecule.
6. The method of claim 5, wherein, The step of determining the reactant molecules of the target molecule according to the feature vectors and the coordinate vectors of the plurality of atoms in the synthetic sub-fragment comprises: input the eigenvectors and the coordinate vectors of the plurality of atoms in the synthetic sub-fragment into a conditional diffusion model to obtain eigenvectors and coordinate vectors of a target atom output by the conditional diffusion model; the target atom is used to indicate an atom to be completed in the synthetic sub-fragment; complete the synthetic sub-fragment according to the eigenvectors and the coordinate vectors of the target atom to obtain the reactant molecule.
7. The method of claim 6, wherein, The conditional diffusion model is configured to add noise data to the eigenvectors and the coordinate vectors of each atom in the synthetic sub-fragment to obtain vector data after adding noise; and perform denoising processing on the vector data after adding noise to obtain the eigenvectors and the coordinate vectors of the target atom.
8. The method of claim 7, wherein, The method further comprises: input the vector data after adding noise into an isometric graph neural network to obtain target vector data output by the isometric graph neural network; The conditional diffusion model is specifically configured to perform denoising processing on the target vector data to obtain the eigenvectors and the coordinate vectors of the target atom.
9. The method according to any one of claims 5-8, characterized in that, The determining whether there is a reaction center between the two atoms according to the eigenvectors of the two atoms in the target molecule comprises: perform feature splicing on the eigenvectors of the two atoms and an edge eigenvector between the two atoms in the target molecule to obtain comprehensive features of the two atoms; determine a reactivity score corresponding to the two atoms according to the comprehensive features of the two atoms; the reactivity score is used to indicate whether there is a reaction center between the two atoms; determine whether there is a reaction center between the two atoms according to the reactivity score.
10. A reverse synthesis processing device, characterized by comprising: comprise: an acquisition module configured to acquire an isomorphic graph of a target molecule to be inversely synthesized and a dual graph corresponding to the isomorphic graph; nodes in the isomorphic graph represent atoms in the target molecule, and nodes in the dual graph correspond to planar structures in the isomorphic graph; a determination module configured to determine eigenvectors of a plurality of atoms in the target molecule according to first node features and second node features; the first node features comprise eigenvectors of a plurality of first nodes in the isomorphic graph; and the second node features comprise eigenvectors of a plurality of second nodes in the dual graph; a processing module configured to perform inverse synthesis processing on the target molecule according to the eigenvectors of the plurality of atoms in the target molecule to obtain a reactant molecule of the target molecule.
11. An electronic device, comprising: comprise a memory and a processor, the memory and the processor are connected; the memory is configured to store computer execution instructions; and the processor is configured to invoke the computer execution instructions to execute the method in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, comprise computer execution instructions, which, when executed on an electronic device, cause the electronic device to execute the method in any one of claims 1-9.
13. A computer program product, characterised in that, comprise computer execution instructions, which, when executed on an electronic device, cause the electronic device to execute the method in any one of claims 1-9.