Training method and device for ligand generation model
Through the ligand generation model of cascaded generator, encoder and pixel convolution neural network, combined with multiple loss function optimization parameters, the accuracy and diversity of ligand electron density image generation problems are solved, achieving high quality and Diversified generation effects.
Patent Information
- Application Number
- CN202410979413.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-22
- Publication Date
- 2024-11-19
- Estimated Expiration
- 2044-07-22
AI Technical Summary
The prior art is difficult to accurately and efficiently generate ligand electron density images, which affects computer vision applications in the field of chemistry.
Using a cascading generator, encoder, pixel convolutional neural network and decoder ligand generation model, the network and pre-trained vector quantization variational autoencoder are generated through conditional adversarial expression, combined with Dess loss and gradient map loss and average absolute error loss, optimize the parameters of the generator and discriminator to achieve accurate generation of ligand electron density images.
The quality and diversity of generated images are improved, the overall performance and generalization capabilities of the ligand generation model are enhanced, and the accuracy and diversity of the generated predicted ligand electron density images are ensured.
Smart Images

Figure CN118537681B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a training method and device for a ligand generation model. Background Art
[0002] Electron density is a method of describing the distribution of electrons in space. Different atomic nuclei have different abilities to adsorb electrons, so different molecular structures will have different electron cloud densities. Using electron cloud density characterization to generate pocket-oriented ligands is an important way to solve chemical problems using computer vision technology. Therefore, how to generate ligands accurately and efficiently has become a problem that needs to be solved. Summary of the invention
[0003] In view of this, the present disclosure provides a training method for a ligand generation model, a ligand generation method, an apparatus, a device, a storage medium, and a program product.
[0004] In a first aspect, the present disclosure provides a training method for a ligand generation model, the ligand generation model comprising: a cascaded generator, an encoder, a pixel convolutional neural network and a decoder; the generator is a generator of a conditional adversarial generation network, the encoder and the decoder are the encoder and the decoder of a pre-trained vector quantized variational autoencoder model, the method comprising: obtaining a set of ligand electron density image samples of a pocket structure; using the generator to generate a predicted ligand electron density image according to the ligand electron density image samples, and based on the difference between the ligand electron density image samples and the predicted ligand electron density image, determining the generation loss, using the generation loss to update the parameters of the generator, the generation loss comprising: a Diess loss, a gradient map loss and a mean absolute error loss; using a first discriminator to classify According to the ligand electron density image samples and the predicted ligand electron density image, the probability that the ligand electron density image is true is predicted, and the first discriminant loss between the predicted image and the real image is generated. The first discriminant loss is used to update the parameters of the first discriminator, and the first discriminant is a discriminator of the adversarial generative network; the second discriminator is used to predict the encoding of the ligand electron density image samples and the probability that the encoding of the predicted ligand electron density image is true according to the encoding of the ligand electron density image samples generated by the encoder and the encoding of the predicted ligand electron density image, and the second discriminant loss between the predicted encoding and the corresponding real encoding is generated. The second discriminant loss is used to update the parameters of the second discriminator, and the second discriminant is a pixel convolutional neural network.
[0005] The training method of the ligand generation model in this embodiment ensures that the generated predicted ligand electron density image is highly realistic by setting the ligand generation model to include a cascaded generator, an encoder, a pixel convolutional neural network and a decoder. The predicted ligand electron density image is encoded by the encoder and discretized by the pixel convolutional neural network, and then restored by the decoder to the ligand density corresponding to the discretized encoding, thereby realizing the generation of diversified predicted ligand electron density images, thereby comprehensively utilizing the advantages of different components to achieve accurate and diversified generation of ligand electron density images. In the process of training the ligand generation model, the training method uses the Diess loss, gradient map loss and mean absolute error loss between the predicted ligand electron density image generated by the generator and the real sample, so that the generator can accurately learn the mapping relationship from input to output, thereby improving the quality of the generated image; then, the discriminator of the generative adversarial network is used as the first discriminator to predict the probability of the real image and the generated image being true, which improves the ability of the generator to generate a real ligand electron density image and optimizes the performance of the discriminator; at the same time, the pixel convolutional neural network is used as the second discriminator to discriminate the probability of the code output by the pre-trained encoder combined with the pixel convolutional neural network being true, which improves the accuracy and discrimination of the pixel convolutional neural network sampling, and further enhances the overall performance of the predicted ligand electron density image generated by the ligand generation model. The training method of the ligand generation model realizes the accurate generation of the ligand electron density image through reasonable model design and optimized training method, and has good generalization ability and training effect.
[0006] In some optional implementations of this embodiment, the gradient map loss is determined based on the following steps: for the ligand electron density image samples and the predicted ligand electron density images, the gradient of the three-dimensional discrete function is generated by the difference method; the mean absolute error loss of the gradient of the three-dimensional discrete function is calculated in each of the three dimensions, and the calculation results of each dimension are added to obtain the gradient map loss.
[0007] The gradient map loss in this embodiment improves the accuracy of the generator in capturing local small changes in the ligand electron density image by calculating the gradient of the three-dimensional discrete function. The calculation of the mean absolute error loss enhances the generator's sensitivity to gradient changes in different regions of the image, thereby guiding the generator to better learn and predict the spatial distribution of electron density. Furthermore, the gradient map loss improves the accuracy of the structural differences reflected in the image, reduces the training fluctuations caused by local noise or outliers in the image, and its high-dimensional feature representation improves the generalization ability of the generator.
[0008] In some optional implementations of this embodiment, the generation loss includes: the sum of the Dice loss, the gradient map loss and the mean absolute error loss.
[0009] The generation loss in this embodiment combines the Dice loss, the gradient map loss and the mean absolute error loss. The generator can comprehensively consider the global similarity, local structural changes and pixel-level differences of the image, and evaluate the similarity between the generated image and the real image from multiple angles, thereby improving the quality of the generated image.
[0010] In some optional implementations of this embodiment, the method further includes: determining the adversarial loss of the generator based on the output of the first discriminator; and updating the parameters of the generator based on the generation loss and the adversarial loss.
[0011] The training method of the ligand generation model in this embodiment, through the joint optimization of adversarial loss and generation loss, the model can find a balance point in the training process so that both the generator and the discriminator can achieve relatively good performance. By adjusting the weights of adversarial loss and generation loss, the trade-off between the quality and diversity of the generated images by the generator can be flexibly controlled.
[0012] In some optional implementations of this embodiment, the pre-trained vector quantized variational autoencoder model is determined based on the following steps: when pre-training the vector quantized variational autoencoder model, a training sample set is obtained, and the training samples include a ligand electron density training image; using the vector quantized variational autoencoder model, based on the ligand electron density training image, a ligand electron density prediction image is generated, and a training loss between the prediction image and the training image is generated, and the training loss is determined based on the following functions: reconstruction loss, quantization loss, codebook loss, regularization term, and the training loss is used to update the parameters of the vector quantized variational autoencoder model.
[0013] The determination method of the pre-trained vector quantized variational autoencoder model in this embodiment is determined by learning specific features in the training image and considering that the training loss is determined based on the reconstruction loss, quantization loss, codebook loss and regularization term. The reconstruction loss can ensure that the generated predicted image is as similar as possible to the original training image; the quantization loss and codebook loss improve the model's ability to learn more effective discrete potential representations; the regularization term can prevent the model from overfitting and improve the generalization ability. Therefore, through the composition of the training loss, the performance of the variational autoencoder is comprehensively improved, and the generated predicted image can maintain structural details and has good overall quality. The ligand electron density prediction image is reconstructed, and the reconstruction effect is improved.
[0014] In a second aspect, the present disclosure provides a training device for a ligand generation model, the ligand generation model comprising: a cascaded generator, an encoder, a pixel convolutional neural network and a decoder; the generator is a generator of a conditional adversarial generation network, the encoder and the decoder are the encoder and the decoder of a pre-trained vector quantized variational autoencoder model, the device comprising: an image sample acquisition module, for acquiring a set of ligand electron density image samples of a pocket structure; a generator training module, for using the generator to generate a predicted ligand electron density image according to the ligand electron density image sample, and based on the difference between the ligand electron density image sample and the predicted ligand electron density image, determining the generation loss, and using the generation loss to update the parameters of the generator, the generation loss comprising: a Diess loss, a gradient map loss and a mean absolute error loss; a discriminator training module, for A first discriminator is used to predict the ligand electron density image samples and the probability that the predicted ligand electron density image is true, and generate a first discriminant loss between the predicted image and the real image according to the ligand electron density image samples and the predicted ligand electron density image, and the first discriminant loss is used to update the parameters of the first discriminator. The first discriminator is a discriminator of an adversarial generative network; a neural network training module is used to adopt a second discriminator to predict the encoding of the ligand electron density image samples and the probability that the encoding of the predicted ligand electron density image is true, and generate a second discriminant loss between the predicted encoding and the corresponding real encoding according to the encoding of the ligand electron density image samples generated by the encoder and the encoding of the predicted ligand electron density image, and the second discriminant loss is used to update the parameters of the second discriminator. The second discriminator is a pixel convolutional neural network.
[0015] A ligand generation device, the device comprising: an image acquisition module, used to obtain an electron density image of a ligand to be generated for specifying a pocket structure; a ligand generation module, used to input the electron density image of the ligand to be generated into a trained ligand generation model to obtain an electron density image of a target ligand generated by the ligand generation model, wherein the trained ligand generation model is trained according to the training method of the ligand generation model of the first aspect or any corresponding embodiment thereof.
[0016] In a third aspect, the present disclosure provides a computer device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the training method of the ligand generation model of the first aspect or any corresponding embodiment thereof, or executes the ligand generation method of the second aspect by executing the computer instructions.
[0017] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the training method for a ligand generation model of the first aspect or any corresponding embodiment thereof, or to execute the ligand generation method of the second aspect.
[0018] In a fifth aspect, the present disclosure provides a computer program product, comprising computer instructions, wherein the computer instructions are used to enable a computer to execute the training method for a ligand generation model of the first aspect or any corresponding embodiment thereof, or to execute the ligand generation method of the second aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the prior art, the drawings required for use in the specific embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 is a flowchart of a training method for a ligand generation model according to an embodiment of the present disclosure;
[0021] Figure 2 It is a flowchart of a method for determining a pre-trained vector quantized variational autoencoder model according to an embodiment of the present disclosure;
[0022] Figure 3 is a schematic flow chart of a ligand generation method according to an embodiment of the present disclosure;
[0023] Figure 4 is a structural block diagram of a training device for a ligand generation model according to an embodiment of the present disclosure;
[0024] Figure 5 is a structural block diagram of a ligand generating device according to an embodiment of the present disclosure;
[0025] Figure 6 It is a schematic diagram of the hardware structure of the computer device of the embodiment of the present disclosure. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.
[0027] According to an embodiment of the present disclosure, an embodiment of a training method for a ligand generation model is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0028] In this embodiment, a training method for a ligand generation model is provided, which can be used for the above-mentioned computer systems, such as desktop computers, tablet computers, servers, etc. (the execution subject is described in combination with actual conditions). The ligand generation model includes: a cascaded generator, an encoder, a pixel convolutional neural network and a decoder; the generator is a generator of a conditional adversarial generation network, and the encoder and decoder are the encoder and decoder of a pre-trained vector quantized variational autoencoder model. Figure 1 is a flowchart of a training method for a ligand generation model according to an embodiment of the present disclosure, such as Figure 1 As shown, the process includes the following steps:
[0029] Step S101, obtaining a sample set of ligand electron density images of pocket structures.
[0030] The ligand electron density image sample set of the pocket structure may include ligand electron density image samples corresponding to different types of pocket structures.
[0031] Step S102, using a generator to generate a predicted ligand electron density image based on the ligand electron density image sample, and based on the difference between the ligand electron density image sample and the predicted ligand electron density image, determining a generation loss, and using the generation loss to update the parameters of the generator.
[0032] Among them, the generation loss includes: Dies loss, gradient map loss and mean absolute error loss.
[0033] Specifically, the adversarial generative network can be a conditional adversarial generative network, so that conditional information, such as electron density image samples of pocket structures, is added during the training process of the generator and the first discriminator and the second discriminator. Then, a predicted ligand electron density image is generated based on the ligand electron density image samples and random noise. Then, the difference between the sample image and the predicted ligand electron density image is determined, and the generation loss is determined based on the difference, and the generation loss is used to update the parameters of the generator.
[0034] The generation loss here includes the Daise loss , in order to clearly calculate the degree of overlap between the two objects A and B (i.e., the ligand electron density image sample and the predicted ligand electron density image), the specific formula is as follows:
[0035]
[0036] in, represents the intersection of A and B, It represents the sum of A and B.
[0037] The generation loss here also includes the gradient map loss to learn the edge and detail information in the sample image. Specifically, the gradient operator can be used to calculate the gradient map. For example, the Sobel operator, Prewitt operator, Laplacian operator, etc. are used to calculate the gradient map. After that, the difference between the gradient map of the sample image and the gradient map of the predicted image can be calculated as the gradient map loss, and the mean square error can be used to measure these differences.
[0038] The generation loss here also includes the mean absolute error loss, which is the average of the absolute values of the deviations between all individual observations and the true values. It is used to measure the difference between the predicted value and the true value. The specific formula is as follows:
[0039]
[0040] in, is the mean absolute error loss function, , are sample images and predicted images respectively, and N is the number of sample images and predicted images.
[0041] Step S103, using a first discriminator, respectively, based on the ligand electron density image samples and the predicted ligand electron density image, predicting the ligand electron density image samples, the probability that the predicted ligand electron density image is true, and generating a first discriminant loss between the predicted image and the true image, and using the first discriminant loss to update the parameters of the first discriminator.
[0042] The first discriminator is the discriminator of the adversarial generative network, that is, the standard discriminator of the adversarial generative network. During the training process, the first discriminator learns to maximize the distinction between ligand electron density image samples and predicted ligand electron density images through the first discriminant loss.
[0043] The first discriminant loss can be implemented by using a loss function commonly used in binary classification tasks, and this application does not limit this. For example, the first discriminant loss can be implemented by using a binary cross entropy loss function, a logarithmic loss function, a binary cross entropy loss combined with logits, and the like.
[0044] Step S104, using a second discriminator, respectively based on the encoding of the ligand electron density image sample generated by the encoder and the encoding of the predicted ligand electron density image, predict the probability that the encoding of the ligand electron density image sample and the encoding of the predicted ligand electron density image are true, and generate a second discriminant loss between the predicted encoding and the corresponding true encoding, and use the second discriminant loss to update the parameters of the second discriminator.
[0045] The second discriminator is a pixel convolutional neural network. During the training process, the second discriminator learns to maximize the distinction between the real code and the predicted code through the second discriminant loss.
[0046] The second discriminant loss can be implemented using a loss function commonly used in binary classification tasks, and this application does not limit this. For example, a binary cross entropy loss function, a logarithmic loss function, a binary cross entropy loss combined with logits, etc. can be used.
[0047] In addition, the pixel convolutional neural network (PixcelCNN) can learn the spatial relationships and local features in the image, improving the efficiency of processing ligand electron density images.
[0048] Here, pixel convolutional neural network encoding is adopted. Since the predicted image shares the image gradient with the generator, more relevant information of the generator can be perceived, and thus the constraints of the pocket structure on the generated predicted image can be perceived through the generation loss of the generator.
[0049] The training method of the ligand generation model in this embodiment ensures that the generated predicted ligand electron density image is highly realistic by setting the ligand generation model to include a cascaded generator, an encoder, a pixel convolutional neural network and a decoder. The predicted ligand electron density image is encoded by the encoder and discretized by the pixel convolutional neural network, and then restored by the decoder to the ligand density corresponding to the discretized encoding, thereby realizing the generation of diversified predicted ligand electron density images, thereby comprehensively utilizing the advantages of different components to achieve accurate and diversified generation of ligand electron density images. In the process of training the ligand generation model, the training method uses the Diess loss, gradient map loss and mean absolute error loss between the predicted ligand electron density image generated by the generator and the real sample, so that the generator can accurately learn the mapping relationship from input to output, thereby improving the quality of the generated image; then, the discriminator of the generative adversarial network is used as the first discriminator to predict the probability of the real image and the generated image being true, which improves the ability of the generator to generate a real ligand electron density image and optimizes the performance of the discriminator; at the same time, the pixel convolutional neural network is used as the second discriminator to discriminate the probability of the code output by the pre-trained encoder combined with the pixel convolutional neural network being true, which improves the accuracy and discrimination of the pixel convolutional neural network sampling, and further enhances the overall performance of the predicted ligand electron density image generated by the ligand generation model. The training method of the ligand generation model realizes the accurate generation of ligand electron density images that conform to the pocket structure through reasonable model design and optimized training methods, and has good generalization ability and training effect.
[0050] In some optional implementations of this embodiment, the gradient map loss is determined based on the following steps: for the ligand electron density image samples and the predicted ligand electron density images, the gradient of the three-dimensional discrete function is generated by the difference method; the mean absolute error loss of the gradient of the three-dimensional discrete function is calculated in each of the three dimensions, and the calculation results of each dimension are added to obtain the gradient map loss.
[0051] Among them, the gradient map loss can first calculate the gradient map of the three-dimensional image on the x, y, and z axes , , :
[0052]
[0053]
[0054]
[0055] in, Indicates the difference between the next pixel and the previous pixel in the x direction; Indicates the difference between the next pixel and the previous pixel in the y direction; .
[0056] It is understandable that the above , , This is only an exemplary description, and the gradient map may be generated by using the difference between the current pixel and the previous pixel, or by using the difference between the next pixel and the current pixel.
[0057] The above three results are summed up to get the L1 loss on the gradient map. :
[0058]
[0059] in, It represents the L1 loss function that calculates the gradient map differences in the x, y, and z directions and adds them together. represents the gradient map of the sample image, Represents the gradient map of the predicted image.
[0060] The gradient map loss in this embodiment improves the accuracy of the generator in capturing local small changes in the ligand electron density image by calculating the gradient of the three-dimensional discrete function. The calculation of the mean absolute error loss enhances the generator's sensitivity to gradient changes in different regions of the image, thereby guiding the generator to better learn and predict the spatial distribution of electron density. Furthermore, the gradient map loss improves the accuracy of the structural differences reflected in the image, reduces the training fluctuations caused by local noise or outliers in the image, and its high-dimensional feature representation improves the generalization ability of the generator.
[0061] In some optional implementations of this embodiment, the generation loss in the above embodiment includes: the sum of the Dice loss, the gradient map loss and the mean absolute error loss.
[0062] The generation loss in this embodiment combines the Dice loss, the gradient map loss and the mean absolute error loss. The generator can comprehensively consider the global similarity, local structural changes and pixel-level differences of the image, and evaluate the similarity between the generated image and the real image from multiple angles, thereby improving the quality of the generated image.
[0063] In some optional implementations of this embodiment, the method in the above embodiment also includes: determining the adversarial loss of the generator based on the output of the first discriminator; and updating the parameters of the generator based on the generation loss and the adversarial loss.
[0064] The training method of the ligand generation model in this embodiment, through the joint optimization of adversarial loss and generation loss, the model can find a balance point in the training process so that both the generator and the discriminator can achieve relatively good performance. By adjusting the weights of adversarial loss and generation loss, the trade-off between the quality and diversity of the generated images by the generator can be flexibly controlled.
[0065] In this embodiment, a method for determining a pre-trained vector quantization variational autoencoder model is provided, which can be used for the above-mentioned mobile terminal, such as a desktop computer, a tablet computer, a server, etc. Figure 2 is a flowchart of a method for determining a pre-trained vector quantized variational autoencoder model according to an embodiment of the present disclosure, such as Figure 2 As shown, the process includes the following steps:
[0066] Step S201, when pre-training a vector quantized variational autoencoder model, obtain a training sample set.
[0067] The vector quantized variational autoencoder model may include an encoder and a decoder. The training samples in the training sample set may include ligand electron density training images.
[0068] Step S202, using a vector quantized variational autoencoder model, generating a ligand electron density prediction image based on the ligand electron density training image.
[0069] Among them, the vector quantized variational autoencoder model can discretize the image according to the given ligand electron density training image through the encoder, and then restore the discretized code through the decoder to generate a ligand electron density prediction image.
[0070] Step S203: generating a training loss between the predicted image and the training image.
[0071] Among them, the training loss can be determined based on the following functions: reconstruction loss, quantization loss, codebook loss, and regularization term.
[0072] Step S204, using the training loss to update the parameters of the vector quantized variational autoencoder model.
[0073] The method for determining the pre-trained vector quantized variational autoencoder model in this embodiment is determined by learning specific features in the training image and considering that the training loss is determined based on reconstruction loss, quantization loss, codebook loss and regularization term. The reconstruction loss can ensure that the generated predicted image is as similar as possible to the original training image; the quantization loss and codebook loss improve the model's ability to learn more effective discrete potential representations; the regularization term can prevent the model from overfitting and improve generalization ability. Therefore, through the composition of the training loss, the performance of the variational autoencoder is comprehensively improved, and the generated predicted image can maintain structural details and has good overall quality. The ligand electron density prediction image is reconstructed, and the reconstruction effect is improved.
[0074] In this embodiment, a ligand generation method is provided, which can be used in the above-mentioned desktop computer, notebook, server, etc. Figure 3 is a flow chart of a ligand generation method according to an embodiment of the present disclosure, such as Figure 3 As shown, the process includes the following steps:
[0075] Step S301, obtaining a ligand electron density image to be generated for specifying a pocket structure.
[0076] Step S302, inputting the ligand electron density image to be generated into the trained ligand generation model to obtain the target ligand electron density image generated by the ligand generation model.
[0077] The trained ligand generation model is obtained by training using the training method of the ligand generation model in the above embodiment.
[0078] The ligand generation method in this embodiment is trained using the training method of the ligand generation model in the above embodiment, so that the target ligand electron density image of the specified pocket can be accurately generated, thereby improving the efficiency of generating the target ligand electron density image.
[0079] As one or more specific application embodiments of the embodiments of the present disclosure, the optimal implementation scheme or the scheme that the inventor most wants to embody is described in combination with specific application scenarios.
[0080] In this embodiment, a training device for a ligand generation model is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be repeated hereafter. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and contemplated.
[0081] This embodiment provides a training device for a ligand generation model, the ligand generation model includes: a cascaded generator, an encoder, a pixel convolutional neural network and a decoder; the generator is a conditional adversarial generation network generator, and the encoder and decoder are the encoder and decoder of a pre-trained vector quantized variational autoencoder model. Figure 4 As shown, the training device of the ligand generation model includes:
[0082] An image sample acquisition module 401 is used to acquire a set of ligand electron density image samples of a pocket structure;
[0083] A generator training module 402 is used to use the generator to generate a predicted ligand electron density image according to the ligand electron density image sample, and determine a generation loss based on the difference between the ligand electron density image sample and the predicted ligand electron density image, and use the generation loss to update the parameters of the generator, where the generation loss includes: a Dyss loss, a gradient map loss, and a mean absolute error loss;
[0084] The discriminator training module 403 is used to use a first discriminator to predict the ligand electron density image sample and the probability that the predicted ligand electron density image is true, and generate a first discriminant loss between the predicted image and the real image, respectively according to the ligand electron density image sample and the predicted ligand electron density image, and use the first discriminant loss to update the parameters of the first discriminator, wherein the first discriminator is a discriminator of the adversarial generative network;
[0085] The neural network training module 404 is used to use a second discriminator to predict the probability that the encoding of the ligand electron density image sample and the encoding of the predicted ligand electron density image are true, and generate a second discriminant loss between the predicted encoding and the corresponding true encoding, and use the second discriminant loss to update the parameters of the second discriminator, which is a pixel convolutional neural network.
[0086] This embodiment also provides a ligand generating device, such as Figure 5 As shown, the ligand generating device comprises:
[0087] An image acquisition module 501 is used to acquire a ligand electron density image to be generated for specifying a pocket structure;
[0088] The ligand generation module 502 is used to input the ligand electron density image to be generated into the trained ligand generation model to obtain the target ligand electron density image generated by the ligand generation model. The trained ligand generation model is trained according to the training method of the ligand generation model in the above embodiment.
[0089] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0090] The ligand generating device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0091] See also Figure 6 , Figure 6 1 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present disclosure, and the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the computer device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system).
[0092] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0093] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0094] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0095] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0096] The computer device further includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means.
[0097] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device may be a touch screen.
[0098] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0099] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.
[0100] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A training method for a ligand generation model, It is characterized in that The ligand generation model comprises: a cascaded generator, an encoder, a pixel convolutional neural network and a decoder; the generator is a generator of a conditional adversarial generation network, the encoder and the decoder are encoders and decoders of a pre-trained vector quantized variational autoencoder model, and the method comprises: Obtain a sample set of ligand electron density images of pocket structures; Using the generator, generating a predicted ligand electron density image according to the ligand electron density image sample, and determining a generation loss based on the difference between the ligand electron density image sample and the predicted ligand electron density image, and using the generation loss to update the parameters of the generator, the generation loss includes: a Dyss loss, a gradient map loss and a mean absolute error loss; Using a first discriminator, respectively predicting the probability that the ligand electron density image sample and the predicted ligand electron density image are true according to the ligand electron density image sample and the predicted ligand electron density image, and generating a first discriminant loss between the predicted image and the real image, and using the first discriminant loss to update the parameters of the first discriminator, the first discriminator being the discriminator of the adversarial generative network; A second discriminator is used to predict the probability that the encoding of the ligand electron density image sample and the encoding of the predicted ligand electron density image are true, respectively, based on the encoding of the ligand electron density image sample and the encoding of the predicted ligand electron density image generated by the encoder, and to generate a second discriminant loss between the predicted encoding and the corresponding true encoding. The second discriminant loss is used to update the parameters of the second discriminator, which is the pixel convolutional neural network.
2. The method according to claim 1, It is characterized in that The gradient map loss is determined based on the following steps: For the ligand electron density image sample and the predicted ligand electron density image, a difference method is used to generate a gradient of a three-dimensional discrete function; The mean absolute error loss of the gradient of the three-dimensional discrete function is calculated in each of the three dimensions, and the calculation results of each dimension are added to obtain the gradient map loss.
3. The method according to claim 2, It is characterized in that The generation losses include: The sum of Dies loss, gradient map loss and mean absolute error loss.
4. The method according to claim 1, It is characterized in that The method further comprises: Determining the adversarial loss of the generator based on the output of the first discriminator; Based on the generation loss and the adversarial loss, the parameters of the generator are updated.
5. The method according to claim 1, It is characterized in that The pre-trained vector quantized variational autoencoder model is determined based on the following steps: When pre-training the vector quantized variational autoencoder model, a training sample set is obtained, wherein the training sample includes a ligand electron density training image; The vector quantized variational autoencoder model is used to generate a ligand electron density prediction image based on the ligand electron density training image, and a training loss between the prediction image and the training image is generated. The training loss is determined based on the following functions: reconstruction loss, quantization loss, codebook loss, and regularization term. The training loss is used to update the parameters of the vector quantized variational autoencoder model.
6. A method for generating a ligand, It is characterized in that The method comprises: Obtain the electron density image of the ligand to be generated for the specified pocket structure; The ligand electron density image to be generated is input into the trained ligand generation model to obtain the target ligand electron density image generated by the ligand generation model, and the trained ligand generation model is trained according to the training method of the ligand generation model described in any one of claims 1-5.
7. A training device for a ligand generation model, It is characterized in that The ligand generation model includes: a cascaded generator, an encoder, a pixel convolutional neural network and a decoder; the generator is a conditional adversarial generation network generator, the encoder and the decoder are the encoder and the decoder of the pre-trained vector quantized variational autoencoder model, and the device includes: An image sample acquisition module is used to obtain a collection of ligand electron density image samples of pocket structures; A generator training module, for using a generator to generate a predicted ligand electron density image according to a ligand electron density image sample, and determining a generation loss based on a difference between the ligand electron density image sample and the predicted ligand electron density image, and using the generation loss to update the parameters of the generator, wherein the generation loss includes: a Dyess loss, a gradient map loss, and a mean absolute error loss; A discriminator training module is used to use a first discriminator to predict the ligand electron density image sample and the probability that the predicted ligand electron density image is true, and generate a first discriminant loss between the predicted image and the real image, respectively according to the ligand electron density image sample and the predicted ligand electron density image, and use the first discriminant loss to update the parameters of the first discriminator, wherein the first discriminator is a discriminator of an adversarial generative network; The neural network training module is used to use a second discriminator to predict the probability that the encoding of the ligand electron density image sample and the encoding of the predicted ligand electron density image are true, respectively, based on the encoding of the ligand electron density image sample generated by the encoder and the encoding of the predicted ligand electron density image, and to generate a second discriminant loss between the predicted encoding and the corresponding true encoding, and use the second discriminant loss to update the parameters of the second discriminator, where the second discriminator is a pixel convolutional neural network.
8. A ligand generating device, It is characterized in that The device comprises: An image acquisition module, used for acquiring an electron density image of a ligand to be generated for specifying a pocket structure; A ligand generation module is used to input the ligand electron density image to be generated into a trained ligand generation model to obtain a target ligand electron density image generated by the ligand generation model, wherein the trained ligand generation model is trained according to the training method of the ligand generation model described in any one of claims 1 to 5.
9. A computer device, It is characterized in that include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the training method of the ligand generation model described in any one of claims 1 to 5, or executes the ligand generation method described in claim 6 by executing the computer instructions.
10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the training method for a ligand generation model according to any one of claims 1 to 5, or to execute the ligand generation method according to claim 6.
11. A computer program product, It is characterized in that The method comprises computer instructions for causing a computer to execute the training method for a ligand generation model according to any one of claims 1 to 5, or the ligand generation method according to claim 6.
