A new drug molecule design method and device fusing convex optimization and evolutionary learning
By integrating generative adversarial network models that combine convex optimization and evolutionary learning, we can optimize the generation of small molecule sequences. This solves the problem of balancing diversity and practicality in high-dimensional chemical spaces in existing generative models, and achieves improvements in high quality, small molecule diversity, and innovation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NORTHEASTERN UNIV CHINA
- Filing Date
- 2025-01-03
- Publication Date
- 2026-04-28
AI Technical Summary
Existing molecular generation methods struggle to balance efficacy, innovation, and drugability when generating high-quality, small-molecule diversity and specific functional molecules, especially in balancing the diversity and practicality of generation models in high-dimensional chemical spaces.
A generative adversarial network (GAN) model combining convex optimization and evolutionary learning is used to construct a generator and a discriminator through word embedding, long short-term memory network and convolutional neural network based on convex optimization. The parameters are updated using policy gradient method and gradient descent method to optimize the generation of small molecule sequences.
It generates small molecules with high similarity to the original samples, greater efficiency and innovation, improving the diversity and quality of generated molecules, especially excelling in generating specific functional molecules, and overcoming the limitations of traditional methods.
Smart Images

Figure CN119943205B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of bioinformatics, specifically relating to a novel drug molecule design method and apparatus that integrates convex optimization and evolutionary learning. Background Technology
[0002] In the field of small molecule generation, with the increasing demand for drug development and materials design, traditional methods based on chemical theory and empirical formulas are gradually showing their limitations. These traditional methods rely on high-precision quantum chemical calculations and laboratory synthesis screening. Although they can provide reliable molecular structures, they are inefficient and cannot effectively address the exploration of vast chemical spaces. Traditional molecular generation methods typically face challenges of high complexity and computational cost.
[0003] In recent years, with the development of machine learning and artificial intelligence technologies, data-driven molecular generation methods have gradually attracted attention. Generative models based on large-scale molecular databases, such as variational autoencoders and autoregressive models, have been used to generate small molecule structures with specific chemical properties. These methods, by learning the distribution of a large number of known molecules, can efficiently generate small molecules that conform to specific chemical rules, significantly improving the efficiency of molecular screening. However, these generative models still have limitations in terms of the effectiveness of generated molecules, similarity to the original data, and novelty, especially when generating molecules with specific functions, it is difficult to take into account the effectiveness of generated small molecules, similarity to the original data, novelty, and druggability.
[0004] However, these generative models still have limitations in terms of the diversity and quality of generated molecules, especially when generating specific functional molecules. Existing methods struggle to balance druggability, molecular sample diversity, and novelty. Nevertheless, some research has begun to explore improving the efficiency and quality of molecule generation by introducing deep learning techniques (such as Generative Adversarial Networks, GANs). These models rely on learning from known molecules and can generate molecular structures that conform to the target distribution. However, existing generative models still face challenges in generating high-quality molecules, particularly when dealing with high-dimensional chemical spaces. Balancing the diversity and practicality of generated molecules remains a critical issue. Therefore, further improving the performance of generative models, especially in enhancing the accuracy of specific targets such as molecular stability and functionality, remains a key research focus in the field of small molecule generation. Summary of the Invention
[0005] To address the shortcomings of existing technologies, this application proposes a novel drug molecule design method and apparatus that integrates convex optimization and evolutionary learning. It combines convex optimization with a GAN (Generative Adversarial Networks) model with reinforcement learning. Compared with other methods, this method can obtain small molecules with higher similarity to the original samples, higher effectiveness in generating small molecules, and higher innovation and drug-likeness for the original dataset.
[0006] Firstly, this application proposes a novel drug molecule design method that integrates convex optimization and evolutionary learning, including:
[0007] Step S1: Obtain the initial dataset of small molecules, where each element in the initial dataset of small molecules is a string representing a small molecule;
[0008] Step S2: Use word embedding to map each element in the initial dataset of small molecules, and convert the strings of small molecules into vectors of small molecules;
[0009] Step S3: In the generative adversarial network, the mapping result of the initial small molecule dataset is input into the generator to generate small molecule sequences, and the loss function of the generator is calculated. The generator is built by adding an attention mechanism model to the long short-term memory network.
[0010] Step S4: Use a discriminator to evaluate the authenticity of the small molecule sequence and calculate the loss function of the discriminator. The discriminator is built using a convolutional neural network based on convex optimization.
[0011] Step S5: Using the generator's loss function as the objective function, update the generator's parameters using the policy gradient method;
[0012] Step S6: Using the discriminator's loss function as the objective function, update the discriminator's parameters using gradient descent.
[0013] Step S7: If the current iteration count has not reached the iteration count threshold, return to step S3: Regenerate the small molecule sequence using the generator corresponding to the updated generator parameters;
[0014] Step S8: If the current iteration count reaches the iteration count threshold, output the final parameters of the generator and the discriminator.
[0015] Step S9: Generate the final small molecule sequence using the generator corresponding to the parameters of the final generator.
[0016] The process of obtaining the initial small molecule dataset includes: extracting the SMILES dataset describing the structure and characteristics of small molecules from the QM9 dataset, and preprocessing the SMILES dataset to obtain the initial small molecule dataset.
[0017] The method of using word embedding to map each element in the initial dataset of small molecules, converting the strings of small molecules into vectors, includes:
[0018] Construct a vocabulary, which includes all unique characters appearing in the SMILES dataset and their corresponding numeric indices;
[0019] By utilizing the correspondence between characters and numeric indices in the vocabulary, each element in the initial small molecule dataset is mapped to obtain a one-hot vector of the initial small molecule dataset.
[0020] The one-hot vector is multiplied by a predefined embedding matrix to obtain the embedding vector;
[0021] Multiple embedding vectors are combined into a batch embedding vector, and the batch embedding vector is used as the vector of the small molecule.
[0022] The generator comprises: multiple long short-term memory networks, an attention mechanism model, and a fully connected layer. Each long short-term memory network corresponds to an input vector of the generator. The output of each long short-term memory network is multiplied by the attention weights. All product results are used as the input of the attention mechanism model. The output of the attention mechanism model is used as the input of the fully connected layer. The output of the fully connected layer is used as the output of the generator.
[0023] The discriminator is built using a convolutional neural network based on convex optimization. The building process includes:
[0024] The initial small molecule dataset and small molecule sequences are embedded to obtain the small molecule embedding matrix;
[0025] The Nystroem method is used to perform kernel approximation on the small molecule embedding matrix to obtain the feature matrix;
[0026] The feature matrix is input into a convolutional neural network for convolution operation;
[0027] The convolution result is input into a max pooling layer for dimensionality reduction, and the dimensionality reduction result is obtained.
[0028] The dimensionality reduction results are processed using a Highway network.
[0029] The output of the Highway network is optimized using a convex optimization layer;
[0030] The optimized structure is mapped onto the classification result through a fully connected layer to obtain the output of the discriminator.
[0031] In the convex optimization layer, the objective function of convex optimization is to minimize the distance between the small molecule sequence and the initial small molecule dataset, and to maximize the diversity of the small molecule sequence and the consistency between the initial small molecule dataset. The constraint is that the characteristics of the small molecule sequence are similar to the characteristics of the initial small molecule dataset.
[0032] The objective function for the convex optimization is calculated as follows:
[0033]
[0034] Among them, hh i For the output of the i-th Highway network, hh j For the output of the j-th Highway network, hh i ' represents the feature of the i-th element in the output of the discriminator Highway network from the initial small molecule dataset, γ is the kernel function bandwidth parameter in the Nystroem method, div is the function for generating sample diversity, coh is the function for generating coherence between samples, and sim(hh) i hh j ) represents the normalized similarity measure Tanimoto coefficient, whose value lies between 0 and 1, ||hh i -hh j || 2 δ is the Euclidean distance between samples, ε is a set value, which can be 0.1, δ is the regularization constraint parameter, and B is the sample batch size.
[0035] Secondly, this application proposes a novel drug molecule design device that integrates convex optimization and evolutionary learning, comprising:
[0036] The initial sample acquisition module is used to acquire the initial dataset of small molecules, wherein each element in the initial dataset of small molecules is a string representing a small molecule.
[0037] The sample conversion module is used to map each element in the initial dataset of small molecules using word embedding, converting the strings of small molecules into vectors of small molecules;
[0038] The sample generation module is used in the generative adversarial network to input the mapping results of the initial small molecule dataset into the generator to generate small molecule sequences and to calculate the loss function of the generator. The generator is built by adding an attention mechanism model to the long short-term memory network.
[0039] The sample evaluation module is used to evaluate the authenticity of the small molecule sequence using a discriminator and calculate the loss function of the discriminator, which is built using a convolutional neural network based on convex optimization.
[0040] The first parameter update module is used to update the generator's parameters using the policy gradient method with the generator's loss function as the objective function.
[0041] The second parameter update module is used to update the parameters of the discriminator using the discriminator's loss function as the objective function and the gradient descent method.
[0042] The loop iteration module is used to return to the sample generation module if the current iteration number has not reached the iteration number threshold: regenerate the small molecule sequence using the generator corresponding to the updated generator parameters; if the current iteration number has reached the iteration number threshold, output the final generator parameters and discriminator parameters.
[0043] The results output module is used to generate the final small molecule sequence using the generator corresponding to the parameters of the final generator.
[0044] Thirdly, this application proposes an electronic device comprising: one or more processors, and a memory for storing instructions that, when executed by the one or more processors, cause the one or more processors to perform the novel drug molecule design method that combines convex optimization and evolutionary learning.
[0045] Fourthly, this application proposes a computer-readable storage medium storing executable instructions that, when executed, cause a processor to perform the novel drug molecule design method that combines convex optimization and evolutionary learning.
[0046] Beneficial effects:
[0047] This application proposes a novel drug molecule design method and apparatus that integrates convex optimization and evolutionary learning. Compared with traditional methods, this method can generate small molecules with high similarity to the original samples, greater effectiveness, and stronger innovation, improving the diversity and quality of generated molecules, especially excelling in generating molecules with specific functions. This method not only improves the efficiency and quality of small molecule generation but also overcomes the limitations of traditional methods in terms of molecule diversity, stability, and physical properties, providing strong technical support for drug development and materials design. Attached Figure Description
[0048] Figure 1 A flowchart of a novel drug molecule design method integrating convex optimization and evolutionary learning according to an embodiment of this application.
[0049] Figure 2 A schematic diagram of a novel drug molecule design method integrating convex optimization and evolutionary learning according to an embodiment of this application;
[0050] Figure 3 A schematic diagram of the generator structure in this application embodiment.
[0051] Figure 4 A schematic diagram of the discriminator structure in an embodiment of this application.
[0052] Figure 5 A comparison diagram of the generated small molecules and sample small molecules in this embodiment of the application. Detailed Implementation
[0053] To facilitate understanding of this application, a more complete description will be provided below with reference to the accompanying drawings, which illustrate preferred embodiments of the application. However, this application can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the disclosure of this application.
[0054] Small molecule generation is an indispensable part of pharmaceutical research and new drug discovery. In order to provide higher quality and more diverse small molecules, this application provides a new drug molecule design method and device that integrates convex optimization and evolutionary learning, which can generate innovative and high-quality small molecule datasets based on the original real small molecule datasets.
[0055] Example 1:
[0056] This application proposes a novel drug molecule design method that integrates convex optimization and evolutionary learning, such as Figure 1 As shown, it includes:
[0057] Step S1: Obtain the initial dataset of small molecules, where each element in the initial dataset of small molecules is a string representing a small molecule;
[0058] The process of obtaining the initial small molecule dataset includes: extracting the SMILES dataset describing the structure and characteristics of small molecules from the QM9 dataset; preprocessing the SMILES dataset, including: removing duplicate data from the dataset and removing invalid molecules using Rdkit, to obtain the initial small molecule dataset.
[0059] In this embodiment, SMILES describing the structure and characteristics of small molecules are extracted from the QM9 dataset, and after processing, a dataset with 130,000 SMILES is obtained.
[0060] Step S2: Use word embedding to map each element in the initial dataset of small molecules, and convert the strings of small molecules into vectors of small molecules;
[0061] In this embodiment, the 130,000 data points obtained in step S1 are processed using word embedding methods commonly used in text data to capture and retain key features of small molecule sequences, facilitating their subsequent input into neural network training. Specifically, this includes:
[0062] The method of using word embedding to map each element in the initial dataset of small molecules, converting the strings of small molecules into vectors, includes:
[0063] Step S2.1: Construct a vocabulary, which includes all unique characters appearing in the SMILES dataset and their corresponding numeric indices;
[0064] In this embodiment, in order to convert the SMILES dataset into embedding vectors, a vocabulary M needs to be constructed. Vocabulary M includes: all unique characters appearing in the SMILES dataset and their corresponding numeric indices;
[0065] Step S2.2: Using the correspondence between characters and numeric indices in the vocabulary, map each element in the initial small molecule dataset to obtain a one-hot vector of the initial small molecule dataset;
[0066] In this embodiment, the character-to-index mapping is performed as follows: for each character c in the SMILES string, a mapping function f is used to find its index i in the vocabulary, i = 1, 2, ..., N:
[0067] i = f(c)
[0068] Here, f(c) is a lookup function that returns the position of character c in the vocabulary, and N is the total number of indexes.
[0069] In this embodiment, the vocabulary corresponding to the characters is as follows:
[0070] {"=":"0","-":"1","]":"2","2":"3","H":"4","F":"5","+":"6",")":"7","#":"8","(":"9","N":"10",
[0071] "O":"11","4":"12","C":"13","[":"14","n":"15","1":"16","5":"17","c":"18","3":"19","o":"20"}
[0072] Step S2.3: Perform matrix multiplication between the one-hot vector and the preset embedding matrix to obtain the embedding vector;
[0073] In this embodiment, for each SMILES character, it is converted into a one-hot vector of the same size as the vocabulary according to the character's index i∈[1,N], where the index position corresponding to the character is 1 and the other positions are 0. Then, these one-hot vectors are coupled to a predefined embedding matrix E∈RN×D Matrix multiplication can efficiently convert discrete one-hot representations into embedding vectors. Each row of the embedding matrix represents the embedding vector of a character in the vocabulary. When a one-hot vector is multiplied by the embedding matrix, only the positions where a 1 is in the one-hot vector match the corresponding row in the embedding matrix. The result is the selection and return of the embedding vector e for that character. t ;
[0074] e t =E(i)
[0075] Where N is the size of the vocabulary, D is the dimension of the embedding, and the embedding vector e t This represents the vector in the i-th row of the embedding matrix E, i.e., the embedding vector of the character with index i.
[0076] Step S2.4: Combine multiple embedding vectors into a batch embedding vector, and use the batch embedding vector as the vector of the small molecule.
[0077] In this embodiment, multiple embedding vectors e t Combined into a batch embedding matrix, the input sequences of different lengths are padded to ensure that all sequences have a sequence representation x of the same length L. g ∈R L×D The embedded matrix is X∈R B×L×D Where B is the batch size;
[0078] x g =[e1,e2,...,e l ]
[0079] X = [x1, x2, ..., x B ]
[0080] Step S3: In the generative adversarial network, the mapping result of the initial small molecule dataset is input into the generator to generate small molecule sequences, and the loss function of the generator is calculated. The generator is built by adding an attention mechanism model to the long short-term memory network.
[0081] In this embodiment, the generator, such as Figure 3 As shown, it includes: multiple long short-term memory networks, an attention mechanism model, and a fully connected layer. Each long short-term memory network corresponds to an input vector of a generator. The output of each long short-term memory network is multiplied by the attention weights. All product results are used as the input of the attention mechanism model. The output of the attention mechanism model is used as the input of the fully connected layer. The output of the fully connected layer is used as the output of the generator.
[0082] Among them, LSTM (Long Short-Term Memory) is an improvement on recurrent neural networks, effectively solving the gradient explosion and vanishing problems of RNNs (Recurrent Neural Networks). LSTM processes the embedding vector sequence in step S2, capturing the long-term dependencies of the sequence through its internal gating mechanism. At each time step, the LSTM unit considers the current input and the previous hidden state to calculate the new hidden state and unit state. The LSTM unit consists of a forget gate, an input gate, a unit state gate, and an output gate. The formulas for each gate and cell unit are expressed as follows:
[0083] (Lastm formula at time t)
[0084] Forgotten Gate: f t =σ(W f ·[h t-1 ,e t ]+b f )
[0085] Input gate: i t =σ(W i ·[h t-1 ,e t ]+b i )
[0086]
[0087] Cell status update:
[0088] Output gate:o t =σ(W o ·[h t-1 ,e t ]+b o )
[0089] h t =o t ·tanh(C t +A t )
[0090] Among them, f t For the output of the forget gate, i t The output of the input gate, For candidate cell states, C t For the current cell state, o t For the output of the output gate, h t As the current hidden state, W f W i W C W oThese are the weight matrices for the forget gate, input gate, candidate cell state, and output gate, respectively. f b i b C b o These are the bias vectors for the forget gate, input gate, candidate cell state, and output gate, respectively. σ is the sigmoid function, mapping the input to between 0 and 1. t h is the current embedding vector representing the input character. t-1 A is the hidden state of the previous time step. t This is the weighted information calculated based on the current input sequence using a self-attention mechanism.
[0091] Adding an attention mechanism to LSTM allows the model to focus on the most important parts of the sequence when generating new samples. It calculates attention weights to weight different parts of the input sequence, resulting in a weighted context vector. The calculation of attention weights typically involves transformations of the query, key, and value, and is normalized using a softmax function; the attention calculation formula is as follows:
[0092]
[0093] Q t =W q x g
[0094] K t =W K x g
[0095] V t =W V x g
[0096] Where, x g =[e1,e2,...,e l ] represents the input sequence, W q W K and W V The weight matrix Q represents the learned weights. t K t and V t d represents the query, key, and value matrix, respectively. k Indicates the dimension of the input features.
[0097] The weighted context vector is passed to the fully connected layer to generate the final output. The output layer produces a probability distribution for the next word in the sequence. Words are sampled from the probability distribution produced by the output layer to generate new samples, selecting the word with the highest probability.
[0098] Step S4: Use a discriminator to evaluate the authenticity of the small molecule sequence and calculate the loss function of the discriminator. The discriminator is built using a convolutional neural network based on convex optimization.
[0099] In this embodiment, the discriminator is built using a convolutional neural network based on convex optimization. This discriminator is used to evaluate the authenticity of the generated small molecule sequences, ensuring the high quality and authenticity of the generator's output. Figure 4 As shown, the setup process includes:
[0100] Step S4.1: Embed the initial small molecule dataset and small molecule sequences to obtain the small molecule embedding matrix;
[0101] In this embodiment, the generated SMILES data (i.e., small molecule sequences) and the real SMILES data (i.e., the initial small molecule dataset) are embedded, and the dimension of the embedding layer is set to 32.
[0102] In this embodiment, the generated SMILES data “CNc1c(oc[nH]c1N)F” and the actual SMILES data “CC12OC3C(=O)C1C23C” have index numbers of [13,13,16,3,11,13,19,13,16,13,3,19,13] and [13,10,18,16,18,15,4,18,16,10,5], respectively, and are transformed into the following matrix:
[0103] [[-0.2342 0.3453 0.4564 0.5675 0.6786 0.7897 0.8908 0.9010 0.0120 0.1231 0.2342 0.3453 0.4565 0.5676 0.6787 0.7898 0.8909 0.9019 0.0120 0.1231 0.2342 0.3453 0.4565 0.5676 0.6787 0.7898 0.8909 0.9019 0.0120 0.1231]
[0108] [-0.2342 0.3453 0.4565 0.5676 0.6787 0.7898 0.8909 0.9019 0.0120 0.1231 0.2342 0.3453 0.4565 0.5676 0.6787 0.7898 0.8909 0.9019 0.0120 0.1231 0.2342 0.3453 0.4565 0.5676 0.6787 0.7898 0.8909 0.9019 0.0120 0.1231] ... ]
[0115] Step S4.2: The Nystroem method is used to perform kernel approximation on the small molecule embedding matrix to obtain the feature matrix;
[0116] In this embodiment, the embedding matrix is X∈R L×D First, the Nystroem kernel approximation is applied to each row of the embedding matrix (i.e., the embedding vector of each character). The kernel approximation maps the original input, transforming the original nonlinear space into a high-dimensional linear space. This facilitates the subsequent transformation of the non-convex optimization properties of the convolutional neural network into a convex optimization problem. The role of the Nystroem method is to use RKF (Rank-k Factorization) to map low-dimensional data to a linear high dimension, and then map the feature data to a low dimension.
[0117] First, using the Nystroem method, a randomly selected reference point x is used. j To approximate the kernel matrix in a high-dimensional linear space, the Nystroem kernel approximation uses Gaussian RKF (Rank-k Factorization) to calculate the kernel matrix and reduce its dimensionality. This aims to efficiently approximate large kernel matrices. The kernel function calculation formula is as follows:
[0118]
[0119] Where γ is the parameter of the Gaussian kernel, x i Let x be the input vector for the Nystroem method. j The reference vector is the input to the Nystroem method. n components kf(x) represents the number of reference points. i ,x j ) is x i With x j The kernel function.
[0120] To map data to a high-dimensional space, the kernel function assumes the existence of a mapping function φ, as shown in the following equation, such that the kernel function can be represented by an inner product, where φ(x) i ) is the input data x iThe eigenvectors are mapped to a high-dimensional space. Directly computing these high-dimensional inner products is very expensive, especially with large datasets. The Nystroem method avoids computing all kernel inner products by using a low-rank approximation of the kernel matrix, instead accelerating the process by randomly selecting reference points and approximating the calculations.
[0121] kf(x i ,x j )=<φ(x i ),φ(x j )>
[0122] Perform singular value decomposition on the kernel matrix:
[0123] kf(x i ,x j )=UΣV T Where U represents the left singular matrix, Σ represents the diagonal matrix, and V represents the right singular matrix.
[0124] Then, a low-dimensional approximate feature mapping is performed, and the calculated low-dimensional features are:
[0125]
[0126] Here, X' represents the low-dimensional feature, which is the feature matrix obtained using the Nystroem method.
[0127] Step S4.3: Input the feature matrix into the convolutional neural network for convolution operation;
[0128] In this embodiment, the feature matrix X' of 4.2 is fed into the convolutional neural network for convolution operation:
[0129] C = Conv(X', K, S)
[0130] in, It is the convolution kernel, K H and K W These are the height and width of the convolution kernel, C. I The number of input channels C O S is the number of output channels, and S is the step size.
[0131] After the convolution operation, the ReLU nonlinear activation function is applied to increase the expressive power of the model.
[0132] h = ReLU(Conv(W·X'+b))
[0133] Where ReLU is a nonlinear activation function, Conv is a convolution operation, W is the weight of the convolution, b is the bias of the convolution, and h is the output after activation.
[0134] Methods of applying residual neural networks after convolution:
[0135] h' = h + X'
[0136] Where h' is the output of the residual neural network:
[0137] Step S4.4: Input the convolution result into the max pooling layer for dimensionality reduction to obtain the dimensionality reduction result;
[0138] In this embodiment, after the convolution operation, the output is reduced in dimensionality by max pooling in order to retain important features;
[0139] hp = MAX(h')
[0140] Where MAX represents the max pooling operation and hp is the dimensionality reduction result.
[0141] Step S4.4: Process the dimensionality reduction results using a Highway network;
[0142] In this embodiment, Highway Networks are used to process the pooled features. Highway Networks contain linear transformations with gating mechanisms.
[0143] g = f(W) g ·hp+b g )
[0144] t=σ(W t ·hp+b t )
[0145] hh=t·g+(1-t)·hp
[0146] Where g is the output of the activation function, f is the transformation function, t is the gated unit, σ is the sigmoid function, and W g W t These are the weight matrices for the transformation function and the gate function, respectively, b g b t These represent the biases of the transformation function and the gate function, respectively.
[0147] Step S4.5: Optimize the output of the Highway network using a convex optimization layer;
[0148] In this embodiment, the features passed through the Highway network are optimized using a convex optimization layer. The objective function of convex optimization is to minimize the distance between generated samples and real samples and to maximize the diversity of generated samples and the overall consistency of the samples. The constraint is that the features of generated samples and real samples should be as close as possible, and an L2 regularization term is added to prevent overfitting.
[0149]
[0150] Where hh represents the features output by the highway layer that generates SMILES, hh' represents the features of the real samples, and γ is the kernel function bandwidth parameter. div and coh are functions for calculating the diversity and coherence between generated samples, respectively. i hh j The normalized similarity measure Tanimoto calculates, and its value is between 0 and 1. i -hh j || 2 The Euclidean distance between samples represents the coherence between them. ε is a very small value that controls the allowable range of similarity between generated and target samples. δ is a regularization constraint parameter used to prevent overfitting. Here, we set ε and δ to 0.1.
[0151] Step S4.6: Map the optimized structure onto the classification result through a fully connected layer to obtain the output of the discriminator.
[0152] In this embodiment, the optimized features are mapped onto the classification result through a fully connected layer. A softmax function is used to generate a probability distribution, yielding the predicted probability of generating true SMILES.
[0153] z = softmax(W) out ·hh+b out )
[0154] Where z is the probability distribution of the output, i.e., the output of the discriminator, and W out b out These represent the output layer weight matrix and bias, respectively.
[0155] Step S5: Using the generator's loss function as the objective function, update the generator's parameters using the policy gradient method;
[0156] Step S6: Using the discriminator's loss function as the objective function, update the discriminator's parameters using gradient descent.
[0157] In this embodiment, a generator is pre-trained on real data using maximum likelihood estimation to learn basic sequence patterns. The pre-trained generator generates negative samples, which are then combined with positive samples from real data to train the discriminator. The discriminator's parameters are optimized by minimizing cross-entropy loss. During the adversarial training phase, the discriminator evaluates the sequences generated by the generator, providing a reward signal reflecting the authenticity of the generated sequences. The generator parameters are updated using a policy gradient method to maximize the expected reward, and Monte Carlo search is used to estimate the reward for future state-action pairs. Specifically, the generator and discriminator of the generative adversarial network are pre-trained for 50 epochs using real data. This allows the generator to gradually learn to generate samples close to real data, while the discriminator improves its ability to distinguish between real and generated data.
[0158] The generator's parameters are updated using a Policy Gradient-based method. The generator's goal is to maximize the probability that its generated samples are considered real samples by the discriminator, i.e., the similarity between generated samples and real samples. Based on feedback from the discriminator in step 4, the generator updates its parameters using the Adam (Adaptive Moment Estimation) algorithm in gradient descent.
[0159] The pre-training loss function of the generator is defined as:
[0160]
[0161] G θ (y t |y 1:t-1 ) represents the generator G θ Given historical conditions y 1:t-1 Generate the t-th target y t The probability of.
[0162] The adversarial training loss function for the generator is defined as:
[0163]
[0164] Among them, L G (θ) is the objective function of the generator, θ represents the generator parameters, T is the length of the generated sequence, and y is the objective function of the generator. 1:t-1 ~G represents a partial sequence generated under the generator strategy. R(y 1:T The reward value is the sum of the complete sequence values, calculated by the discriminator based on the quality of the generated samples. To calculate the time step t based on the generator G θ For the previous sequence y 1:t-1 The expected value.
[0165] For the sequence generated by the generator, the discriminator determines whether it is real data or generated data based on the input sample. By using the classification error, the discriminator updates its parameters, gradually improving its ability to distinguish between real and fake samples.
[0166] The loss function of the discriminator is the sum of the crossover loss function, L2 regularization, and nuclear norm regularization.
[0167]
[0168] Among them, y i Labels for the data (1 for real data, 0 for generated data), D φ (y i Let λ be the probability predicted by the discriminator for the i-th sample, and λ1 be the regularization coefficient. For L2 norm regularization, λ2 is the nuclear norm regularization coefficient, ||W HS || * For nuclear norm regularization.
[0169] The generator model parameters are updated by calculating the policy gradient and the Adam optimizer:
[0170]
[0171] Where η is the learning rate. Find the gradient G of the generator loss function. θ (y t ∣y 1:t-1 ) represents the conditional probability of the generator. Step S7: If the current iteration count has not reached the iteration count threshold, return to step S3: regenerate the small molecule sequence using the generator corresponding to the updated generator parameters;
[0172] In this embodiment, as Figure 2 As shown, the number of iterations includes the total number of iterations and the batch number of iterations. If either the total number of iterations or the batch number of iterations fails to meet the corresponding iteration threshold, the process must return to step S3. In this embodiment, adversarial training is performed for 100 epchs (total number of iterations). The generator and discriminator are trained alternately. The generator aims to generate increasingly realistic samples, while the discriminator strives to improve its ability to distinguish between real and fake samples. The small molecule sample data generated by the generator is fed into the discriminator and compared with real sample data based on features to determine the authenticity of the generated sample data. The discriminator's reward mechanism is used to update the generator parameters, and the generator's generated samples and labels are used to update the discriminator parameters. Repeating the above steps, using the idea of a game between the generator and the discriminator, the small molecules generated by the generator become more realistic, and the discriminator becomes more capable of distinguishing between real and fake samples, thereby achieving the goal of generating small molecule data that is as realistic as the original dataset.
[0173] Step S8: If the current iteration count reaches the iteration count threshold, output the final parameters of the generator and the discriminator.
[0174] Step S9: Generate the final small molecule sequence using the generator corresponding to the parameters of the final generator.
[0175] In this embodiment, RDKit is used to calculate the properties of the generated small molecule until the properties of the generated small molecule reach the target. RDKit is an open-source cheminformatics software package that provides rich data structures and algorithms for processing chemical data, including molecule construction, analysis, and manipulation, and is widely used in drug discovery, chemical education, and research. Because the BLEU (Bilingual Evaluation Understudy) score is a commonly used metric for evaluating the similarity between machine-translated text and human-translated text, it calculates accuracy by comparing the degree of n-gram matching between the generated text and the reference text. In the sequence generation task of small molecule generation, the BLEU value can be used to measure the similarity between the generated SMILES string and the SMILES string of the real molecule. Finally, the generation results of the above-mentioned small molecule generation method based on convex optimization generative adversarial networks are evaluated using the text generation metrics BLEU and BLEU2 values and the small molecule generation metrics.
[0176] In this embodiment, the small molecule generation method based on convex optimization and generative adversarial networks of the present invention is applied to the QM9 organic small molecule dataset. The QM9 dataset is a database containing the quantum chemical properties of over 130,000 organic small molecules composed of carbon (C), hydrogen (H), oxygen (O), nitrogen (N), and fluorine (F). Each molecule contains complete spatial information for calculating the atoms in a single low-energy conformation of chemical properties. The dataset provides information on the molecular geometry, energy, electronic, and thermodynamic properties, including the molecular minimum energy conformation, corresponding harmonic frequencies, dipole moments, polarizability, as well as energy, enthalpy, and free energy. Due to its scale and detail, the QM9 dataset has become an important resource in cheminformatics, materials science, and machine learning, particularly in areas such as molecular property prediction and new drug development.
[0177] In the small molecule generation task, we used evaluation metrics including text-based metrics Bleu and Bleu2, and small molecule evaluation metrics such as Validity, Diversity, Novelty, and Drug Likeness. Bleu assesses the similarity between the chemical structure of the generated molecule and the target molecule. Bleu2 focuses on the overlap between two consecutive words in the text, calculating the maximum frequency of each 2-gram in the generated sequence in the reference sequence, normalizing the data, and taking the geometric mean. Bleu2 measures the similarity between the generated molecule structure and known valid molecule structures, thus assessing the accuracy and rationality of the generated molecule. Molecular validity ensures that the generated small molecules are chemically feasible, i.e., they conform to known chemical rules and reaction mechanisms. Molecular diversity measures the diversity of molecules in the generated small molecule set. In small molecule generation, high diversity means the ability to explore a wider chemical space, increasing the chances of discovering new drugs or materials. Molecular novelty measures the similarity between the generated small molecule and known molecules, calculated using the Simpson Diversity Index, which considers species richness and evenness. High novelty means that the generated molecule is significantly different from known molecules in structure and properties. The drug-likeness index measures whether the generated small molecule possesses the physicochemical properties of a known drug. This index is used to predict whether a molecule has the potential to become a viable drug candidate, including pharmacological activity, suitable physicochemical properties, and ADMET attributes. The QED score is obtained by calculating a weighted sum of these attributes, where the weight of each attribute is determined by maximizing Shannon entropy.
[0178] These indicators collectively constitute a multi-dimensional framework for evaluating the effectiveness of small molecule generation, and the relevant results are shown in Table 1. The experimental results show that the generated SMILES, with a similarity of 0.79 to the real sample data, exhibit significant similarity to the characteristics of small molecules in the original QM9 dataset; the generated small molecule effectiveness of 0.35 indicates that some of the generated samples are capable of forming small molecules; and the druggability is as high as 0.17, suggesting that the new molecules have the potential to become effective drug candidates. Furthermore... Figure 5 The paper presents a comparison of the structural diagrams of some of the generated small molecules and the QM9 small molecule, drawn using Pymol software. The comparison reveals a high degree of structural similarity between the generated small molecules. This method has significant value in the field of small molecule discovery for drug development.
[0179] Table 1. Evaluation Results of Small Molecules
[0180]
[0181] This embodiment proposes a novel drug molecule design method integrating convex optimization and evolutionary learning. First, an initial dataset containing n samples is obtained by extracting the QM9 organic small molecule dataset. Next, word embedding technology is used to preprocess the dataset, transforming molecular sequences into vector representations, effectively capturing key molecular features. Then, an attention-based LSTM model is constructed as a generator to generate high-quality small molecule sequences. Simultaneously, a convolutional neural network based on improved convex optimization is constructed as a discriminator to evaluate the authenticity of the generated small molecule sequences. Furthermore, this invention utilizes maximum likelihood estimation to pre-train the generator on real data, learning basic sequence patterns. Through an adversarial training phase, the generator parameters are updated using a policy gradient method to maximize the expected reward, while Monte Carlo search is used to estimate the reward for future state-action pairs. Finally, the properties of the small molecules are calculated using RDKit until the generated small molecules achieve a similarity of over 79% to the original data and an originality of over 85%.
[0182] Example 2:
[0183] This application proposes a novel drug molecule design device that integrates convex optimization and evolutionary learning, comprising: an initial sample acquisition module, a sample conversion module, a sample generation module, a sample evaluation module, a first parameter update module, a second parameter update module, a loop iteration module, and a result output module;
[0184] The initial sample acquisition module is connected to the sample conversion module, the sample conversion module is connected to the sample generation module, the sample generation module is connected to the sample evaluation module, the sample evaluation module is connected to the first parameter update module, the first parameter update module is connected to the second parameter update module, the second parameter update module is connected to the loop iteration module, and the loop iteration module is connected to the sample generation module and the result output module respectively.
[0185] The initial sample acquisition module is used to acquire the initial dataset of small molecules, wherein each element in the initial dataset of small molecules is a string representing a small molecule.
[0186] The sample conversion module is used to map each element in the initial dataset of small molecules using word embedding, converting the strings of small molecules into vectors of small molecules;
[0187] The sample generation module is used in the generative adversarial network to input the mapping results of the initial small molecule dataset into the generator to generate small molecule sequences and to calculate the loss function of the generator. The generator is built by adding an attention mechanism model to the long short-term memory network.
[0188] The sample evaluation module is used to evaluate the authenticity of the small molecule sequence using a discriminator and calculate the loss function of the discriminator, which is built using a convolutional neural network based on convex optimization.
[0189] The first parameter update module is used to update the generator's parameters using the policy gradient method with the generator's loss function as the objective function.
[0190] The second parameter update module is used to update the parameters of the discriminator using the discriminator's loss function as the objective function and the gradient descent method.
[0191] The loop iteration module is used to return to the sample generation module if the current iteration number has not reached the iteration number threshold: regenerate the small molecule sequence using the generator corresponding to the updated generator parameters; if the current iteration number has reached the iteration number threshold, output the final generator parameters and discriminator parameters.
[0192] The results output module is used to generate the final small molecule sequence using the generator corresponding to the parameters of the final generator.
[0193] Example 3:
[0194] This embodiment proposes an electronic device, including: one or more processors, and a memory for storing instructions, which, when executed by the one or more processors, cause the one or more processors to perform the novel drug molecule design method that combines convex optimization and evolutionary learning.
[0195] The electronic device may be a mobile phone, computer, or tablet computer, etc., and includes a memory and a processor. The memory stores a computer program, which, when executed by the processor, implements the novel drug molecule design method that integrates convex optimization and evolutionary learning as described in the embodiments. It is understood that the electronic device may also include an input / output (I / O) interface and communication components.
[0196] The processor is used to execute all or part of the steps in the novel drug molecule design method that integrates convex optimization and evolutionary learning as described in the above embodiments. The memory is used to store various types of data, which may include, for example, instructions for any application or method in an electronic device, as well as application-related data.
[0197] The processor can be implemented as an Application Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor, or other electronic components, and is used to execute the novel drug molecule design method that integrates convex optimization and evolutionary learning as described in the above embodiments.
[0198] Example 4:
[0199] This embodiment proposes a computer-readable storage medium that stores executable instructions. When these instructions are executed, if they are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
[0200] The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the novel drug molecule design method that integrates convex optimization and evolutionary learning as described in the various embodiments of this application.
[0201] The aforementioned storage media include: flash memory, hard disk, multimedia card, card-type memory (e.g., SD (Secure Digital Memory Card) or DX (Memory Data Register, MDR) memory, random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, server, APP (Application) application store, and other media capable of storing program verification codes. These media store computer programs, which, when executed by a processor, can implement the various steps of the novel drug molecule design method that integrates convex optimization and evolutionary learning as described above.
[0202] The scope of protection of this application is not limited to the embodiments described above. Obviously, those skilled in the art can make various modifications and variations to this disclosure without departing from the scope and spirit of this disclosure. If such modifications and variations fall within the scope of the claims of this disclosure and their equivalents, then the intent of this disclosure also includes such modifications and variations.
Claims
1. A novel drug molecule design method integrating convex optimization and evolutionary learning, characterized in that, include: Step S1: Obtain the initial dataset of small molecules, where each element in the initial dataset of small molecules is a string representing a small molecule; Step S2: Use word embedding to map each element in the initial dataset of small molecules, and convert the strings of small molecules into vectors of small molecules; Step S3: In the generative adversarial network, the mapping result of the initial small molecule dataset is input into the generator to generate small molecule sequences, and the loss function of the generator is calculated. The generator is built by adding an attention mechanism model to the long short-term memory network. Step S4: Use a discriminator to evaluate the authenticity of the small molecule sequence and calculate the loss function of the discriminator. The discriminator is built using a convolutional neural network based on convex optimization. Step S5: Using the generator's loss function as the objective function, update the generator's parameters using the policy gradient method; Step S6: Using the discriminator's loss function as the objective function, update the discriminator's parameters using gradient descent. Step S7: If the current iteration count has not reached the iteration count threshold, return to step S3: Regenerate the small molecule sequence using the generator corresponding to the updated generator parameters; Step S8: If the current iteration count reaches the iteration count threshold, output the final parameters of the generator and the discriminator. Step S9: Generate the final small molecule sequence using the generator corresponding to the parameters of the final generator; The discriminator is built using a convolutional neural network based on convex optimization. The building process includes: The initial small molecule dataset and small molecule sequences are embedded to obtain the small molecule embedding matrix; The Nystroem method is used to perform kernel approximation on the small molecule embedding matrix to obtain the feature matrix; The feature matrix is input into a convolutional neural network for convolution operation; The convolution result is input into a max pooling layer for dimensionality reduction, and the dimensionality reduction result is obtained. The dimensionality reduction results are processed using a Highway network. The output of the Highway network is optimized using a convex optimization layer; The optimized structure is mapped onto the classification result through a fully connected layer to obtain the output of the discriminator.
2. The novel drug molecule design method integrating convex optimization and evolutionary learning according to claim 1, characterized in that, The process of obtaining the initial small molecule dataset includes: extracting the SMILES dataset describing the structure and characteristics of small molecules from the QM9 dataset, and preprocessing the SMILES dataset to obtain the initial small molecule dataset.
3. The novel drug molecule design method integrating convex optimization and evolutionary learning according to claim 1, characterized in that, The method of using word embedding to map each element in the initial dataset of small molecules, converting the strings of small molecules into vectors, includes: Construct a vocabulary, which includes all unique characters appearing in the SMILES dataset and their corresponding numeric indices; By utilizing the correspondence between characters and numeric indices in the vocabulary, each element in the initial small molecule dataset is mapped to obtain a one-hot vector of the initial small molecule dataset. The one-hot vector is multiplied by a predefined embedding matrix to obtain the embedding vector; Multiple embedding vectors are combined into a batch embedding vector, and the batch embedding vector is used as the vector of the small molecule.
4. The novel drug molecule design method integrating convex optimization and evolutionary learning according to claim 1, characterized in that, The generator comprises: multiple long short-term memory networks, an attention mechanism model, and a fully connected layer. Each long short-term memory network corresponds to an input vector of the generator. The output of each long short-term memory network is multiplied by the attention weights. All product results are used as the input of the attention mechanism model. The output of the attention mechanism model is used as the input of the fully connected layer. The output of the fully connected layer is used as the output of the generator.
5. The novel drug molecule design method integrating convex optimization and evolutionary learning according to claim 1, characterized in that, In the convex optimization layer, the objective function of convex optimization is to minimize the distance between the small molecule sequence and the initial small molecule dataset, and to maximize the diversity of the small molecule sequence and the consistency between the initial small molecule dataset. The constraint is that the characteristics of the small molecule sequence are similar to the characteristics of the initial small molecule dataset.
6. The novel drug molecule design method integrating convex optimization and evolutionary learning according to claim 5, characterized in that, The objective function for the convex optimization is calculated as follows: ; ; ; ; in, This is the output of the i-th Highway network. For the output of the j-th Highway network, The feature of the i-th element in the initial dataset of small molecules. This refers to the kernel function bandwidth parameter in the Nystroem method. A function to generate sample diversity, A function to generate coherence between samples. The Tanimoto coefficient is a normalized similarity measure with values between 0 and 1. Let be the Euclidean distance between samples. For a set value, Here, B is the regularization constraint parameter, and B is the sample batch size.
7. A novel drug molecule design device integrating convex optimization and evolutionary learning, characterized in that, include: The initial sample acquisition module is used to acquire the initial dataset of small molecules, wherein each element in the initial dataset of small molecules is a string representing a small molecule. The sample conversion module is used to map each element in the initial dataset of small molecules using word embedding, converting the strings of small molecules into vectors of small molecules; The sample generation module is used in the generative adversarial network to input the mapping results of the initial small molecule dataset into the generator to generate small molecule sequences and to calculate the loss function of the generator. The generator is built by adding an attention mechanism model to the long short-term memory network. The sample evaluation module is used to evaluate the authenticity of the small molecule sequence using a discriminator and calculate the loss function of the discriminator, which is built using a convolutional neural network based on convex optimization. The discriminator is built using a convolutional neural network based on convex optimization. The building process includes: The initial small molecule dataset and small molecule sequences are embedded to obtain the small molecule embedding matrix; The Nystroem method is used to perform kernel approximation on the small molecule embedding matrix to obtain the feature matrix; The feature matrix is input into a convolutional neural network for convolution operation; The convolution result is input into a max pooling layer for dimensionality reduction, and the dimensionality reduction result is obtained. The dimensionality reduction results are processed using a Highway network. The output of the Highway network is optimized using a convex optimization layer; The optimized structure is mapped onto the classification result through a fully connected layer to obtain the output of the discriminator; The first parameter update module is used to update the generator's parameters using the policy gradient method with the generator's loss function as the objective function. The second parameter update module is used to update the parameters of the discriminator using the discriminator's loss function as the objective function and the gradient descent method. The loop iteration module is used to return to the sample generation module if the current iteration number has not reached the iteration number threshold: regenerate the small molecule sequence using the generator corresponding to the updated generator parameters; if the current iteration number has reached the iteration number threshold, output the final generator parameters and discriminator parameters. The results output module is used to generate the final small molecule sequence using the generator corresponding to the parameters of the final generator.
8. An electronic device, characterized in that, include: One or more processors, and a memory for storing instructions that, when executed by the one or more processors, cause the one or more processors to perform the novel drug molecule design method that integrates convex optimization and evolutionary learning as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, It stores executable instructions that, when executed, cause the processor to perform the novel drug molecule design method that combines convex optimization and evolutionary learning as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Image description confrontation generation method based on reinforcement learning
CN114022687A
Cyclic adversarial neural network molecule generation method and system based on embedded bidirectional long-short term memory
CN117079745A