Drug molecule generation method and device based on latent space multi-constraint diffusion model

By using a loop-graph neural network and a latent space multi-constraint diffusion model, the problem of insufficient topological property capture in drug molecule design by graph neural networks is solved, resulting in more reasonable molecular structures and properties, thus addressing the issue of poor generation quality in existing technologies.

CN122314152APending Publication Date: 2026-06-30UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610415193.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-03-31
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing graph neural network models struggle to effectively capture the topological properties of molecular graphs in drug molecule design, and directly applying diffusion models to discrete graph structures results in poor data adaptability, affecting the quality of generated data.

Method used

A latent space-based multi-constraint diffusion model is adopted, which learns the molecular topological properties through a loop-graph neural network and combines it with a latent space adaptive multi-constraint diffusion model to generate new drug molecules. The constraint weights are adjusted by using message passing inside and outside the loop and an adaptive mechanism to ensure the balance of structure and properties of the generated molecules.

Benefits of technology

The graph neural network's ability to capture molecular topological properties has been improved, resulting in molecules that achieve a better balance while satisfying various property constraints, thus improving the quality of the generated molecules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122314152A_ABST
    Figure CN122314152A_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for drug molecule generation based on a latent space multi-constraint diffusion model, relating to the field of smart medical technology. The method includes: S1, obtaining the two-dimensional structure of a known molecule and representing it as an initial feature matrix and adjacency matrix; S2, learning the two-dimensional structural features of the known molecule, obtaining the final feature matrix, and converting it into a latent space; S3, constructing and optimizing the latent space multi-constraint diffusion model; S4, generating a new hidden space; S5, analyzing the new hidden space to generate a new atom list and a new adjacency matrix, obtaining a new molecule; S6, analyzing whether the new molecule is a valid molecule and outputting the generation result. This method solves the problem that current graph neural network models cannot capture the unique topological properties of molecular graphs well; and avoids the problem of poor data adaptability that occurs when performing a latent space multi-constraint diffusion model directly on a discrete graph structure, enabling the generated molecule to achieve a balance between various attributes while satisfying each attribute constraint.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart medical technology, and in particular to a method and apparatus for generating drug molecules based on a potential spatial multi-constraint diffusion model. Background Technology

[0002] Drug discovery is an extremely complex, time-consuming, and costly undertaking. Traditional drug discovery processes often rely on extensive trial-and-error experiments (such as high-throughput screening) to search for potential therapeutic "prospect compounds" from a vast library of compounds. This process is not only inefficient (averaging 10-15 years and costing over $1 billion), but also has a very low success rate, with approximately 90% of candidate drugs failing in clinical trials and regulatory approval. A major challenge is obtaining new, effective, and selective molecules that can effectively modulate the function of target proteins or pathways, thereby alleviating or curing diseases. Early on, medicinal chemists played a crucial role in designing new molecules, relying on their extensive knowledge and experience to formulate hypotheses and design new compounds. However, due to the complexity of chemical space and the challenges of multi-parameter optimization, relying solely on the experience of domain experts for molecule design is time-consuming and labor-intensive. In recent years, deep learning-based drug molecule design has gained increasing attention because it significantly reduces the time, money, and labor costs associated with developing new drugs.

[0003] O. Mahmood, E. Mansimov, R. Bonneau, et al. Masked graph modeling for molecule generation[J]. Nature Communications, 2021, 12:3156. This paper proposes a drug molecule generation method based on masked graph modeling (MGM). By randomly masking atoms / bonds in the molecular graph, a graph neural network is used to learn the conditional distribution and iteratively reconstruct the molecule. This method achieves a better tradeoff between distribution similarity and novelty while ensuring molecular validity. It achieves good validity and uniqueness scores on the QM9 and ChEMBL datasets, outperforming most baseline graph generation models. However, for large molecules (such as those on the ChEMBL dataset), the high masking rate leads to abnormal graph density, affecting the generation quality. In addition, ordinary graph neural networks lack the ability to model complex molecular topologies and are poor at capturing topological properties such as molecular ring structures. Summary of the Invention

[0004] The purpose of this invention is to design a method and apparatus for drug molecule generation based on a potential space multi-constraint diffusion model in order to solve the above problems.

[0005] The present invention achieves the above objectives through the following technical solutions:

[0006] Drug molecule generation methods based on latent spatial multi-constraint diffusion models include:

[0007] S1. Obtain the two-dimensional structure of a known molecule and represent the two-dimensional structure as an initial characteristic matrix. and adjacency matrix Where d represents the embedding dimension and n represents the number of atoms contained in a known molecule;

[0008] S2. Use a ring-graph neural network to learn the two-dimensional structural features of known molecules, obtain the final feature matrix, and transform it into a global latent space Z;

[0009] S3. Construct an initial latent space multi-constraint diffusion model, and use the training dataset to train and optimize the initial latent space multi-constraint diffusion model to obtain an optimized latent space multi-constraint diffusion model.

[0010] S4. Generate a new hidden space using the optimized latent space multi-constraint diffusion model. ;

[0011] S5. Analyze new hidden spaces This generates a new list of atoms and a new adjacency matrix A, resulting in a new molecule.

[0012] S6. Analyze whether the new molecule is an effective molecule and output the generation result.

[0013] A drug molecule generation device based on a potential space multi-constraint diffusion model includes:

[0014] Storage; storage is used to store computer programs;

[0015] An actuator; the actuator is used to execute a computer program in a storage device, which, when executed, implements the drug molecule generation method based on a potential space multi-constraint diffusion model as described above.

[0016] The beneficial effects of this invention are as follows: This method solves the problem that current graph neural network models cannot capture the unique topological properties of molecular graphs well; and avoids the problem of poor data adaptability that occurs when performing diffusion models directly on discrete graph structures, so that the generated molecules can achieve a balance between various properties while satisfying the constraints of each property. Attached Figure Description

[0017] Figure 1 This is a flowchart of the drug molecule generation method based on the potential space multi-constraint diffusion model of the present invention during the generation stage;

[0018] Figure 2This is a schematic diagram of the message passing phase within the loop in this invention. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present 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 the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0020] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0021] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0022] In the description of this invention, it should be understood that the terms "upper," "lower," "inner," "outer," "left," "right," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship commonly used when the product of this invention is in use, or the orientation or positional relationship commonly understood by those skilled in the art. They are only used to facilitate the description of this invention and to simplify the description, and are not intended to indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this invention.

[0023] Furthermore, the terms "first," "second," etc., are used only to distinguish descriptions and should not be interpreted as indicating or implying relative importance.

[0024] In the description of this invention, it should also be noted that, unless otherwise explicitly specified and limited, terms such as "set" and "connection" should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.

[0025] The specific embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0026] like Figure 1As shown, the drug molecule generation method based on the latent space multi-constraint diffusion model includes:

[0027] S1. Obtain the two-dimensional structure of a known molecule and represent the two-dimensional structure as an initial characteristic matrix. and adjacency matrix Where d represents the embedding dimension and n represents the number of atoms in the known molecule; for each atom, the concatenation of one-hot embeddings of atom type, atom connectivity, number of hydrogen atoms, and implicit valence state is used as its initial feature matrix; for the adjacency matrix... Each element in the list has: .

[0028] S2. A ring-graph neural network is used to learn the two-dimensional structural features of a known molecule, obtaining the final feature matrix and transforming it into a global latent space Z. The ring-graph neural network includes two stages: inter-neighbor message passing in S21 and intra-ring message passing in S22-S25. Intra-ring message passing is as follows... Figure 2 As shown, loop-graph neural networks can better capture the unique topological properties of molecular graphs; specifically including:

[0029] S21. Using an adjacency matrix, the eigenvectors of each atom v in the known two-dimensional structure of a molecule are transformed into eigenvectors of the adjacency matrix. Perform message passing between neighbors, generating atom v at time step eigenvectors ;

[0030] S22. Use the Chem.GetSymmSSSR() function in the RDKit tool to find all rings within the molecule and return a list of atomic indices for each ring, represented as C= ,in and These represent the first and last node atoms on the ring, respectively.

[0031] S23. Define a node c for each ring to represent the ring, and the eigenvector of the node atom u on the ring is: Then the initial characteristics of node c are expressed as: Where Avg represents the average aggregation function;

[0032] S24, Update step c at time step eigenvectors at time Specifically:

[0033] ① Calculate the message of node atom u on the ring. , is represented as: ,in, This indicates that node atom u is at time step eigenvectors, This indicates that node c is at time step eigenvectors;

[0034] ② Aggregate messages from all atomic nodes on node c to obtain the aggregated message. , is represented as: ;

[0035] ③ Based on aggregated messages and node c at time step eigenvectors Update point c at time step eigenvectors , is represented as: ;

[0036] S25, All node atoms on this ring are linked by the eigenvector of node c. eigenvectors of node atom u To update its time step The eigenvector at +1 , is represented as: MLP stands for Multilayer Perceptron;

[0037] S26. Determine if the current loop count has reached the preset count. If yes, proceed to S27; otherwise, return to S21.

[0038] S27. Current node representation The final node representation yields the final feature matrix. ;

[0039] S28. The final feature matrix After flattening, the global potential space Z is obtained through a fully connected layer.

[0040] S3. Construct an initial latent space multi-constraint diffusion model, and use the training dataset to train and optimize the initial latent space multi-constraint diffusion model to obtain an optimized latent space multi-constraint diffusion model.

[0041] First, multiple attribute predictors are trained to predict the attribute prediction values ​​in the latent space. The attribute predictors are multilayer perceptrons (MLPs) used to diffuse the constraints within the model.

[0042] The latent space multi-constraint diffusion model consists of two stages: forward diffusion and backward denoising. The forward diffusion stage is further divided into... Each time step, the state at each time step It refers to the state of the previous time step. The result of adding random Gaussian noise: ;in Indicates 1 to At a certain time step, These are predefined parameters; Indicates a given The state at time -1 The conditional probability distribution of the state at time step; N indicates that the distribution is a Gaussian distribution; Represent the identity matrix; use reparameterization to... directly with As a condition, then , i = (1, 2, 3... ), Indicates multiplication. It is the product of multiple products;

[0043] The backward denoising stage starts from Starting from this point, at each time step, the noise from the previous time step is predicted by a noise predictor and denoised to restore the original state. Therefore, the main task of the diffusion model is to train the noise predictor;

[0044] Training and optimizing a multi-constraint diffusion model in the latent space specifically includes:

[0045] (1) The conditional vector f of the latent space Z of the training data is expressed as: ,in, , , These represent the target values ​​for ring tension, LogP, and QED attributes, respectively. , , This represents the corresponding weight value;

[0046] (2) Input the latent space Z of the training data into the diffusion model, perform a forward diffusion step, and randomly select a time step. Random noise is obtained. And calculate the state after adding noise. ;

[0047] (3) The state after adding noise Time step The embedded data is concatenated with the conditional vector f and input into the noise predictor to obtain the predicted noise. :

[0048] (4) Based on the predicted noise Analyze the current time step Denoising estimation under ;

[0049] (5) Denoising estimation Input multiple pre-trained attribute predictors to obtain multiple attribute prediction values ​​M;

[0050] (6) Based on the predicted value M of multiple attributes and the predicted noise The total loss L of the diffusion model is expressed as: ,in, The basic loss is expressed as: , The regularization loss is expressed as: , , For the loss of attributes, The value can be 1, 2, or 3; To adjust the base loss and regularization loss The parameters of the weights;

[0051] (7) Optimize the latent space multi-constraint diffusion model using the total loss L to obtain the trained latent space multi-constraint diffusion model;

[0052] (8) Determine whether the stopping condition is met. If it is met, the trained latent space multi-constraint diffusion model is used as the optimized latent space multi-constraint diffusion model; otherwise, return to (1) and train and optimize the trained latent space multi-constraint diffusion model again.

[0053] S4. Generate a new hidden space using the optimized latent space multi-constraint diffusion model. Specifically, it includes:

[0054] 1) Sample a latent space from random Gaussian noise. ;

[0055] 2) Potential space The new hidden space is obtained by inputting the optimized latent space multi-constraint diffusion model. .

[0056] S5. Analyze new hidden spaces This generates a new list of atoms and a new adjacency matrix A, resulting in a new molecule; specifically including:

[0057] S51, the decoder accesses the new hidden space through multiple fully connected layers. Decode the vector and reshape it using a Reshape operation. A new feature matrix X in dimension;

[0058] S52. Based on the new feature matrix X, predict the new atom list and the new adjacency matrix A, and the value of the i-th row and j-th column in the new adjacency matrix A. Represented as: ,in, , , It is the floor symbol. It is a splicing symbol. This represents the i-th row of the new feature matrix X. , , The values ​​can only be 0 or 1. This represents a multilayer perceptron (MLP) with shared weights.

[0059] The prediction process to obtain a new list of atoms involves inputting each row of the new feature matrix X into a multilayer perceptron (MLP) to obtain the atom type for the corresponding row, thus obtaining a new list of atoms. Each row of the new feature matrix X corresponds to one atom.

[0060] S6. Analyze whether the new molecule is a valid molecule and output the generation results; specifically including:

[0061] S61. Use the nx.is_connected() method to check the connectivity of the new adjacency matrix A. If it is not connected, discard it, the result is failure, and proceed to S64; otherwise, proceed to S62.

[0062] S62. The valence state of the new molecule is checked using the env.check_chemical_validity() method in RDKit. If the valence state is valid, the new molecule is considered a valid molecule, the result is a valid molecule, and proceeds to S64; otherwise, proceed to S63.

[0063] S63. Utilize the error messages from RDKit and determine whether the error messages meet the correction conditions. If so, add positive or negative charges to the atoms with incorrect valence states to correct them. The corrected molecule is then considered a valid molecule, and the generated result is a valid molecule, proceeding to S64. Otherwise, discard the molecule, the generated result is considered a failure, and proceed to S64.

[0064] S64. Output the generated results.

[0065] This method proposes a ring-graph neural network. By explicitly modeling the ring structure within molecules and employing alternating neighbor-to-neighbor and intra-ring message passing, the improved graph neural network can better adapt to the ring structure of molecular graphs, addressing the problem that current graph neural network models cannot effectively capture the unique topological properties of molecular graphs. Furthermore, by using a latent space adaptive multi-constraint diffusion model, more structural and property constraints are incorporated when generating new molecules, resulting in more reasonable structures and properties. Moreover, an adaptive mechanism adjusts the weights of various constraints according to their influence, avoiding conflicts between constraints and making the newly generated molecules more efficient overall.

[0066] A drug molecule generation device based on a potential space multi-constraint diffusion model includes:

[0067] Storage; storage is used to store computer programs;

[0068] An actuator; the actuator is used to execute a computer program in a storage device, which, when executed, implements the drug molecule generation method based on a potential space multi-constraint diffusion model as described above.

[0069] The technical solutions of the present invention are not limited to the specific embodiments described above. Any technical modifications made in accordance with the technical solutions of the present invention fall within the protection scope of the present invention.

Claims

1. A drug molecule generation method based on a latent space multi-constraint diffusion model, characterized in that, include: S1. Obtain the two-dimensional structure of a known molecule and represent the two-dimensional structure as an initial characteristic matrix. and adjacency matrix Where d represents the embedding dimension and n represents the number of atoms contained in a known molecule; S2. Use a ring-graph neural network to learn the two-dimensional structural features of known molecules, obtain the final feature matrix, and transform it into a global latent space Z; S3. Construct an initial latent space multi-constraint diffusion model, and use the training dataset to train and optimize the initial latent space multi-constraint diffusion model to obtain an optimized latent space multi-constraint diffusion model. S4. Generate a new hidden space using the optimized latent space multi-constraint diffusion model. ; S5. Analyze new hidden spaces This generates a new list of atoms and a new adjacency matrix A, resulting in a new molecule. S6. Analyze whether the new molecule is an effective molecule and output the generation result.

2. The drug molecule generation method based on a latent space multi-constraint diffusion model according to claim 1, characterized in that, S2 includes: S21. Using an adjacency matrix, the eigenvectors of each atom v in the known two-dimensional structure of a molecule are transformed into eigenvectors of the adjacency matrix. Perform message passing between neighbors, generating atom v at time step eigenvectors ; S22. Use the Chem.GetSymmSSSR() function in the RDKit tool to find all rings within the molecule and return a list of atomic indices for each ring, represented as C= ,in and These represent the first and last node atoms on the ring, respectively. S23. Define a node c for each ring to represent the ring, and the eigenvector of the node atom u on the ring. Then the initial characteristics of node c are expressed as: Where Avg represents the average aggregation function; S24, Update step c at time step eigenvectors at time ; S25, All node atoms on this ring are linked by the eigenvector of node c. eigenvectors of node atom u To update its time step The eigenvector at +1 , is represented as: MLP stands for Multilayer Perceptron; S26. Determine if the current loop count has reached the preset count. If yes, proceed to S27; otherwise, return to S21. S27. Current node representation The final node representation yields the final feature matrix. ; S28. The final feature matrix After flattening, the global potential space Z is obtained through a fully connected layer.

3. The drug molecule generation method based on a latent space multi-constraint diffusion model according to claim 1, characterized in that, Specifically in S24: ① Calculate the message of node atom u on the ring. , is represented as: ,in, This indicates that node atom u is at time step eigenvectors, This indicates that node c is at time step eigenvectors; ② Aggregate messages from all atomic nodes on node c to obtain the aggregated message. , is represented as: ; ③ Based on aggregated messages and node c at time step eigenvectors Update point c at time step eigenvectors , is represented as: .

4. The drug molecule generation method based on a potential space multi-constraint diffusion model according to claim 1, characterized in that, Training a multi-constraint diffusion model in the latent space specifically includes: (1) The conditional vector f of the latent space Z of the training data is expressed as: ,in, , , These represent the target values ​​for ring tension, LogP, and QED attributes, respectively. , , This represents the corresponding weight value; (2) Input the latent space Z of the training data into the diffusion model, perform a forward diffusion step, and randomly select a time step. Random noise is obtained. And calculate the state after adding noise. ; (3) The state after adding noise Time step The embedded data is concatenated with the conditional vector f and input into the noise predictor to obtain the predicted noise. : (4) Based on the predicted noise Analyze the current time step Denoising estimation under ; (5) Denoising estimation Input multiple pre-trained attribute predictors to obtain multiple attribute prediction values ​​M; (6) Based on the predicted value M of multiple attributes and the predicted noise Analyze the total loss L of the diffusion model; (7) Optimize the latent space multi-constraint diffusion model using the total loss L to obtain the trained latent space multi-constraint diffusion model; (8) Determine whether the stopping condition is met. If it is met, the trained latent space multi-constraint diffusion model is used as the optimized latent space multi-constraint diffusion model; otherwise, return to (1) and train and optimize the trained latent space multi-constraint diffusion model again.

5. The drug molecule generation method based on a potential space multi-constraint diffusion model according to claim 4, characterized in that, In (6), the total loss L is expressed as: ,in, The basic loss is expressed as: , The regularization loss is expressed as: , , For the loss of attributes, The value can be 1, 2, or 3; To adjust the base loss and regularization loss The parameters of the weights.

6. The drug molecule generation method based on a latent space multi-constraint diffusion model according to claim 4, characterized in that, In S4, generating a new hidden space using the optimized latent space multi-constraint diffusion model specifically includes: 1) Sample a latent space from random Gaussian noise. ; 2) Potential space The new hidden space is obtained by inputting the optimized latent space multi-constraint diffusion model. .

7. The drug molecule generation method based on a latent space multi-constraint diffusion model according to claim 1, characterized in that, Specifically, S5 includes: S51, the decoder accesses the new hidden space through multiple fully connected layers. Decode the vector and reshape it using a Reshape operation. A new feature matrix X in dimension; S52. Based on the new feature matrix X, predict the new atom list and the new adjacency matrix A, and the value of the i-th row and j-th column in the new adjacency matrix A. Represented as: ,in, , , It is the floor symbol. It is a splicing symbol. This represents the i-th row of the new feature matrix X. , , The values ​​can only be 0 or 1. This represents a multilayer perceptron (MLP) with shared weights. The prediction process to obtain a new list of atoms involves inputting each row of the new feature matrix X into a multilayer perceptron (MLP) to obtain the atom type for the corresponding row, thus obtaining a new list of atoms. Each row of the new feature matrix X corresponds to one atom.

8. The drug molecule generation method based on a latent space multi-constraint diffusion model according to claim 1, characterized in that, S6 includes: S61. Use the nx.is_connected() method to check the connectivity of the new adjacency matrix A. If it is not connected, discard it, the result is failure, and proceed to S64; otherwise, proceed to S62. S62. The valence state of the new molecule is checked using the env.check_chemical_validity() method in RDKit. If the valence state is valid, the new molecule is considered a valid molecule, the result is a valid molecule, and proceeds to S64; otherwise, proceed to S63. S63. Utilize the error messages from RDKit and determine whether the error messages meet the correction conditions. If so, add positive or negative charges to the atoms with incorrect valence states to correct them. The corrected molecule is then considered a valid molecule, and the generated result is a valid molecule, proceeding to S64. Otherwise, discard the molecule, the generated result is considered a failure, and proceed to S64. S64. Output the generated results.

9. A drug molecule generation device based on a potential space multi-constraint diffusion model, characterized in that, include: Storage; Storage is used to store computer programs; Actuator; An actuator is used to execute a computer program in a storage device, which, when executed, implements a drug molecule generation method based on a latent spatial multi-constraint diffusion model as described in any one of claims 1-8.