Molecular inverse synthesis path prediction method and system based on dynamic selective sampling
Through the dynamic selective sampling molecular retrosynthetic pathway prediction method, using depth-guided adaptive selection and dynamic balance group selection strategies, the problems of low efficiency and local optimality in traditional methods are solved, and efficient planning and accurate prediction of complex molecular retrosynthetic pathways are achieved.
Patent Information
- Application Number
- CN202510835298.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-09-26
AI Technical Summary
Existing technologies have problems with low efficiency, local optimality and long-tail distribution of data sets in molecular retrosynthesis path planning, which makes it difficult for traditional methods to cope with complex scenarios and cannot dynamically adapt to the priorities of different synthesis scenarios, resulting in insufficient model prediction capabilities for unconventional pathways.
A molecular retrosynthetic pathway prediction method based on dynamic selective sampling is adopted to optimize molecular retrosynthetic pathway planning by constructing a dynamic candidate subset selection model and combining the depth-guided adaptive selection strategy and the dynamic balance group selection strategy.
It improves the success rate and computational efficiency of complex molecular retrosynthetic pathways, breaks through the limitations of traditional methods, enhances the ability to explore rare reaction types, and improves the intelligence and precision of pathway planning.
Smart Images

Figure CN120708743A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of bioinformatics, and in particular to a method and system for predicting molecular retrosynthetic pathways based on dynamic selective sampling. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Molecular retrosynthetic pathway planning is a core technology in chemical synthesis. Starting from a target molecule, complex molecules are deconstructed into commercial precursors through a reverse disassembly strategy, similar to "reverse disassembling a chemical puzzle." Traditional "cutting methods" rely on manual experience to locate the breakpoints. As the demand for complex molecular synthesis increases, traditional methods are inefficient and cognitively constrained, making them difficult to handle in complex scenarios. Modern integration of AI and computational chemistry has led to the development of data-driven methods such as graph neural networks and reinforcement learning to improve efficiency, but this also brings new challenges.
[0004] The core dilemma of current retrosynthesis research stems from the combinatorial complexity of molecular structures: the number of ways to cut the chemical bonds of target molecules increases exponentially, which leads to the difficulty of traditional search algorithms (such as Monte Carlo tree search, Algorithms (e.g., those used in the USPTO) require traversing numerous invalid pathways, dramatically increasing computational costs and making it difficult to guarantee an optimal solution. Furthermore, existing models generally employ static strategies of uniform sampling or fixed weights, failing to dynamically adapt to the priorities of different synthetic scenarios. This means that when dealing with molecules containing unusual functional groups or complex ring systems, they are prone to falling into local optima and missing key steps. Furthermore, retrosynthesis datasets (e.g., those from the USPTO) exhibit significant long-tail distributions and a lack of data on rare reaction types, resulting in insufficient prediction capabilities for unconventional pathways, further hindering the innovative design of synthetic routes for complex molecules. Summary of the Invention
[0005] To address the above problems, the present invention proposes a molecular retrosynthetic pathway prediction method and system based on dynamic selective sampling. By constructing a dynamic candidate subset selection model and deploying a deep-guided adaptive selection strategy and a dynamic balanced group selection strategy, efficient planning of complex molecular retrosynthetic pathways is achieved, the success rate and computational efficiency are improved, and the limitations of traditional methods are broken through.
[0006] In order to achieve the above object, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a method for predicting molecular retrosynthetic pathways based on dynamic selective sampling, comprising: Obtain the target molecule, perform preprocessing, and obtain a standardized molecular fingerprint; Inputting the molecular fingerprint into a dynamic selective sampling model to obtain a molecular retrosynthetic pathway; Among them, the dynamic selective sampling model includes an embedding layer, a selection layer, an expansion layer and a planning layer; the embedding layer is used to divide the molecules into a difference data set and a balanced data set based on molecular fingerprint encoding and similarity calculation; the selection layer is used to adopt a deep-guided adaptive selection strategy for the difference data set and a dynamic balanced group selection strategy for the balanced data set to select the best intermediate molecules; the expansion layer is used to expand the best intermediate molecules, generate new molecules and update the candidate list; the planning layer is used to determine whether the molecules other than the target molecules on the path are commercially available molecules. If so, the complete path is output; otherwise, selection and expansion continue until the preset conditions are met.
[0007] In a second aspect, the present invention provides a molecular retrosynthetic pathway prediction system based on dynamic selective sampling, comprising: The molecular feature extraction unit is configured to obtain a target molecule, perform preprocessing, and obtain a standardized molecular fingerprint; a retrosynthetic pathway planning unit, configured to input the molecular fingerprint into a dynamic selective sampling model to obtain a molecular retrosynthetic pathway; Among them, the dynamic selective sampling model includes an embedding layer, a selection layer, an expansion layer and a planning layer; the embedding layer is used to divide the molecules into a difference data set and a balanced data set based on molecular fingerprint encoding and similarity calculation; the selection layer is used to adopt a deep-guided adaptive selection strategy for the difference data set and a dynamic balanced group selection strategy for the balanced data set to select the best intermediate molecules; the expansion layer is used to expand the best intermediate molecules, generate new molecules and update the candidate list; the planning layer is used to determine whether the molecules other than the target molecules on the path are commercially available molecules. If so, the complete path is output; otherwise, selection and expansion continue until the preset conditions are met.
[0008] In a third aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method for predicting a molecular retrosynthetic pathway based on dynamic selective sampling described in the first aspect.
[0009] In a fourth aspect, the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the method for predicting a molecular retrosynthetic pathway based on dynamic selective sampling described in the first aspect are implemented.
[0010] Compared with the prior art, the present invention has the following beneficial effects: The present invention adopts a dynamic selective sampling model ( ) to break through the bottleneck of existing technologies. In response to the complexity of molecular structure combinations, a dynamic environment perception strategy is used to replace traditional static sampling. The three-stage priority sorting of the depth-guided adaptive selection strategy is used to balance exploration and development and reduce invalid path traversal. The dynamic balance group selection strategy is used to divide the dynamic balance group to avoid local optimality and improve the path discovery rate. In response to the lack of adaptability of static strategies, a dynamic switching strategy is used based on the similarity of molecular structures. Deep guidance and dynamic balance strategies are used for difference data sets and balanced data sets respectively to accurately match the priorities of different synthesis scenarios. In response to the long-tail distribution problem of data sets, the dynamic grouping mechanism enhances the exploration of rare reaction types, and the neural-guided multi-layer perceptron is combined to refine molecular features, optimize data utilization efficiency, improve algorithm efficiency and data diversity, and enhance the intelligence and precision of retrosynthesis technology.
[0011] Advantages of additional aspects of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The accompanying drawings, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their description are used to explain the present invention but do not constitute a limitation of the present invention.
[0013] Figure 1 A flow chart of a molecular retrosynthetic pathway prediction method based on dynamic selective sampling provided by an embodiment of the present invention; Figure 2 The embodiment of the present invention provides Dataset construction flowchart; Figure 3 A schematic diagram of a molecular feature preprocessing process based on a neural-guided multilayer perceptron (NG-MLP) model provided in an embodiment of the present invention; Figure 4 The embodiment of the present invention provides -DGA model schematic; Figure 5 The embodiment of the present invention provides -Schematic diagram of DEG model; Figure 6 A schematic diagram of dynamic strategy analysis provided by an embodiment of the present invention; Figure 7 A schematic diagram showing the optimization and comparison of the path planning algorithms provided in the embodiments of the present invention; Figure 8 A schematic diagram comparing the ratio of iteration times of different algorithms provided in an embodiment of the present invention; Figure 9 A schematic diagram comparing the path length ratios of different algorithms provided by an embodiment of the present invention; Figure 10 A schematic diagram comparing the deep aggregation distribution of different algorithms provided by the embodiments of the present invention; Figure 11 A schematic diagram of a box plot comparison of the number of iterations of different algorithms provided in an embodiment of the present invention; Figure 12 A schematic diagram comparing the success rate progress of the total number of iterations of different algorithms provided in an embodiment of the present invention; Figure 13 A schematic diagram comparing the depth evolution during successful iterations of different algorithms provided in an embodiment of the present invention; Figure 14 A schematic diagram comparing the success rates of different algorithms during depth growth provided by an embodiment of the present invention; Figure 15 A schematic diagram of a radar chart comparing the multi-dimensional performance of different algorithms provided by an embodiment of the present invention; Figure 16 The traditional algorithm and - Schematic diagram of box plot comparison of DEG algorithm groups; Figure 17 The traditional algorithm and - Schematic diagram of box plot comparison of DEG algorithm groups; Figure 18 A schematic diagram comparing the cumulative search workload of different algorithms provided by an embodiment of the present invention; Figure 19 A schematic diagram comparing the total length of path depths of different algorithms provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0014] The present invention will be further described below with reference to the accompanying drawings and embodiments.
[0015] Example 1 like Figure 1 As shown, this embodiment discloses a molecular retrosynthetic pathway prediction method based on dynamic selective sampling, comprising the following steps: S1: Obtain the target molecule, perform preprocessing, and obtain a standardized molecular fingerprint; S2: inputting the molecular fingerprint into a dynamic selective sampling model to obtain a molecular retrosynthetic pathway; Among them, the dynamic selective sampling model includes an embedding layer, a selection layer, an expansion layer and a planning layer; the embedding layer is used to divide the molecules into a difference data set and a balanced data set based on molecular fingerprint encoding and similarity calculation; the selection layer is used to adopt a deep-guided adaptive selection strategy for the difference data set and a dynamic balanced group selection strategy for the balanced data set to select the best intermediate molecules; the expansion layer is used to expand the best intermediate molecules, generate new molecules and update the candidate list; the planning layer is used to determine whether the molecules other than the target molecules on the path are commercially available molecules. If so, the complete path is output; otherwise, selection and expansion continue until the preset conditions are met.
[0016] Next, a molecular retrosynthetic pathway prediction method based on dynamic selective sampling disclosed in this embodiment is described in detail.
[0017] 1. Raw data cleaning Raw data cleaning corresponds to the environment perception layer, such as Figure 2 As shown, the system first loads target molecule raw data, such as chemical reaction data and molecular structure information, from various formats such as CSV, SDF, and JSON. It then performs basic validation, including checking the file's existence and verifying the data format's standardization, such as the validity of SMILES strings and the integrity of the SDF file. If the file is missing or formatted incorrectly, the system triggers error handling mechanisms, such as logging or aborting the process.
[0018] The data cleaning and standardization phase then begins, ensuring data consistency and usability by removing duplicate entries, filling or deleting missing values, filtering data according to preset rules, such as retaining reactions with yields above a threshold, and unifying the text format, mainly by standardizing SMILES strings and unifying capitalization.
[0019] After cleaning, the data is serialized into pickle files for rapid reuse and undergoes secondary quality verification to ensure reliability in subsequent steps. Based on the molecular complexity and reaction type of the data, the system selects an appropriate retrosynthesis algorithm, such as Monte Carlo tree search or deep learning models, to further process the molecular structure: generating or retrieving three-dimensional conformations, optimizing storage and query efficiency (e.g., creating molecular fingerprint indexes), removing charge information to simplify analysis, and ultimately verifying the chemical plausibility of the target molecule's SMILES.
[0020] The SMILES string of the target molecule is extracted as the starting point for retrosynthetic pathway planning. Systematic preprocessing improves data quality and format consistency, providing reliable input for subsequent pathway search and scoring models, thereby improving the efficiency and accuracy of retrosynthetic planning.
[0021] (2) Data preprocessing Further, in Figure 3In this example, a neural-guided multi-layer perceptron (NG-MLP) model is proposed to preprocess molecular feature data, process molecular fingerprints from simplified molecular input line input system (SMILES) strings, and extract latent representations for attribute prediction and feature analysis.
[0022] Compared with the traditional MLP model, the neural-guided multi-layer perceptron model can improve the training stability of deep networks through residual connections, ensuring that key information of molecular features is not lost during transmission. The NG-MLP architecture consists of the following three stages: input projection stage, residual stage and task-specific output head stage. The specific embedding steps can be referred to Figure 3 shown.
[0023] Given a molecular fingerprint , the input projection layer maps it to a low-dimensional latent space by: (1) in, and is a learnable parameter. The normalization layer (LayerNorm) stabilizes the training process, while the SiLU (Sigmoid Linear Unit) activation function introduces nonlinearity. Refinement is performed through N residual blocks. For the lth block ( ): (2) Each block includes: (3) in, is the linear weight, Dropout is a learnable parameter that reduces overfitting. In the above computational process, residual connections are used to fuse the original and new features, ensuring gradient flow and enabling feature reuse and enhancement. The refined features are then diverted to two specific tasks: value prediction and feature projection.
[0024] Value Prediction: Compute scalar estimates of molecular properties , as shown below: (4) in, Represents the activation function, which is passed through N residuals The latent representation after block refinement, 、 is a learnable parameter.
[0025] Feature projection: Generates a standardized 128-dimensional representation by the following method: (5) This example uses a neural-guided multi-layer perceptron (NG-MLP) architecture to convert SMILES strings into fixed-length molecular fingerprints that encode structural motifs, functional groups, and atomic environments. These molecular fingerprints are presented in a dense numerical form, enabling the model to capture chemically meaningful patterns such as aromaticity, hybridization states, and steric effects. By leveraging SMILES-based features, NG-MLP achieves a fusion of symbolic molecular representation and deep learning, enabling effective generalization across diverse chemical spaces used in fields such as drug discovery and materials science. Furthermore, by mapping molecular fingerprints to latent features, key features can be extracted while removing noise, thereby enhancing the model's robustness and interpretability.
[0026] (3) Dynamic Selective Sampling Model like Figure 4 and Figure 5 As shown, dynamic selective sampling ( ) model includes embedding layer, selection layer, expansion layer and planning layer. In the selection layer, dynamic selective sampling ( ) The model selects different strategies to adjust the path planning method, which is a strategy adjustment; at the extension layer, the model can perceive different feature expressions and score estimates to distinguish different situations in the path expansion of each step, which is a strategy adjustment; at the planning layer, the model will evaluate the expansion time, length, number of expansions and other information to evaluate the path, which is a performance evaluation.
[0027] Among them, due to the different selection layers, dynamic selective sampling ( ) model is divided into depth-guided adaptive selection ( -DGA) model and dynamic equilibrium group selection ( -DEG) model.
[0028] The embedding layer is used to input the received molecular fingerprint into the planning process in the form of a character string; The selection layer is used to evaluate the best intermediate molecule from the open list output by the embedding layer; The task extension layer is used to expand the intermediate molecules using the single-step model to obtain the expanded intermediate molecules; The task planning layer is used to determine whether the molecules on the pathway other than the target molecule are commercially available molecules and to determine whether the retrosynthetic pathway planning is successful.
[0029] 1. Embedding layer Molecular structural similarity is closely related to chemical reaction patterns, and similar molecules often have similar reactivity and synthesis pathways. In this example, in retrosynthetic pathway planning, after data cleaning and preprocessing standardization, adaptive grouping is achieved based on molecular similarity scores.
[0030] like Figure 4 and Figure 5 The evaluation model in the embedding layer shown is used to group datasets based on similarity and thus process them based on different strategies.
[0031] Specifically, a molecular fingerprint encoding (such as MACCS or ECFP) is first combined with Tanimoto similarity calculation to construct a molecular similarity matrix. Tanimoto similarity measures the degree of similarity in molecular structures by calculating the ratio of the intersection and union of molecular fingerprints. Higher values indicate greater structural commonality. The median difference in similarity reflects the structural uniformity of molecules within a group. Small differences indicate high structural similarity, while large differences indicate greater structural diversity.
[0032] The preprocessed SMILES strings representing the molecular structure and the corresponding data are divided into two subsets through hierarchical cluster analysis: for the balanced data set whose median similarity difference within the group is less than the first preset value, where the molecular structures are highly similar and the potential synthesis pathways are concentrated, a dynamic balanced group selection strategy is adopted; when the median similarity difference within the group exceeds the second preset value for the differential data set, where the molecular structures are significantly different and the synthesis pathways may be scattered in different areas, the depth-guided adaptive selection strategy is activated.
[0033] Exemplarily, the first preset value is 0.2, and the second preset value is 0.5.
[0034] By grouping similar molecules and optimizing the search strategy based on the structural characteristics of each group, blind exploration in irrelevant chemical space can be avoided.
[0035] 2. Select the layer A deep-guided adaptive selection strategy is used for differential datasets, while a dynamic balanced group selection strategy is used for balanced datasets. Starting from the target molecule, different strategies are used to select the best intermediate molecules based on their molecular structure characteristics for expansion, until all molecules in the pathway, except the target molecule, are commercially available.
[0036] (1) Depth-guided adaptive selection strategy To address the inability of traditional path planning evaluation mechanisms to adapt to dynamic changes and molecular feature differences during the search phase, this embodiment provides a deep-guided adaptive selection strategy. Specifically, this strategy employs a three-stage strategy to construct a dynamic priority-ordered search tree node mechanism. This strategy optimizes the exploration of new and potentially favorable routes and efficiently utilizes promising regions based on the iterative progress of the search process.
[0037] Phase 1: Random pioneer exploration phase. In the early iterations of the search process, the algorithm prioritizes rapid traversal of the chemical space to identify possible retrosynthetic pathways. To prevent the algorithm from converging prematurely, a screening mechanism is used to select the best candidate node from a large number of candidates. In the retrosynthetic pathway planning process, a candidate node is a molecule (or corresponding molecular state) in the search tree that represents the molecules to be explored and can be linked to the target molecule or intermediate product through chemical reactions and other operations. It is the basic unit used for dynamic screening and advancement of pathway exploration. The screening mechanism is specifically as follows: (6) in, Represents the size of the candidate list C. n is the minimum value set, and μ is a hyperparameter. The final selection is randomly drawn from the top k nodes to obtain the initial candidate node pool: (7) in, represents the score of the candidate list node, represents the sorting function, Indicates slicing the sorted index sequence. Indicates the sequence number of the node with the best score in the candidate list. Indicates uniform distribution sampling, from Among the first k candidate node indexes obtained, one index is randomly selected with uniform probability.
[0038] The second stage is the coordinated exploration stage. The exploration operation aims to search for new areas in the solution space, focusing on promising areas in the initial candidate node pool. In this stage, a comprehensive evaluation function stat is used to select nodes. The comprehensive evaluation function stat considers both cost-benefit and depth constraints. In Formula 8, Represents cost calculation, Normalize Represents the profit calculation. By operating and analyzing the comprehensive evaluation function stat, the search bias is adjusted to make the search process more inclined to obtain feasible solutions, thereby ensuring that the diversity of path exploration is maintained while widely covering the reaction tree.
[0039] The coordinated exploration phase is described as follows: (8) Where w is the node weight, is the maximum depth of all open nodes, ∈ is a small constant used to prevent division by zero, α is the depth discount factor used to penalize nodes that are too deep, represents the node depth value statistics, β is the feasibility weight, emphasizing the feasibility of the solution, is min-max normalization using global statistics.
[0040] Randomly select from the top k nodes to obtain the advanced candidate node pool.
[0041] (9) The second phase of this embodiment guides the search toward more feasible solutions through comprehensive consideration of depth and cost, ensuring balanced exploration of the solution space while focusing on routes with potential.
[0042] The third stage is the focused convergence stage. In the final stage of the search process, the path length constraint is imposed using Equation 10, which allows the algorithm to strategically narrow the search scope to intermediate nodes with medium depth based on real-world synthetic constraints. For each depth level, a specific screening and evaluation mechanism is used to process and analyze the nodes to further optimize the search path and obtain a retrosynthetic solution that meets actual needs.
[0043] (10) in, represents the score of the node with depth d; i represents the group with shallow paths to increase shallow exploration; n represents the node; C represents the candidate list, Denotes the depth calculation function, d represents the path depth. Select the first 5 nodes based on the f value: (11) from Randomly select a node from (12) Considering that in actual synthesis processes, theoretically deeper pathways often lead to reduced yields and increased costs due to accumulated side reactions, the pharmaceutical industry prefers pathways that meet efficient synthesis standards. Therefore, this embodiment limits the search scope to the intermediate region in the third stage to prioritize pathways with higher synthetic feasibility. When the node depth is too large (e.g., depth d > 15), the discriminative power of the depth discount factor α in Equation 8 decreases as the penalty value tends to level off. To ensure the effectiveness of the depth-based penalty mechanism, this stage addresses this issue by completely excluding such excessively deep nodes.
[0044] The depth-guided adaptive selection strategy described in this embodiment introduces randomness in the first phase by dynamically sampling from the top k candidate nodes, unlike traditional greedy algorithms that directly select the node with the lowest f-score. This random sampling mechanism prioritizes breadth-first exploration, preventing the algorithm from prematurely converging on suboptimal paths and significantly increasing the diversity of explored paths. By temporarily accepting nodes with higher f-scores, intermediates with significantly different structures are discovered, potentially enabling the search for more viable long-term solutions.
[0045] In the third stage, based on actual synthetic experience, the search scope is limited to shallower paths to address the issue of depth penalties being ineffective in overly deep paths. A hierarchical filtering mechanism, which first selects the top five nodes by depth and then randomly samples these nodes, ensures both chemical feasibility and computational efficiency, aligning with human chemists' preference for limited-step synthetic schemes.
[0046] The random exploration strategy in the first phase works in tandem with the deep constraints in the third phase, broadening the search space through random sampling in the early stages and enhancing the practicality of the proposed solution through deep constraints in the later stages. The intermediate molecules selected through the depth-guided adaptive selection strategy can significantly increase the probability of discovering effective and scalable synthetic routes.
[0047] (2) Dynamically balanced group selection strategy ① Dynamic subgroup evolution driven by molecular characteristics In order to enhance the exploration and exploitation balance in molecular graph search, a dynamic balance group selection strategy is proposed. Figure 5 As shown, the method divides the search space into dynamically evolving subgroups based on molecular feature similarity, while incorporating depth-aware adaptive weights to maintain group diversity and stability.
[0048] The first step is to initialize the population under feature diversification. Each molecule is represented as a 128-dimensional feature vector , extracted by a graph neural network (GNN) encoder. Based on the feature similarity of molecules, they are dynamically divided into K groups. Group centers (for k = 1, ..., K) by perturbing the characteristics of the target molecule To initialize: (13) in, , N(0,1) represents a random normal vector; are manually set hyperparameters; Represents the root eigenvector. This method generates two initial centers close to the root eigenvector at the beginning of optimization by performing directional perturbations, which helps to quickly capture the local feature distribution.
[0049] For the remaining center groups k=3,...,K, global random sampling is used: (14) in, yes This approach ensures that the generated centers cover a wider range of the feature space and helps explore global features. Dynamic group adaptation uses a depth-weighted moving average to update the group during the search process: (15) in, is the dynamic adaptation weight, d is the node depth, is the base weight; This decay factor ensures that the population evolution is more conservative for deeper nodes, thereby preserving high-quality regions, while allowing shallow nodes to explore new chemical space.
[0050] ② Group redistribution strategy based on similarity threshold After completing the dynamic subgroup evolution driven by molecular features, determining the initial subgroup center, and completing group initialization, a set of adaptive allocation rules is required to ensure that newly generated nodes can be accurately and reasonably integrated into the existing subgroup structure. Since new nodes are constantly generated as the search progresses, if they are randomly allocated, the diversity and uniqueness of the subgroups based on feature similarity will be destroyed, resulting in redundant exploration or omission of key areas. Therefore, a group reallocation strategy based on similarity thresholds is proposed. Specifically: By calculating feature distances, we quantitatively compare new nodes with existing group centers. This quantitative comparison serves as an important basis for assigning new nodes to the most appropriate groups based on their similarity to group characteristics. This reallocation method effectively improves the overall performance and consistency of the dynamic group selection strategy by maintaining group cohesion and uniqueness.
[0051] In the process of retrosynthesis route planning, feature distance calculation can be used to screen out nodes that are both similar and sufficiently different, thereby avoiding the redundancy problem of path planning and making the planned synthesis route both coherent and efficient, ensuring the uniqueness of the obtained route and meeting the preset requirements. When performing the group allocation operation of the new node, a dynamic similarity constraint mechanism is adopted: (16) in, represents the characteristic distance between node j and the group center. A feature vector representing the new node. The eigenvector representing the center of group j. Represents the L2 norm, that is, calculating the Euclidean distance.
[0052] In this embodiment, the group reallocation strategy based on the similarity threshold is based on the characteristic distance between the node and the subgroup center, combined with the similarity threshold judgment, so that the new node is only assigned to the group with the highest feature fit. It maintains the uniqueness of each group and avoids feature redundancy. It also enhances the adaptability of subgroup selection through the dynamic allocation mechanism, builds a solid foundation for accurate and orderly node-subgroup association for subsequent retrosynthetic path exploration, and selects the best intermediate molecules through the dynamic balance group selection strategy, which can ensure the consistency of subgroup features at different stages and help the algorithm efficiently explore feasible synthetic routes.
[0053] ③Threshold-based node allocation strategy While threshold-based node allocation ensures initial order in subgroups when new nodes are added, the characteristics of nodes within a subgroup gradually change with each iteration during the search process, potentially leading to decreased group cohesion, feature redundancy, or imbalanced diversity. If not adjusted promptly after long-term operation, subgroups will not accurately reflect molecular feature associations, reducing the efficiency of retrosynthetic exploration.
[0054] Therefore, we propose a threshold-based node allocation strategy. By setting a similarity threshold, we ensure that new nodes are assigned only to the groups with the highest feature similarity. This maintains the uniqueness of each group and avoids the emergence of groups with overly similar or redundant features. This allocation strategy effectively enhances the adaptability and robustness of dynamic group selection, ensuring that each group maintains unique and consistent features at different stages.
[0055] In retrosynthesis route planning, this similarity threshold-based node allocation method can construct synthetic routes that are both diverse and coherent. By avoiding selecting nodes that are highly similar to existing route segments, this method enables the algorithm to generate more efficient and unique synthetic routes, significantly improving the performance and quality of retrosynthesis route planning.
[0056] (17) in, Indicates the group index to which the new node is assigned, represents the group center number j that minimizes the feature distance, and θ represents the dynamic similarity threshold.
[0057] In this implementation, existing nodes and groups are reorganized based on feature distances and dynamic thresholds. This aims to break down the irrational clustering that has formed over time, reshape the uniqueness and cohesion of subgroups, and continuously optimize the subgroup structure as the search progresses. This, in conjunction with the node allocation method, ensures that subgroups always meet the needs of retrosynthesis exploration, improving the overall performance of the strategy and the quality of path planning.
[0058] 3. Extension layer like Figure 4 shown In the DGA model, the first expansion layer performs expansion on the intermediate molecules output by the selection layer based on the depth-guided adaptive selection strategy: a reaction template is matched for each molecule to generate new molecules with attributes such as template, score, and depth; the new molecules are incorporated into the candidate list, and the original intermediate molecules in the candidate list that have completed expansion are removed at the same time.
[0059] like Figure 5 shown In the -DEG model, the second expansion layer expands the intermediate molecules output by the selection layer based on the dynamic balanced group selection strategy. After the expansion, the newly added molecules will be dynamically grouped with the molecules in the candidate list through similarity calculation, thereby obtaining a balanced dynamic group.
[0060] It should be understood that the template matching rules, scoring mechanism, depth calculation method, dynamic grouping by similarity calculation and other methods can be set and implemented by those skilled in the art according to actual conditions.
[0061] 4. Planning layer Based on the candidate list obtained by the expansion layer, the planning layer determines whether all molecules on the path, excluding the target molecule, are commercially available. If so, the complete path is output. If not, the selection and expansion process continues until the number of iterations or the time limit are exceeded. If these limits are exceeded, the path planning is deemed a failure.
[0062] Exemplarily, the preset number of times is set to 300 times, and the preset time is set to 6 minutes.
[0063] It should be understood that the neural-guided multilayer perceptron model and the dynamic selective sampling model described in this embodiment need to be trained with historical inverse synthesis data before they can be put into use. This process can be clearly understood and implemented by those skilled in the art and will not be repeated here.
[0064] (IV) Performance evaluation 1. Comparison of static and dynamic evaluation algorithms: In the field of retrosynthesis, traditional route planning algorithms (such as the A* algorithm) generally use static evaluation functions, which are specifically expressed as: (18) Where represents the cumulative cost from the root node to the current node, and represents the heuristic estimate of the remaining cost to the goal. These two parts constitute the evaluation function f(n). Although this formulation provides computational simplicity, it has inherent rigidity problems when dealing with complex chemical spaces. For example, static heuristic methods cannot adapt to depth-dependent feasibility constraints or the changing chemical priorities in multi-step planning processes. Figure 6As shown in Figure 2, the comparison shows that the evaluation framework analyzes candidate nodes in multiple scenarios to more accurately identify route information using a dynamic formula: (19) Here, α, β, and α represent the importance of the evaluation function, which varies under different circumstances. The m(n), t(n), and y(n) functions represent the changes in the evaluation function under different scenarios. Here, we introduce a conceptual function, as shown in Equation 19. As the planning strategy within the framework changes, the specific parameters of the evaluation function will vary. The specific framework will be analyzed in specific cases. In path planning for retrosynthetic analysis, the choice of evaluation strategy has a decisive impact on the algorithm's performance. Static evaluation methods use predefined rules for global evaluation. While they have low computational complexity and high execution efficiency, they are less adaptable to state changes during the search process. In contrast, dynamic evaluation mechanisms introduce real-time feedback adjustments, implement refined intermediate screening at each decision step, and utilize heuristic strategies to dynamically optimize the search direction. This adaptive adjustment significantly reduces the invalid search space and the complexity of the search tree branches, thereby improving the accuracy and success rate of path discovery while controlling computational resource consumption. Experiments have shown that the dynamic evaluation framework can explore more chemically rational synthesis routes within the same time budget by iteratively optimizing the intermediate selection strategy. It is particularly suitable for path planning tasks for complex molecular structures. Specific experimental data demonstrates the generation efficiency of the performance evaluation layer in path planning.
[0065] 2. Performance Analysis of Retrosynthetic Route Planning In the field of retrosynthesis planning technology, based on existing construction methods, chemical synthesis paths are constructed as search tree models. Each state of the search tree corresponds to a set of molecules that can be used to synthesize the target molecule; in the initial state, the search tree uses the target molecule as the root node. The states in the tree are converted by nodes, and the conversion is controlled by the edges that characterize the chemical reaction to achieve the transition of the molecule from one state to another. The purpose of the retrosynthesis planning described in this embodiment is to determine all molecules that can be used as feasible starting materials in a certain state. The feasible starting materials are also commonly referred to as available building blocks.
[0066] In order to explore the above search space, this embodiment adopts a one-step retrosynthesis prediction model as a strategic model, which can generate potential chemical reactions that can be used to synthesize input molecules. In each state, the reaction templates with the top 50 probabilities are selected as effective operations. At the same time, the heuristic function is used to estimate the synthesis cost of the molecule based on the availability of the building blocks. Each molecule is represented by a 2048-dimensional Morgan fingerprint vector, which serves as the input data for the heuristic evaluation process. The model innovatively integrates two complementary strategies: dynamic equilibrium grouping and deep-guided adaptive selection. After evaluating molecular data, including basic composition and structural characteristics, it selects different strategies for planning operations. The evaluation results are shared, helping to optimize the evaluation approach. This framework has achieved significant results in the field of retrosynthesis planning, effectively overcoming key technical bottlenecks of existing methods.
[0067] in, The (DEG) strategy is based on Morgan fingerprints, which dynamically divides the molecular space into evolving subgroups based on structural similarity, and combines it with a depth-aware weighting mechanism to maintain the diversity and stability of the subgroups. Compared with traditional static grouping techniques such as UCT-like sampling, it has significant technical advantages.
[0068] The (DGA) mechanism adopts a complex three-stage node selection process, which achieves an orderly switching between new path exploration and optimal area utilization by organically combining heuristic-based pruning strategy, depth-aware prioritization and continuous feedback loop.
[0069] As shown in Table 1, the benchmark test on the USPTO dataset shows that the The model showed excellent performance: its success rate was as high as 98.94%, significantly better than LevinTS's 96.84%; in terms of synthesis path efficiency, The synthetic path generated by the (DGA) takes only 6.17 steps on average, which is a significant improvement over the 7.45 steps of LevinTS. In terms of computational efficiency, it takes only 46.9 seconds on average to complete each task and achieve the expansion of 52.54 nodes. At the same time, the adaptive architecture of the model can effectively compensate for the inherent errors in heuristic estimation, especially for the case of prediction error σ, and its performance continues to outperform best-first methods such as WA and PHS, as well as exploration-intensive algorithms such as ε-Greedy. Taking the ε-Greedy algorithm as an example, although its success rate can reach 92.11%, the path length it requires is as long as 43.78 steps, which is far inferior to the comprehensive performance of this embodiment. Model.
[0070] Table 1 Comparison of results of various models on the USPTO dataset
[0071] 3. Performance results of route planning on generalized dataset To improve the balance between exploration and exploitation in molecular graph search, this example proposes a dynamic balanced group selection strategy and a depth-guided adaptive selection strategy. The dynamic balanced group selection strategy divides the search space into dynamically evolving subgroups based on molecular feature similarity, and combines it with a depth-aware adaptive weighting mechanism to ensure subgroup diversity and stability. Its core components are described in detail below. The deep-guided adaptive selection strategy adopts a three-stage strategy to construct a complex dynamic priority sorting mechanism for search tree nodes, optimize the exploration of new potential favorable paths, and efficiently utilize the most promising areas according to the progress of search iterations, forming the core of the retrosynthetic route planning model.
[0072] This embodiment proposes (DEG) and The DGA method has significant advantages. As shown in Table 2, in the evaluation of the length of the retrosynthesis planning solution of seven data sets, (DEG) and The average solution length of (DGA) is lower than that of many other algorithms, showing higher route discovery efficiency.
[0073] Table 2 Comparison of path length results of various models on existing datasets
[0074] In terms of success rate accuracy, as shown in Table 3, (DEG) outperforms in most datasets (DGA). Taking the USPTO dataset as an example, although both achieved a success rate of 98.94%, in datasets such as Toxicity LD50, (DEG) had a success rate of 62.04%, while (DGA) is only 61.46%. The above data show that (DEG) not only has a higher success rate in multiple scenarios, but also demonstrates better generalization ability, becoming a more robust technical solution in retrosynthesis planning.
[0075] Table 3 Comparison of the success rates of various models on existing datasets
[0076] 4. Route optimization visualization Figure 7 The effectiveness of the dynamic balance group selection strategy and the depth-guided adaptive selection strategy described in this embodiment in reducing the length of the retrosynthetic route is demonstrated. (DGA) and The synthetic routes generated by the three methods (DEG) were compared and analyzed. Among them, the paths generated by the traditional baseline A* algorithm have complex trajectories and contain redundant nodes, indicating that its adaptability to dynamic search constraints is limited.
[0077] The (DGA) strategy introduces a depth-guided adaptive weighting mechanism, which shortens the generated path length by 33.4% compared to the baseline A algorithm. This strategy effectively avoids unnecessary detours by prioritizing the exploration of shallow nodes with higher heuristic potential. The (DEG) strategy further shortened the path length by 25.6% by leveraging dynamic subgroup partitioning and balanced resource allocation. This strategy achieves rapid convergence to high-fitness paths by reconfiguring subgroups in real time and focusing on regions with optimal molecular feature similarity. (DEG) with The two strategies of DGA work synergistically to eliminate redundant nodes while maintaining structural diversity. The dual-strategy framework they constitute can achieve efficient search and navigation in complex molecular spaces, and is significantly superior to traditional methods in terms of path compactness and computational efficiency.
[0078] 5. Analysis of route depth and iteration efficiency To fully verify (DEG) and In order to improve the optimization performance of the DGA model, this embodiment carried out a series of experiments, focusing on its deep exploration capability, computational efficiency and grouping behavior characteristics. The experimental results show that although in the early stages of iteration, (DEG) and (DGA) accounts for a relatively low proportion of node expansion, but has demonstrated the ability to explore deep path information, which is of great significance for mining new and potentially effective synthesis paths. As the iteration progresses, in longer paths, (DEG) and The participation rate of (DGA) has increased significantly. This phenomenon does not mean that the efficiency has decreased, but rather reflects the effective exploration of the model in deeper search areas, such as Figure 8 In the path prediction task of about 10 steps, the model shows obvious optimization effect. The reduction of path length distribution not only reduces the number of node expansions, but also highlights its efficiency in identifying short path synthesis solutions. Figure 9 shown.
[0079] like Figure 10 As shown, even when the search depth increases, (DEG) and (DGA) can still maintain a high level of exploration capability, which is the key to its effective navigation in complex molecular space and avoid falling into suboptimal solutions. Figure 11 This further confirms the model's ability to overcome local optimal problems, where The dynamic balanced grouping strategy of (DEG) provides nodes with a broader exploration space. This balanced exploration mechanism has significant advantages in complex search scenarios with multiple feasible solutions, and helps to improve the overall performance of retrosynthetic path planning.
[0080] 6. Experimental Analysis of Dynamic Search Strategies To fully verify the (DGA) and Compared with the traditional To demonstrate the performance advantages of the algorithm, we designed and conducted a series of experiments. Based on standardized datasets and carefully calibrated parameters, we evaluated the algorithm across multiple dimensions, including success rate, path depth, exploration capability, iteration efficiency, and overall performance stability, to ensure fairness and reproducibility of the results.
[0081] The experimental results show that Figure 12 As shown, (DGA) and (DEG) achieves a higher success rate than algorithm A with fewer iterations, demonstrating a more efficient navigation capability in complex search spaces. (DGA) reduces the average successful path length to less than 6 steps for the first time (see Figure 13 ), showing the characteristics of giving priority to shallow high-potential nodes and reducing redundant steps; in the deep search area, both can still maintain high success rate and exploration ability (see Figure 14 ). Figure 15 The radar chart further shows that (DGA) excels in efficiency and coverage, (DEG) has more advantages in stability and exploration, and its comprehensive performance is significantly better than algorithm A.
[0082] In the comparison of group characteristics (see Figure 16 and Figure 17 ), compared with the problems of uneven node aggregation and vacant classes in traditional clustering methods, which lead to waste of resources and limited exploration, (DEG) ensures that nodes have fairer exploration opportunities through a balancing strategy, effectively improving the diversity of exploration solutions and the overall effectiveness of the model in the retrosynthesis planning task. In addition, the experimental evaluation of the algorithm's exploration depth shows that (see Figure 18 and Figure 19 ), compared with the traditional A algorithm, (DGA) and (DEG) Although the number of iterations and search depth have increased, this does not mean that the time required to detect a successful path has increased or the path length has become longer. Instead, it shows that it has effectively alleviated the local optimal problem and significantly expanded the exploration area.
[0083] Example 2 This embodiment provides a molecular retrosynthetic pathway prediction system based on dynamic selective sampling, comprising: The molecular feature extraction unit is configured to obtain a target molecule, perform preprocessing, and obtain a standardized molecular fingerprint; a retrosynthetic pathway planning unit, configured to input the molecular fingerprint into a dynamic selective sampling model to obtain a molecular retrosynthetic pathway; Among them, the dynamic selective sampling model includes an embedding layer, a selection layer, an expansion layer and a planning layer; the embedding layer is used to divide the molecules into a difference data set and a balanced data set based on molecular fingerprint encoding and similarity calculation; the selection layer is used to adopt a deep-guided adaptive selection strategy for the difference data set and a dynamic balanced group selection strategy for the balanced data set to select the best intermediate molecules; the expansion layer is used to expand the best intermediate molecules, generate new molecules and update the candidate list; the planning layer is used to determine whether the molecules other than the target molecules on the path are commercially available molecules. If so, the complete path is output; otherwise, selection and expansion continue until the preset conditions are met.
[0084] Example 3 This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the steps of the method for predicting a molecular retrosynthetic pathway based on dynamic selective sampling as described in the first embodiment above are implemented.
[0085] Example 4 This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the steps of the method for predicting a molecular retrosynthetic pathway based on dynamic selective sampling as described in the first embodiment above are implemented.
[0086] The steps or modules involved in Examples 2 to 4 above correspond to those in Example 1. For detailed implementations, please refer to the relevant description of Example 1. The term "computer-readable storage medium" should be understood to mean a single medium or multiple media that includes one or more instruction sets; it should also be understood to include any medium that can store, encode, or carry an instruction set for execution by a processor and cause the processor to perform any method of the present invention.
[0087] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A molecular retrosynthetic pathway prediction method based on dynamic selective sampling, characterized in that: include: Obtain the target molecule, perform preprocessing, and obtain a standardized molecular fingerprint; Inputting the molecular fingerprint into a dynamic selective sampling model to obtain a molecular retrosynthetic pathway; The dynamic selective sampling model includes an embedding layer, a selection layer, an expansion layer, and a planning layer. The embedding layer is used to divide molecules into difference datasets and balanced datasets based on molecular fingerprint encoding and similarity calculation. The selection layer is used to adopt a deep-guided adaptive selection strategy for differential data sets and a dynamic balanced group selection strategy for balanced data sets to select the best intermediate molecules; the expansion layer is used to expand the best intermediate molecules, generate new molecules and update the candidate list; the planning layer is used to determine whether the molecules other than the target molecule on the path are commercially available molecules. If so, the complete path is output; otherwise, selection and expansion continue until the preset conditions are met.
2. A molecular retrosynthetic pathway prediction method based on dynamic selective sampling according to claim 1, characterized in that: The pretreatment includes: The target molecule SMILES string is used to generate a standardized molecular fingerprint through a neural-guided multi-layer perceptron model; The neural-guided multilayer perceptron model includes: an input projection stage, which is used to map the initial molecular fingerprint of the SMILES string to a low-dimensional latent space; a residual stage, which is used to refine the latent space through residual blocks; and an output stage, which is used to generate a 128-dimensional standardized molecular fingerprint and latent features.
3. A molecular retrosynthetic pathway prediction method based on dynamic selective sampling according to claim 1, characterized in that: The embedding layer is used to divide molecules into difference data sets and balanced data sets based on molecular fingerprint encoding and similarity calculation, specifically including: Calculate the Tanimoto similarity between molecules and construct a similarity matrix; The data set is divided by hierarchical clustering analysis: if the median difference of similarity within a group is less than the first preset value, it is classified as a balanced data set; if the median difference of similarity within a group is greater than the second preset value, it is classified as a difference data set.
4. A molecular retrosynthetic pathway prediction method based on dynamic selective sampling as claimed in claim 1, characterized in that: In the selection layer, a deep-guided adaptive selection strategy is used to select the best intermediate molecule for the difference dataset; the deep-guided adaptive selection strategy includes three stages, specifically including: In the first stage, the top m nodes with the best scores are extracted from the difference dataset, and the initial node pool is generated by uniform random sampling; In the second stage, based on a comprehensive evaluation function of cost-benefit and depth constraints, the initial node pool is screened to obtain an advanced node pool; In the third stage, based on the constraint path depth, the first n nodes are screened from the advanced node pool according to the depth level and randomly sampled to output the best intermediate molecule; where m>n>0.
5. A molecular retrosynthetic pathway prediction method based on dynamic selective sampling as claimed in claim 2, characterized in that: In the selection layer, a dynamic balanced group selection strategy is adopted for the balanced data set to select the best intermediate molecule, specifically including: Generate local subgroup centers based on the potential feature-directed perturbation equilibrium dataset, and generate global subgroup centers through global random sampling to construct a dynamic subgroup set; The depth-weighted moving average method is used to adjust the center position of the dynamic subgroup set, so that the shallow node subgroup tends to explore new areas, and the deep node subgroup tends to use known paths; The Euclidean distance between the new node and the center of each subgroup is calculated, and it is assigned to the nearest subgroup or a new subgroup is created according to the dynamic similarity threshold. Finally, the node with the best score is selected from each subgroup as the best intermediate molecule.
6. A molecular retrosynthetic pathway prediction method based on dynamic selective sampling according to claim 1, characterized in that: The expansion layer is used to expand the best intermediate molecule, generate a new molecule and update the candidate list, specifically including: the expansion layer includes a first expansion layer and a second expansion layer; The first expansion layer is used to process the intermediate molecules output by the deep-guided adaptive selection strategy, generate new molecules by matching the reaction template through the single-step retrosynthesis model, and remove the original intermediate molecules; The second extension layer is used to process the intermediate molecules output by the dynamic equilibrium group selection strategy: new molecules are generated by matching the reaction template through the single-step retrosynthesis model, and the similarity between the new molecules and the molecules in the candidate list is calculated, and they are dynamically redistributed to subgroups.
7. A method for predicting molecular retrosynthetic pathways based on dynamic selective sampling according to claim 1, characterized in that: The planning layer is used to determine whether the molecules on the path other than the target molecule are commercially available. If so, the complete path is output. Otherwise, the path is selected and expanded until the preset conditions are met. Specifically, the following are included: If all molecules in the pathway except the target molecule are commercially available, output the complete retrosynthetic pathway; Otherwise, the layer selection and expansion operations are repeated until the number of iterations or the calculation time exceeds the preset value; if the termination condition is reached and the output requirements are still not met, the path planning is determined to have failed.
8. A molecular retrosynthesis pathway prediction system based on dynamic selective sampling, characterized in that: include: The molecular feature extraction unit is configured to obtain a target molecule, perform preprocessing, and obtain a standardized molecular fingerprint; a retrosynthetic pathway planning unit, configured to input the molecular fingerprint into a dynamic selective sampling model to obtain a molecular retrosynthetic pathway; The dynamic selective sampling model includes an embedding layer, a selection layer, an expansion layer, and a planning layer. The embedding layer is used to divide molecules into difference datasets and balanced datasets based on molecular fingerprint encoding and similarity calculation. The selection layer is used to adopt a deep-guided adaptive selection strategy for differential data sets and a dynamic balanced group selection strategy for balanced data sets to select the best intermediate molecules; the expansion layer is used to expand the best intermediate molecules, generate new molecules and update the candidate list; the planning layer is used to determine whether the molecules other than the target molecule on the path are commercially available molecules. If so, the complete path is output; otherwise, selection and expansion continue until the preset conditions are met.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of a molecular retrosynthetic pathway prediction method based on dynamic selective sampling as claimed in any one of claims 1 to 7 are implemented.
10. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the method for predicting a molecular retrosynthetic pathway based on dynamic selective sampling according to any one of claims 1 to 7 are implemented.
