A multi-step information fusion-based molecular retrosynthesis prediction method and system
By combining knowledge graph embedding, graph convolutional networks, and the external attention mechanism of the Transformer architecture, the problem of lack of global consistency and insufficient structural modeling in molecular retrosynthetic pathways in existing technologies is solved, achieving efficient and accurate prediction of multi-step synthetic pathways and improving the intelligent assistance capabilities for drug development and organic synthesis.
Patent Information
- Application Number
- CN202610151625.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-03
- Publication Date
- 2026-04-14
- Estimated Expiration
- 2046-02-03
AI Technical Summary
Existing retrosynthetic methods for molecules fail to fully utilize contextual information during single-step prediction, resulting in a lack of global consistency in synthetic pathways and insufficient structural modeling capabilities. Furthermore, they lack generalization ability and are difficult to predict complex multi-step synthetic pathways.
We employ a method that combines knowledge graph embedding with graph convolutional networks. Through single-step reaction modeling and multi-step path feature fusion, we utilize the external attention mechanism of the Transformer architecture to realize the interaction between the product and multi-step path features, and combine it with a search algorithm to generate a synthetic path.
It significantly improves the global consistency and accuracy of molecular retrosynthesis prediction, especially in complex multi-step synthesis tasks, enhancing the feasibility and reliability of pathways and providing an efficient and intelligent auxiliary tool for drug development and organic synthesis.
Smart Images

Figure CN121641254B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of artificial intelligence and computer-aided drug design, specifically to a molecular retrosynthesis prediction method and system based on multi-step information fusion, belonging to the interdisciplinary field of computer chemical synthesis planning and deep learning. Background Technology
[0002] Retrosynthetic prediction is a core issue in drug development and organic synthesis design. Its goal is to automatically predict the set of possible reactants based on a target molecule and progressively generate the complete reaction pathway for synthesizing that molecule. Existing retrosynthetic methods mainly include the following categories:
[0003] The first category is template-based methods. These methods rely on predefined reaction templates or those mined from data, and determine possible reactants by matching product molecules with the template during prediction. While these methods offer strong interpretability, their drawbacks include reliance on a static reaction rule library, making it difficult to cover novel or complex chemical reactions, and limiting their scalability and flexibility.
[0004] The second category is template-free methods based on deep learning. With the development of neural networks, researchers have proposed modeling retrosynthesis as a sequence-to-sequence prediction problem. This typically involves using models such as the Transformer to directly predict reactants from products, thereby reducing reliance on templates. These methods have achieved good results on standard public datasets, but their predictions are often limited to single-step reactions and lack the ability to comprehensively model the global path.
[0005] Building upon this, researchers proposed an inverse synthesis paradigm of "single-step prediction + multi-step search." Specifically, the single-step prediction model is used to predict possible reactants given the products; the multi-step search algorithm then recursively calls the single-step prediction model and combines it with search strategies (such as depth-first search, bundle search, or heuristic search) to progressively expand and obtain the complete synthesis path. This paradigm improves the feasibility of path generation, but still has shortcomings.
[0006] The main limitations of existing methods are: first, they fail to fully utilize the contextual information of the preceding and following reaction steps in the single-step prediction process, resulting in a lack of global consistency and coherence in the overall synthesis path; second, they have limited utilization of the overall structure of the reaction path and lack a mechanism to introduce structured modeling tools such as graph neural networks to model and fuse the path, making it difficult to capture the contextual dependencies in complex multi-step synthesis; and third, when the template coverage is insufficient or the product exceeds the training distribution, the generalization ability of existing methods is insufficient, leading to a decrease in prediction accuracy and path feasibility. Summary of the Invention
[0007] This invention provides a molecular retrosynthesis prediction method and system based on multi-step information fusion. Addressing the shortcomings of existing technologies in fully utilizing contextual information in the single-step prediction stage, lacking global consistency in the overall synthesis path, and insufficient path structure modeling capabilities, this invention proposes a solution combining knowledge graph embedding and graph convolutional networks. This achieves the organic fusion of single-step and multi-step synthesis path information. Furthermore, in the decoding stage of the Transformer-based model, multi-step path fusion features are introduced, and interaction with the encoder output is achieved through an external attention mechanism, thereby effectively improving prediction performance and the feasibility of the synthesis path.
[0008] A molecular retrosynthesis prediction method based on multi-step information fusion includes the following steps:
[0009] Single-step reaction modeling: Each single-step reaction in the reaction dataset is modeled as a triple, and a knowledge graph embedding model is used to compare and learn positive and negative samples to obtain a single-step reaction node representation that can reflect the molecular structure features and semantic associations of the reaction.
[0010] Multi-step path feature fusion: Based on the node representation obtained by the single-step reaction modeling, a multi-step reaction directed graph is constructed, and a relational graph convolutional network is used to perform multi-layer feature fusion. Through message passing and neighbor information aggregation, a fused node representation that contains both its own single-step information and path context is obtained.
[0011] Reactant prediction and synthesis path generation: In the decoding stage of the reactant prediction model based on the Transformer architecture, the multi-step path fusion feature obtained by the multi-step path feature fusion is introduced. The external attention mechanism is used to realize the interaction between the model encoder output and the fusion node representation to improve the accuracy of single-step prediction. In the path generation stage, the synthesis path is recursively expanded by combining the search algorithm until the path endpoint matches the known starting raw materials in the database.
[0012] Furthermore, the knowledge graph embedding model in the single-step reaction modeling includes an entity and relation embedding layer, a scoring function, and a negative sampling mechanism. The entity and relation embedding layer has an embedding dimension of 256 and is initialized and managed through an external embedding storage module. During training, the model generates comparison samples through negative sampling with head entity replacement and completes training optimization in conjunction with the corresponding scoring calculation module.
[0013] Furthermore, the relational graph convolutional network in the multi-step path feature fusion includes an embedding layer and two convolutional layers, and is regularized using the Dropout mechanism. The forward propagation process of this network includes the following steps: First, the input node numbers nids are mapped to the corresponding node representations x through the embedding layer; then, the node representations are input to the first convolutional layer, and feature propagation and aggregation are performed in the convolution operation by combining the edge type information of the graph structure g and the normalization factor to obtain the hidden node representations of the first layer, and a nonlinear transformation is introduced through the activation function; then, the Dropout layer is used to refine the hidden representations. The model performs random parameter loss to reduce overfitting risk and improve generalization ability. Then, the processed node representation is input into the second convolutional layer to continue combining edge type and normalization information to complete feature updates and obtain higher-level node representations. Finally, the network is further regularized through a Dropout layer to obtain the final output of the network. The relational graph convolutional network is used to obtain the fusion features of multi-step paths. During training, it is optimized based on the ranking loss function, and the prediction score of positive triples is constrained to be higher than that of negative triples, finally obtaining a 256-dimensional multi-step path fusion feature representation.
[0014] Furthermore, the reactant prediction model in the reactant prediction and synthesis path generation is a Transformer-based structure. This structure includes an embedding module, an encoder, a decoder, a memory mechanism module, and a multi-step path fusion feature and encoder output interaction module. Specifically: the embedding module maps the character numbers of the input products or reactants into vector representations and adds positional encoding; the output serves as the input to the subsequent encoder and decoder. The encoder consists of multiple stacked self-attention encoder layers. Each layer sequentially includes a self-attention mechanism, residual connections and layer normalization, a feedforward fully connected network, and regularization processing, used to extract higher-order representations of the product sequence. The memory mechanism module is used to perform multi-layer memory attention processing on the encoder output to fuse historical reaction or path information; the multi-step path fusion feature and encoder output interaction module realizes the interactive fusion of product representation and multi-step path fusion features through linear mapping and multi-head attention mechanism, and inputs them into the decoder after residual and layer normalization stabilization representation; the decoder is composed of multi-layer decoder layers stacked together, each layer including self-attention mechanism, mutual attention mechanism and feedforward network structure, used to model the reactant sequence by combining product representation and multi-step path fusion features, and the decoder output is linearly mapped to obtain the predicted probability distribution of the reactants, thereby generating the target reactant sequence.
[0015] Furthermore, in the reactant prediction and synthesis path generation process, the reactant prediction model achieves interaction between multi-step path fusion features and encoder output through an external attention mechanism. The implementation of this external attention mechanism includes the following steps: First, the product representation output by the encoder is projected onto the same dimensional space as the multi-step path fusion features using a linear mapping to ensure alignment of the two types of features in the same representation space. The parameters of the projection operation are represented by a learnable matrix, the input is the product representation output by the encoder, and the output is the projected product vector. Then, the projected product representation is used as a query, and the multi-step path fusion features are used as the key and value. A multi-head attention mechanism is used to perform interactive computation between the two. The computation of each attention head achieves feature fusion through weighted summation, and the results of multiple attention heads are merged through a linear transformation to form the final attention output. After completing the attention interaction, the model further combines the fused features with the original product representation through residual connections and layer normalization operations. Finally, the fused features are reprojected onto the original embedding dimension of the decoder through a linear mapping to ensure consistency with the input feature dimension of the decoder, thereby generating the final feature representation for reactant prediction.
[0016] Furthermore, during the training process of the reactant prediction model in the reactant prediction and synthesis pathway generation, the learning rate is scheduled using a combination of cosine annealing and preheating, with an initial learning rate of 1×10⁻⁶. -4 In the initial warm-up phase, the learning rate increases linearly from 0 to the initial learning rate; then, in the cosine annealing phase, the learning rate gradually decreases according to the cosine function, with a minimum of no less than 1e-6; at the same time, a multi-round iterative strategy is adopted. After completing a full training cycle, the best-performing model in that cycle is selected as the new starting point, and training is repeated on its basis until the model performance converges.
[0017] Furthermore, in reactant prediction and synthetic pathway generation, for molecules outside the reaction dataset, the node representation space obtained from single-step reaction modeling and multi-step path feature fusion is used to find the closest reference product node using vector similarity retrieval. Specifically, the molecular SMILES (Simplified molecular input line entry system) representation is converted into a Morgan fingerprint vector and stored together with the corresponding multi-step path fusion features. During the retrieval stage, the molecule to be queried is converted into a fingerprint vector to quickly obtain a set of similar candidate molecules, and the index position, corresponding feature vector, and similarity score calculated based on Euclidean distance of the candidate molecules are output, thereby providing feasible multi-step path fusion features for molecules outside the reaction dataset.
[0018] This invention also relates to a molecular retrosynthesis prediction system based on multi-step information fusion, comprising the aforementioned prediction method, including a data storage module for storing reaction datasets, knowledge graph structures, and their embedding vectors; a single-step representation acquisition module for generating high-quality single-step reaction representations based on knowledge graph embedding methods; and a multi-step path feature fusion module for achieving multi-step information fusion and context enhancement through a relational graph convolutional network; the system further includes a retrosynthesis reaction prediction module that introduces multi-step path fusion features into the decoding stage of a Transformer-based model to improve the accuracy of reactant prediction; and a synthesis path generation and scoring module that recursively expands candidate paths through a search strategy and scores and filters generated paths based on multi-dimensional indicators; and a computer program control module for coordinating the collaborative operation of the above functional modules to achieve a fully automated process from single-step reaction modeling to complete retrosynthesis path generation.
[0019] Compared with the prior art, the beneficial effects of the present invention are as follows:
[0020] 1. By introducing knowledge graphs to model the relationships in multi-step synthesis paths, a systematic expression of path structure and semantic information is achieved, breaking through the limitations of relying on templates or single data distributions;
[0021] 2. By leveraging a relational graph convolutional network and combining it with a multi-objective ranking mechanism, the context and preferences of multi-step paths are jointly modeled, thereby significantly enhancing the global consistency and rationality of the synthesized paths;
[0022] 3. By integrating multi-step enhancement features in the model decoding stage, and taking into account both local reaction prediction and overall path optimization, the accuracy and practicality of predicting complex molecule retrosynthetic pathways are significantly improved.
[0023] In summary, this invention, through the combination of method and system, can significantly improve the global consistency and accuracy of retrosynthetic prediction, especially in complex multi-step synthesis tasks, demonstrating higher feasibility and application value, and providing an efficient and intelligent auxiliary tool for drug development and organic synthesis. Attached Figure Description
[0024] Figure 1 This is an overall flowchart of the molecular retrosynthesis prediction method and system based on multi-step information fusion, which is the specific implementation of the present invention.
[0025] Figure 2 This is a flowchart illustrating the operation of the present invention;
[0026] Figure 3 The synthetic routes predicted by both the GuideRetro method and the baseline method (FusionRetro) for the same target molecule are as follows. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.
[0028] Step 1: Single-step reaction modeling.
[0029] In embodiments of this invention, each single-step reaction in the publicly available dataset USPTO-Full (Lowe, 2012, extracted from US Patent and Trademark Office patent text) is first structured. Specifically, each reaction is transformed into a triple (h, r, t) in a knowledge graph. Here, h represents the reactant, i.e., the input molecule of the reaction; r represents the reaction relationship, indicating whether a reaction relationship exists between molecules; and t represents the product, i.e., the output molecule of the reaction. To facilitate computation, an index table of reactant and product molecules is first constructed, mapping each different molecule to a unique integer ID. The reaction relationship is defined as a variable with a value of 0 or 1, indicating whether the relationship exists. Thus, all real reactions are considered positive samples. To enhance the model's ability to judge the rationality of reactions, this invention further generates a corresponding negative sample for each positive sample. The negative sample is constructed by randomly replacing the reactant h while keeping the reaction relationship r and product t unchanged, thereby generating a "fake" reaction triple. This ensures both the structural consistency of positive and negative samples and enables the model to distinguish between real and "fake" reactions through comparative learning.
[0030] Subsequently, a knowledge graph embedding model is used to train the aforementioned triples. In this embodiment, the classic TransE model (Bordes et al., NIPS 2013) is selected, whose architecture includes entity and relation embedding layers, a scoring function, and a negative sampling mechanism. The core idea of the TransE model is: if a reaction triple (h, r, t) is valid, then its embedding vector satisfies the following approximate relationship: ,in, These represent the vector embeddings of reactants, reaction relationships, and products, respectively. During model training, the embedding vectors of all molecular nodes and reaction relationships are first randomly initialized. For each positive and negative sample triplet, the score function is calculated: Where γ is a preset constant used to control the scale of the fraction. Let L2 norm represent the L2 norm, used to measure vector differences. A higher score indicates that the response is more likely to be a true response. The loss function is in the form of:
[0031] Where M and N are the number of positive and negative samples, respectively. , These represent the vectors of positive and negative sample triplets, respectively. This represents the sigmoid function. The embedding parameters are iteratively updated using the Adam optimizer, ultimately resulting in higher scores for positive samples than negative samples, thus learning high-quality reactant and product embeddings.
[0032] After training, the resulting molecular node embeddings, i.e., single-step reaction node representations, have a dimension of 256. These embedding vectors can be exported as npy format files (NumPy saving format) for direct use in subsequent multi-step reaction path prediction tasks. This representation not only preserves the structural features of molecules but also integrates reaction relationship information, providing a reliable foundation for multi-step information fusion and path-level prediction.
[0033] Step 2: Multi-step path feature fusion.
[0034] In embodiments of the present invention, to fully utilize the contextual information in the multi-step reaction path, the single-step reaction node representation obtained in step 1 is input into a multi-layer graph neural network of a relational graph convolutional network for feature fusion. The architecture of the relational graph convolutional network includes an embedding layer and a RelGraphConv convolutional layer. The forward propagation process of this network specifically includes the following steps: First, the input node numbers nids are mapped to the corresponding node vector representation x through the embedding layer; then, the node representation is input into the first layer of the relational graph convolutional layer, and convolution calculation is performed in conjunction with the edge type and normalization factor of the graph structure g to obtain the implicit node representation of the first layer, and nonlinear activation is introduced through the ReLU function; next, the Dropout layer is used to randomly drop parameters on the result to improve the generalization ability of the model; then, the processed representation is input into the second layer of the relational graph convolutional layer, and feature update is performed in conjunction with the relation type and normalization information of the edges to obtain a new node representation; finally, after processing by the Dropout layer, it is used as the final output of the forward propagation process. The specific method of obtaining multi-step path fusion features of the present invention will be described below.
[0035] First, the single-step reaction triplet data (h, r, t) is modeled inversely, with product nodes as head nodes and reactant nodes as tail nodes. This aims to ensure the information propagation direction aligns with the prediction direction of the inverse synthesis task (deriving reactants from products), guaranteeing semantic consistency of the model. To further improve path selection capability, a Synthetic Complexity Score (SCScore) is added to each reaction edge. The SCScore, proposed by Coley et al., is an index for quantifying synthesis difficulty; a lower value indicates easier synthesis of the molecule, ranging from 0 to 5. Based on this, this invention uses the synthesis complexity score as an additional attribute of edges during graph construction to assist path selection. Finally, a directed anisotropic graph is constructed using the DGL (Deep Graph Library) framework, where nodes represent reaction products or intermediate molecules; edges represent chemical reaction relationships, and edge attributes include the presence of a reaction and the synthesis complexity score.
[0036] After the graph is constructed, the node embedding representations generated in step 1 are used as input features (i.e., initial node embeddings) for the relational graph convolutional network. The relational graph convolutional network model consists of two RelGraphConv convolutional layers. Each layer updates the node representation by weighted aggregation of the embedding features of neighboring nodes and combining them with a relation type weight matrix. Specifically, each node, during its update, simultaneously integrates its own features and the contextual information of its neighboring reaction steps, and undergoes a non-linear transformation using the ReLU activation function. After multiple convolutions, the node representations gradually acquire global path awareness, thereby enabling them to capture the dependencies between different reaction steps.
[0037] During training, batch subgraph sampling is employed. Specifically, using the NeighborSampler method provided by DGL, only a subset of nodes and their neighbors are sampled in each training batch to form a local subgraph. This method ensures efficient model training while reducing memory consumption, making it suitable for modeling large-scale reaction networks. For each target node, the edge with the smallest SCScore among its neighbors is selected as a positive sample, and the remaining edges are selected as negative samples, forming a training pair. Subsequently, the model parameters are optimized using the ranking-based Bayesian Personalized Ranking Loss (BPR Loss), specifically:
[0038] in, , P represents the scores of positive and negative samples, and the number of negative samples among the sampled neighbor nodes, respectively. This loss function enhances the model's ability to distinguish the target synthesis path by maximizing the difference between the scores of positive and negative samples. During the optimization process, this invention uses the Adam optimizer combined with gradient clipping techniques for parameter updates. After training, the trained model is loaded and the final node embedding vector is obtained through neighbor sampling, which is the multi-step path fusion feature.
[0039] This invention fixes the embedding dimension at 256 dimensions, consistent with step 1. The final generated multi-step fusion features are exported and saved in NumPy file format for subsequent reactant prediction.
[0040] Step 3: Reactant prediction and synthetic pathway generation.
[0041] In a further implementation of this invention, the node characterization obtained through multi-step path information fusion in step 2 is used to assist in reactant prediction and synthesis pathway generation. This step can be further divided into the following two parts:
[0042] (a) Reactant prediction
[0043] This invention provides a Transformer-based molecular retrosynthesis prediction model for predicting reactants. The model comprises an embedding module, an encoder, a decoder, a memory mechanism module, and a module for interacting with multi-step path fusion features and encoder output. This module jointly models product characterization with multi-step path fusion features to improve reactant prediction accuracy. The specific architecture and processing flow are as follows:
[0044] The embedding module maps the character numbers of the input products or reactants into vector representations and adds positional encoding to preserve sequence information; the embedding is regularized using a Dropout layer. The output of this module is an initial vector representation of the node or molecule, which is used as input to the subsequent encoder and decoder.
[0045] The encoder consists of multiple stacked self-attention encoder layers. Each encoder layer includes: a self-attention mechanism to receive the embedding vector, perform feature interactions within the input sequence, and calculate the weighted representation at each position; residual connections and layer normalization to add the self-attention output to the original input and perform normalization to ensure gradient stability; a feedforward fully connected network to further extract sequence features through two layers of linear transformation and ReLU activation; and Dropout and layer normalization to regularize and normalize the feedforward output. The encoder output is a high-order representation of the product sequence, containing global contextual information.
[0046] The memory mechanism module performs multi-layer memory attention processing on the encoder output to fuse historical responses or path information. Each layer includes residual connections, feedforward networks, and normalization operations similar to those in the encoder to enhance the model's ability to capture multi-step path information.
[0047] The external feature interaction module targets multi-step path fusion features. The model projects the encoder output onto the same dimensional space as the external features through linear mapping, and then uses a multi-head attention mechanism for interactive fusion.
[0048] The decoder consists of multiple stacked decoder layers. Each layer includes: a self-attention mechanism for self-interaction modeling of the reactant sequence; a mutual attention mechanism for attention calculation between the encoder output and the fusion result of external features, enabling information interaction between the encoder and decoder; and a feedforward network with residual and normalization operations to further extract and stabilize features. The output prediction layer linearly maps the decoder output to the vocabulary dimension to obtain the predicted probability distribution for each reactant position, used for reactant sequence generation.
[0049] The overall information flow consists of the product sequence received by the model and the multi-step path fusion features. The product sequence interacts with the multi-step path fusion features through embedding, encoder, and memory mechanisms in the external attention fusion module before being input into the decoder, and finally outputs the reactant prediction results.
[0050] In the reactant prediction stage, this invention uses the fused node representations as external feature inputs to assist the Transformer-based decoder in predicting reactant generation. Specifically, the entire reactant prediction model, based on the FusionRetro (Liu et al., ICML2023) model, introduces an external attention mechanism to effectively utilize the features of the multi-step fusion path. Through this mechanism, the decoder can not only focus on the features of the product itself but also simultaneously refer to the external features obtained by fusing path information, thereby improving the accuracy and rationality of the prediction. The implementation of the external attention mechanism and the solution adopted by this invention in combining multi-step fusion path features with encoder output will be further explained below to ensure the stability of the fusion mechanism and the effectiveness of the prediction results.
[0051] First, this invention projects the product representation output by the model encoder onto a dimensional space with the same dimensions as the multi-step path fusion features through linear mapping, ensuring that the two types of features can be aligned. That is...
[0052] in , The parameters of the linear mapping, This represents the output of the encoder. This represents the projection of the product. Subsequently, the product representation is fused layer by layer with the multi-step path fusion features, and the interaction between the two is established through a multi-head attention mechanism. Here, the query (Q) is the projection of the product representation, and both the key (K) and value (V) are multi-step path fusion features. The computation method Attn for each head and the multi-head attention MHA form are as follows:
[0053]
[0054]
[0055] in For multi-step path fusion features, Let be the dimension of the attention matrix. This is the projection matrix after merging multiple attention heads.
[0056] After the interaction, the model further employs residual connections and layer normalization to ensure the stability of the original product representation. Finally, a linear layer remaps the fusion result back to the original embedding dimension of the decoder to ensure consistency with the original input. The entire external attention mechanism can be represented as:
[0057]
[0058] LayerNorm is the layer normalization operation. , For the parameters of the final linear mapping layer, These are the features that are ultimately input into the decoder.
[0059] During reactant prediction in the model, the model may generate products that are not covered by the template or belong to unknown molecules. To address this issue, this invention proposes a processing method based on vector similarity retrieval. Specifically, in steps 1 and 2, the molecular representation vectors have been obtained through knowledge graph embedding and multi-step path fusion, and a one-to-one mapping relationship has been established with the corresponding molecular IDs. When encountering unknown molecules, this method uses this representation space as the retrieval basis and quickly locates the closest reference product node through vector similarity search, thus providing a feasible alternative for unknown molecules in path reasoning. To achieve efficient similarity retrieval, this invention uses the FAISS (Facebook AISimilarity Search) library to construct an approximate nearest neighbor index. First, molecular SMILES (SimplifiedMolecular Input Line Entry System) are converted into Morgan fingerprint vectors and cached together with their corresponding multi-step path fusion features; then, the index training and vector storage are performed in a large-scale embedding space using the IVF-Flat index structure provided by FAISS. In the retrieval stage, the molecule to be queried is converted into a fingerprint vector, and the set of candidate molecules most similar to it is quickly obtained. The results include the index position of the candidate molecules, their corresponding feature vectors, and similarity scores. The similarity score is calculated using the following formula:
[0060] Where d is the Euclidean distance, which is the distance between two vectors.
[0061] In the training phase of reactant prediction, the dataset used is the RetroBench path dataset created by FusionRetro. The training and validation sets are used together in this invention to ensure the diversity and coverage of training samples. For parameter initialization, the main body of the model loads the pre-trained parameters from the FusionRetro model to fully utilize existing pre-trained knowledge. The newly added fusion feature-related modules (such as the node representation mapping layer and external attention mechanism) are randomly initialized and trained from scratch to ensure independence from the original parameters and gradual adaptation during training. The optimization process uses the Adam optimizer with an initial learning rate of 1e-4, combined with gradient pruning to prevent gradient explosion and ensure training stability. To further improve the model's convergence speed and final performance, a cosine annealing combined with a warm-up learning rate scheduler is introduced during training: in the initial warm-up phase, the learning rate increases linearly from 0 to the initial learning rate; subsequently, in the cosine annealing phase, the learning rate gradually decreases according to a cosine function, with a minimum not less than the set 1e-6.
[0062] In organizing the training data, batch processing and GPU parallel acceleration of matrix operations are employed to significantly improve training and prediction efficiency. Each training epoch iterates through all training samples, with the epoch count set to 300. During training, each iteration calculates the cross-entropy loss between the predicted results and the actual reactant sequences, and updates the parameters through backpropagation. To achieve better performance, a multi-round iterative strategy is used: after completing a 300-epoch training cycle, the best-performing model from that cycle is selected as the new starting point, and training is repeated on this basis until the model converges in performance.
[0063] Ultimately, through the above training process, this invention can effectively integrate multi-step path information with the model's decoding capabilities to achieve higher-precision reactant prediction.
[0064] (ii) Path generation
[0065] In embodiments of this invention, after obtaining the single-step reactant prediction results, a complete synthetic pathway is recursively generated using a search algorithm. For a given target molecule, the system first uses the single-step reactant prediction model to generate a set of candidate reactants, and then progressively selects the optimal candidate for recursive expansion during the pathway expansion process until all leaf nodes are determined to be starting materials. To ensure the feasibility and accuracy of the predicted pathway, this invention introduces a commercial chemical database as an endpoint constraint during the pathway expansion stage, specifically selecting known commercial molecules from the ZINC database as the pathway endpoint set. The ZINC database is a virtual compound library containing hundreds of millions of commercially available small molecules, providing a reliable source of raw materials for drug discovery and synthetic planning. Simultaneously, this invention utilizes InChIKey (an internationally standardized molecular identifier proposed by IUPAC) as a unified representation method, mapping the predicted starting materials one-to-one with the actual commercial molecules existing in the database, thereby ensuring the reliability of the generated pathway in terms of both chemical feasibility and practical availability.
[0066] During the recursive path expansion process, each step uses multiple candidate reactants generated by the single-step prediction model as nodes to be expanded. When a candidate node can be successfully matched with the starting material in the database, the expansion of that branch terminates; if no match is found, the single-step prediction model is called again to expand the next level of reactant prediction until all branch nodes meet the termination condition or reach the preset maximum search depth, thereby ensuring the controllability of the path search process in terms of computational resources.
[0067] To improve the efficiency and diversity of path generation, this invention combines multiple search strategies in path expansion: First, greedy depth-first search (DFS), which selects the candidate reactant with the highest predicted probability at each step, enabling rapid generation of a complete synthetic path; Second, heuristic search (… The algorithm comprehensively considers the cost of the generated paths and the estimated cost of subsequent paths during path expansion, and dynamically sorts candidate branches through a priority queue to find a better solution; thirdly, beam search ( In each expansion level, only a few candidate paths with the highest scores are retained to avoid an exponential increase in the number of paths and to achieve a balance between search efficiency and path quality.
[0068] After the path search is completed, this invention performs a quality assessment on the generated complete synthetic path. The assessment metric adopts the starting material matching criterion proposed in the FusionRetro work, namely set-wise exact match. This metric judges the correctness of the path by comparing whether the set of starting materials obtained in the predicted path is completely consistent with the actual set of starting materials in the reference path. When the sets are completely matched, the path prediction is considered correct; if there are missing or incorrect molecules, it is considered an incorrect prediction. This assessment method imposes higher accuracy requirements on the predicted path at the starting material level, and can comprehensively measure the authenticity and practicality of the path prediction.
[0069] In summary, by combining single-step prediction models, multi-step path context features, and various search strategies, this invention can not only generate complete retrosynthetic pathways that conform to chemical logic, but also ensure that the starting materials strictly correspond to real commercially available molecules, thereby significantly improving the applicability and reliability of retrosynthetic prediction in actual drug development and organic synthesis scenarios.
[0070] Test Results
[0071] The testing environment for this invention was as follows: Ubuntu 20.04.5 LTS (Focal Fossa) operating system, CPU was a 14 vCPU Intel(R) Xeon(R) Gold 6330 CPU @ 2.00GHz, GPU was a single NVIDIA RTX 3090 (24GB), and the algorithm of this invention was implemented using Python 3.8.20.
[0072] To verify the effectiveness of the method of this invention, comparative experiments were conducted with existing state-of-the-art methods on the test set of the Retrobench dataset. The experimental results are shown in Table 1. The evaluation metric adopted is the set-wise exact match criterion proposed in the FusionRetro work. The comparison methods include Transformer (Karpov et al., 2019), FusionRetro (Liu et al., ICML 2023), and RetroInText (Kang et al., ICLR 2025).
[0073] Table 1. Experimental results of different retrosynthetic prediction methods
[0074]
[0075] This invention introduces knowledge graph embedding technology and combines it with a relational graph convolutional network to construct a multi-step information fusion mechanism, achieving deep interaction between single-step response features and synthesis path context information. As shown in Table 1, by comparing with current mainstream inverse synthesis prediction models under different search strategies, the experimental results fully demonstrate the superiority of the method of this invention: Under the search strategy, the Top-1 accuracy of this invention reaches 42.9%, an improvement of 1.7 percentage points compared to the suboptimal RetroInText model (41.2%); simultaneously, the Top-5 accuracy reaches 57.1%, also outperforming the comparison model. This indicates that the multi-step fusion features generated by this invention can provide more accurate "synthesibility guidance" for the search algorithm, effectively improving the success rate of path planning. Even under the Greedy DFS strategy without relying on complex search tree expansion, the method of this invention still achieves a Top-1 accuracy of 40.9%.
[0076] Figure 3 The diagram shows the synthetic routes predicted by the method of this invention (GuideRetro) and the baseline method (FusionRetro) for the same target molecule. The reference route (extracted from the patented reaction) has numbers below the molecular diagram indicating synthetic complexity (i.e., how many reaction steps are required to reach the final starting material). It can be seen that the route predicted by the model of this invention shows a steady decrease in synthetic complexity of intermediate molecules, converging more efficiently to the starting material (synthesis in 3 steps), and the resulting path is similar to the reference route. Conversely, the baseline model, focusing only on single-step information, is limited to the current reaction, resulting in a longer overall synthetic process (requiring 8 reaction steps) and poorer overall path consistency (some reactants generated by certain reactions make synthesis more difficult). The method of this invention introduces the fusion features of the current synthetic route information and external real synthetic routes, and interacts between the two within the model. This provides effective guidance for retrosynthetic prediction throughout the planning process. This allows planning decisions to transcend the local chemical environment, incorporating route-level feasibility, and improving the accuracy, robustness, and search efficiency of the planning.
[0077] This demonstrates that the inverse synthesis prediction method based on the fusion of knowledge graph and graph convolutional network proposed in this invention can integrate path context information with external chemical prior knowledge, thereby improving the accuracy and reliability of inverse synthesis path prediction.
[0078] It should be understood that the above description is for illustrative purposes and not for limitation. Many implementations and applications beyond the provided examples will become apparent to those skilled in the art upon reading the above description.
Claims
1. A molecular retrosynthesis prediction method based on multi-step information fusion, characterized in that, Includes the following steps: Single-step reaction modeling: Each single-step reaction in the reaction dataset is modeled as a triple, and a knowledge graph embedding model is used to compare and learn positive and negative samples to obtain a single-step reaction node representation that can reflect the molecular structure features and semantic associations of the reaction. Multi-step path feature fusion: Based on the node representation obtained by the single-step reaction modeling, a multi-step reaction directed graph is constructed, and a relational graph convolutional network is used to perform multi-layer feature fusion. Through message passing and neighbor information aggregation, a fused node representation that contains both its own single-step information and path context is obtained. Reactant prediction and synthesis path generation: In the decoding stage of the reactant prediction model based on the Transformer architecture, the multi-step path fusion feature obtained by the multi-step path feature fusion is introduced. The external attention mechanism is used to realize the interaction between the model encoder output and the fusion node representation to improve the accuracy of single-step prediction. In the path generation stage, the synthesis path is recursively expanded by combining the search algorithm until the path endpoint matches the known starting raw materials in the database. The multi-step path feature fusion relational graph convolutional network includes an embedding layer and two convolutional layers, with regularization achieved through Dropout. The forward propagation process of the network includes the following steps: First, the input node numbers nids are mapped to their corresponding node representations x through the embedding layer; then, the node representations are input to the first convolutional layer, where feature propagation and aggregation are performed in the convolution operation, incorporating edge type information of the graph structure g and a normalization factor, to obtain the implicit node representations of the first layer, and a nonlinear transformation is introduced through an activation function; finally, the Dropout layer is used to refine the implicit representations. Random parameter loss is performed to reduce the risk of overfitting and improve the model's generalization ability. Then, the processed node representation is input into the second convolutional layer, and feature updates are completed by combining edge type and normalization information to obtain a higher-level node representation. Finally, the dropout layer is used for further regularization to obtain the final output of the network. The relational graph convolutional network is used to obtain the fusion features of multi-step paths. During training, it is optimized based on the ranking loss function, and the prediction score of positive triples is constrained to be higher than that of negative triples, finally obtaining a 256-dimensional multi-step path fusion feature representation. The reactant prediction model in the reactant prediction and synthesis path generation is a Transformer-based structure. This structure includes an embedding module, an encoder, a decoder, a memory mechanism module, and a multi-step path fusion feature and encoder output interaction module. Specifically: the embedding module maps the character numbers of the input products or reactants into vector representations and adds positional encoding; the output serves as the input to the subsequent encoder and decoder. The encoder consists of multiple stacked self-attention encoder layers, each layer sequentially including a self-attention mechanism, residual connections and layer normalization, a feedforward fully connected network, and regularization processing, used to extract high-order representations of the product sequences. The memory mechanism module is used to perform multi-layer memory attention processing on the encoder output to fuse historical reaction or path information; the multi-step path fusion feature and encoder output interaction module realizes the interactive fusion of product representation and multi-step path fusion features through linear mapping and multi-head attention mechanism, and inputs them into the decoder after residual and layer normalization stabilization representation; the decoder is composed of multiple stacked decoder layers, each layer including self-attention mechanism, mutual attention mechanism and feedforward network structure, used to model the reactant sequence by combining product representation and multi-step path fusion features, and the decoder output is linearly mapped to obtain the predicted probability distribution of the reactants, thereby generating the target reactant sequence; In the reactant prediction and synthesis path generation process, the reactant prediction model utilizes an external attention mechanism to interact with the multi-step path fusion features and the encoder output. This external attention mechanism involves the following steps: First, the product representation output by the encoder is projected onto the same dimensional space as the multi-step path fusion features using a linear mapping. This ensures alignment of the two types of features within the same representation space. The projection parameters are represented by a learnable matrix, the input is the product representation output by the encoder, and the output is the projected product vector. Next, the projected product representation is used as the query, and the multi-step path fusion features are used as the key and value. A multi-head attention mechanism is employed to perform interactive computation between the two. Each attention head's computation achieves feature fusion through weighted summation, and the results from multiple attention heads are merged using a linear transformation to form the final attention output. After completing the attention interaction, the model further combines the fused features with the original product representation through residual connections and layer normalization operations. Finally, the fused features are reprojected onto the decoder's original embedding dimension using a linear mapping to ensure consistency with the decoder's input feature dimension, thereby generating the final feature representation for reactant prediction.
2. The method according to claim 1, characterized in that, The knowledge graph embedding model in the single-step reaction modeling includes an entity and relation embedding layer, a scoring function, and a negative sampling mechanism. The entity and relation embedding layer has an embedding dimension of 256 and is initialized and managed through an external embedding storage module. During training, the model generates comparison samples through negative sampling with head entity replacement and completes training optimization in conjunction with the corresponding scoring calculation module.
3. The method according to claim 1, characterized in that, During the training process of the reactant prediction model in the reactant prediction and synthesis pathway generation, the learning rate is scheduled using a combination of cosine annealing and preheating, with an initial learning rate of 1×10⁻⁶. -4 In the initial warm-up phase, the learning rate increases linearly from 0 to the initial learning rate; then, in the cosine annealing phase, the learning rate gradually decreases according to the cosine function, with a minimum of no less than 1e-6; at the same time, a multi-round iterative strategy is adopted. After completing a full training cycle, the model with the best performance in the cycle is selected as the new starting point, and training is repeated on its basis until the model performance converges.
4. The method according to claim 1, characterized in that, In reactant prediction and synthetic pathway generation, for molecules outside the reaction dataset, the node representation space obtained by single-step reaction modeling and multi-step path feature fusion is used. Vector similarity retrieval is then employed to find the closest reference product node. Specifically, the molecule's Simplified molecular input line entry system representation is converted into a Morgan fingerprint vector and stored together with the corresponding multi-step path fusion features. During the retrieval stage, the molecule to be queried is converted into a fingerprint vector to quickly obtain a set of similar candidate molecules. The index position, corresponding feature vector, and similarity score calculated based on Euclidean distance of the candidate molecules are output, thus providing feasible multi-step path fusion features for molecules outside the reaction dataset.
5. A molecular retrosynthesis prediction system based on multi-step information fusion, characterized in that, The system includes the prediction method according to any one of claims 1-4, comprising a data storage module for storing the reaction dataset, knowledge graph structure and its embedding vectors; a single-step representation acquisition module for generating high-quality single-step reaction representations based on the knowledge graph embedding method; and a multi-step path feature fusion module for achieving multi-step information fusion and context enhancement through a relational graph convolutional network; the system further includes an inverse synthesis reaction prediction module, which introduces multi-step path fusion features in the decoding stage of the model based on the Transformer architecture to improve the accuracy of reactant prediction; and a synthesis path generation and scoring module, which recursively expands candidate paths through a search strategy and scores and filters the generated paths based on multi-dimensional indicators; and a computer program control module for coordinating the operation of the functional modules to achieve a fully automated process from single-step reaction modeling to complete inverse synthesis path generation.
Citation Information
Patent Citations
Knowledge graph reasoning method based on dynamic rule perception memory
CN121189442A
Multi-modal characterization molecular property prediction method based on layered bidirectional cross attention
CN121438993A
