Case knowledge enhancement-based organic synthesis product prediction method and device

By employing a case-based knowledge enhancement approach, and utilizing molecular characterization mapping logic and supervised fine-tuning of a large language model, the problem of low accuracy in predicting organic synthetic products using large language models was solved, achieving higher accuracy and reliability.

CN121331269APending Publication Date: 2026-01-13INST OF AUTOMATION CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511382213.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-25
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

The large language model has low accuracy in predicting organic synthetic products, mainly due to insufficient pre-training knowledge in the chemical field and insufficient understanding of the principles of synthetic reactions.

Method used

By using case knowledge enhancement methods, we obtain target reaction inputs, retrieve reaction cases based on molecular characterization mapping logic, perform predictions using a supervised fine-tuning large language model, and enhance input information by combining case studies and text descriptions to construct a high-quality prediction model.

Benefits of technology

It significantly improves the accuracy and reliability of organic synthesis product prediction, reduces uncertainty, and enhances overall decision-making efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121331269A_ABST
    Figure CN121331269A_ABST
Patent Text Reader

Abstract

The invention provides an organic synthesis product prediction method and device based on case knowledge enhancement, and is applied to the technical field of artificial intelligence, and the method comprises the steps: obtaining an input organic synthesis prediction problem; for the target given reaction input, performing molecular representation retrieval based on a preset molecular representation mapping logic to obtain a target molecular representation corresponding to the target given reaction input, and determining a target reaction case corresponding to the target molecular representation in a preset molecular representation library; taking the target reaction case as case enhancement, taking the text description of the target reaction case as knowledge enhancement, and supplementing the organic synthesis prediction problem to obtain a case knowledge enhanced organic synthesis prediction problem; and inputting the case knowledge enhanced organic synthesis prediction problem into the supervised and fine-tuned large language model to obtain a prediction synthesis product corresponding to the organic synthesis prediction problem output by the large language model. According to the invention, the accuracy and reliability of prediction of the synthetic product can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method and apparatus for predicting organic synthetic products based on case knowledge enhancement. Background Technology

[0002] Large language models possess rich pre-trained text knowledge, good instruction adherence, and excellent learning generalization ability, making them suitable for solving problems in scientific research fields. By fine-tuning the model on a text-based chemical reaction prediction dataset, the model can predict products based on a given reaction input.

[0003] Large language models can be used for text-based organic synthesis product prediction tasks, but their accuracy is lower than that of traditional models due to insufficient pre-training knowledge in the chemical field and insufficient understanding of the principles of synthesis reactions.

[0004] This shows that the methods for predicting organic synthesis products in related technologies have a technical problem of low accuracy. Summary of the Invention

[0005] This invention provides a method and apparatus for predicting organic synthetic products based on case knowledge enhancement, which addresses the shortcomings of existing organic synthetic product prediction methods in terms of low accuracy and improves the accuracy and reliability of synthetic product prediction.

[0006] This invention provides a method for predicting organic synthesis products based on case-based knowledge enhancement, comprising the following steps: Obtaining an input organic synthesis prediction problem, wherein the organic synthesis prediction problem includes: a target given reaction input; for the target given reaction input, performing molecular characterization retrieval based on a preset molecular characterization mapping logic to obtain the target molecular characterization corresponding to the target given reaction input, and determining the target reaction case corresponding to the target molecular characterization in a preset molecular characterization library; using the target reaction case as case enhancement, and using the text description of the target reaction case as knowledge enhancement to supplement the organic synthesis prediction problem, obtaining a case-based knowledge-enhanced organic synthesis prediction problem; inputting the case-based knowledge-enhanced organic synthesis prediction problem into a supervised fine-tuned large language model to obtain the predicted synthesis product corresponding to the organic synthesis prediction problem output by the large language model.

[0007] According to a case-based knowledge enhancement-based organic synthesis product prediction method provided by the present invention, before obtaining the input organic synthesis prediction problem, the method further includes: obtaining a cleaned product prediction dataset; constructing and training a chemical reaction category prediction model based on the cleaned product prediction dataset to obtain a trained chemical reaction category prediction model, wherein the chemical reaction category prediction model is used to predict reaction categories based on given reaction inputs; extracting intermediate layer information from the trained chemical reaction category prediction model to obtain molecular characterization mapping logic; and constructing a molecular characterization library based on a given reaction input in a complete reaction equation, according to the molecular characterization mapping logic and the cleaned product prediction dataset.

[0008] According to the present invention, an organic synthesis product prediction method based on case knowledge enhancement is provided. The step of obtaining the cleaned product prediction dataset includes: filtering the product prediction dataset according to preset screening conditions to obtain the cleaned product prediction dataset, wherein the screening conditions include at least one of the following: the same reaction input, but different synthesized products; including chiral products; including multiple products.

[0009] According to the present invention, an organic synthesis product prediction method based on case knowledge enhancement is provided. The given reaction input adopts the form of simplified molecular linear input specification, and the given reaction input includes reactants, solvents, and reagents. The chemical reaction category prediction model is a three-layer multilayer perceptron, including: a first linear layer, including: a linear layer with an input dimension of 10240 and an output dimension of 8192 and a ReLU activation function; a second linear layer, including: a linear layer with an input dimension of 8192 and an output dimension of 2048 and a ReLU activation function; and a third linear layer, including: a linear layer with an input dimension of 2048 and an output dimension of 50.

[0010] According to the present invention, an organic synthesis product prediction method based on case knowledge enhancement is provided. The step of determining the target reaction case corresponding to the target molecule characterization in a preset molecular characterization library includes: determining the similarity between the target molecule characterization and each molecule characterization in the preset molecular characterization library; selecting the top K molecule characterizations with the highest similarity, and using the reaction cases corresponding to the top K molecule characterizations as target reaction cases.

[0011] According to a case-knowledge-enhanced organic synthesis product prediction method provided by the present invention, after inputting the case-knowledge-enhanced organic synthesis prediction problem into a supervised fine-tuned large language model to obtain the predicted synthesis product corresponding to the organic synthesis prediction problem output by the large language model, the method further includes: repeatedly inputting the case-knowledge-enhanced organic synthesis prediction problem into the supervised fine-tuned large language model multiple times to obtain multiple predicted synthesis products corresponding to the organic synthesis prediction problem output by the large language model; determining the predicted molecular properties corresponding to each of the multiple predicted synthesis products; determining the molecular property distribution of all synthesis product samples in the cleaned product prediction dataset; determining the similarity between the predicted molecular properties corresponding to each predicted synthesis product and the molecular property distribution of all synthesis product samples; and taking the predicted synthesis product with the highest similarity as the final prediction result.

[0012] This invention also provides an organic synthesis product prediction device based on case knowledge enhancement, comprising the following modules: an acquisition module for acquiring an input organic synthesis prediction problem, wherein the organic synthesis prediction problem includes a target given reaction input; a retrieval module for performing molecular characterization retrieval based on a preset molecular characterization mapping logic for the target given reaction input, obtaining the target molecular characterization corresponding to the target given reaction input, and determining the target reaction case corresponding to the target molecular characterization in a preset molecular characterization library; an enhancement module for supplementing the organic synthesis prediction problem by using the target reaction case as case enhancement and the text description of the target reaction case as knowledge enhancement, thereby obtaining a case knowledge-enhanced organic synthesis prediction problem; and a prediction module for inputting the case knowledge-enhanced organic synthesis prediction problem into a supervised fine-tuned large language model to obtain the predicted synthesis product corresponding to the organic synthesis prediction problem output by the large language model.

[0013] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the case knowledge-enhanced organic synthesis product prediction method as described above.

[0014] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the case knowledge-enhanced organic synthesis product prediction method as described above.

[0015] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the case-based knowledge-enhanced method for predicting organic synthetic products as described above.

[0016] The present invention provides a method and apparatus for predicting organic synthesis products based on case knowledge enhancement. First, the target reaction input is obtained as input to ensure the accuracy of the problem definition. Next, historical reaction cases are retrieved and matched based on molecular characterization mapping logic to provide specific data references. Then, the input information is enhanced by case studies and text descriptions to enrich the contextual knowledge. Finally, a supervised fine-tuning large language model is used for prediction, thereby significantly improving the accuracy and reliability of synthesis product prediction, reducing uncertainty, and improving overall decision-making efficiency. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced one by one below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0018] Figure 1 This is a flowchart illustrating the case-based knowledge-enhanced method for predicting organic synthesis products provided by this invention.

[0019] Figure 2 This is a schematic diagram of the complete process of the case-based knowledge-enhanced method for predicting organic synthesis products provided by the present invention.

[0020] Figure 3 This is a schematic diagram of the reaction category prediction model structure and molecular characterization method provided by the present invention.

[0021] Figure 4 This is a schematic diagram of the case knowledge retrieval process provided by the present invention.

[0022] Figure 5 This is a schematic diagram of multiple predictions and result filtering provided by the present invention.

[0023] Figure 6 This is a schematic diagram of the module of the case-based knowledge-enhanced organic synthesis product prediction device provided by the present invention.

[0024] Figure 7 This is a schematic diagram of the physical structure of the electronic device provided by the present invention. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0026] Large language models can be used for text-based organic synthesis product prediction tasks, but their accuracy is lower than that of traditional models due to insufficient pre-training knowledge in the chemical field and insufficient understanding of the principles of synthesis reactions.

[0027] This invention provides a method and apparatus for predicting organic synthesis products based on case-based knowledge enhancement. Specifically, it includes: data cleaning to filter unreasonable samples in the product prediction dataset; constructing and training a chemical reaction category prediction model based on a given reaction input; extracting intermediate layer information from the chemical reaction category prediction model as a molecular characterization method; constructing a molecular characterization library based on reaction inputs in complete reaction equations, given a product prediction training set; for the product prediction training and test sets, using the molecular characterization method to obtain corresponding molecular characterizations for given reaction inputs, and retrieving similar samples from the molecular characterization library as reaction cases; using the reaction cases as case enhancements, and adding the text descriptions of the cases as knowledge enhancements after the question to construct a supervised fine-tuning dataset for a large language model, and as evaluation input to predict synthetic products; performing multiple predictions on the same question to obtain multiple possible results, introducing molecular properties as further screening criteria to obtain the final prediction result. This invention uses the above method to solve the problem in related technologies where the large language model's pre-trained knowledge of the chemical domain and its insufficient understanding of synthetic reactions lead to lower accuracy compared to traditional models.

[0028] Optionally, the case-knowledge-enhanced organic synthesis product prediction method of this application embodiment can be executed by a server, by a terminal device, or by both a server and a terminal device. Taking the case-knowledge-enhanced organic synthesis product prediction method of this embodiment executed by a server as an example.

[0029] Figure 1 This is a flowchart illustrating the case-based knowledge-enhanced method for predicting organic synthesis products provided by this invention, as shown below. Figure 1 As shown, the method includes the following steps.

[0030] Step 101: Obtain the input organic synthesis prediction problem, wherein the organic synthesis prediction problem includes: target given reaction input.

[0031] In this embodiment of the invention, the problem of obtaining input for organic synthesis prediction involves receiving a target given reaction input, which is represented in the form of a simplified molecular linear input specification (SMILES), including SMILES strings for reactants, solvents, and reagents.

[0032] In practice, the input data is obtained directly from user queries or system interfaces as the starting point for the prediction task. It is ensured that the reaction input format is standardized and complete, for example, extracted from a pre-set dataset (such as Open-Reaction-Database) or user input. The SMILES string must conform to the chemical information standard (such as using the RDKIT tool to verify its validity).

[0033] Step 102: For a given target reaction input, perform molecular characterization retrieval based on a preset molecular characterization mapping logic to obtain the target molecular characterization corresponding to the given target reaction input, and determine the target reaction case corresponding to the target molecular characterization in the preset molecular characterization library.

[0034] In this embodiment of the invention, for the input target given reaction input (represented in the form of the string SMILES, including reactants, solvents and reagents), molecular characterization retrieval is performed based on a preset molecular characterization mapping logic.

[0035] For example, the RDKIT chemical information processing tool can be used to generate a combination of RDK, Layered, Pattern, Avalon, and Morgan molecular fingerprints (vector dimension 10240) for a given target reaction input.

[0036] The molecular fingerprint combination is input into the trained chemical reaction category prediction model, and the output of the second linear layer (dimension 2048) of the chemical reaction category prediction model is extracted as the target molecule characterization.

[0037] The target molecular characterization described above is input into a preset molecular characterization library (which is built based on a product prediction dataset and is used to store molecular characterizations of complete reaction equations) for retrieval. The similarity between the target molecular characterization and each molecular characterization in the preset molecular characterization library is determined. The top K molecular characterizations with the highest similarity are selected, and the reaction cases corresponding to the top K molecular characterizations are used as target reaction cases.

[0038] Step 103: Use the target reaction case as case enhancement and the text description of the target reaction case as knowledge enhancement to supplement the organic synthesis prediction problem, thus obtaining the organic synthesis prediction problem with case knowledge enhancement.

[0039] In this embodiment of the invention, firstly, the target reaction cases (i.e., the retrieved complete reaction equations SMILES) are directly used as case enhancement content; secondly, their text descriptions (i.e., knowledge enhancement content) are generated through two independent methods: The pre-defined generative large model is invoked to parse the SMILES expressions of the reaction cases, generating structured text containing analysis of the molecular composition of reactants / solvents / reagents and deduction of the reaction process (specifically covering reaction site prediction, main reaction path inference, side reaction path exclusion and product verification logic).

[0040] Synchronously retrieve the original process condition description text of the corresponding reaction equation in the preset product prediction dataset.

[0041] Finally, the enhanced content from the above cases and the enhanced knowledge content are integrated according to a fixed template to form a supplemented predictive question input.

[0042] Step 104: Input the case knowledge-enhanced organic synthesis prediction problem into the supervised fine-tuned large language model to obtain the predicted synthesis product corresponding to the organic synthesis prediction problem output by the large language model.

[0043] In this embodiment of the invention, the case knowledge-enhanced organic synthesis prediction problem includes: problem description instructions (target reaction input presented in the form of SMILES, covering reactants, solvents and reagents), case enhancement content (complete reaction equation SMILES of multiple retrieved target reaction cases), and knowledge enhancement content (structured text containing molecular composition analysis of reactants / solvents / reagents and reaction process deduction, or original process condition description text of the corresponding reaction equation extracted from the product prediction dataset).

[0044] The case-knowledge-enhanced organic synthesis prediction problem is input into a supervised fine-tuned large language model, which adopts the Qwen2.5-32B architecture. The large language model is trained with full parameters (learning rate 1e-5, training for 3 rounds) using the cross-entropy loss function and weighted processing (product SMILES weight 2.0, other text weight 1.0). The large language model parses the input case-knowledge-enhanced organic synthesis prediction and predicts the synthesis products.

[0045] Finally, the output of the large language model is presented in text form, in which the predicted synthetic product molecule SMILES is wrapped in... <chem> and< / chem> Within the label, it is used as a direct prediction result.

[0046] Through the embodiments of the present invention, firstly, the target reaction input is obtained as input to ensure the accuracy of the problem definition; then, historical reaction cases are retrieved and matched based on molecular characterization mapping logic to provide specific data references; next, the input information is enhanced by cases and text descriptions to enrich contextual knowledge; finally, a supervised fine-tuning large language model is used for prediction, thereby significantly improving the accuracy and reliability of synthetic product prediction, reducing uncertainty, and improving overall decision-making efficiency.

[0047] According to the case knowledge enhancement-based organic synthesis product prediction method provided by the present invention, before obtaining the input organic synthesis prediction problem, the method further includes: Obtain the product prediction dataset after cleaning; Based on the cleaned product prediction dataset, a chemical reaction category prediction model is constructed and trained to obtain the trained chemical reaction category prediction model, which is used to predict the reaction category based on a given reaction input. Intermediate layer information is extracted from the trained chemical reaction category prediction model to obtain the molecular characterization mapping logic; Based on the molecular characterization mapping logic, and using the cleaned product prediction dataset, a molecular characterization library is constructed based on the given reaction input in the complete reaction equation.

[0048] In this embodiment of the invention, unreasonable samples in the product prediction dataset are screened; a chemical reaction category prediction model based on a given reaction input is constructed and trained; the intermediate layer information of the chemical reaction category prediction model is extracted as a molecular characterization method (i.e., molecular characterization mapping logic); and for a given product prediction dataset, a molecular characterization library based on the reaction input in the complete reaction equation is constructed. In some embodiments, for the product prediction training set and the product prediction test set, the corresponding molecular characterization is obtained by using molecular characterization mapping logic for a given reaction input, and similar samples in the molecular characterization library are retrieved as reaction cases. Reaction cases are used as case enhancements, and the textual descriptions of these cases are used as knowledge enhancements, added after the question. These are used to construct a supervised fine-tuning dataset for a large language model and as evaluation input to predict synthetic products. Multiple predictions are made for the same question, yielding multiple possible results, and molecular properties are introduced as a further screening criterion.

[0049] In this embodiment of the invention, the product prediction dataset (e.g., Open-Reaction-Database) is first cleaned.

[0050] Secondly, a chemical reaction category prediction model was constructed and trained based on the cleaned product prediction dataset: using schneider50k as the training set, the SMILES sequences of reactants, solvents and reagents were used to generate five molecular fingerprints (2048 in each dimension) of RDK, Layered, Pattern, Avalon and Morgan using the RDKIT tool, and spliced ​​together to form a 10240-dimensional molecular pre-encoding input; a three-layer MLP network architecture (including: the first linear layer, the second linear layer and the third linear layer) was adopted, and the cross-entropy loss function and Adam optimizer (learning rate 1e-5) were used to train for 500 rounds, and an early stopping strategy was implemented (the model was terminated if the accuracy of the validation set did not improve for 20 consecutive rounds).

[0051] Subsequently, the output of the second linear layer (2048-dimensional vector) of the chemical reaction category prediction model was extracted as the molecular characterization mapping logic.

[0052] Finally, based on this mapping logic, feature extraction is performed on the reaction input of each complete reaction equation in the cleaned dataset to construct a standardized molecular characterization library.

[0053] Through the embodiments of the present invention, a high-quality product prediction dataset after cleaning is obtained, a chemical reaction category prediction model that can predict the reaction category based on a given reaction input is constructed and trained, intermediate layer information is extracted from the model to obtain the molecular characterization mapping logic, and a molecular characterization library based on a complete reaction equation given the reaction input is constructed accordingly, providing a solid and targeted data and model foundation for subsequent organic synthesis product prediction.

[0054] According to the present invention, an organic synthesis product prediction method based on case knowledge enhancement is provided, which obtains a cleaned product prediction dataset, including: The product prediction dataset is filtered according to preset filtering criteria to obtain a cleaned product prediction dataset. The filtering criteria include at least one of the following: The same reaction input can produce different synthetic products. Including chiral products; It includes multiple products.

[0055] In this embodiment of the invention, the product prediction dataset is an Open-Reaction-Database; unreasonable samples are filtered out, including: the same reaction input but different products; containing chiral products; containing multiple products.

[0056] In some embodiments, the Open-Reaction-Database is used as the source of the original dataset, and the dataset is rigorously cleaned using preset filtering conditions; the specific filtering process includes: Conflicting samples with identical reaction inputs (i.e., identical combinations of reactants, solvents, and reagents) but different synthetic product smiles were removed to eliminate data ambiguity. Reaction records containing chiral products were removed (because the stereochemical information of chiral molecules in SMILES representations can easily lead to prediction complexity). Exclude non-single reaction systems that generate multiple products (ensure that each reaction corresponds to only a single target product and avoid interference from multiple products).

[0057] This cleaning operation is automated using the RDKIT chemical tool. The scripts are used to verify the uniqueness of products and molecular properties in batches, and finally output a high-quality, standardized cleaning dataset, which lays the foundation for subsequent modeling.

[0058] Through the embodiments of the present invention, the product prediction dataset is filtered according to preset screening conditions (covering situations such as different synthetic products from the same reaction input, chiral products, and multiple products) to obtain a cleaned dataset, which can accurately focus on complex and representative chemical reaction data and remove irrelevant or simple data interference.

[0059] According to the case knowledge enhancement-based organic synthesis product prediction method provided by the present invention, the given reaction input adopts the form of simplified molecular linear input specification, and the given reaction input includes: reactants, solvents and reagents; The chemical reaction category prediction model is a three-layer multilayer perceptron, including: The first linear layer consists of: a linear layer with an input dimension of 10240 and an output dimension of 8192, and the ReLU activation function; The second linear layer consists of: a linear layer with an input dimension of 8192 and an output dimension of 2048, and the ReLU activation function; The third linear layer consists of a linear layer with an input dimension of 2048 and an output dimension of 50.

[0060] In this embodiment of the invention, the given reaction input adopts the form of Simplified Molecular Linear Input Specification (SMILES), including reactants, solvents and reagents; the RDKIT chemical information processing tool is used to obtain the RDK, Layered, Pattern, Avalon and Morgan molecular fingerprints of the reaction input and combine them as molecular pre-encoding.

[0061] Among them, the output vector dimension of RDK, Layered, Pattern, Avalon, and Morgan molecular fingerprint encoding is 2048, and the combination method is vector concatenation to obtain a molecular pre-encoding with a dimension of 10240.

[0062] The chemical reaction category prediction model is a three-layer multilayer perceptron, specifically defined as follows: The first linear layer contains a linear transformation layer with an input dimension of 10240 (corresponding to the spliced ​​fingerprint features of molecular pre-encoded data) and an output dimension of 8192, and is connected to the ReLU activation function for nonlinear processing; the second linear layer contains a linear transformation layer with an input dimension of 8192 and an output dimension of 2048, and is also connected to the ReLU activation function; the third linear layer is a purely linear output layer with an input dimension of 2048 and an output dimension of 50, which directly generates the predicted reaction category probability distribution. This structure gradually reduces dimensionality through fully connected layers, realizing the mapping from high-dimensional features to category labels, laying the foundation for subsequent molecular characterization extraction.

[0063] In this embodiment of the invention, the chemical reaction category prediction model (three-layer multilayer perceptron) adopts the cross-entropy loss function, the Adam optimizer, the learning rate is 1e-5, and it is trained for 500 rounds.

[0064] During the training phase, an early stopping strategy is adopted: if the accuracy of the validation set does not improve within 20 consecutive rounds, training is stopped and the model weights are saved.

[0065] Through the embodiments of the present invention, a simplified molecular linear input specification is adopted to clearly define the given reaction input (covering reactants, solvents and reagents), so that the data format is unified and standardized, which is convenient for model processing; and the chemical reaction category prediction model is designed as a three-layer multilayer perceptron with a specific structure, which can efficiently extract reaction input features and accurately predict reaction categories.

[0066] According to the present invention, an organic synthesis product prediction method based on case knowledge enhancement determines the target reaction case corresponding to the target molecule characterization in a preset molecular characterization library, including: Determine the similarity between the target molecule characterization and the characterizations of each molecule in the pre-defined molecular characterization library; The top K molecular characters with the highest similarity are selected, and the reaction cases corresponding to the top K molecular characters are used as target reaction cases.

[0067] In this embodiment of the invention, based on a given reaction input, the reaction category prediction model outputs the K most likely categories, searches for molecular representations with the same reaction category in the molecular representation library, and selects the complete reaction equations corresponding to the N closest molecular representations as reaction cases.

[0068] The L2 norm is used to calculate the distance representation; both K and N are 3.

[0069] For example, based on the target reaction input, the top K reaction categories with the highest probabilities (K=3) are output by a pre-trained chemical reaction category prediction model (three-layer MLP), and all molecular characterization samples belonging to these categories are screened in the molecular characterization library to form a candidate subset.

[0070] The similarity between the target molecule characterization and the characterization of each molecule in the candidate subset is calculated. The distance is quantified using the L2 norm (Euclidean distance) instead of similarity. The top N samples with the smallest distance (N=3) are selected, and their corresponding complete reaction equations SMILES are used as the target reaction cases.

[0071] Through the embodiments of the present invention, the similarity between the target molecule characterization and each molecule characterization in the preset molecular characterization library is calculated, and the reaction cases corresponding to the top K molecule characterizations with the highest similarity are selected as target reaction cases. This can quickly and accurately find the cases most similar to the target molecule in the huge molecular characterization library, effectively utilize case knowledge to provide a reliable reference for the prediction of organic synthesis products, and improve the accuracy and efficiency of prediction.

[0072] According to the case-knowledge-enhanced organic synthesis product prediction method provided by the present invention, after inputting the case-knowledge-enhanced organic synthesis prediction problem into a supervised fine-tuned large language model and obtaining the predicted synthesis product corresponding to the organic synthesis prediction problem output by the large language model, the method further includes: The case knowledge-enhanced organic synthesis prediction problem is repeatedly input into the supervised fine-tuned large language model to obtain multiple predicted synthetic products corresponding to the organic synthesis prediction problem output by the large language model. Determine the properties of the predicted molecules for each of the multiple predicted synthetic products; Determine the distribution of molecular properties of all synthesized product samples in the cleaned product prediction dataset; Determine the similarity between the predicted molecular properties of each predicted synthetic product and the distribution of molecular properties of all synthetic product samples, and take the predicted synthetic product with the highest similarity as the final prediction result.

[0073] In this embodiment of the invention, each sample in the supervised fine-tuning dataset contains a problem description instruction, as well as pre-retrieved response cases and corresponding text descriptions as knowledge enhancement; the large language model uses Qwen2.5-32B.

[0074] The problem description instruction is to give a large language model reaction input, instruct the model to predict the product, and include the final product molecule SMILES in the input. <chem> and< / chem> middle.

[0075] The large language model employs full-parameter fine-tuning, uses the cross-entropy loss function, has a learning rate of 1e-5, and a training epoch of 3. Different weights are applied to the loss values ​​of the final product molecule SMILES and the remaining text content, and these weights are then summed.

[0076] Among them, the weights of SMILES and the rest of the text content are 2.0 and 1.0, respectively.

[0077] In some embodiments, the predicted synthetic product is evaluated. The evaluation process includes: given a reaction input, obtaining reaction cases and corresponding text descriptions as knowledge enhancement using a case retrieval method; inputting the problem description, the obtained reaction cases, and the knowledge enhancement into the model, allowing the large language model to predict the product, and including the final product molecule SMILES in the model. <chem> and< / chem> In the middle, calculate the Morgan molecular fingerprint of the product molecule SMILES and the standard answer molecule SMILES, and use RDKIT to calculate the fingerprint similarity. If the similarity is greater than a preset threshold, the answer is considered correct.

[0078] In some embodiments, the knowledge sources corresponding to the reaction cases include: using a pre-defined generative large model to describe the molecular composition of reactants, solvents, and reagents, and to analyze the reaction process, based on the reaction case expression; and retrieving the corresponding process condition descriptions for the reaction expressions from the product prediction dataset (Open-Reaction-Database).

[0079] The distribution of molecular properties of all products in the Open-Reaction-Database dataset is statistically analyzed. For each predicted synthetic product, the corresponding predicted molecular properties are calculated, and the products are sorted according to the distribution of molecular properties to select the most likely results.

[0080] Among these, molecular properties take into account drug similarity, toxicity, and pharmacokinetics.

[0081] For the molecular property distributions of multiple predicted synthetic products, the similarity with the molecular property distributions of all products in the product prediction dataset is calculated, and the SMILES corresponding to the highest similarity is taken as the final result.

[0082] Through the embodiments of the present invention, the similarity of the target molecule characterization with each characterization in the molecular characterization library is measured by similarity, the correlation between molecules is quantified, and the reaction cases corresponding to the top K molecular characterizations with the highest similarity are selected as targets, which can efficiently and accurately screen out the most valuable information.

[0083] The following describes an example of a case-based knowledge-enhanced method for predicting organic synthesis products provided by this invention in a practical application scenario.

[0084] refer to Figure 2 , Figure 2 This is a schematic diagram of the complete process of the case-based knowledge-enhanced method for predicting organic synthesis products provided by this invention. Figure 2 The method includes: Step 110, data cleaning.

[0085] Specifically, unreasonable samples in the product prediction dataset are filtered out. For the product prediction dataset Open-Reaction-Database, unreasonable samples include those with the same reaction input but different products, those containing chiral products, and those containing multiple products.

[0086] Step 120: Train the chemical reaction category prediction model.

[0087] Specifically, a chemical reaction category prediction model based on a given reaction input is constructed and trained, using schneider50k as the category prediction training set; the RDKIT chemical information processing tool is used to obtain and combine the RDK, Layered, Pattern, Avalon, and Morgan molecular fingerprints of the reaction input as molecular pre-encoding.

[0088] Specifically, the output vectors of RDK, Layered, Pattern, Avalon, and Morgan molecular fingerprint encoding all have a dimension of 2048. The combination method is vector concatenation to obtain a molecular pre-encoding with a dimension of 10240.

[0089] The reaction category prediction model is a three-layer MLP, with pre-coded information as input and the predicted reaction category as output.

[0090] Specifically, the first layer of the model contains a linear layer with an input dimension of 10240 and an output dimension of 8192, as well as the ReLU activation function; the second layer contains a linear layer with an input dimension of 8192 and an output dimension of 2048, as well as the ReLU activation function; and the third layer contains a linear layer with an input dimension of 2048 and an output dimension of 50.

[0091] The three-layer MLP uses the cross-entropy loss function, Adam optimizer, and a learning rate of 1e-5 during the training phase, and is trained for 500 rounds.

[0092] Step 130: Calculate molecular characterization and construct a molecular characterization library.

[0093] By extracting intermediate layer information from chemical reaction category prediction models as a molecular characterization method, and given a product prediction training set, a molecular characterization library based on reaction inputs in complete reaction equations is constructed.

[0094] Specifically, the output of the second linear layer of the reaction category prediction model is used as a molecular characterization.

[0095] Step 140: Retrieve similar samples as response cases.

[0096] For the product prediction training and test sets, given reaction inputs are used to obtain corresponding molecular characteristics using molecular characterization methods, and similar samples in the molecular characterization library are retrieved as reaction cases.

[0097] Specifically, the reaction category prediction model precodes three possible categories for a given input molecule, searches for molecular representations with the same reaction category in the molecular representation library, and selects the reaction equations SMILES corresponding to the three closest representations as cases.

[0098] The L2 norm is used to calculate the distance representation.

[0099] Step 150: Introduce a textual description of the reaction case as knowledge enhancement.

[0100] The response cases are used as case augmentations, and the textual descriptions of the cases are used as knowledge augmentations. These are added after the question. The supervised fine-tuning dataset used to build the large language model is used to train the model and as evaluation input to predict the synthetic output.

[0101] Specifically, the text descriptions of the cases are generated using GPT-4o, DeepSeek-R1, and Qwen-72B, describing the molecular composition of reactants, solvents, and reagents, as well as the corresponding reaction process analysis; or the corresponding process conditions descriptions for the reaction expressions can be directly retrieved from the Open-Reaction-Database.

[0102] Specifically, the supervised fine-tuning dataset and evaluation inputs are given a reaction input, cases and knowledge are added, the model is instructed to predict the products, and the final product molecules SMILES are required to be included. <chem> and< / chem> middle.

[0103] Specifically, during the training phase, full parameter fine-tuning was adopted, using the cross-entropy loss function with a learning rate of 1e-5 and a training epoch of 3. Different weights were applied to the loss values ​​of the final product molecule SMILES and the remaining text content, and then weighted.

[0104] Step 160: Monitor, fine-tune, and evaluate.

[0105] During the evaluation phase, multiple predictions are made for the same problem to obtain multiple possible results. Molecular properties are then introduced as a further screening criterion to obtain the final prediction result.

[0106] Specifically, for a single prediction, the SMILES output of each evaluation is used to obtain the molecular Morgan fingerprint through RDKIT, and the fingerprint similarity between it and the standard answer is calculated. If the similarity is 1.0, it is considered correct.

[0107] Specifically, the property distribution of all product molecules in the Open-Reaction-Database dataset is statistically analyzed. For multiple prediction results, the molecular property distribution is calculated and sorted according to its similarity to the property distribution of product molecules in the dataset. The most similar result is selected as the final output.

[0108] Among these, molecular properties take into account drug similarity, toxicity, and pharmacokinetics.

[0109] refer to Figure 3 , Figure 3 This is a schematic diagram of the reaction category prediction model structure and molecular characterization method provided by the present invention. The input is molecular precoding, and the output is molecular characterization and predicted reaction category.

[0110] The reaction category prediction model consists of a first layer containing a linear layer with an input dimension of 10240 and an output dimension of 8192, along with a ReLU activation function; a second layer containing a linear layer with an input dimension of 8192 and an output dimension of 2048, along with a ReLU activation function; and a third layer containing a linear layer with an input dimension of 2048 and an output dimension of 50.

[0111] The output of the second linear layer is used as a molecular characterization.

[0112] refer to Figure 4 , Figure 4 This is a schematic diagram of the case knowledge retrieval process provided by the present invention. For example... Figure 4 As shown, the method includes: Input reaction conditions, predict reaction type and obtain molecular characterization.

[0113] Step 310: Search for similar cases.

[0114] Here, based on the molecular characterization library, similar cases matching the same reaction type are retrieved.

[0115] Step 320: Add case study text knowledge.

[0116] Here, add a text description of the case response.

[0117] Output case studies and related knowledge.

[0118] The knowledge sources include: using GPT-4o, DeepSeek-R1, and Qwen-72B to describe the molecular composition of reactants, solvents, and reagents, and to analyze the reaction process based on the reaction case expressions; and searching the Open-Reaction-Database for the corresponding process conditions for the reaction expressions.

[0119] refer to Figure 5 , Figure 5 This is a schematic diagram illustrating the multiple predictions and result filtering provided by the present invention. For example... Figure 5 The method takes multiple prediction results as input and outputs the final prediction result. It includes: Step 410: Analyze the distribution of properties of all product molecules in the statistical dataset.

[0120] Statistically analyze the property distribution of all product molecules in the Open-Reaction-Database dataset.

[0121] Step 420: Calculate the property distribution for each result.

[0122] For each prediction output, calculate its corresponding property distribution and compare it with the distribution obtained from the dataset. Take the SMILES with the highest similarity as the final prediction result.

[0123] The following describes the case-based knowledge-enhanced organic synthesis product prediction device provided by the present invention. The case-based knowledge-enhanced organic synthesis product prediction device described below can be referred to in correspondence with the case-based knowledge-enhanced organic synthesis product prediction method described above.

[0124] refer to Figure 6 , Figure 6 This is a schematic diagram of the module of the case-based knowledge-enhanced organic synthesis product prediction device provided by the present invention.

[0125] The acquisition module 601 is used to acquire the input organic synthesis prediction problem, wherein the organic synthesis prediction problem includes: a target given reaction input; The retrieval module 602 is used to perform molecular characterization retrieval based on a preset molecular characterization mapping logic for a given target reaction input, obtain the target molecular characterization corresponding to the given target reaction input, and determine the target reaction case corresponding to the target molecular characterization in the preset molecular characterization library. The enhancement module 603 is used to enhance the target reaction case as a case and the text description of the target reaction case as knowledge enhancement to supplement the organic synthesis prediction problem, thereby obtaining an organic synthesis prediction problem with case knowledge enhancement. The prediction module 604 is used to input the case knowledge-enhanced organic synthesis prediction problem into the supervised fine-tuned large language model to obtain the predicted synthesis product corresponding to the organic synthesis prediction problem output by the large language model.

[0126] Specifically, the case-knowledge-enhanced organic synthesis product prediction device provided by the present invention can realize all the method steps implemented in the above-described case-knowledge-enhanced organic synthesis product prediction method embodiments, and can achieve the same technical effect. Here, the parts that are the same as those in the method embodiments and the beneficial effects will not be described in detail.

[0127] Figure 7 This is a schematic diagram of the physical structure of the electronic device provided by the present invention, such as... Figure 7As shown, the electronic device may include a processor 710, a communications interface 720, a memory 730, and a communication bus 740, wherein the processor 710, communications interface 720, and memory 730 communicate with each other via the communication bus 740. The processor 710 can call logic instructions in the memory 730 to execute a case-based knowledge-enhanced organic synthesis product prediction method. This method includes: acquiring an input organic synthesis prediction problem, wherein the organic synthesis prediction problem includes a target given reaction input; for the target given reaction input, performing molecular characterization retrieval based on a preset molecular characterization mapping logic to obtain the target molecular characterization corresponding to the target given reaction input, and determining the target reaction case corresponding to the target molecular characterization in a preset molecular characterization library; using the target reaction case as case enhancement and the text description of the target reaction case as knowledge enhancement to supplement the organic synthesis prediction problem, obtaining a case-knowledge-enhanced organic synthesis prediction problem; inputting the case-knowledge-enhanced organic synthesis prediction problem into a supervised fine-tuned large language model to obtain the predicted synthesis product corresponding to the organic synthesis prediction problem output by the large language model.

[0128] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0129] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the case-based knowledge-enhanced organic synthesis product prediction method provided by the above methods. The method includes: acquiring an input organic synthesis prediction problem, wherein the organic synthesis prediction problem includes a target given reaction input; for the target given reaction input, performing molecular characterization retrieval based on a preset molecular characterization mapping logic to obtain the target molecular characterization corresponding to the target given reaction input, and determining the target reaction case corresponding to the target molecular characterization in a preset molecular characterization library; using the target reaction case as case enhancement and the text description of the target reaction case as knowledge enhancement to supplement the organic synthesis prediction problem, thereby obtaining a case-knowledge-enhanced organic synthesis prediction problem; inputting the case-knowledge-enhanced organic synthesis prediction problem into a supervised fine-tuned large language model to obtain the predicted synthesis product corresponding to the organic synthesis prediction problem output by the large language model.

[0130] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the case-knowledge-enhanced organic synthesis product prediction method provided by the above methods. This method includes: acquiring an input organic synthesis prediction problem, wherein the organic synthesis prediction problem includes a target given reaction input; for the target given reaction input, performing molecular representation retrieval based on a preset molecular representation mapping logic to obtain the target molecular representation corresponding to the target given reaction input, and determining the target reaction case corresponding to the target molecular representation in a preset molecular representation library; using the target reaction case as case enhancement and the text description of the target reaction case as knowledge enhancement to supplement the organic synthesis prediction problem, obtaining a case-knowledge-enhanced organic synthesis prediction problem; inputting the case-knowledge-enhanced organic synthesis prediction problem into a supervised fine-tuned large language model to obtain the predicted synthesis product corresponding to the organic synthesis prediction problem output by the large language model.

[0131] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0132] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0133] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for predicting organic synthesis products based on case-based knowledge enhancement, characterized in that, include: An organic synthesis prediction problem is obtained from the input, wherein the organic synthesis prediction problem includes: a target given reaction input; For the given target reaction input, molecular characterization retrieval is performed based on a preset molecular characterization mapping logic to obtain the target molecular characterization corresponding to the given target reaction input, and the target reaction case corresponding to the target molecular characterization in the preset molecular characterization library is determined. The target reaction case is used as a case enhancement, and the text description of the target reaction case is used as knowledge enhancement to supplement the organic synthesis prediction problem, resulting in an organic synthesis prediction problem with case knowledge enhancement. The organic synthesis prediction problem enhanced by the case knowledge is input into the supervised fine-tuned large language model to obtain the predicted synthetic product corresponding to the organic synthesis prediction problem output by the large language model.

2. The method for predicting organic synthesis products based on case knowledge enhancement according to claim 1, characterized in that, Prior to the organic synthesis prediction problem of obtaining the input, the method further includes: Obtain the product prediction dataset after cleaning; Based on the cleaned product prediction dataset, a chemical reaction category prediction model is constructed and trained to obtain the trained chemical reaction category prediction model, wherein the chemical reaction category prediction model is used to predict the reaction category based on a given reaction input; The intermediate layer information is extracted from the trained chemical reaction category prediction model to obtain the molecular characterization mapping logic. Based on the molecular characterization mapping logic and the cleaned product prediction dataset, a molecular characterization library is constructed based on the given reaction input in the complete reaction equation.

3. The method for predicting organic synthesis products based on case knowledge enhancement according to claim 2, characterized in that, The process of obtaining the cleaned product prediction dataset includes: The product prediction dataset is filtered according to preset filtering criteria to obtain a cleaned product prediction dataset, wherein the filtering criteria include at least one of the following: The same reaction input can produce different synthetic products. Including chiral products; It includes multiple products.

4. The method for predicting organic synthesis products based on case knowledge enhancement according to claim 2, characterized in that, The given reaction input adopts the form of a simplified molecular linear input specification, and the given reaction input includes: reactants, solvents, and reagents; The chemical reaction category prediction model is a three-layer multilayer perceptron, including: The first linear layer consists of: a linear layer with an input dimension of 10240 and an output dimension of 8192, and the ReLU activation function; The second linear layer consists of: a linear layer with an input dimension of 8192 and an output dimension of 2048, and the ReLU activation function; The third linear layer consists of a linear layer with an input dimension of 2048 and an output dimension of 50.

5. The method for predicting organic synthesis products based on case knowledge enhancement according to claim 4, characterized in that, The step of determining the target reaction case corresponding to the target molecule characterization in a preset molecular characterization library includes: Determine the similarity between the target molecule characterization and the characterizations of each molecule in a pre-defined molecular characterization library; The top K molecular characteristics with the highest similarity are selected, and the reaction cases corresponding to the top K molecular characteristics are used as target reaction cases.

6. The method for predicting organic synthesis products based on case knowledge enhancement according to claim 1, characterized in that, After inputting the case knowledge-enhanced organic synthesis prediction problem into a supervised fine-tuned large language model to obtain the predicted synthetic product corresponding to the organic synthesis prediction problem output by the large language model, the method further includes: The case knowledge-enhanced organic synthesis prediction problem is repeatedly input into the supervised fine-tuned large language model to obtain multiple predicted synthetic products corresponding to the organic synthesis prediction problem output by the large language model. Determine the predicted molecular properties corresponding to each of the plurality of predicted synthetic products; Determine the distribution of molecular properties of all synthetic product samples in the cleaned product prediction dataset; The similarity between the predicted molecular properties corresponding to each predicted synthetic product and the molecular property distribution of all synthetic product samples is determined, and the predicted synthetic product with the highest similarity is taken as the final prediction result.

7. An organic synthesis product prediction device based on case-based knowledge enhancement, characterized in that, include: An acquisition module is used to acquire the input organic synthesis prediction problem, wherein the organic synthesis prediction problem includes: a target given reaction input; The retrieval module is used to perform molecular characterization retrieval based on a preset molecular characterization mapping logic for the given target reaction input, obtain the target molecular characterization corresponding to the given target reaction input, and determine the target reaction case corresponding to the target molecular characterization in a preset molecular characterization library. An enhancement module is used to enhance the target reaction case as a case and the text description of the target reaction case as knowledge enhancement to supplement the organic synthesis prediction problem, thereby obtaining an organic synthesis prediction problem with case knowledge enhancement. The prediction module is used to input the organic synthesis prediction problem enhanced by the case knowledge into the supervised fine-tuned large language model to obtain the predicted synthesis product corresponding to the organic synthesis prediction problem output by the large language model.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the case knowledge-enhanced method for predicting organic synthetic products as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the case knowledge-enhanced method for predicting organic synthetic products as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the case knowledge-enhanced method for predicting organic synthetic products as described in any one of claims 1 to 6.