A molecular optimization method and system based on diffusion model

CN117894398BActive Publication Date: 2026-08-11HUNAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-29
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

[0008]针对现有技术的以上缺陷或改进需求,本发明提供了一种基于扩散模型的分子优化方法和系统,其目的在于,解决现有基于RNN的分子优化方法由于没有实现对数据的加密,因此会导致数据泄露的技术问题;以及现有基于VAE的分子优化方法,其生成的数据是从特征的分布里抽样出来的,不同的特征会生成相似的数据,且计算KL散度时由于有隐变量服从高斯分布的假设在里面,所以VAE的先验分布几乎只能是高斯分布,因此会导致VAE生成的样本质量不高的技术问题,以及现有基于GAN的分子优化方法由于存在对抗训练,往往需要定义多个损失函数实现分子优化,因此导致很难有精确的循环一致性的技术问题

Benefits of technology

[0058]1、本发明由于采用了步骤(2-3)到(2-10),其通过对基于扩散模型的编码器和解码器分别训练,实现了对两个模型的解耦,这有利于保护数据隐私;本发明在分子优化的过程中,只需要编码器和解码器,其训练过程不依赖于先验的领域对知识,这样可以很好的保护数据隐私;分子优化的过程可以以加密的形式进行(假设A是想要优化分子的一方,他可以利用编码器对分子进行编码,这也是加密的过程,然后把编码发送给B,B可以利用解码器对编码进行优化,然后将结果发送给A,整个过程B都无法获取源数据),因此能够解决RNN存在的在优化过程中没有实现对数据的加密,导致数据泄露的技术问题;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117894398B_ABST
    Figure CN117894398B_ABST
Patent Text Reader

Abstract

This invention discloses a molecular optimization method based on a diffusion model, comprising: acquiring multiple molecules, each molecule having a DRD2 value; constructing a first molecule set from all molecules with DRD2 values ​​less than 0.05; constructing a second molecule set from all molecules with DRD2 values ​​greater than 0.5; preprocessing the first and second molecule sets to obtain updated first and second molecule sets respectively; extracting information for each molecule from the first and second molecule sets respectively; the information of all molecules in the first and second molecule sets forming first and second molecule information sets respectively; and inputting the preprocessed first molecule information set into a pre-trained molecular optimization model to obtain the molecular optimization result for each molecule corresponding to the first molecule information set. This invention solves the technical problem of data leakage caused by the lack of data encryption in existing RNN-based molecular optimization methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of deep learning and diffusion models, and more specifically, relates to a molecular optimization method and system based on diffusion models. Background Technology

[0002] Molecular optimization involves improving the properties of existing molecules to create more effective molecules while maintaining similarity. Currently, the number of potential drug-like molecules is as high as 10. 23 ~10 60 Finding molecules that meet the requirements in such a vast chemical space is extremely difficult. Molecular optimization, however, is based on existing molecules, which can greatly narrow down the search scope and thus find molecules that meet the requirements more quickly.

[0003] Traditionally, molecular optimization relies on the knowledge and experience of medicinal chemists, and is performed through fragment-based screening or synthesis. However, this process is highly inefficient and cannot be automated. Therefore, computer-aided drug design has rapidly developed, with deep learning technology being widely applied across various stages of drug development. The first approach is based on Recurrent Neural Networks (RNNs), which learns the textual representation of molecules and then optimizes them through reinforcement learning or transfer learning. The second approach is based on Variational Autoencoders (VAEs), which include an encoder to encode molecules into latent vectors and a decoder to decode the latent vectors back into molecules, optimizing them within the latent vector space. The third approach is based on Generative Adversarial Networks (GANs), which consist of an adversarial generator and a discriminator. The generator produces data that meets certain conditions, while the discriminator determines whether the generated data is genuine.

[0004] However, the above methods all have some drawbacks that cannot be ignored:

[0005] First, RNN-based molecular optimization methods do not implement data encryption, which can lead to data leakage problems.

[0006] Second, the molecular optimization method based on VAE generates data sampled from the distribution of features. Different features will generate similar data. Furthermore, when calculating the KL divergence, there is an assumption that the latent variables follow a Gaussian distribution. Therefore, the prior distribution of VAE can almost only be a Gaussian distribution, which will lead to low quality of samples generated by VAE.

[0007] Third, GAN-based molecular optimization methods often require defining multiple loss functions to achieve molecular optimization due to adversarial training, which makes it difficult to achieve accurate cycle consistency. Summary of the Invention

[0008] To address the aforementioned deficiencies or improvement needs of existing technologies, this invention provides a molecular optimization method and system based on a diffusion model. Its purpose is to solve the following problems: First, existing RNN-based molecular optimization methods suffer from data leakage due to the lack of data encryption. Second, existing VAE-based molecular optimization methods generate data sampled from feature distributions, leading to similar data from different features. Furthermore, the assumption that latent variables follow a Gaussian distribution during KL divergence calculation means the prior distribution of VAEs is almost always Gaussian, resulting in low-quality samples. Third, existing GAN-based molecular optimization methods often require adversarial training, necessitating the definition of multiple loss functions for molecular optimization, making precise cycle consistency difficult.

[0009] To achieve the above objectives, according to one aspect of the present invention, a molecular optimization method based on a diffusion model is provided, comprising the following steps:

[0010] (1) Obtain multiple molecules, each molecule having a DRD2 value. Construct a first molecule set from all molecules with a DRD2 value less than 0.05, and construct a second molecule set from all molecules with a DRD2 value greater than 0.5. Preprocess the first and second molecule sets to obtain updated first and second molecule sets respectively. Extract information of each molecule from the first and second molecule sets respectively. The information of all molecules in the first molecule set constitutes the first molecule information set, and the information of all molecules in the second molecule set constitutes the second molecule information set.

[0011] (2) Input the first molecular information set after preprocessing in step (1) into the pre-trained molecular optimization model to obtain the molecular optimization result of each molecule corresponding to the first molecular information set.

[0012] Preferably, step (1) specifically involves: firstly, downloading molecules from the open-source dataset ZINC and storing them in the simplified molecular input line specification SMILES format, i.e., the text representation of the molecules; then, using the open-source software RDKit to calculate the DRD2 value of each molecule; placing molecules with a DRD2 value less than 0.05 into the first molecule set and molecules with a DRD2 value greater than 0.5 into the second molecule set; subsequently, using the RDKit tool to extract the Morgan fingerprint of each molecule in the first and second molecule sets, and calculating the Tanimoto similarity between each molecule in the first and second molecule sets using the Morgan fingerprint; removing all molecules with a Tanimoto similarity less than or equal to 0.4 to obtain the updated first and second molecule sets respectively; and then using RDKit to extract the first and second molecule sets. The molecular information for each molecule includes the molecule's atomic features X, chemical bond features E, and molecular skeleton structure S. The chemical bond features E further include the discrete structure Disc of the corresponding molecular diagram and the chemical bond type Etyp, i.e., E = {Edisc, Etyp}. Since the maximum length of a molecule is 35, the discrete structure Disc, chemical bond type Etyp, atomic features X, and molecular skeleton structure S of each molecule are all Len*Len matrices. Therefore, the molecular information for each molecule is represented by four Len*Len matrices. Finally, the molecular information of all molecules extracted from the first molecule set is used to construct the first molecular information set, and the molecular information of all molecules extracted from the second molecule set is used to construct the second molecular information set, where Len represents the maximum length of the molecule.

[0013] Preferably, the molecular optimization result obtained in step (2) is to optimize the molecules with DRD2 values ​​less than 0.05 corresponding to the preprocessed first molecular information set into molecules with DRD2 values ​​greater than 0.5, and the molecular similarity between the two is greater than 0.4.

[0014] The molecular optimization model is based on the diffusion model and includes an encoder and a decoder;

[0015] Preferably, the encoder includes a first noise prediction module and a forward diffusion module, the specific structure of which is as follows:

[0016] The first diagram shows the noise prediction module. The input to the graph neural network is θ1, which is the parameter of the graph noise prediction module in the encoder. Its input at time t = 0 is the molecular information of a batch of molecules corresponding to the first molecular information set, and its input at subsequent times t is the molecular information x at time t. t The output is a set of noise prediction vectors of size Num*128, where Num represents the batch size.

[0017] The first diagram shows the noise prediction module. It includes a standard messaging layer, an attention-based fully connected messaging layer, and a fully connected layer.

[0018] The input of the standard message passing layer at time t=0 is the molecular information of a batch of molecules corresponding to the first molecular information set, that is, a matrix of size Num*4 Len*Len. The output at time t=0 is the first message passing vector set of size Num*32*256.

[0019] The standard message-passing layer receives the molecular information x at time t as its input at time t. t The output at time t is the first message passing vector set of size Num*32*256.

[0020] Specifically, at time t=0, the standard message passing layer first uses the Linear_pyg model in the PyTorch framework to increase the dimensionality of the molecular information of a batch of molecules corresponding to the first set of molecular information to obtain the first set of feature vectors. Then, it uses the ReLU linear rectified function to perform nonlinear processing on the first set of feature vectors to obtain an intermediate set of vectors. Subsequently, it uses the Linear_pyg model in the PyTorch framework again to reduce the dimensionality of the intermediate set of vectors to obtain the second set of feature vectors. Finally, it uses the GINEConv model in the PyTorch framework to perform message aggregation on the second set of feature vectors to output the first set of message passing vectors with a size of Num*32*256.

[0021] At the subsequent time t, the standard message passing layer first uses the Linear_pyg model in the PyTorch framework to process the molecular information x at time t. t The system first increases the dimensionality to obtain the first set of feature vectors. Then, it uses ReLU to perform non-linear processing on the first set of feature vectors to obtain an intermediate set of vectors. Subsequently, it uses the Linear_pyg model in the PyTorch framework to reduce the dimensionality of the intermediate set of vectors to obtain the second set of feature vectors. Finally, it uses the GINEConv model in the PyTorch framework to perform message aggregation on the second set of feature vectors to output the first set of message passing vectors with a size of Num*32*256.

[0022] Preferably, the input of the attention-based fully connected message passing layer at time t=0 is the molecular information of a batch of molecules corresponding to the first molecular information set, i.e., Num*4 matrices of size Len*Len, and the output at time t=0 is the second message passing vector set of size Num*32*256.

[0023] The attention-based fully connected message-passing layer takes the molecular information x at time t as its input at time t. t The output at time t is a second set of message passing vectors of size Num*32*256.

[0024] Specifically, at time t=0, the attention-based fully connected message passing layer first uses the Linear layer in the PyTorch framework to perform a nonlinear transformation on the molecular information of a batch of molecules in the first set of input molecular information to obtain an intermediate vector set. Then, the attention mechanism is used to process the intermediate vector set to obtain the attention vector set. Finally, the hyperbolic tangent activation function tanh is used to activate the attention vector set to output a second message passing vector set of size Num*32*256.

[0025] At a subsequent time t, the attention-based fully connected message-passing layer first uses the Linear layer in the PyTorch framework to process the molecular information x at time t. t A nonlinear transformation is performed to obtain an intermediate vector set. Then, an attention mechanism is used to process the intermediate vector set to obtain an attention vector set. Finally, tanh is used to activate the attention vector set to output a second message passing vector set of size Num*32*256.

[0026] Preferably, the input of the fully connected layer at time t=0 is a first message passing vector set of size Num*32*256 output from the standard message passing layer, and a second message passing vector set of size Num*32*256 output from the attention-based fully connected message passing layer, and an output noise prediction vector set of size Num*128.

[0027] The input of the fully connected layer at time t is a first message passing vector set of size Num*32*256 output from the standard message passing layer, and a second message passing vector set of size Num*32*256 output from the attention-based fully connected message passing layer. The output at time t is a noise prediction vector set of size Num*128.

[0028] Specifically, at time t=0, the fully connected layer first adds the first message passing vector set and the second message passing vector set to obtain an intermediate vector set. Finally, the Linear layer in the PyTorch framework performs non-linear processing on the intermediate vector set to output a noise prediction vector set of size Num*128.

[0029] At time t, the fully connected layer first adds the first message passing vector set and the second message passing vector set to obtain an intermediate vector set. Finally, the Linear layer in the PyTorch framework performs non-linear processing on the intermediate vector set to output a noise prediction vector set of size Num*128.

[0030] The input to the forward diffusion module is the molecular information xt at time t and the noise prediction vector set of size Num*128 output from the noise prediction module in the first figure. The output is the molecular xT at time T.

[0031] Specifically, the forward diffusion module first calculates the molecular time at time t+1. The first graph noise prediction module of the encoder at time t Based on the set of noise prediction vectors output from the input xt, the molecule xt at time t+1 is then obtained. +1 The input is fed into the noise prediction module of the first figure to obtain the noise prediction vector set at time t+1. Then, for the obtained noise prediction vector set at time t+1, t = t+1 is set, and the numerator xt at time t+2 is calculated through the above process. +2 Repeat the above process, setting t = t + 1 each time, until t = T, at which point the molecule xT at time T is obtained, where T represents the total number of diffusion steps and T = 1000.

[0032] Preferably, the decoder includes a second graph noise prediction module and an inverse denoising module.

[0033] The second diagram shows the noise prediction module. Let be a graph neural network, where θ2 is the parameter of the graph noise prediction module in the decoder. Its input is the numerator xT at time T output by the encoder, and its output is a set of noise prediction vectors of size Num*128.

[0034] The specific structure of the noise prediction module in the second figure, as well as the input processing procedure, are exactly the same as those in the noise prediction module in the first figure.

[0035] The input to the inverse denoising module is the numerator xT at time T output by the encoder and the noise prediction module in the second figure. The output is a set of noise prediction vectors of size Num*128, and the output is the molecule x0 at time t=0.

[0036] Specifically, first, calculate the molecule at time t-1. in Then, the molecule xt obtained at time t-1 ―1The input is fed into the noise prediction module in the second figure to obtain the noise prediction vector set at time t-1. Then, for the obtained noise prediction vector set at time t-1, t = t-1 is set, and the numerator xt at time t-2 is calculated through the above process. ―2 Repeat the above process, setting t = t-1 each time, until t = 0, at which point the molecule x0 at t = 0 is obtained, which is the optimized molecule.

[0037] Preferably, the molecular optimization model is obtained through the following steps:

[0038] (2-1) Obtain multiple molecules, each with a DRD2 value. Construct a first molecule set from all molecules with DRD2 values ​​less than 0.05, and a second molecule set from all molecules with DRD2 values ​​greater than 0.5. Preprocess the first and second molecule sets to obtain updated first and second molecule sets, respectively. Extract information for each molecule from the first and second molecule sets, respectively. The information of all molecules in the first molecule set constitutes the first molecule information set, and the information of all molecules in the second molecule set constitutes the second molecule information set. Divide the information of all molecules in the first molecule information set and the information of all molecules in the second molecule information set into training, testing, and validation sets in an 8:1:1 ratio, respectively.

[0039] (2-2) Initialize the total number of iterations (epochs) and the learning rate (η) of the molecular optimization model during the training process;

[0040] (2-3) Input the molecular information of each molecule in the training set of the first molecular information set obtained in step (2-1) into the encoder of the molecular optimization model to obtain the molecule xt at time t, which is the molecule after adding noise, and obtain the noise εt sampled from the standard normal distribution at time t.

[0041] (2-4) Input the noise-adding molecule xt at time t obtained in step (2-3) into the first graph noise prediction module to obtain the noise prediction vector set at time t;

[0042] (2-5) Based on the noise prediction vector set obtained in step (2-4) The loss function is calculated using the real noise εt obtained in (2-3). The encoder based on the diffusion model is iteratively trained using this loss function to obtain the iteratively trained encoder. The iteratively trained encoder is then validated using the validation set in the first molecular information set in step (2-1) to obtain the initially trained encoder.

[0043] (2-6) Repeat steps (2-3) to (2-5) until the total number of iterations (epochs) set in step (2-2) is reached, thereby obtaining the trained encoder based on the diffusion model.

[0044] (2-7) Input the molecular information of each molecule in the training set of the second molecular information set obtained in step (2-1) into the decoder of the molecular optimization model to obtain the molecule xt at time t, where the molecule xt is the molecule after adding noise;

[0045] (2-8) Input the noise-adding molecule xt at time t obtained in step (2-7) into the noise prediction module of the second figure to obtain the noise prediction vector set at time t;

[0046] (2-9) Based on the noise prediction vector set obtained in step (2-8) The loss function is calculated using the real noise εt added in (2-7). The loss function is used to iteratively train the decoder based on the diffusion model to obtain the iteratively trained decoder. The iteratively trained decoder is then verified using the validation set in the second molecular information set in step (2-1) to obtain the preliminarily trained decoder.

[0047] (2-10) Repeat steps (2-7) to (2-9) until the total number of iterations (epochs) set in step (2-2) is reached, thereby obtaining the trained decoder based on the diffusion model.

[0048] Preferably, step (2-3) specifically involves first defining the forward diffusion process equation, which is: Where x0 represents the molecular information of each molecule in the training set of the first molecular information set, and then calculate... Where T is the total number of diffusion steps, which is taken as 1000 here. Finally, the noisy molecule xt at time t is sampled, i.e. The noisy molecule xt at any given time can be obtained through a forward diffusion process;

[0049] Step (2-4) specifically involves first inputting the noise-adding molecule xt at time t obtained in step (2-3) into the standard message passing layer and the attention-based fully connected message passing layer in the first graph noise prediction module to obtain the first message passing vector set and the second message passing vector set; finally, inputting the obtained first message passing vector set and the second message passing vector set into the fully connected layer in the first graph noise prediction module to obtain the noise prediction vector set.

[0050] The formula for calculating the loss function in step (2-5) is as follows: in Represents the set of noise prediction vectors The squared second norm of the distance between the real noise εt and the actual noise. This means calculating the expected value of xt given x0. This represents the expected value of x0. θ1 represents the parameter θ1 of the graph noise prediction module of the optimized encoder, which makes the predicted noise equal to the actual noise.

[0051] Step (2-7) specifically involves first defining the forward diffusion process equation, which is as follows: Where x0 represents the molecular information of each molecule in the training set within the second molecular information set, and then calculate... Finally, the noisy molecule xt at time t is sampled, i.e. The noisy molecule xt and the corresponding noise εt at any given time can be obtained through the forward diffusion process.

[0052] Step (2-8) specifically involves first inputting the noisy molecule xt at time t obtained in step (2-7) into the standard message passing layer and the attention-based fully connected message passing layer in the second graph noise prediction module to obtain the first message passing vector set and the second message passing vector set; finally, inputting the obtained first message passing vector set and the second message passing vector set into the fully connected layer in the second graph noise prediction module to obtain the noise prediction vector set.

[0053] The formula for calculating the loss function in step (2-9) is as follows: ]},in Represents the set of noise prediction vectors The squared second norm of the distance between the real noise εt and the actual noise. This means calculating the expected value of xt given x0. This represents the expected value of x0. The parameter θ2 of the graph noise prediction module of the optimizer is set so that the predicted noise is equal to the actual noise.

[0054] According to another aspect of the present invention, a molecular optimization system based on a diffusion model is provided, comprising:

[0055] The first module is used to acquire multiple molecules, each with a DRD2 value. All molecules with DRD2 values ​​less than 0.05 are constructed into a first molecule set, and all molecules with DRD2 values ​​greater than 0.5 are constructed into a second molecule set. The first and second molecule sets are preprocessed to obtain updated first and second molecule sets, respectively. Information of each molecule is extracted from the first and second molecule sets, respectively. The information of all molecules in the first molecule set constitutes the first molecule information set, and the information of all molecules in the second molecule set constitutes the second molecule information set.

[0056] The second module is used to input the first molecular information set preprocessed by the first module into the pre-trained molecular optimization model to obtain the molecular optimization result of each molecule corresponding to the first molecular information set.

[0057] In summary, compared with the prior art, the above-described technical solutions conceived by this invention can achieve the following beneficial effects:

[0058] 1. This invention employs steps (2-3) to (2-10), which decouples the two models by training the encoder and decoder based on the diffusion model separately, thus protecting data privacy. During molecular optimization, this invention only requires the encoder and decoder, and its training process does not rely on prior domain knowledge, effectively protecting data privacy. The molecular optimization process can be performed in an encrypted form (assuming A wants to optimize the molecule, they can use the encoder to encode the molecule, which is also an encrypted process, and then send the encoding to B. B can use the decoder to optimize the encoding and then send the result to A. Throughout the process, B cannot obtain the source data). Therefore, this invention solves the technical problem of data leakage caused by the lack of data encryption during the optimization process in RNNs.

[0059] 2. Since the present invention adopts steps (2-3) to (2-10), its encoder and decoder are both diffusion models. The data dimension of the diffusion model is always the same as the original data during the training process, and the generated content is formed by gradually removing noise from the noise. Therefore, it can solve the technical problem of low quality of generated samples in VAE.

[0060] 3. Since the present invention adopts steps (2-3) to (2-10), its encoder and decoder based on the diffusion model are essentially deep generative models. This model adopts a deterministic generation method, that is, one noise corresponds to one deterministic molecule. The whole process is deterministic, thus solving the technical problem of GAN having difficulty in achieving accurate cycle consistency.

[0061] 4. The method of this invention can solve molecular optimization problems, improve the performance and accuracy of models, and provide more reliable tools and methods for molecular optimization in the medical field;

[0062] 5. This invention can be widely applied to various molecular optimization tasks and can improve the performance of model training. Attached Figure Description

[0063] Figure 1 This is an overall flowchart of the molecular optimization method based on the diffusion model of this invention. Detailed Implementation

[0064] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention. Furthermore, the technical features involved in the various embodiments of this invention described below can be combined with each other as long as they do not conflict with each other.

[0065] The basic idea of ​​this invention is to achieve molecular optimization by using an encoder and decoder based on a diffusion model. First, the molecules in the ZINC dataset are preprocessed using the open-source software RDKit to obtain molecular graphs. Then, the low-activity molecular graphs are input into a pre-trained encoder to obtain molecular codes. Finally, the molecular codes are input into the decoder to obtain the optimized molecules.

[0066] like Figure 1 As shown, this invention provides a molecular optimization method based on a diffusion model, comprising the following steps:

[0067] (1) Obtain multiple molecules, each with a dopamine receptor D2 (DRD2) value. Construct a first molecule set from all molecules with a DRD2 value less than 0.05, and construct a second molecule set from all molecules with a DRD2 value greater than 0.5. Preprocess the first and second molecule sets to obtain updated first and second molecule sets respectively. Extract information of each molecule from the first and second molecule sets respectively. The information of all molecules in the first molecule set constitutes the first molecule information set, and the information of all molecules in the second molecule set constitutes the second molecule information set.

[0068] DRD2 is the numerical value of the molecular activity against the D2 dopamine receptor.

[0069] Specifically, the molecules acquired in this step are all graph data, stored in matrix form. The first step involves downloading molecules from the open-source dataset ZINC and storing them in the Simplified Molecular Input Line Entry System (SMILES) format, i.e., a text representation of the molecules. Then, the open-source software RDKit is used to calculate the DRD2 value of each molecule. Molecules with a DRD2 value less than 0.05 (referred to as low-activity molecules) are placed in the first molecule set, and molecules with a DRD2 value greater than 0.5 (referred to as high-activity molecules) are placed in the second molecule set. Subsequently, RDKit is used to extract Morgan fingerprints for each molecule in both sets, and the Tanimoto similarity between each molecule in the first and second sets is calculated using these Morgan fingerprints. The similarity of all molecules is less than or equal to 0.4. Molecules with similarity less than or equal to 0.4 are removed to obtain updated first and second molecular sets. Then, RDKit is used to extract molecular information for each molecule in the first and second molecular sets. This information includes the molecule's atomic features X, chemical bond features E, and molecular skeleton structure S. The chemical bond features E further include the discrete structure Edisc and chemical bond type Etyp of the corresponding molecular graph, i.e., E = {Edisc, Etyp}. Since the maximum length of a molecule is 35, the discrete structure Edisc, chemical bond type Etyp, atomic features X, and molecular skeleton structure S of each molecule are all Len*Len matrices (where Len represents the maximum length of the molecule; in this invention, Len = 35). Therefore, the molecular information for each molecule is represented by four Len*Len matrices. Finally, the extracted molecular information from all molecules in the first molecular set is used to construct the first molecular information set, and the extracted molecular information from all molecules in the second molecular set is used to construct the second molecular information set.

[0070] (2) Input the first molecular information set after preprocessing in step (1) into the pre-trained molecular optimization model to obtain the molecular optimization result of each molecule corresponding to the first molecular information set.

[0071] Specifically, the final molecular optimization result is to optimize molecules with DRD2 values ​​less than 0.05 corresponding to the first set of preprocessed molecular information into molecules with DRD2 values ​​greater than 0.5, and the molecular similarity between the two is greater than 0.4.

[0072] The molecular optimization model of this invention is based on a diffusion model, such as... Figure 1As shown, it includes an encoder and a decoder.

[0073] The encoder includes a noise prediction module and a forward diffusion module, the specific structure of which is as follows:

[0074] The first diagram shows the noise prediction module. The graph neural network is defined as follows: θ1 represents the parameters of the graph noise prediction module in the encoder. Its input at time t = 0 is the molecular information of a batch (i.e., Batch Size) of molecules corresponding to the first molecular information set, and its input at subsequent times t (where t ≠ 0) is the molecular information x at time t. t The output is a set of noise prediction vectors of size Num*128.

[0075] The first diagram shows the noise prediction module. It includes a standard messaging layer, an attention-based fully connected messaging layer, and a fully connected layer.

[0076] The standard message passing layer's input at time t=0 is the molecular information of a batch of molecules corresponding to the first molecular information set (i.e., Num*4 matrices of size Len*Len), and its output at time t=0 is the first message passing vector set of size Num*32*256, where Num represents the batch size, which is 64 in this example.

[0077] The standard message-passing layer receives the molecular information x at time t as its input at time t. t The output at time t is the first message passing vector set of size Num*32*256.

[0078] Specifically, at time t=0, this layer first uses the Linear_pyg model in the PyTorch framework to increase the dimensionality of the molecular information of a batch of molecules corresponding to the first set of molecular information, to obtain the first feature vector set. Then, it uses the Linear Rectification Function (ReLU) to perform nonlinear processing on the first feature vector set to obtain an intermediate vector set. Subsequently, it uses the Linear_pyg model in the PyTorch framework again to reduce the dimensionality of this intermediate vector set to obtain the second feature vector set. Finally, it uses the GINEConv model in the PyTorch framework to perform message aggregation on the second feature vector set, outputting a first message passing vector set of size Num*32*256. At subsequent times t, this layer first uses the Linear_pyg model in the PyTorch framework to increase the dimensionality of the molecular information x at time t. tThe system first increases the dimensionality to obtain the first set of feature vectors. Then, it uses the Linear Rectification Function (ReLU) to perform non-linear processing on the first set of feature vectors to obtain an intermediate set of vectors. Subsequently, it uses the Linear_pyg model in the PyTorch framework to reduce the dimensionality of the intermediate set of vectors to obtain the second set of feature vectors. Finally, it uses the GINEConv model in the PyTorch framework to perform message aggregation on the second set of feature vectors to output the first set of message passing vectors with a size of Num*32*256.

[0079] The input of the attention-based fully connected message passing layer at time t=0 is the molecular information (i.e., Num*4 Len*Len matrices) of a batch (i.e., Batch Size) of molecules corresponding to the first molecular information set, and the output at time t=0 is the second message passing vector set of size Num*32*256.

[0080] The attention-based fully connected message-passing layer takes the molecular information x at time t as its input at time t. t The output at time t is a second set of message passing vectors of size Num*32*256.

[0081] Specifically, at time t=0, this layer first uses the Linear layer in the PyTorch framework to perform a nonlinear transformation on the molecular information of a batch of molecules in the first set of input molecular information to obtain an intermediate vector set. Then, the attention mechanism is used to process the intermediate vector set to obtain an attention vector set. Finally, the hyperbolic tangent activation function (tanh) is used to activate the attention vector set to output a second message passing vector set of size Num*32*256.

[0082] At a subsequent time t, this layer first uses a Linear layer in the PyTorch framework to process the molecular information x at time t. t A nonlinear transformation is performed to obtain an intermediate vector set. Then, an attention mechanism is used to process the intermediate vector set to obtain an attention vector set. Finally, the attention vector set is activated using the tanh function to output a second message passing vector set of size Num*32*256.

[0083] The input to the fully connected layer at time t=0 is a first message passing vector set of size Num*32*256 output from the standard message passing layer, and a second message passing vector set of size Num*32*256 output from the attention-based fully connected message passing layer. The output is a noise prediction vector set of size Num*128.

[0084] The input of the fully connected layer at time t is a first message passing vector set of size Num*32*256 output from the standard message passing layer, and a second message passing vector set of size Num*32*256 output from the attention-based fully connected message passing layer. The output at time t is a noise prediction vector set of size Num*128.

[0085] Specifically, at time t=0, the layer first adds the first message passing vector set and the second message passing vector set to obtain an intermediate vector set. Finally, the Linear layer in the PyTorch framework is used to perform non-linear processing on the intermediate vector set to output a noise prediction vector set of size Num*128.

[0086] At time t, the layer first adds the first message passing vector set and the second message passing vector set to obtain an intermediate vector set. Finally, it uses the Linear layer in the PyTorch framework to perform nonlinear processing on the intermediate vector set to output a noise prediction vector set of size Num*128.

[0087] The forward diffusion module is defined by the forward diffusion equation. Its inputs are the molecular information xt at time t and the set of noise prediction vectors of size Num*128 output by the noise prediction module in the first figure. Its output is the molecular xT at time T.

[0088] The specific steps are as follows: First, calculate the molecule at time t+1. in The first graph noise prediction module of the encoder at time t Based on the set of noise prediction vectors output from the input xt, the molecule xt at time t+1 is then obtained. +1 The input is fed into the noise prediction module of the first figure to obtain the noise prediction vector set at time t+1. Then, for the obtained noise prediction vector set at time t+1, t = t+1 is set, and the numerator xt at time t+2 is calculated through the above process. +2 Repeat the above process, setting t = t + 1 each time, until t = T, at which point the molecule xT at time T is obtained, where T represents the total number of diffusion steps and T = 1000.

[0089] The decoder includes a second-graph noise prediction module and an inverse denoising module.

[0090] The second diagram shows the noise prediction module. Let be a graph neural network, where θ2 is the parameter of the graph noise prediction module in the decoder. Its input is the numerator xT at time T output by the encoder, and its output is a set of noise prediction vectors of size Num*128.

[0091] The specific structure of the noise prediction module in the second figure and the input processing procedure are exactly the same as those of the noise prediction module in the first figure above, and will not be repeated here.

[0092] The inverse denoising module is defined by the inverse denoising formula, and its inputs are the numerator xT at time T output by the encoder and the second graph noise prediction module. The output is a set of noise prediction vectors of size Num*128, and the output is the molecule x0 at time t=0.

[0093] The specific steps are as follows: First, calculate the molecule at time t-1. in Then, the molecule xt obtained at time t-1 ―1 The input is fed into the noise prediction module in the second figure to obtain the noise prediction vector set at time t-1. Then, for the obtained noise prediction vector set at time t-1, t = t-1 is set, and the numerator xt at time t-2 is calculated through the above process. ―2 Repeat the above process, setting t = t-1 each time, until t = 0, at which point the molecule x0 at t = 0 is obtained, which is the optimized molecule.

[0094] Specifically, the molecular optimization model of the present invention is obtained through the following steps:

[0095] (2-1) Obtain multiple molecules, each with a dopamine receptor D2 (DRD2) value. Construct a first molecule set from all molecules with DRD2 values ​​less than 0.05, and a second molecule set from all molecules with DRD2 values ​​greater than 0.5. Preprocess the first and second molecule sets to obtain updated versions. Extract information for each molecule from both sets. The information from all molecules in the first molecule set constitutes the first molecule information set, and the information from all molecules in the second molecule set constitutes the second molecule information set. Divide the information from all molecules in the first and second molecule information sets into training, testing, and validation sets in an 8:1:1 ratio.

[0096] The pretreatment process for molecules in this step is exactly the same as that in step (1) above, and will not be repeated here;

[0097] The process of dividing the training set, test set, and validation set in this step is as follows: First, the two sets of preprocessed molecular information are randomly shuffled. Then, each set of shuffled molecular information is evenly divided into 10 parts. One part is randomly selected from the 10 parts as the test set, and another part is randomly selected from the remaining 9 parts as the validation set. The remaining 8 parts are used as the training set.

[0098] (2-2) Initialize the total number of iterations (epochs) and the learning rate (η) of the molecular optimization model during the training process;

[0099] Specifically, the total number of iterations (epochs) in this step ranges from 100 to 200, preferably 150; the learning rate (η) ranges from 0 to 1, preferably 0.0001.

[0100] (2-3) Input the molecular information of each molecule in the training set of the first molecular information set obtained in step (2-1) into the encoder of the molecular optimization model to obtain the molecule xt at time t, which is the molecule after adding noise, and obtain the noise εt sampled from the standard normal distribution at time t.

[0101] Specifically, this step begins by defining the forward diffusion process equation, which is as follows: Where x0 represents the molecular information of each molecule in the training set of the first molecular information set, and then calculate... Where T is the total number of diffusion steps, which is taken as 1000 here. Finally, the noisy molecule xt at time t is sampled, i.e. The noisy molecule xt at any given time can be obtained through a forward diffusion process.

[0102] (2-4) Input the noise-adding molecule xt at time t obtained in step (2-3) into the first graph noise prediction module to obtain the noise prediction vector set at time t;

[0103] Specifically, this step first inputs the noise-adding molecule xt at time t obtained in step (2-3) into the standard message passing layer and the attention-based fully connected message passing layer in the first graph noise prediction module to obtain the first message passing vector set and the second message passing vector set; finally, the obtained first message passing vector set and second message passing vector set are input into the fully connected layer in the first graph noise prediction module to obtain the noise prediction vector set.

[0104] (2-5) Based on the noise prediction vector set obtained in step (2-4) The loss function is calculated using the real noise εt obtained in (2-3). The encoder based on the diffusion model is iteratively trained using this loss function to obtain the iteratively trained encoder. The iteratively trained encoder is then validated using the validation set in the first molecular information set in step (2-1) to obtain the initially trained encoder.

[0105] Specifically, the loss function in this step calculates the distance between the predicted noise and the actual noise. The goal of optimizing the loss function is to make the predicted noise equal to the actual noise, and its calculation formula is as follows: in Represents the set of noise prediction vectors The squared second norm of the distance between the real noise εt and the actual noise. This means calculating the expected value of xt given x0. This represents the expected value of x0. θ1 represents the parameter θ1 of the graph noise prediction module of the optimized encoder, which makes the predicted noise equal to the actual noise.

[0106] (2-6) Repeat steps (2-3) to (2-5) until the total number of iterations (epochs) set in step (2-2) is reached, thereby obtaining the trained encoder based on the diffusion model.

[0107] (2-7) Input the molecular information of each molecule in the training set of the second molecular information set obtained in step (2-1) into the decoder of the molecular optimization model to obtain the molecule xt at time t, where the molecule xt is the molecule after adding noise;

[0108] Specifically, this step begins by defining the forward diffusion process equation, which is as follows: Where x0 represents the molecular information of each molecule in the training set within the second molecular information set, and then calculate... Finally, the noisy molecule xt at time t is sampled, i.e. The forward diffusion process allows us to obtain the noisy molecule xt and the corresponding noise εt at any given time.

[0109] (2-8) Input the noise-adding molecule xt at time t obtained in step (2-7) into the noise prediction module of the second figure to obtain the noise prediction vector set at time t;

[0110] Specifically, this step first inputs the noise-adding molecule xt at time t obtained in step (2-7) into the standard message passing layer and the attention-based fully connected message passing layer in the second graph noise prediction module to obtain the first message passing vector set and the second message passing vector set; finally, the obtained first message passing vector set and second message passing vector set are input into the fully connected layer in the second graph noise prediction module to obtain the noise prediction vector set.

[0111] (2-9) Based on the noise prediction vector set obtained in step (2-8) The loss function is calculated using the real noise εt added in (2-7). The loss function is used to iteratively train the decoder based on the diffusion model to obtain the iteratively trained decoder. The iteratively trained decoder is then verified using the validation set in the second molecular information set in step (2-1) to obtain the preliminarily trained decoder.

[0112] Specifically, the loss function in this step calculates the distance between the predicted noise and the actual noise. The goal of optimizing the loss function is to make the predicted noise equal to the actual noise, and its calculation formula is as follows: in Represents the set of noise prediction vectors The squared second norm of the distance between the real noise εt and the actual noise. This means calculating the expected value of xt given x0. This represents the expected value of x0. The parameter θ2 of the graph noise prediction module of the optimizer is set so that the predicted noise is equal to the actual noise.

[0113] (2-10) Repeat steps (2-7) to (2-9) until the total number of iterations (epochs) set in step (2-2) is reached, thereby obtaining the trained decoder based on the diffusion model.

[0114] Test Results

[0115] The testing environment for this invention was as follows: Ubuntu 18.04.5 operating system, Intel(R) Xeon(R) Platinum 8358 CPU @ 2.60GHz, two NVIDIA RTX 2080Ti 24GB GPUs, and the algorithm of this invention was implemented using Python 3.7.

[0116] To demonstrate the effectiveness of the method of this invention and its improvement on molecular optimization, tests were conducted on the test set derived from the ZINC dataset. The test results obtained by this invention were compared with several current advanced methods, and the evaluation results are shown in Table 1.

[0117] According to the test results on the test set derived from the ZINC dataset as recorded in Table 1, it can be seen that the molecular optimization method based on the diffusion model proposed in this invention outperforms existing methods in terms of success rate, diversity, and novelty.

[0118] Table 1 Comparison of Molecular Optimization Results

[0119]

[0120] Those skilled in the art will readily understand that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A molecular optimization method based on a diffusion model, characterized in that, Includes the following steps: (1) Obtain multiple molecules, each with a DRD2 value. Construct a first molecule set from all molecules with a DRD2 value less than 0.05, and a second molecule set from all molecules with a DRD2 value greater than 0.

5. Preprocess the first and second molecule sets to obtain updated first and second molecule sets respectively. Extract information for each molecule from the first and second molecule sets respectively. The information of all molecules in the first molecule set constitutes the first molecule information set, and the information of all molecules in the second molecule set constitutes the second molecule information set. Step (1) specifically involves downloading molecules from the open-source dataset ZINC and storing the molecules in the simplified molecule input line specification SMILES format, i.e. The molecules are represented by text. Then, the DRD2 value of each molecule is calculated using the open-source software RDKit. Molecules with a DRD2 value less than 0.05 are placed into a first molecule set, and molecules with a DRD2 value greater than 0.5 are placed into a second molecule set. Subsequently, the Morgan fingerprint of each molecule in the first and second molecule sets is extracted using RDKit. The Tanimoto similarity between each molecule in the first and second molecule sets is calculated using the Morgan fingerprint. Molecules with a Tanimoto similarity less than or equal to 0.4 are removed to obtain updated first and second molecule sets. Finally, RDKit is used to extract molecular information for each molecule in the first and second molecule sets, including the atomic features of the molecules. Chemical bond characteristics and molecular skeleton structure The chemical bond characteristics of the molecules This further includes the discrete structure of the molecular diagram corresponding to the molecule. and chemical bond types ,Right now Since the maximum length of a molecule is 35, each molecule corresponds to a discrete structure in the molecular diagram. Chemical bond types and the atomic characteristics of the molecule. and molecular skeleton structure All four are Len*Len matrices, so the molecular information corresponding to each molecule is represented by 4 Len*Len matrices. Finally, the molecular information of all molecules in the first set of extracted molecules is used to construct the first molecular information set, and the molecular information of all molecules in the second set of extracted molecules is used to construct the second molecular information set, where Len represents the maximum length of the molecule. (2) Input the first molecular information set after preprocessing in step (1) into the pre-trained molecular optimization model to obtain the molecular optimization result of each molecule corresponding to the first molecular information set.

2. The molecular optimization method based on a diffusion model according to claim 1, characterized in that, The molecular optimization result obtained in step (2) is to optimize the molecules with DRD2 values ​​less than 0.05 corresponding to the first molecular information set after preprocessing into molecules with DRD2 values ​​greater than 0.5, and the molecular similarity between the two is greater than 0.

4. The molecular optimization model is based on the diffusion model and includes an encoder and a decoder.

3. The molecular optimization method based on a diffusion model according to claim 2, characterized in that, The encoder includes a noise prediction module and a forward diffusion module, the specific structure of which is as follows: The first diagram shows the noise prediction module. For a graph neural network, where The parameters for the noise prediction module in the encoder are as follows: its input at time t=0 is the molecular information of a batch of molecules corresponding to the first molecular information set, and its input at subsequent times t is the molecular information at time t. The output is a set of noise prediction vectors of size Num*128, where Num represents the batch size; The first diagram shows the noise prediction module. It includes a standard messaging layer, an attention-based fully connected messaging layer, and a fully connected layer; The input of the standard message passing layer at time t=0 is the molecular information of a batch of molecules corresponding to the first molecular information set, that is, a matrix of size Num*4 Len*Len. The output at time t=0 is the first message passing vector set of size Num*32*256. The standard message passing layer receives the molecular information at time t as its input at time t. The output at time t is the first message passing vector set of size Num*32*256; Specifically, at time t=0, the standard message passing layer first uses the Linear_pyg model in the PyTorch framework to increase the dimensionality of the molecular information of a batch of molecules corresponding to the first set of molecular information to obtain the first feature vector set. Then, it uses the ReLU linear rectified function to perform nonlinear processing on the first feature vector set to obtain the intermediate vector set. Subsequently, it uses the Linear_pyg model in the PyTorch framework to reduce the dimensionality of the intermediate vector set to obtain the second feature vector set. Finally, it uses the GINEConv model in the PyTorch framework to perform message aggregation on the second feature vector set to output the first message passing vector set of size Num*32*256. At the subsequent time t, the standard message passing layer first uses the Linear_pyg model in the PyTorch framework to process the molecular information at time t. The system first increases the dimensionality to obtain the first set of feature vectors. Then, it uses ReLU to perform non-linear processing on the first set of feature vectors to obtain an intermediate set of vectors. Subsequently, it uses the Linear_pyg model in the PyTorch framework to reduce the dimensionality of the intermediate set of vectors to obtain the second set of feature vectors. Finally, it uses the GINEConv model in the PyTorch framework to perform message aggregation on the second set of feature vectors to output the first set of message passing vectors with a size of Num*32*256.

4. The molecular optimization method based on a diffusion model according to claim 3, characterized in that, The input of the attention-based fully connected message passing layer at time t=0 is the molecular information of a batch of molecules corresponding to the first molecular information set, that is, a matrix of size Num*4 Len*Len. The output at time t=0 is the second message passing vector set of size Num*32*256. The attention-based fully connected message-passing layer takes the molecular information at time t as its input at time t. The output at time t is a second message passing vector set of size Num*32*256; Specifically, at time t=0, the attention-based fully connected message passing layer first uses the Linear layer in the PyTorch framework to perform a nonlinear transformation on the molecular information of a batch of molecules in the first set of input molecular information to obtain an intermediate vector set. Then, the attention mechanism is used to process the intermediate vector set to obtain the attention vector set. Finally, the hyperbolic tangent activation function tanh is used to activate the attention vector set to output a second message passing vector set of size Num*32*256. At a subsequent time t, the attention-based fully connected message-passing layer first uses the Linear layer in the PyTorch framework to process the molecular information at time t. A nonlinear transformation is performed to obtain an intermediate vector set. Then, an attention mechanism is used to process the intermediate vector set to obtain an attention vector set. Finally, tanh is used to activate the attention vector set to output a second message passing vector set of size Num*32*256.

5. The molecular optimization method based on a diffusion model according to claim 4, characterized in that, The input of the fully connected layer at time t=0 is a first message passing vector set of size Num*32*256 output from the standard message passing layer, and a second message passing vector set of size Num*32*256 output from the attention-based fully connected message passing layer, and a noise prediction vector set of size Num*128 output. The input of the fully connected layer at time t is a first message passing vector set of size Num*32*256 output from the standard message passing layer and a second message passing vector set of size Num*32*256 output from the attention-based fully connected message passing layer. The output at time t is a noise prediction vector set of size Num*128. Specifically, at time t=0, the fully connected layer first adds the first message passing vector set and the second message passing vector set to obtain an intermediate vector set. Finally, the Linear layer in the PyTorch framework performs non-linear processing on the intermediate vector set to output a noise prediction vector set of size Num*128. At time t, the fully connected layer first adds the first message passing vector set and the second message passing vector set to obtain an intermediate vector set. Finally, the Linear layer in the PyTorch framework performs non-linear processing on the intermediate vector set to output a noise prediction vector set of size Num*128. The input to the forward diffusion module is the molecular information at time t. The noise prediction module in the first figure outputs a set of noise prediction vectors of size Num*128, and the output is the numerator at time T. ; Specifically, the forward diffusion module first calculates the molecular time at time t+1. ,in , , The first graph noise prediction module of the encoder at time t Based on the input The set of output noise prediction vectors is then used to obtain the numerator at time t+1. The input is fed into the noise prediction module of the first figure to obtain the noise prediction vector set at time t+1. Then, for the obtained noise prediction vector set at time t+1, t=t+1 is set, and the numerator at time t+2 is calculated through the above process. Repeat the above process, setting t=t+1 each time, until t=T, at which point the molecule at time T is obtained. ,in This represents the total number of diffusion steps, and T = 1000.

6. The molecular optimization method based on a diffusion model according to claim 5, characterized in that, The decoder includes a second-graph noise prediction module and an inverse denoising module; The second diagram shows the noise prediction module. For a graph neural network, where These are the parameters for the image noise prediction module in the decoder, whose input is the numerator at time T output by the encoder. Output a set of noise prediction vectors of size Num*128; The specific structure of the noise prediction module in the second figure, as well as the input processing procedure, are exactly the same as those in the noise prediction module in the first figure. The input to the inverse denoising module is the numerator at time T output by the encoder. Noise prediction module in Figure 2 The output is a set of noise prediction vectors of size Num*128, and the output is the numerator at time t=0. ; Specifically, first calculate the molecule at time t-1. ,in , Then, the molecule obtained at time t-1 The input is fed into the noise prediction module in the second figure to obtain the noise prediction vector set at time t-1. Then, for the obtained noise prediction vector set at time t-1, t=t-1 is set, and the numerator at time t-2 is calculated through the above process. Repeat the above process, setting t=t-1 each time, until t=0, at which point the molecule at t=0 is obtained. This refers to the optimized molecule.

7. The molecular optimization method based on a diffusion model according to claim 6, characterized in that, The molecular optimization model is obtained through the following steps: (2-1) Obtain multiple molecules, each with a DRD2 value. Construct a first molecule set from all molecules with a DRD2 value less than 0.05, and a second molecule set from all molecules with a DRD2 value greater than 0.

5. Preprocess the first and second molecule sets to obtain updated first and second molecule sets respectively. Extract information for each molecule from the first and second molecule sets respectively. The information of all molecules in the first molecule set constitutes the first molecule information set, and the information of all molecules in the second molecule set constitutes the second molecule information set. Divide the information of all molecules in the first molecule information set and the information of all molecules in the second molecule information set into training, testing, and validation sets respectively in a ratio of 8:1:

1. (2-2) Initialize the total number of epochs and the learning rate of the molecular optimization model during the training process. ; (2-3) Input the molecular information of each molecule in the training set of the first molecular information set obtained in step (2-1) into the encoder of the molecular optimization model to obtain the molecular information at time t. The molecule The molecule is given noise, and the noise sampled from the standard normal distribution at time t is obtained. ; (2-4) The noise-adding molecule at time t obtained in step (2-3) The data is input into the noise prediction module of the first graph to obtain the set of noise prediction vectors at time t; (2-5) The set of noise prediction vectors obtained from step (2-4) The actual noise obtained in (2-3) Calculate the loss function, use the loss function to iteratively train the encoder based on the diffusion model, and obtain the iteratively trained encoder. Then, use the validation set in the first molecular information set in step (2-1) to validate the iteratively trained encoder to obtain the initially trained encoder. (2-6) Repeat steps (2-3) to (2-5) until the total number of iterations (epochs) set in step (2-2) is reached, thereby obtaining the trained encoder based on the diffusion model; (2-7) Input the molecular information of each molecule in the training set of the second molecular information set obtained in step (2-1) into the decoder of the molecular optimization model to obtain the molecular information at time t. The molecule The molecule after noise addition; (2-8) The noise-adding molecule at time t obtained in step (2-7) The input is fed into the noise prediction module of the second figure to obtain the set of noise prediction vectors at time t; (2-9) Based on the noise prediction vector set obtained in step (2-8) The real noise added in (2-7) Calculate the loss function, use the loss function to iteratively train the decoder based on the diffusion model, and obtain the iteratively trained decoder. Then, use the validation set in the second molecular information set in step (2-1) to validate the iteratively trained decoder to obtain the preliminarily trained decoder. (2-10) Repeat steps (2-7) to (2-9) above until the total number of iterations (epochs) set in step (2-2) is reached, thereby obtaining the trained decoder based on the diffusion model.

8. The molecular optimization method based on a diffusion model according to claim 7, characterized in that, Step (2-3) specifically involves first defining the forward diffusion process equation, which is: ,in, For each molecule in the training set from the first molecule information set, then calculate... , , Where T is the total number of diffusion steps, which is taken as 1000 here. Finally, for the noisy molecule at time t... Sampling, i.e. Noisy molecules at any given time can be obtained through a forward diffusion process. ; Step (2-4) specifically involves first processing the noise-adding molecules at time t obtained in step (2-3). The first message passing vector set and the second message passing vector set are input into the standard message passing layer and the attention-based fully connected message passing layer in the first graph noise prediction module to obtain the first message passing vector set and the second message passing vector set. Finally, the first message passing vector set and the second message passing vector set are input into the fully connected layer in the first graph noise prediction module to obtain the noise prediction vector set. The formula for calculating the loss function in step (2-5) is as follows: ,in Represents the set of noise prediction vectors With real noise The square of the second norm of the distance between them express Certainly calculate Expected value express Expected value This represents the parameters of the graph noise prediction module for optimizing the encoder. This makes the predicted noise equal to the actual noise; Step (2-7) specifically involves first defining the forward diffusion process equation, which is: ,in, For each molecule in the training set within the second molecule information set, then calculate... , , Finally, for the noisy molecule at time t... Sampling, i.e. Noisy molecules at any given time can be obtained through a forward diffusion process. and corresponding noise ; Step (2-8) specifically involves first processing the noise-adding molecule at time t obtained in step (2-7). The first message passing vector set and the second message passing vector set are input into the standard message passing layer and the attention-based fully connected message passing layer in the second graph noise prediction module to obtain the second message passing vector set; finally, the first message passing vector set and the second message passing vector set are input into the fully connected layer in the second graph noise prediction module to obtain the noise prediction vector set. The formula for calculating the loss function in step (2-9) is as follows: ,in Represents the set of noise prediction vectors With real noise The square of the second norm of the distance between them express Certainly calculate Expected value express Expected value This represents the parameters of the graph noise prediction module in the optimizer. Make the predicted noise equal to the actual noise.

9. A molecular optimization system based on a diffusion model, implemented based on the molecular optimization method based on a diffusion model as described in claim 1, characterized in that, The molecular optimization system includes: The first module is used to acquire multiple molecules, each with a DRD2 value. All molecules with DRD2 values ​​less than 0.05 are constructed into a first molecule set, and all molecules with DRD2 values ​​greater than 0.5 are constructed into a second molecule set. The first and second molecule sets are preprocessed to obtain updated first and second molecule sets, respectively. Information of each molecule is extracted from the first and second molecule sets, respectively. The information of all molecules in the first molecule set constitutes the first molecule information set, and the information of all molecules in the second molecule set constitutes the second molecule information set. The second module is used to input the first molecular information set preprocessed by the first module into the pre-trained molecular optimization model to obtain the molecular optimization result of each molecule corresponding to the first molecular information set.

Citation Information

Patent Citations

  • Marine compound molecule generation method based on deep learning and chemical reaction rules

    CN115565622A

  • Methods and systems for generating lifestyle change recommendations based on biological extractions

    US20210295977A1