Molecular structure determination method and device, electronic equipment and storage medium
By combining two-dimensional and three-dimensional molecular diagrams with text-encoded diffusion models, the problem of insufficient two-dimensional representation in molecular optimization is solved, enabling more accurate molecular structure generation, which is applicable to drug discovery and materials design.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-11
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies, in the process of molecular optimization, only focus on the two-dimensional representation of molecular structure, resulting in insufficient accuracy in predicting the physicochemical properties of molecules.
By combining graph encoders and text encoders with a diffusion model, more accurate molecular structures are generated through feature extraction and adjustment of two-dimensional and three-dimensional molecular graphs and target description text.
It improves the accuracy of molecular structure prediction and can generate optimized molecules that meet diverse requirements and specific structures, making it suitable for drug discovery, chemical engineering, and polymer material design.
Smart Images

Figure CN121662216A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of molecular optimization technology, and in particular to a method, apparatus, electronic device and storage medium for determining molecular structure. Background Technology
[0002] Molecular optimization is a crucial process in fields such as drug discovery, chemical engineering, catalysts, and polymer material design. It refers to the modification and optimization of the structure of an initial molecule, involving strategic chemical modifications to enhance desired properties. Molecular optimization is often viewed as a reverse design problem, starting with the desired properties and working backward to determine the molecular structure required to achieve them. The core objective of molecular optimization is to generate molecules that meet stringent structural, physical, and electrochemical standards while preserving the essential structural features beneficial to synthesis.
[0003] Currently, molecular optimization typically focuses on the two-dimensional representation of molecular structure, i.e., optimizing molecular structure based on the two-dimensional (2D) bond topology of the initial molecule. However, since this method involves incomplete molecular structural information, it may affect the accurate prediction of molecular physicochemical properties. Summary of the Invention
[0004] This application provides a method, apparatus, electronic device, and storage medium for determining molecular structure, which can improve the accuracy of the predicted molecular structure of the target molecule.
[0005] Firstly, this application provides a method for determining molecular structure. This method can be executed by an electronic device, or a chip, chip system, or circuit within the electronic device. For example, the electronic device can be a computer, server, tablet computer, laptop computer, vehicle terminal, etc. The method may include: the electronic device inputting a two-dimensional molecular map and a three-dimensional molecular map of an initial molecule into a graph encoder; extracting features from the two-dimensional and three-dimensional molecular maps using the graph encoder to obtain the molecular structure features of the initial molecule; inputting the text describing the target molecule into a text encoder; extracting features from the text description text using the text encoder to obtain text features; inputting the molecular structure features and text features into a diffusion model; and adjusting the molecular structure features based on the text features using the diffusion model to obtain the molecular structure of the target molecule.
[0006] The graph encoder in this application can process both two-dimensional and three-dimensional molecular graphs. When optimizing molecular structures, it considers not only the two-dimensional structure but also the three-dimensional structure, optimizing molecules based on both. This utilizes more complete molecular structural information, thus improving the accuracy of the predicted molecular structure of the target molecule. Furthermore, the processing of the two-dimensional and three-dimensional molecular graphs of the sample molecules is decoupled from the processing of the optimization target description text. The chemical structure encoder processes the two-dimensional and three-dimensional molecular graphs of the sample molecules, while the text encoder processes the optimization target description text. This decoupled workflow allows this application to utilize a large amount of molecular structure data lacking accompanying text descriptions for model training, making training data easier to obtain.
[0007] In one possible implementation, the text encoder may include a parse tree and a Large Language Model (LLM). An electronic device can input the target molecular description text into the parse tree, segment the target molecular description text using the parse tree to obtain multiple keywords, concatenate these keywords with the target molecular description text, and then input the concatenation into the LLM to obtain the text features encoded by the LLM.
[0008] In the above implementation, the target molecule description text is segmented by a parsing tree to obtain multiple keywords, which allows for fine-grained language analysis. By concatenating these keywords with the target molecule description text and then processing them using LLM, the resulting text features can contain more detailed descriptions.
[0009] In one possible implementation, the diffusion model includes a feature fusion module and a structure adjustment module. The electronic device can input molecular structural features and textual features into the feature fusion module, which then fuses the molecular structural features and textual features to obtain a feature fusion vector. This feature fusion vector is then input into the structure adjustment module, which generates the molecular structure of the target molecule based on the feature fusion vector.
[0010] In the above implementation, the structure adjustment module, based on the feature fusion vector, can optimize the structure of the initial molecule according to the requirements specified in the target molecule description text, thereby obtaining the molecular structure of the target molecule.
[0011] In one possible implementation, the structure adjustment module includes a manifold constraint function, which is used to make the molecular structure of the target molecule conform to a set three-dimensional structure.
[0012] In the above implementation, the manifold constraint function can make the molecular structure of the target molecule conform to the set three-dimensional structure, and make the target molecule conform to the three-dimensional structure of the effective molecule, thereby improving the effectiveness of molecular optimization.
[0013] In one possible implementation, the molecular structure of the target molecule includes a portion of the molecular structure of the initial molecule.
[0014] In one possible implementation, the graph encoder, the text encoder, and the diffusion model belong to a molecular generation model. The molecular generation model is trained on a training dataset that includes two-dimensional molecular graphs and three-dimensional molecular graphs of various molecules, as well as multiple optimization target descriptive texts.
[0015] In one possible implementation, the training process of the molecular generation model may include: deleting a set number of two-dimensional and three-dimensional molecular maps of molecules from the training dataset to obtain a target dataset; generating a validation dataset based on the set number of two-dimensional and three-dimensional molecular maps of molecules; training the model to be trained using the target dataset to obtain a trained model to be validated; validating the model to be validated using the validation dataset, and if the validation passes, using the model to be validated as the molecular generation model.
[0016] In the above implementation, deleting a set number of two-dimensional and three-dimensional molecular graphs from the training dataset can enable the molecular generation model to have zero-shot generalization ability, perform well when dealing with unseen categories and tasks, and can be optimized for various types of molecules.
[0017] Secondly, this application provides a molecular structure determination device that can be applied in electronic devices, and the molecular structure determination device may include:
[0018] The feature extraction unit is used to input the two-dimensional and three-dimensional molecular graphs of the initial molecule into the graph encoder, and extract features from the two-dimensional and three-dimensional molecular graphs to obtain the molecular structure features of the initial molecule; and to input the target molecule description text into the text encoder, and extract features from the target molecule description text to obtain the text features.
[0019] The structure generation unit is used to input molecular structure features and text features into the diffusion model. The diffusion model adjusts the molecular structure features based on the text features to obtain the molecular structure of the target molecule.
[0020] In one possible implementation, the text encoder includes a parse tree and a large language model (LLM); the feature extraction unit is specifically used for:
[0021] The target molecule description text is input into a parsing tree, and the parsing tree is used to segment the target molecule description text to obtain multiple keywords;
[0022] Multiple keywords are concatenated with the target molecule description text and input into LLM to obtain the text features encoded by LLM.
[0023] In one possible implementation, the diffusion model includes a feature fusion module and a structure adjustment module; the structure generation unit is specifically used for:
[0024] Molecular structural features and textual features are input into the feature fusion module. The feature fusion module then fuses the molecular structural features and textual features to obtain a feature fusion vector.
[0025] The feature fusion vector is input into the structure adjustment module, which then generates the molecular structure of the target molecule based on the feature fusion vector.
[0026] In one possible implementation, the structure adjustment module includes a manifold constraint function; the manifold constraint function is used to make the molecular structure of the target molecule conform to a set three-dimensional structure.
[0027] In one possible implementation, the molecular structure of the target molecule includes a portion of the molecular structure of the initial molecule.
[0028] In one possible implementation, the graph encoder, text encoder, and diffusion model belong to the molecular generation model; the molecular generation model is trained based on a training dataset, which includes two-dimensional molecular graphs of various molecules, three-dimensional molecular graphs, and multiple optimization target descriptive texts.
[0029] Thirdly, this application also provides an electronic device including at least one processor and at least one memory. The one or more memories store one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause the electronic device to perform any of the methods described in the first aspect above.
[0030] Fourthly, this application also provides a chip including a processor and a power supply circuit. The power supply circuit is used to supply power to the processor, which is used to execute a computer program to implement any of the methods described in the first aspect above.
[0031] Fifthly, this application provides a computer-readable storage medium storing computer-executable instructions for causing a computer to perform any of the methods provided in the first aspect above.
[0032] In a sixth aspect, this application provides a computer program product storing instructions that, when executed by a processor, implement any of the methods provided in the first aspect.
[0033] The technical effects that can be achieved by any of the technical solutions in the second to sixth aspects mentioned above can be described with reference to the technical effects that can be achieved by the technical solution in the first aspect mentioned above, and the repeated parts will not be repeated. Attached Figure Description
[0034] Figure 1 A schematic diagram of the molecular generation model provided in the embodiments of this application;
[0035] Figure 2 A flowchart illustrating the training process of a molecular generation model provided in this application embodiment;
[0036] Figure 3 A schematic diagram illustrating a molecular structure optimization process provided in an embodiment of this application;
[0037] Figure 4 A schematic diagram illustrating a molecular structure optimization result provided in an embodiment of this application;
[0038] Figure 5 A schematic diagram illustrating another molecular structure optimization result provided in an embodiment of this application;
[0039] Figure 6 A schematic diagram illustrating another molecular structure optimization result provided in an embodiment of this application;
[0040] Figure 7 A flowchart illustrating a method for determining molecular structure provided in this application embodiment;
[0041] Figure 8 A schematic diagram illustrating another molecular structure optimization result provided in an embodiment of this application;
[0042] Figure 9 A schematic diagram illustrating another molecular structure optimization result provided in an embodiment of this application;
[0043] Figure 10 A schematic diagram illustrating another molecular structure optimization result provided in an embodiment of this application;
[0044] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application;
[0045] Figure 12 This is a schematic diagram of a molecular structure determination device provided in an embodiment of this application;
[0046] Figure 13 This is a schematic diagram of the structure of a chip provided in an embodiment of this application. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the embodiments of this application will be described in detail below with reference to the accompanying drawings. The terminology used in the implementation section of this application is only for explaining specific embodiments of this application and is not intended to limit this application.
[0048] Before introducing the specific solutions provided in the embodiments of this application, some terms used in this application will be explained to facilitate understanding by those skilled in the art, but the terms used in this application are not limited.
[0049] (1) Large Language Model (LLM): An LLM is a large-scale language model consisting of artificial neural networks with billions of weights or more parameters. It uses unsupervised learning to pre-train on a large amount of unlabeled corpus to generate a general LLM model, which can then be fine-tuned for different specific tasks. For example, LLMs can be used for generative tasks such as text generation, machine translation, and dialogue generation.
[0050] In this application embodiment, "multiple" refers to two or more. Therefore, in this application embodiment, "multiple" can also be understood as "at least two". "At least one" can be understood as one or more, such as one, two, or more. For example, "including at least one" means including one, two, or more, and it does not limit which ones are included. For example, including at least one of A, B, and C, then it could include A, B, C, A and B, A and C, B and C, or A and B and C. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / ", unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.
[0051] Unless otherwise stated, the ordinal numbers such as "first" and "second" mentioned in the embodiments of this application are used to distinguish multiple objects, and are not used to limit the order, sequence, priority or importance of multiple objects.
[0052] Molecular optimization is a crucial process in fields such as drug discovery, chemical engineering, catalysts, and polymer material design. It refers to the modification and optimization of the structure of an initial molecule, involving strategic chemical modifications to enhance the desired properties of the initial molecule. The core objective of molecular optimization is to generate molecules that meet stringent structural, physical, and electrochemical standards while preserving the essential structural features beneficial to the synthesis.
[0053] Currently, molecular optimization typically focuses on the two-dimensional representation of molecular structure, i.e., optimizing molecular structure based on the two-dimensional (2D) bond topology of the initial molecule. However, since this method involves incomplete molecular structural information, it may affect the accurate prediction of molecular physicochemical properties.
[0054] Based on this, embodiments of this application provide a method for determining molecular structure. This method can be executed by an electronic device, which may include, but is not limited to, servers, computers, tablets, vehicle terminals, smart medical terminals, smart grid terminals, mobile terminals, etc. The method may include: inputting a two-dimensional molecular map and a three-dimensional molecular map of an initial molecule into a graph encoder; extracting features from the two-dimensional and three-dimensional (3D) molecular maps using the graph encoder to obtain the molecular structure features of the initial molecule; inputting a description text of the target molecule into a text encoder; extracting features from the description text using the text encoder to obtain text features; and inputting the molecular structure features and text features into a diffusion model; adjusting the molecular structure features based on the text features using the diffusion model to obtain the molecular structure of the target molecule. Embodiments of this application, when optimizing the molecular structure, not only consider the two-dimensional structure of the molecule but also combine it with the three-dimensional structure, optimizing the molecule based on both the two-dimensional and three-dimensional structures. This utilizes more complete molecular structure information, thus improving the accuracy of the predicted molecular structure of the target molecule.
[0055] The embodiments of this application can be applied to molecular optimization tasks in bioinformatics. Given an optimization target and an initial molecule to be optimized, an optimized target molecule that meets diversity requirements and specific structural and texture constraints can be output. Molecular optimization tasks are key tasks in drug discovery, chemical engineering, catalyst and polymer material design, creating opportunities for more detailed and effective exploration of a broad chemical space and opening up new frontiers for developing molecular entities with customized properties and functions.
[0056] In the embodiments of this application, a molecular generation model can be pre-trained. For example... Figure 1 As shown, the molecular generation model can include a graph encoder, a text encoder, and a diffusion model. When a user needs to optimize a molecule, they can input the initial 2D and 3D molecular graphs, along with the target molecule's descriptive text (i.e., the optimization target), into the electronic device. The electronic device inputs the initial 2D and 3D molecular graphs into the graph encoder, which extracts features from them to obtain the molecular structure features of the initial molecule. The electronic device then inputs the target molecule's descriptive text into the text encoder, which extracts features from it to obtain text features. These text features are then input into the diffusion model, which adjusts the molecular structure features based on the text features to obtain the molecular structure of the target molecule.
[0057] For ease of understanding, the following section first introduces the training process of the molecular generation model, which can be executed by any electronic device. For example... Figure 2 As shown, the training process may include the following steps:
[0058] S201, Obtain the training dataset for training the molecular generation model.
[0059] The training dataset includes two-dimensional and three-dimensional molecular diagrams of various molecules, as well as multiple optimization target description texts. The training dataset can be a large molecular database. For example, the training dataset can be the publicly available PCQM4Mv2 dataset, a quantum chemistry dataset containing 3,746,619 molecules, including the MoleculeSTM dataset. The MoleculeSTM dataset contains over 280K chemical structure-text pairs, which can be used to train text-molecule models. To better align the chemical space with the semantic space, this embodiment effectively incorporates the 3D structural information of the molecules to enhance alignment with the text descriptions. Since the MoleculeSTM dataset lacks 3D molecular coordinates, this embodiment extracts the 3D information and energy-related values of the molecules from PubchemQC based on the index identifiers (PIDs) in the MoleculeSTM dataset.
[0060] S202, extract two-dimensional and three-dimensional molecular maps of sample molecules from the training dataset, as well as descriptive text for any optimization objective.
[0061] S203: Input the two-dimensional and three-dimensional molecular maps of the sample molecules into the graph encoder. The graph encoder extracts features from the two-dimensional and three-dimensional molecular maps to obtain the molecular structure features of the sample molecules.
[0062] The electronic device uses a graph encoder to process the two-dimensional and three-dimensional molecular graphs of the sample molecules to obtain a potential representation of the molecular structure, i.e., the molecular structural features of the sample molecules. This step can be represented as:
[0063] z G =f m (G)
[0064] Where G represents the molecular diagram, f m () represents a graph encoder, also known as a chemical structure encoder. A chemical structure encoder can use a graph converter (SE(3)) specifically customized for molecules.
[0065] S204. Input any optimization target description text into the text encoder, and extract features from the text encoder to obtain text features.
[0066] The electronic device uses a text encoder to process any optimization target description text to obtain a potential representation of the optimization target description text, i.e., text features. In this embodiment, the processing of the two-dimensional and three-dimensional molecular diagrams of sample molecules is decoupled from the processing of the optimization target description text. A chemical structure encoder processes the two-dimensional and three-dimensional molecular diagrams of sample molecules, while a text encoder processes the optimization target description text. This decoupled workflow allows this embodiment to utilize a large amount of molecular structure data lacking accompanying text descriptions for training. The processing of the optimization target description text can be represented as follows:
[0067] z t =f t (description)
[0068] Where, description represents the optimized target description text, f t () indicates a text encoder.
[0069] In some embodiments, a text encoder may include a parse tree and an LLM (Limited Language Model). An electronic device can input any optimization target description text into a parse tree, segment the text using the parse tree to obtain multiple keywords, concatenate these keywords with any optimization target description text, and input this concatenation into the LLM to obtain the text features output by the LLM. The LLM can employ a lightweight LLM model, possessing the ability to capture subtle semantic representations from text descriptions.
[0070] For example, to mitigate the pattern collapse problem of global loss, the embedding of any optimization target description text can be enhanced by automatically extracting target-related keywords Z1, Z2, ... from any optimization target description text Z0 using the parse tree of the text encoder. This is beneficial for multi-target prompting tasks. For instance, if any optimization target description text Z0 is "This molecule dissolves in water and has a low HOMO value," the target-related keywords extracted by the parse tree of the text encoder include Z1 = "dissolves in water" and Z2 = "low HOMO value." Concatenating multiple keywords Z1, Z2, ... with any optimization target description text Z0 yields a connected embedding Z = (Z0, Z1, Z2), which is then used for multi-target alignment. The connected embedding is then input into an LLM (Limited Linear Modulation), and Z is encoded using the LLM to obtain the text features output by the LLM.
[0071] S205, Align the molecular structure features of the sample molecules with the textual features of any optimization target description text.
[0072] During model training, the molecular structure feature z can be minimized using the CLIP loss function. G and the text features z of the given descriptive text t The cosine distance between the potential spaces is used to align the molecular structural features of the sample molecules with the textual features of any optimized target descriptive text. This process can be represented as:
[0073] f(z G ,z t ) = CLIP(z G ,z t )
[0074] CLIP() represents the CLIP loss function. The CLIP loss function is used for contrastive learning and matching image-text pairs. It comprises two parts: contrastive loss and matching loss. The calculation of the CLIP loss function can be as follows: 1. Contrastive Loss: This calculates the similarity between image-text pairs composed of the molecular structural features of the sample molecule and the textual features of any target description text, and then applies the cross-entropy loss function for optimization. Specifically, it calculates the similarity score between the molecular structural features of the sample molecule and the textual features of any target description text, and minimizes the difference between them using the cross-entropy loss function. 2. Matching Loss: This optimizes the fine-grained matching between the molecular structural features of the sample molecule and the textual features of any target description text. The matching loss uses a binary classification approach to learn the matching degree of image-text pairs and employs a negative sampling strategy to enhance training performance.
[0075] This application embodiment achieves alignment by comparing and learning the molecular structural features of sample molecules with the textual features of any optimization target description text. This text-structure alignment can be independently fine-tuned for text in a specific domain, such as materials science.
[0076] S206. Input the molecular structure features of the sample molecules and the textual features of any optimization target description text into the diffusion model to obtain the predicted molecular structure output by the diffusion model.
[0077] Diffusion models can adjust the molecular structure features of sample molecules based on the textual features of the text describing any optimization objective, thereby obtaining a predicted molecular structure. For example... Figure 3As shown, after multiple adjustments, the diffusion model outputs the predicted molecular structure. The diffusion model can include a feature fusion module and a structure adjustment module. An electronic device can input the molecular structure features of the sample molecule and the textual features of any optimization target description text into the feature fusion module of the diffusion model. The feature fusion module performs feature fusion on the molecular structure features of the sample molecule and the textual features of any optimization target description text to obtain a feature fusion vector. This feature fusion vector is then input into the structure adjustment module, which outputs the predicted molecular structure based on the feature fusion vector.
[0078] Diffusion models can generate new molecular structures within a chosen chemical space. Similar to standard diffusion sampling, diffusion models sample Gaussian noise and undergo iterative denoising, integrating alignment targets into the denoising process and iteratively adjusting the noise steps to preserve the similarity between input and output.
[0079] S207, based on the predicted molecular structure, adjusts the model parameters to obtain a trained molecular generation model.
[0080] Based on the predicted molecular structure, the model parameters can be adjusted, and then new sample molecules can be selected from the training dataset for the next round of iterative training until a trained molecular generation model is obtained. In this embodiment of the application, to avoid introducing any multi-stage correction feedback during the entire model training process, the denoising process can be performed in a single run.
[0081] The molecular generation model in this embodiment is a joint 2D-3D model. It introduces fine-grained cue control by using gradients derived from contrastive loss, aligning text-based cues with molecular structure representations. The model training process in this embodiment includes two stages. The first stage trains an unconditional molecular generation model using a large molecular database with diverse physicochemical properties. The second stage uses text-molecular structure data to perform cross-modal alignment and text-guided molecular structure optimization on the large molecular database.
[0082] In the first stage, unconditional pre-training of the 2D-3D joint model is performed, including two key processes: the forward process and the backward process. To adapt the above process to 2D and 3D molecular graphs, molecules can be represented as 2D and 3D molecular graphs. The 2D molecular graph can include node features (atom types) and adjacency matrices (representing chemical bond edges), while the 3D molecular graph indicates 3D positions. A molecule can be characterized as a combination of node features, adjacency matrices, and 3D positions. Specifically, assuming a molecule consists of N atoms, then X = [x1,...,xN] represents the position of an atom in the periodic table. In the forward process, the original structure of the sample molecule undergoes a series of joint Markov transformations. The intermediate structure during the transformation process can be represented as the intermediate structure at step ε, A(ε) = (X(ε), E(ε), Z(ε)), where X(ε) represents the node features, i.e., the atom types, E(ε) represents the adjacency matrix, and Z(ε) represents the 3D positions. The initial structure can be represented as A(0).
[0083] For the 3D position Z(ε), a Markov chain is implemented by progressively introducing Gaussian noise. The transformation from Z(ε-1) to Z(ε) is as follows:
[0084] Z(ε)=αˉ(ε)·Z(ε-1)+1-αˉ(ε)·π(ε)
[0085] The hyperparameter αˉ(ε)∈(0,1) controls the scale of Gaussian noise added in each step, and π(ε) represents the sampled Gaussian noise.
[0086] For 2D molecular graphs, which are also constrained by discrete Markov chains, their transition probabilities are given by the following formula:
[0087] P(X(ε-1)∣X(ε),∈(ε))∝exp(-12σ(ε)∥X(ε)-f(X(ε-1))∥2)
[0088] Here, f() represents the marginal distribution of atom types, and σ() is a hyperparameter controlling the noise variance, guiding the denoising process and ensuring that the final optimization result aligns with the given objective. Formally, the cue, represented by P, guides the process and is expected to influence the transition probability of the denoising process.
[0089] P(X(ε-1)∣X(ε),P)=P(X(ε-1)∣X(ε))·Clip(Enc(X(ε)),Enc(P))
[0090] This application's embodiments use CLIP mapping in text-image alignment to establish a connection between text cues and molecular structures. The contrast-based CLIP loss minimizes the cosine distance in the latent space between the molecular representation Z and the given cue text P: Clip(Z,P).
[0091] This application embodiment uses a pre-trained graph encoder to map X to its vector embedding Z. For text, latent embeddings are extracted from a pre-trained large language model. During CLIP optimization, the parameters of the graph encoder and the large language model are effectively fine-tuned in an unsupervised (stop-gradient) manner. The magnitude of CLIP directly measures the alignment between a given molecule and the target text. In other words, for the original molecule embedding Z_0, the optimized molecule Z_optimized satisfies the following condition:
[0092] Clip(Z_optimized,Z_0)>0
[0093] This application's embodiments are based on a differential CLIP design, P(X(ε-1)∣X(ε),P). Assuming the CLIP is robustly trained, let P(Z∣P)=N(μ,σ2), where σ2 is a hyperparameter. Then, Taylor expansion is used:
[0094]
[0095] in,
[0096] Based on the above process, we can set P(X(ε-1)|X(ε),P) as:
[0097]
[0098] The parameter ∈ is introduced to control the strength of the prompt guidance.
[0099] The diffusion model in this embodiment defines the molecular structural manifold through a manifold constraint function. The manifold constraint function can also be called a 3D fractional function. The normal direction points to the data manifold defined by the probability density P(X0). In the molecular scenario, the data manifold corresponds to a valid molecule with a legal structure, constituting a low-dimensional submanifold in all chemical graph spaces. For example, the valence rules of atoms impose strict constraints on the topology of the graph. However, the gradient... Possibly The presence of a negative component in the direction of X0 can lead to deviations from the data manifold defined by P(X0). To address this issue, embodiments of this application... Subtracting the negative components to enhance the effectiveness of the final denoising result can be expressed as:
[0100]
[0101] in, Incorporating manifold constraints during diffusion model encoding can improve the effectiveness of optimization results for both single-objective and multi-objective optimization tasks.
[0102] The intermediate steps introduced during the backdiffusion process serve as a medium connecting the initial molecule with the molecule possessing the target properties. In contrast to generation methods that sample from white noise, the intermediate molecule structure representation preserves the basic structural information of the original molecule. Furthermore, in the subsequent backward optimization process, textual hints are added at each step, which can be represented as:
[0103] q θ (M t-1 |M t )→q θ (M t-1 |M t ,y)=p(y,t)·q θ (M t-1 |M t )
[0104]
[0105] In some embodiments, to establish the zero-shot generalization capability of a molecular generation model, before training the molecular generation model, a target dataset can be obtained by deleting a set number of 2D and 3D molecular maps of molecules from the training dataset. A validation dataset is then generated based on these target molecular maps. The molecular generation model to be trained is then trained using the target dataset to obtain a trained model to be validated. The model to be validated is then validated using the validation dataset. If the validation passes, the model to be validated is adopted as the molecular generation model. For example, the set number can be 200. For instance, 200 molecules can be deleted from the training dataset, and the molecular generation model can be trained using the remaining 2D and 3D molecular maps. Then, the trained molecular generation model can be validated using the deleted 200 molecules to ensure that the molecular generation model has zero-shot generalization capability, performs well in handling unseen categories and tasks, can be optimized for various types of molecules, and that the optimization results are diversified due to different input molecules, different hints, and different parallel runs, enabling the molecular generation model to effectively improve its hit rate through diversity optimization. The effect is particularly evident in zero-sample scenarios, which broadens the application of deep learning in new drug design goals and prediction of complex biological activities.
[0106] To adapt to the diverse needs of different application scenarios, different downstream tasks, i.e., different training objectives, can be designed when training the molecular generation model. For example, in some embodiments, multiple optimization objective description texts may include optimization objective description texts that do not explicitly specify the positions of atoms and their bonds to be optimized. The molecular generation model trained based on multiple optimization objective description texts can flexibly optimize molecules without limiting the positions of the atoms and their bonds to be optimized, such as... Figure 4 As shown in (a) above. In other embodiments, the multiple optimization target description texts may include optimization target description texts with molecular structure constraints, for example, optimization target description texts indicating that the atomic structure at specified positions of the molecule cannot be changed, such as... Figure 4 As shown in (b) above, a molecular generation model trained based on multiple optimization target description texts can be used for molecular optimization with structural constraints. In other embodiments, the multiple optimization target description texts may include optimization target description texts that precisely indicate the optimization location. A molecular generation model trained based on multiple optimization target description texts can be used to optimize the structure at a specified location in a molecule, such as... Figure 4 As shown in (c) and (d) in the figure.
[0107] In some embodiments, 18 optimization tasks were designed, covering both 2D and 3D related optimizations. These tasks encompass a wide range of molecular energy and structural properties. Clearly, the molecular generation model of this embodiment consistently achieved excellent hit rates across most of the 18 tasks. This observation highlights the effectiveness and benefits of incorporating the 3D structure of molecules into the diffusion model and aligning the chemical space with the semantic space, thereby facilitating the exploration of output molecules that meet the desired properties. The integration of the 3D structure of molecules also provides additional navigation for exploring the accessible chemical space. The diversity of optimization results due to different input molecules, different hints, and different parallel runs allows the molecular generation model of this embodiment to effectively improve hit rates through multi-run optimization.
[0108] Exemplarily, in one embodiment, the optimization task can be a single-objective molecular optimization. In single-objective molecular optimization, modifications to the molecular structure include the addition, removal, and replacement of functional groups or molecular cores, frequently resulting in rearrangements of the molecular skeleton, as this embodiment can manipulate three-dimensional structures. For example, highly electronegative atoms have greater electron affinity, thus lowering the overall electronic energy level, while low electronegativity atoms do the opposite. In response to tasks such as increasing HOMO and LUMO energy levels, the molecular generation model provided in this embodiment removes highly electronegative atoms and functional groups, such as fluorine and chlorine atoms, as well as sulfonone and isoxazole groups, from the input initial molecule. Conversely, in tasks requiring lower electronic energy levels, the introduction of highly electronegative functional groups or atoms can widen the HOMO-LUMO gap by replacing the isoxazole group with a saturated chain, or narrow the HOMO-LUMO gap by introducing a double bond conjugated with a carbonyl group. This is because introducing or removing conjugated structures can lead to denser or sparser electronic energy levels, thus resulting in a wider or narrower HOMO-LUMO gap. Water solubility can be adjusted by adding and removing hydrogen-bonding groups, such as hydroxyl and amine groups, increasing and decreasing it respectively. Regarding molecular polarity, optimizations such as replacing sulfur atoms with nitrogen atoms increase bond polarity and enhance overall polarity, while removing polar carbonyl groups decreases polarity.
[0109] In another embodiment, the optimization task can be based on molecular optimization of binding affinity. For example... Figure 5 As shown, when the target molecule description text indicates "This molecule tested positive in assays of enzyme protein inhibitors and substrates. It uses molecular oxygen to insert one oxygen atom into the matrix and reduces a second oxygen atom to a water molecule," Figure 5 The target molecules output in groups (a) and (b) have low docking scores, verifying that the ligands generated by the molecular generation model provided in this application can bind more tightly to the receptor. Figure 5 In (a) of the example, the docking score of the initial input molecule is -7.3, and the docking score of the target output molecule is -8.8. Figure 5 In (b), the docking score of the initial molecule is -7.8, and the docking score of the target molecule is -9.3.
[0110] In another embodiment, the optimization task can be multi-objective molecular optimization. Water solubility and polarity are two positively correlated properties. Therefore, the molecular generation model provided in this application converts the 2-oxo-1-pyridine group into a phenyl group, reducing the solubility and polarity of the input initial molecule. Conversely, when given the opposite cue, the molecular generation model provided in this application can add a hydroxyl group to the input initial molecule, increasing both solubility and polarity. In multi-objective tasks that improve solubility and polarity, 46% of molecules showed an increase in solubility, while 31.5% showed an increase in both properties, higher than the hit rate of single-objective solubility improvement tasks. This suggests that incorporating polarity into the cue helps to better regulate solubility. One possible reason is that the molecular generation model provided in this application allows for more flexible regulation of polarity. When addressing cuees related to molecular conformation, the molecular generation model provided in this application cleverly achieves the objective by manipulating the 3D structure, going beyond functional group-level modifications. Figure 6 As shown in (a), when the target molecule description text indicates "this molecule is low polarity," a hydroxyl group is added to the molecule. Due to the reverse arrangement, it neutralizes the dipole of the neighboring hydroxyl group, as indicated by the arrow. Therefore, the molecule's dipole moment decreases from 1.898 Debye to 0.914 Debye. Figure 6 As shown in (b), when the target molecule description text indicates "this molecule has high polarity", the output target molecule discards two CF bonds, canceling the dipole of the pyridine ring. The removal of CF bonds and the introduction of aligned hydroxyl groups increase the molecule's dipole moment from 0.467 Debye to 0.905 Debye. Figure 6 The upper part of the model represents a two-dimensional graphic of the molecule, while the lower part represents its three-dimensional conformation. For example, when instructed to reduce the polarity of the input molecule, the molecular generation model provided in this application strategically adds a polar hydroxyl group, such as... Figure 6 As shown in (a) of the diagram. The added hydroxyl group spatially cancels the dipole moment of another existing CO bond, resulting in a decrease in the total dipole moment. In another example, when the task is to increase the polarity of a molecule containing six heteroatoms (including two fluorine atoms), the molecular generation model provided in this application removes the highly polar CF bond and outputs a molecule containing four heteroatoms, as shown in (a). Figure 6 As shown in (b) of this paper, in the stable conformation, the two CF bonds are opposite to the dipole of the pyridine ring. Therefore, replacing the CF bonds with hydroxyl groups that are more aligned with the pyridine dipole effectively increases the polarity. These examples demonstrate the ability of the molecular generative models provided in the embodiments of this application to understand the entire molecule, including transient conformational information, which is a key aspect of accurate task execution.
[0111] While flexible optimization scenarios offer the greatest optimization diversity within chemical space, in some cases it is necessary to preserve specific substructures. Formally, this involves breaking down the molecule into two disjoint parts: and in This represents the substructure to be protected. Therefore, from recovering A∈(A 0 Transformation into conditional density Since P is fixed, the gradient required during the optimization process becomes:
[0112]
[0113] The substructures to be protected in the above process It is specified to include all core structures, but excludes hydrogen atoms or other removable atoms. By optimizing only predefined removable atoms, the goal is to maintain the integrity of the molecular backbone, emphasizing the influence of non-hydrogen components, which play a key role in defining the chemical properties and function of the original molecule.
[0114] In another embodiment, the optimization task can be stereochemical constraint optimization of the template molecule. The following case study on tetraphenylsilane demonstrates the capability of the molecular generation model provided in this application for such a task. The non-coplanar benzene rings in tetraphenylsilane are an ideal structural feature for optical materials with high refractive indices and low birefringence (birefringence). The benzene rings contribute to strong refractive power. The non-coplanar configuration hinders π-π stacking, preventing the formation of layered structures and thus reducing birefringence. To generate more candidate molecules with satisfactory configurations, this application spatially fixes the benzene rings in the tetraphenylsilane molecule and diffuses a central silicon atom. The structural constraints are removed in the final step of the denoising process. The effectively generated structures are examined by density functional theory calculations. Most structures connect the four benzene rings through the generated central group, maintaining the non-coplanarity of the benzene rings.
[0115] In another embodiment, the optimization task can be molecular optimization related to redox potential. The application of the molecular generation model provided in this application can be extended to a wider range of physicochemical tasks, illustrated here by example in optimizing the performance of input molecules in terms of redox potential. In energy storage, increasing the energy density of a battery requires increasing the voltage, which necessitates electrolyte molecules with a broad electrochemical window. In some embodiments, the oxidation potential of thiophene, a typical electrolyte additive, can be increased while its reduction potential is decreased. Thiophene is a commonly used structure in lithium-ion battery electrolyte additives. To enhance the resistance of thiophene to high voltage, this application applies the cue “this molecule has a low HOMO (highest occupied molecular orbital) value and a high oxidation potential,” while constraining all atoms except hydrogen. A comparative experiment without the cue is used as a baseline. With the cue, 19.5% of the generated derivatives showed an increased oxidation potential, compared to 12.3% without the cue. Similar experiments were performed with phosphates, which are commonly used in electrolytes to improve battery stability at high temperatures. The success rate with the cue was 8.12%, compared to 5.66% without the cue. To illustrate the modification of the reduction potential, embodiments of this application use quinoline, which is relevant to redox flow batteries. By constraining all atoms except hydrogen atoms and using appropriate hints, embodiments of this application successfully modified the reduction potential in two directions. In the more desirable direction of reducing the reduction potential, embodiments of this application achieved a success rate of 69.1%.
[0116] After model training is complete, the electronic device can use the trained molecular generation model to perform molecular optimization tasks. The electronic device performing the molecular optimization task can be the same as or a different electronic device used for model training. For example... Figure 7 As shown, the process of an electronic device performing a molecular optimization task may include the following steps:
[0117] S701 inputs the two-dimensional and three-dimensional molecular graphs of the initial molecule into the graph encoder, and extracts features from the two-dimensional and three-dimensional molecular graphs to obtain the molecular structure features of the initial molecule.
[0118] The electronic device uses a graph encoder to process the two-dimensional and three-dimensional molecular graphs of the initial molecule to obtain a potential representation of the molecular structure, namely the molecular structural features of the initial molecule.
[0119] S702, Input the target molecule description text into the text encoder, and extract features from the target molecule description text through the text encoder to obtain text features.
[0120] The target molecule description text contains optimization targets. An electronic device uses a text encoder to process the target molecule description text, obtaining its potential representation, i.e., text features. This application decouples the processing of the initial molecule's two-dimensional and three-dimensional molecular diagrams from the processing of the target molecule description text. A chemical structure encoder processes the initial molecule's two-dimensional and three-dimensional molecular diagrams, while a text encoder processes the target molecule description text.
[0121] In some embodiments, the text encoder may include a parse tree and an LLM (Limited Language Model). An electronic device can input the target molecular description text into the parse tree, segment the target molecular description text using the parse tree to obtain multiple keywords, concatenate these keywords with the target molecular description text, and input the concatenation into the LLM to obtain the text features output by the LLM.
[0122] S703 inputs molecular structure features and text features into the diffusion model. The diffusion model then adjusts the molecular structure features based on the text features to obtain the molecular structure of the target molecule.
[0123] The diffusion model includes a feature fusion module and a structure adjustment module. The electronic device inputs molecular structural features and textual features into the feature fusion module, which fuses these features to obtain a feature fusion vector. This vector is then input into the structure adjustment module, which generates the molecular structure of the target molecule based on the feature fusion vector. The structure adjustment module includes a manifold constraint function; this function ensures the target molecule's molecular structure conforms to a predetermined three-dimensional structure.
[0124] The molecular structure of the target molecule output by the diffusion model includes a portion of the initial molecule's molecular structure. For example, if the target molecule description precisely indicates the optimized position, the structure of other positions in the target molecule, except for the optimized position, is the same as the initial molecule's molecular structure. If the target molecule description indicates a position in the molecule that cannot be changed, then the structure of that position is the same as the initial molecule's molecular structure. For instance, when the target molecule description indicates optimization at the highest occupied molecular orbital (HOMO) energy, the optimized molecular structure of the target molecule is as follows: Figure 8 As shown in (a), when the target molecule description text indicates optimization for the lowest unoccupied molecular orbital (LUMO) energy, the optimized molecular structure of the target molecule is as follows: Figure 8 As shown in (b) of the diagram.
[0125] The molecular generation model provided in this application is 3DToMolo, a text-structure aligned symmetry diffusion framework for molecular generation and optimization tasks. It aims to coordinate diverse modalities, such as molecular structure and text descriptions, seamlessly aligning multiple modalities to produce molecular structures with desired symmetry and texture constraints. This application specifically targets the optimization of both 2D (atom type and chemical bond topology) and conformational (3D) aspects of molecules. Furthermore, the molecular optimization method provided in this application is compatible with a wide range of complex objectives, facilitating multi-objective guided optimization. The significant capabilities of LLM in the molecular generation model explore the feasibility of integrating attribute and structural descriptions into a unified text format. This application leverages the power of LLM to extract a unified representation from textual mixtures and achieves alignment within the textual and molecular structural representation spaces through contrastive training. The training process involves training representation pairs obtained from a lightweight LLM and a graph encoder specifically designed for molecules. Unlike generation methods sampling from white noise, the intermediate molecular representations retain the basic structural information of the original molecules. Moreover, the control over the text description is very fine-grained during subsequent inverse optimization. Molecular generative models not only possess inherent flexibility in optimizing entire molecular regions, but also demonstrate their powerful ability to preserve substructures in two real-world scenarios. In these instances, specific 3D structures are pre-fixed, and optimization is performed only within the remaining infill regions, highlighting the versatility and effectiveness of molecular generative models.
[0126] The method provided in this application can be applied to molecular optimization tasks in bioinformatics. Given an optimization target and a molecule to be optimized, it outputs an optimized molecule that meets diversity requirements and specific structural and texture constraints. Molecular optimization is a key task in drug discovery, chemical engineering, catalyst and polymer material design, creating opportunities for more detailed and effective exploration of a broad chemical space and opening up new frontiers for developing molecular entities with customized properties and functions.
[0127] For example, Figure 9 The effects of molecular optimization with structural constraints are shown. Figure 9 (a) in the text represents unconditional modification of the input molecular skeleton, and the bolded part marks the skeleton preserved in the output target molecule. Figure 9 In diagram (b), the internal region optimization of the molecule is shown. The initial molecule on the left is a swirl-chain conjugated molecule, tetraphenylsilane, with the central silicon atom diffused while the four benzene rings remain fixed until the final step of the denoising process. The right side shows two selected output structures, where the benzene rings are still non-coplanar. For clarity, hydrogen atoms are not shown. Figure 9 (c) represents the redox-related fast-driven molecular optimization for preserving the framework.
[0128] Figure 10 The effect of optimizing a specific position on a molecule is shown. Figure 10 (a) shows the molecular structure of penicillin. The molecule has a β-lactam ring in the middle, and the dashed arrows indicate nucleophilic attacks from oxygen atoms on the side chains to the β-lactam ring. The right-hand region shows the functional groups that need to be optimized. Figure 10 (b) is a representative example of the molecular optimization results given the prompt, with the right-hand region marked with modifications where the phenyl group is replaced by a more electron-withdrawing isoxazolyl group. Figure 10 (c) shows the three-dimensional structures of the penicillin molecule (top) and the isoxazole-substituted derivative (bottom). The numbers in the figure represent the partial charges attacking the oxygen atom, indicating that molecular optimization successfully reduced the electron density and nucleophilicity of the oxygen atom. Figure 10 (d) in the figure represents the molecular structure of triptolide, with the optimized sites marked in the upper region. Figure 10 (e) in the example represents a typical optimization of two modified side-chain connections. Both exhibit increased solubility and polarity under a given cue order. In this embodiment, the optimization task is hard-coded molecular optimization at a specified site. Optimizing precisely at a pre-specified optimization site is notoriously difficult for latent space-based molecular representations, primarily due to the lack of precise spatial decoding. On the other hand, several machine learning-based optimization site recognizers have been proposed, particularly tailored to domain-specific tasks. Since many of these recognizers are trained on well-defined datasets, and such detailed targets may be rare in textual representations of molecular structures, molecular generation models face obstacles in automatically identifying the desired optimization sites solely from textual cues. Therefore, embodiments of this application adapt molecular generation models for hard-coded optimization at pre-specified sites. From a methodological perspective, the 3D location of the specified site is utilized during the hard-coded optimization process. The capabilities of the molecular generation model of embodiments of this application are demonstrated on two example drug molecules, penicillin and homoharringtonine. For penicillin, the key β-lactam ring is susceptible to binding by β-lactamases and acidic hydrolysis, such as... Figure 10As shown in (a) of the diagram. One proposed mechanism suggests that the initial nucleophilic attack is carried out by the oxygen atom in another amide group against the carbonyl group in the β-lactam ring. Therefore, an effective strategy is to replace the benzyl group with a strong electron-attracting functional group with a large steric volume to hinder the binding of the lactamase and reduce the nucleophilicity of the attacking oxygen atom. The penicillin molecule was optimized while maintaining the structural constraints of the entire molecule, indicated by "this molecule has a large electron-attracting group", with all parts except the benzyl group remaining unchanged. In the optimized structures, 23% successfully showed a reduction in the electron density of the attacking oxygen atom as revealed by DFT calculations, and 43% of the structures had a ring with at least five members, indicating a significant steric effect. Figure 10 A representative result is shown in (b) and (c) where the benzyl group is replaced by a more electron-attracting isoxazole group. It is noteworthy that semi-synthetic penicillin series, such as piperazine, have been recognized as having better resistance to acids and β-lactamases.
[0129] The embodiments of this application use publicly available molecular datasets to compare the effects of related technologies and the methods of this application. The comparison results are shown in Table 1. As can be seen from Table 1, the method of the embodiments of this application has the best overall effect.
[0130] Table 1
[0131]
[0132] This application employs a molecular generation model to optimize the initial molecule requiring optimization through a conditionally guided denoising process, outputting a target molecule based on text prompts. This application describes molecular optimization as a multimodal guided optimization task, effectively coordinating data from two different modalities: molecular diagrams and text descriptions. It guides the optimization of existing lead compounds' properties, systematically improving molecular structures using experimental data and medicinal chemistry expertise. This preserves the molecule's main framework, resulting in drug candidates with better-defined pharmacological properties and higher clinical trial success rates. Unlike models that generate molecules from zero samples in no-information noise (such as normalized flow, GANs, and VAEs), effective automated molecular optimization requires learning the differences in molecular distribution before and after optimization to conform to preferred properties. On the one hand, related technologies guide attribute-oriented transformations through vector motion in latent space. Since the transformation occurs in latent space rather than the actual 3D molecular space, this method may encounter diversity collapse problems, potentially leading to the loss of crucial molecular structural information. This application, however, combines 3D molecular structure for optimization, improving the accuracy of the predicted target molecule's molecular structure and the molecule's synthetic probability. On the other hand, implicit search-based methods in related technologies, such as reinforcement learning and MCTS, require expert-designed optimization paths. Optimization paths are crucial when training the reward function, ensuring its consistency with fixed properties and formulating policies for molecular modifications. In practice, optimization sites, such as optimal sidechains, need to be identified at each step. This approach can be limited by a lack of flexibility, as predefined optimization path data may fail to capture the inherent diversity and subtle possibilities in molecular optimization. The embodiments of this application allow for more flexible molecular optimization and can improve the generalization ability of molecular generation models in zero-shot scenarios. With limited training data, molecular generation models perform well when handling unseen categories and tasks.
[0133] This application also provides an electronic device that can be used to implement the above. Figure 1 The method embodiments shown can achieve the beneficial effects of the above-described method embodiments by providing the functionality of the methods described above.
[0134] In some embodiments, the structure of the electronic device 1100 can be as follows: Figure 11As shown, the system includes a processor 1110 and a memory 1120 connected to the processor 1110. The processor 1110 and the off-chip memory 1120 can be interconnected via a bus. The processor 1110 can be a general-purpose processor, such as a microprocessor, or other conventional processor. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be a control bus, a system bus, or a data bus.
[0135] The memory 1120 can be used to store model parameters of the molecular generation model and data generated and used during the execution of the molecular structure determination method by the processor 1110. The memory 1120 can also be used to store software programs and modules. The processor 1110 executes various functional applications and data processing of the electronic device 1100 by running the software programs and modules stored in the memory 1120, such as the molecular structure determination method provided in the embodiments of this application.
[0136] The memory 1120 may include a program storage area and a data storage area. The program storage area may store the operating system, application programs of at least one application, etc.; the data storage area may be used to store user data, intermediate data generated during molecular optimization, etc. In addition, the memory 1120 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0137] The processor 1110 in the electronic device 1100 is used to run computer instructions or programs stored in the memory 1120 to perform the functions described in any of the above method embodiments. In some embodiments, the processor 1110 may include one or more processing units, such as a central processing unit (CPU), graphics processing unit (GPU), application processor (AP), image signal processing unit (ISP), microprocessor (MP), controller, video codec, baseband processor, embedded neural network processing unit (NPU) in the field of AI, or digital signal processor (DSP), etc. Different processors may be independent devices, such as independent chips, or they may be integrated into the same chip. Different processing units may be independent devices or they may be integrated into one or more processors. The processor 1110 may also include a controller, which can generate operation control signals according to the instruction opcode and timing signals to complete the control of instruction fetching and execution.
[0138] In some embodiments, the processor 1110 can input the two-dimensional and three-dimensional molecular diagrams of the initial molecule into a graph encoder, extract features from the two-dimensional and three-dimensional molecular diagrams using the graph encoder to obtain the molecular structural features of the initial molecule, input the target molecule text into a text encoder, extract features from the text describing the target molecule to obtain text features, and input the molecular structural features and text features into a diffusion model. The diffusion model adjusts the molecular structural features based on the text features to obtain the molecular structure of the target molecule. This process, in optimizing the molecular structure, considers not only the two-dimensional structure of the molecule but also its three-dimensional structure, optimizing the molecule based on both the two-dimensional and three-dimensional structures. The molecular structural information utilized is more complete, thus improving the accuracy of the predicted molecular structure of the target molecule.
[0139] It is understood that the structures illustrated in the embodiments of this application do not constitute a specific limitation on the terminal device. In other embodiments of this application, the electronic device may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0140] This application also provides a molecular structure determination device, which can be applied to an electronic device, such as a computer, tablet computer, laptop computer, vehicle terminal, or server, such as a cloud server. In some embodiments, such as Figure 12 As shown, the molecular structure determination device 1200 may include a feature extraction unit 1201 and a structure generation unit 1202. The molecular structure determination device 1200 can be used to implement... Figure 7 The method embodiments shown can achieve the beneficial effects of the above-described method embodiments by providing the functionality of the methods described above.
[0141] The feature extraction unit 1201 can be used to input the two-dimensional and three-dimensional molecular diagrams of the initial molecule into the graph encoder, and extract features from the two-dimensional and three-dimensional molecular diagrams through the graph encoder to obtain the molecular structure features of the initial molecule; input the target molecule description text into the text encoder, and extract features from the target molecule description text through the text encoder to obtain text features; the structure generation unit 1202 can be used to input the molecular structure features and text features into the diffusion model, and adjust the molecular structure features based on the text features through the diffusion model to obtain the molecular structure of the target molecule.
[0142] In some embodiments, the text encoder includes a parsing tree and a large language model (LLM); the feature extraction unit 1201 is specifically used to: input the target molecular description text into the parsing tree, segment the target molecular description text through the parsing tree to obtain multiple keywords; concatenate the multiple keywords with the target molecular description text, and input them into the LLM to obtain the text features encoded by the LLM.
[0143] In some embodiments, the diffusion model includes a feature fusion module and a structure adjustment module; the structure generation unit 1202 can be specifically used to: input molecular structure features and text features into the feature fusion module, perform feature fusion on the molecular structure features and text features through the feature fusion module to obtain a feature fusion vector; input the feature fusion vector into the structure adjustment module, and generate the molecular structure of the target molecule based on the feature fusion vector through the structure adjustment module.
[0144] It should be noted that, in some embodiments, the feature extraction unit 1201 can be used to execute any step in the molecular structure determination method, and the structure generation unit 1202 can also be used to execute any step in the molecular structure determination method. The steps implemented by the feature extraction unit 1201 and the structure generation unit 1202 can be specified as needed. The feature extraction unit 1201 and the structure generation unit 1202 respectively implement different steps in the molecular structure determination method to achieve all the functions of the molecular structure determination device. The molecular structure determination device 1200 can also employ more or fewer functional modules to achieve the functions of the molecular structure determination device 1200.
[0145] In the embodiments of this application, the functional modules can be integrated into a single processor, or each module can exist physically separately, or two or more modules can be integrated into a single module. The integrated modules can be implemented in hardware or as software functional modules.
[0146] This application also provides a chip that can be used to implement the functions of the above method embodiments, and thus can achieve the beneficial effects of the above method embodiments.
[0147] In some embodiments, the structure of the chip 1300 can be as follows: Figure 13 As shown, the system includes a processor 1301 and a power supply circuit 1302 connected to the processor 1301. The processor 1301 and the power supply circuit 1302 can be interconnected via a bus. The processor 1301 can be a digital signal processor (DSP), ASIC, field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or other specific integrated circuits. The bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus can be categorized as an address bus, data bus, control bus, etc. The power supply circuit 1302 supplies power to the processor 1301 via the bus.
[0148] The processor 1301 can be connected to a memory located outside the chip or to a memory located inside the chip, and run software programs and modules stored in the memory to perform various functional applications and data processing of the chip 1300, such as the molecular structure determination method provided in the embodiments of this application, so as to improve the accuracy of the predicted molecular structure of the target molecule.
[0149] In some embodiments, the processor 1301 may include one or more processing units, which may be independent devices or integrated into one or more processors. The processor 1301 may also include a controller, which can generate operation control signals according to the instruction opcode and timing signals to control the instruction fetching and execution.
[0150] The method steps in the embodiments of this application can be implemented in hardware or by a processor executing a computer program or instructions. The computer program or instructions can constitute a computer program product.
[0151] This application also provides a computer program product comprising computer-executable instructions. In one embodiment, the computer-executable instructions are used to cause a computer to perform the functions described in the method embodiments above.
[0152] Computer-executable instructions can be stored in a computer-readable storage medium. This application also provides a computer-readable storage medium storing executable instructions. In one embodiment, the computer-executable instructions are used to cause a computer to perform the functions described in the method embodiments above.
[0153] The computer-readable storage medium provided in the embodiments of this application may be random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), register, hard disk, portable hard disk, CD-ROM, or any other form of computer-readable storage medium known in the art.
[0154] Computer-executable instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another. For example, the computer program or instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that a computer can access, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; it can also be an optical medium, such as a digital video disc (DVD); or it can be a semiconductor medium, such as a solid-state drive.
[0155] One or more of the above modules or units can be implemented by software, hardware, or a combination of both. When any of the above modules or units is implemented by software, the software exists as computer program instructions and is stored in memory. The processor can be used to execute the program instructions and implement the above method flow. The processor can include, but is not limited to, at least one of the following: CPU, microprocessor, digital signal processor (DSP), microcontroller unit (MCU), or artificial intelligence processor, etc., various computing devices that run software. Each computing device may include one or more cores for executing software instructions to perform calculations or processing. The processor can be built into a SoC, DPU, or ASIC, or it can be a separate semiconductor chip. In addition to the cores for executing software instructions to perform calculations or processing, the processor may further include necessary hardware accelerators, such as FPGAs, PLDs, or logic circuits that implement dedicated logic operations.
[0156] When the above modules or units are implemented in hardware, the hardware can be any one or any combination of CPU, microprocessor, DSP, MCU, artificial intelligence processor, ASIC, SoC, FPGA, PLD, special purpose digital circuit, hardware accelerator or non-integrated discrete device, which can run the necessary software or perform the above method flow independently of software.
[0157] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the scope of the technology disclosed in this application, and these modifications or substitutions should all be covered within the scope of protection of this application.
Claims
1. A method for determining molecular structure, characterized in that, The method includes: The two-dimensional and three-dimensional molecular maps of the initial molecule are input into the graph encoder, and the graph encoder performs feature extraction on the two-dimensional and three-dimensional molecular maps to obtain the molecular structure features of the initial molecule. The target molecule description text is input into a text encoder, and the text encoder extracts features from the target molecule description text to obtain text features; The molecular structure features and the text features are input into a diffusion model. The diffusion model adjusts the molecular structure features based on the text features to obtain the molecular structure of the target molecule.
2. The method according to claim 1, characterized in that, The text encoder includes a parsing tree and a large language model (LLM); the process of inputting the target molecule description text into the text encoder and extracting features from the target molecule description text through the text encoder to obtain text features includes: The target molecule description text is input into the parsing tree, and the parsing tree is used to segment the target molecule description text to obtain multiple keywords; The multiple keywords are concatenated with the target molecule description text and input into the LLM to obtain the text features encoded by the LLM.
3. The method according to claim 1 or 2, characterized in that, The diffusion model includes a feature fusion module and a structure adjustment module; the process of inputting the molecular structure features and the text features into the diffusion model, and adjusting the molecular structure features based on the text features to obtain the molecular structure of the target molecule, includes: The molecular structure features and the text features are input into the feature fusion module, and the feature fusion module performs feature fusion on the molecular structure features and the text features to obtain a feature fusion vector; The feature fusion vector is input into the structure adjustment module, which then generates the molecular structure of the target molecule based on the feature fusion vector.
4. The method according to claim 3, characterized in that, The structure adjustment module includes a manifold constraint function; the manifold constraint function is used to make the molecular structure of the target molecule conform to a set three-dimensional structure.
5. The method according to any one of claims 1 to 4, characterized in that, The molecular structure of the target molecule includes a portion of the molecular structure of the initial molecule.
6. The method according to any one of claims 1 to 5, characterized in that, The graph encoder, the text encoder, and the diffusion model belong to the molecular generation model; the molecular generation model is trained based on a training dataset, which includes two-dimensional molecular graphs, three-dimensional molecular graphs, and multiple optimization target descriptive texts for various molecules.
7. The method according to claim 6, characterized in that, The training process of the molecular generation model includes: The target dataset is obtained by deleting a set number of two-dimensional and three-dimensional molecular maps of molecules from the training dataset. Based on the set number of molecules, two-dimensional and three-dimensional molecular diagrams are generated to create a verification dataset. The target dataset is used to train the model to be trained, resulting in a trained model to be validated. The model to be validated is validated using the validation dataset. If the validation passes, the model to be validated is adopted as the molecular generation model.
8. A molecular structure determination device, characterized in that, The device includes: The feature extraction unit is used to input the two-dimensional molecular map and the three-dimensional molecular map of the initial molecule into the graph encoder, and extract features from the two-dimensional molecular map and the three-dimensional molecular map through the graph encoder to obtain the molecular structure features of the initial molecule; and to input the target molecule description text into the text encoder, and extract features from the target molecule description text through the text encoder to obtain the text features. The structure generation unit is used to input the molecular structure features and the text features into the diffusion model, and to adjust the molecular structure features based on the text features through the diffusion model to obtain the molecular structure of the target molecule.
9. The apparatus according to claim 8, characterized in that, The text encoder includes a parsing tree and a large language model (LLM); the feature extraction unit is specifically used for: The target molecule description text is input into the parsing tree, and the parsing tree is used to segment the target molecule description text to obtain multiple keywords; The multiple keywords are concatenated with the target molecule description text and input into the LLM to obtain the text features encoded by the LLM.
10. The apparatus according to claim 8 or 9, characterized in that, The diffusion model includes a feature fusion module and a structure adjustment module; the structure generation unit is specifically used for: The molecular structure features and the text features are input into the feature fusion module, and the feature fusion module performs feature fusion on the molecular structure features and the text features to obtain a feature fusion vector; The feature fusion vector is input into the structure adjustment module, which then generates the molecular structure of the target molecule based on the feature fusion vector.
11. An electronic device, characterized in that, The device includes at least one processor and at least one memory; wherein the one or more memories store one or more computer programs, the one or more computer programs including instructions that, when executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1 to 7.
12. A chip, characterized in that, It includes a processor and a power supply circuit; the power supply circuit is used to supply power to the processor, and the processor is used to execute a computer program to implement the method as described in any one of claims 1 to 7.
13. A computer-readable storage medium, characterized in that, The device stores computer-executable instructions for causing a computer to perform the method as described in any one of claims 1 to 7.
14. A computer program product, characterized in that, It includes computer-executable instructions for causing a computer to perform the method as described in any one of claims 1 to 7.