Model training method, diffusion model-based molecule generation method and data processing device
By using an encoder and decoder training method, mixed modal data is uniformly mapped to a shared latent space and a denoising network is used to solve the shortcomings of traditional diffusion models in handling mixed modal data in molecular generation, thus achieving efficient molecular generation.
Patent Information
- Application Number
- CN202510926139.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-10-17
AI Technical Summary
Traditional diffusion models struggle to effectively handle mixed-modal data when dealing with molecular generation, leading to a surge in optimization difficulty and insufficient validity of generated samples.
By training the encoder and decoder, mixed modal data are uniformly mapped to a shared latent space, and noise is balanced using a denoising network, thus achieving efficient representation and reconstruction of molecules.
It effectively solves the problem of information density differences between mixed modal data, and improves the rationality of generated samples and optimization efficiency.
Smart Images

Figure CN120804707A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer technology, and in particular, to a model training method, an encoding method, a decoding method, a molecule generation method based on a diffusion model, a data processing apparatus, a computer readable storage medium, and a computer program product. BACKGROUND
[0002] As a generative deep learning framework based on probabilistic modeling, diffusion models have shown breakthrough progress in the field of image generation and video synthesis in recent years. For example, in the field of image, diffusion models can generate high-resolution, semantically rich and highly diverse image samples through the learning mechanism of progressive noise addition and reverse denoising. In the field of video, diffusion models can generate coherent and smooth dynamic sequences by introducing a time dimension for modeling, which significantly improves the authenticity and controllability of the generated content. The success of diffusion models is due to the single modal characteristics of image data or video data, i.e., pixel values as continuous data can be modeled through a unified Gaussian noise diffusion process.
[0003] However, in the field of molecule generation, the application of traditional diffusion models faces challenges. For example, the modeling mechanism of diffusion processes conflicts with the mixed modal data representing molecules, such as their chemical structures, making traditional diffusion models have defects in processing such mixed modal data. For example, directly using original data for joint diffusion may lead to increased optimization difficulty and / or insufficient rationality of generated samples. SUMMARY
[0004] In view of this, the embodiments of the present disclosure provide a model training method, an encoding method, a decoding method, a molecule generation method based on a diffusion model, a data processing apparatus, a computer readable storage medium, and a computer program product, thereby providing a new diffusion model that allows mixed modal data representing molecules, such as their chemical structures, to be uniformly mapped to a shared latent space, solving the problem of difficulty in balancing noise due to the difference in information density between mixed modal data, and thereby overcoming one or more of the above-mentioned defects.
[0005] According to a first aspect of the present disclosure, a model training method is provided, comprising: obtaining a training data set, the training data set comprising a plurality of original data samples, each of the original data samples comprising first atomic attribute data of a plurality of atoms of a molecule, first bond attribute data of the plurality of atoms, and first atomic coordinate data of the plurality of atoms; encoding, by means of an encoder, an original data sample selected from the training data set into a latent feature of the molecule; decoding, by means of a decoder, the latent feature into a reconstructed data sample, the reconstructed data sample comprising second atomic attribute data of the plurality of atoms of the molecule, second bond attribute data of the plurality of atoms, and second atomic coordinate data of the plurality of atoms; and training the encoder and the decoder according to a difference between the original data sample and the reconstructed data sample.
[0006] According to a second aspect of the present disclosure, a model training method is provided, comprising: obtaining a training data set, the training data set comprising a plurality of original data samples, each of the original data samples comprising first atomic attribute data of a plurality of atoms of a molecule, first bond attribute data of the plurality of atoms, and first atomic coordinate data of the plurality of atoms; encoding, by means of an encoder, an original data sample selected from the training data set into an original latent feature of the molecule; adding noise to the original latent feature to generate a noisy latent feature; denoising, by means of a denoising network, the noisy latent feature to obtain a denoised latent feature; and training the denoising network according to a difference between the original latent feature and the denoised latent feature.
[0007] According to a third aspect of the present disclosure, an encoding method is provided, comprising: obtaining atomic attribute data of a plurality of atoms of a molecule, bond attribute data of the plurality of atoms, and atomic coordinate data of the plurality of atoms; converting the atomic attribute data into a first feature, the bond attribute data into a second feature, and the atomic coordinate data into a third feature; and aggregating the first feature, the second feature, and the third feature into a latent feature of the molecule.
[0008] According to a fourth aspect of the present disclosure, a decoding method is provided, comprising: obtaining a latent feature of a molecule; and determining, based on the latent feature, atomic attribute data of a plurality of atoms of the molecule, bond attribute data of the plurality of atoms, and atomic coordinate data of the plurality of atoms.
[0009] According to a fifth aspect of the present disclosure, a molecule generation method based on a diffusion model is provided, comprising: obtaining a noisy hidden feature; obtaining a conditional hidden feature; generating an aggregated hidden feature based on the noisy hidden feature and the conditional hidden feature; performing denoising processing on the aggregated hidden feature to obtain a denoised hidden feature; obtaining atomic attribute data for a plurality of atoms of the molecule, bond attribute data for the plurality of atoms, and atomic coordinate data for the plurality of atoms based on the denoised hidden feature.
[0010] According to a sixth aspect of the present disclosure, a data processing apparatus is provided, comprising: at least one memory; and at least one processor coupled to the at least one memory, the at least one processor being configured to perform the model training method, the encoding method, the decoding method, or the molecule generation method of any one of the embodiments described in the present disclosure based on instructions stored in the at least one memory.
[0011] According to a seventh aspect of the present disclosure, a computer-readable storage medium is provided, having computer instructions stored thereon, the instructions being executed by a processor to implement the model training method, the encoding method, the decoding method, or the molecule generation method of any one of the embodiments described in the present disclosure.
[0012] According to an eighth aspect of the present disclosure, a computer program product is provided, which, when running on a computer, causes the computer to implement the model training method, the encoding method, the decoding method, or the molecule generation method of any one of the embodiments described in the present disclosure.
[0013] Other features, aspects, and advantages of the present disclosure will become apparent from the following detailed description of the exemplary embodiments with reference to the following drawings. BRIEF DESCRIPTION OF DRAWINGS
[0014] Embodiments of the present disclosure will be described below with reference to the accompanying drawings. It should be understood that the accompanying drawings described below relate only to some embodiments of the present disclosure and do not limit the present disclosure. In the drawings:
[0015] Figure 1 is a flowchart of a model training method according to some embodiments of the present disclosure;
[0016] Figures 2A-2C is a schematic diagram of a first matrix, a second matrix, and a third matrix for jointly representing a molecule;
[0017] Figure 3 is Figure 1 is a block diagram of an exemplary implementation of encoding an original data sample into a hidden feature for the molecule by means of an encoder in the model training method of
[0018] Figure 4 isFigure 1 a block diagram of an exemplary embodiment of a step in the model training method according to some embodiments of the present disclosure;
[0019] Figure 5 a flowchart of an encoding method according to some embodiments of the present disclosure;
[0020] Figure 6 a flowchart of a decoding method according to some embodiments of the present disclosure;
[0021] Figure 7 a flowchart of a model training method according to some embodiments of the present disclosure;
[0022] Figure 8 a flowchart of a model training method according to some embodiments of the present disclosure;
[0023] Figure 9 a block diagram of an exemplary embodiment of a step in the model training method according to some embodiments of the present disclosure;
[0024] Figure 10 a block diagram of an exemplary embodiment of a third encoder according to some embodiments of the present disclosure;
[0025] Figure 11 a block diagram of an exemplary embodiment of a fourth encoder according to some embodiments of the present disclosure;
[0026] Figure 12 a flowchart of a molecule generation method based on a diffusion model according to some embodiments of the present disclosure;
[0027] Figure 13 a block diagram of a data processing apparatus according to some embodiments of the present disclosure;
[0028] Figure 14 a block diagram of an electronic device according to some embodiments of the present disclosure.
[0029] It should be understood that the dimensions of the various portions shown in the attached figures are shown for convenience only. It is possible that the same or similar reference numerals can be used in different figures to denote the same or similar parts. Therefore, once a part is defined in one figure, it can not be further discussed in subsequent figures. DETAILED DESCRIPTION
[0030] The technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the drawings in the embodiments of the present disclosure. It should be understood that the present disclosure can be implemented in various forms, and should not be interpreted as being limited to the embodiments described herein.
[0031] It should be understood that various steps of the method embodiments of the present disclosure can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit performing the steps shown. The scope of the present disclosure is not limited in this regard. The relative arrangement of components and steps illustrated in these embodiments should be interpreted as an example only, not limiting the scope of the present disclosure.
[0032] The term "comprising" and variations thereof as used in the present disclosure mean an open-ended term that specifies the presence of stated elements / features but does not preclude the presence or addition of other elements / features. The term "based on" means "based, at least in part, on." The term "according to" means "according to at least in part."
[0033] It should be noted that the concepts of "first", "second", etc. mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not intended to limit the order or interdependence of the functions performed by these devices, modules or units. Unless otherwise specified, the concepts of "first", "second", etc. are not intended to imply a given order or any other manner of given order in time, space, ranking, or the like.
[0034] It should be noted that the modification of "one", "multiple" mentioned in the present disclosure is illustrative but not limiting, and those skilled in the art should understand that unless the context clearly indicates otherwise, it should be understood as "one or more".
[0035] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings, but the present disclosure is not limited to these specific embodiments. The following specific embodiments can be combined with each other, and for the same or similar concepts or processes, some embodiments can not be described again. In addition, in one or more embodiments, specific features, structures or characteristics can be combined by any suitable means from the present disclosure which is clear to those skilled in the art.
[0036] In the field of molecule generation, e.g., small molecule (especially pharmaceutical small molecule) generation, a molecule, e.g., its chemical structure, can be jointly represented by mixed modal data. However, when implementing molecule generation by using a traditional diffusion model based on continuous coordinates, there are defects in the processing of mixed modal data by the traditional diffusion model due to the conflict between the mixed modal data and the modeling mechanism of the diffusion process (e.g., it is difficult to balance noise due to the difference in information density between mixed modal data).
[0037] Some embodiments of the present disclosure provide a model training method for a diffusion model, specifically including a model training method for an encoder and a decoder, and a model training method for a denoising network. This provides a new diffusion model that allows for uniformly mapping mixed-modal data that jointly characterizes molecules, such as their chemical structures, to a shared latent space. This addresses the difficulty in balancing noise due to information density differences between mixed-modal data, thereby overcoming one or more of the aforementioned deficiencies.
[0038] Figure 1 A flowchart of a model training method according to some embodiments of the present disclosure is shown.
[0039] like Figure 1 As shown, the model training method may include: step S1, obtaining a training data set, the training data set including multiple original data samples, each of the original data samples including first atomic property data for multiple atoms of a molecule, first bond property data for the multiple atoms, and first atomic coordinate data for the multiple atoms; step S2, encoding the original data samples selected from the training data set into latent features for the molecule with the help of an encoder; step S3, decoding the latent features into reconstructed data samples with the help of a decoder, the reconstructed data samples including second atomic property data for multiple atoms of the molecule, second bond property data for the multiple atoms, and second atomic coordinate data for the multiple atoms; step S4, training the encoder and the decoder according to the difference between the original data sample and the reconstructed data sample.
[0040] The above-mentioned model training method can be constituted as a model training method for an encoder and a decoder to be used in a diffusion model.
[0041] The encoder can map the input data to a latent space and generate or encode it into latent features, such as latent feature vectors. Here, the encoder can uniformly map the mixed modal data that can jointly characterize the molecule to a shared latent space and aggregate it into latent features for the molecule, such as a latent feature vector. The latent features in the shared latent space can be used to compress or integrate the mixed modal data as input data, thereby achieving efficient representation of the input data. In some embodiments, the encoder can be configured as an autoencoder, such as a variational autoencoder. It should be understood that the encoder can be configured as any form of encoder, without limitation.
[0042] The decoder can reconstruct, restore or decode the latent features in the latent space into mixed modal data that can jointly characterize the molecule as output data, so that the output data is as close as possible to the input data.
[0043] To train the above-mentioned encoder and decoder, the present disclosure provides at least one training dataset, each of which can include a plurality of original data samples, each of which can be composed of mixed modal data capable of jointly representing a molecule, for example, its chemical structure. Here, each original data sample can include first atomic attribute data for a plurality of atoms of a molecule (i.e., for one predetermined molecule), first bond attribute data for the plurality of atoms, and first atomic coordinate data for the plurality of atoms. The present disclosure proposes to describe a specific molecule from three aspects of atomic attributes, bond attributes, and atomic coordinates (i.e., atomic three-dimensional coordinates x, y, z), realizing an effective mathematical representation for molecules.
[0044] The encoder can uniformly map the mixed modal original data samples (i.e., discrete atomic attribute data, discrete bond attribute data, and continuous atomic coordinate data for a molecule) to a shared hidden space and aggregate into a hidden feature, for example, a hidden feature vector for the molecule, and the hidden feature still contains feature components associated with the atomic attributes, bond attributes, and atomic coordinates of the molecule. To this end, the encoder can be configured to convert the atomic attribute data, the bond attribute data, and the atomic coordinate data into equal-dimensional feature vectors, respectively, and then aggregate to generate a unified hidden feature representation. For example, encoding an original data sample selected from the training dataset into a hidden feature for the molecule by the encoder can include: converting or mapping the first atomic attribute data into a first feature; converting or mapping the first bond attribute data into a second feature; converting or mapping the first atomic coordinate data into a third feature; and aggregating the first feature, the second feature, and the third feature into the hidden feature. The first feature, the second feature, and the third feature can each have the same feature dimension and thus can be efficiently aggregated into a unified hidden feature.
[0045] The decoder can decode the hidden feature into a reconstructed data sample, which can include second atomic attribute data for a plurality of atoms of the molecule, second bond attribute data for the plurality of atoms, and second atomic coordinate data for the plurality of atoms. Since the hidden feature generated by the encoder still contains feature components associated with the atomic attributes, bond attributes, and atomic coordinates of the molecule, the decoder can reconstruct the reconstructed atomic attribute data (i.e., the second atomic attribute data), the reconstructed bond attribute data (i.e., the second bond attribute data), and the reconstructed atomic coordinate data (i.e., the second atomic coordinate data) of the molecule based on the corresponding feature components in the hidden feature.
[0046] To train the encoder and the decoder, a loss function value between the original data sample and the reconstructed data sample can be calculated, and based on the loss function value, the parameters of the encoder and the parameters of the decoder are updated by using back propagation. To this end, a composite loss function can be constructed, and for atomic property data and key property data, for example, a cross-entropy loss or a boundary optimization loss can be used, and for atomic coordinate data, for example, a mean square error loss or an error absolute value loss can be used.
[0047] The above is described in combination with Figure 1 The model training method according to some embodiments of the present disclosure is introduced, which allows the encoder and the decoder of the diffusion model to be trained, realizes the unified mapping of the mixed modal data for jointly representing molecules to the shared hidden space, and further realizes the efficient and unified hidden feature representation of the mixed modal data, and effectively balances the information density difference between the mixed modal data.
[0048] To facilitate understanding of the model training method of the embodiments of the present disclosure, the following is described in combination with Figures 2A to 4 The exemplary embodiments of the steps in the model training method are described in detail. Those skilled in the art should understand that, Figures 2A to 4 The block diagram of the exemplary embodiments of the steps shown is only one example that can be realized by the embodiments of the present disclosure. The scope of application of the embodiments of the present disclosure is not limited by any aspect of this block diagram. Based on the above description, the model training method provided by the present disclosure will be described in detail in combination with the drawings.
[0049] As Figures 2A-2C shown, the mixed modal data for jointly representing molecules can be represented by a plurality of matrices, for example, three matrices. For atomic property data, a first matrix M1 can be used for representation, for key property data, a second matrix M2 can be used for representation, and for atomic coordinate data, a third matrix M3 can be used for representation. Thus, for an original data sample, the first atomic property data is represented in the form of a first original matrix, the first key property data is represented in the form of a second original matrix, and the first atomic coordinate data is represented in the form of a third original matrix. Correspondingly, for a reconstructed data sample, the second atomic property data is represented in the form of a first reconstructed matrix, the second key property data is represented in the form of a second reconstructed matrix, and the second atomic coordinate data is represented in the form of a third reconstructed matrix.
[0050] As discrete categorical data, the first atomic attribute data and the second atomic attribute data can respectively include atomic number (or atomic type) for the respective atom and at least one of formal charge and number of connected hydrogen atoms for the respective atom. The integration of formal charge in atomic attribute data of a molecule can effectively support the generation of molecules in different protonation states. Since the protonation state of a molecule has a key impact on the activity, polarity and / or binding capacity of the molecule in the field of drug design (such as the construction of pharmacophore models, molecular docking simulation, etc.), the introduction of this data dimension has a favorable value. In addition, by including the number of connected hydrogen atoms (i.e., the number of hydrogen atoms directly connected to the respective atom or the number of bonded hydrogen atoms) of each atom in the atomic attribute data, the chemical structure of the molecule can be accurately defined.
[0051] In Figure 2A In the embodiments shown, the first atomic attribute data and the second atomic attribute data can respectively include atomic number (more precisely, atomic number of element other than hydrogen, or heavy atomic number), formal charge, and number of connected hydrogen atoms. The representation of excluding hydrogen atoms from the atomic number column and forming a separate column of the number of connected hydrogen atoms can form a simplified atomic attribute data matrix, reduce data storage, and effectively meet the automation processing needs in the field of computer-aided drug design and molecular simulation.
[0052] As Figure 2A The first matrix for representing atomic attribute data can be constructed as an n*3 matrix, "n" corresponds to the number of atoms, and "3" corresponds to the characteristic dimension of the atom, i.e., three columns of characteristic data: the first column can correspond to the atomic number column (more precisely, the atomic number of element other than hydrogen), the second column can correspond to the formal charge column, and the third column can correspond to the number of connected hydrogen atoms column. It should be understood that the data form for representing the above-mentioned characteristic attributes has diversity and is not limited to the specific presentation of the current embodiments.
[0053] As discrete categorical data, the first bond attribute data and the second bond attribute data can respectively include multiple items of no bond, single bond, double bond, triple bond, delocalized π bond (such as aromatic bond), coordinate bond, hydrogen bond, van der Waals force, ionic bond, π-π stacking interaction, etc. Figure 2BAs shown, the second matrix for representing the bond property data can be configured as an n*n matrix, where "n" corresponds to the number of atoms. As an example, "0" can represent no bond, i.e. no bond between two atoms, "1" can represent a single bond between two atoms, "2" can represent a double bond between two atoms, "3" can represent a triple bond between two atoms, and "4" can represent a delocalized pi bond or an aromatic bond between two atoms. It should be understood that the data form for characterizing the above bond properties is diverse and is not limited to the specific presentation of the current embodiment.
[0054] As continuous data, the third matrix for representing the atomic coordinate data can be configured as an n*3 matrix, where "n" corresponds to the number of atoms and "3" corresponds to a three-dimensional coordinate system, i.e. x, y, z.
[0055] Figure 3 A block diagram illustrating an exemplary embodiment of encoding the original data samples into the latent feature of the molecule by means of the encoder in the above model training method is shown. As shown, the encoder can be configured to convert the first original matrix M1 (or the first atomic property data), the second original matrix M2 (or the first bond property data), and the third original matrix M3 (or the first atomic coordinate data) into feature vectors of the same dimension, respectively, and then aggregate to generate a unified latent feature representation. Figure 3
[0056] In the embodiment shown, the first atomic property data can be converted into a first feature of n*d form by means of the first embedding layer E1 in the encoder, where "n" represents the number of atoms and "d" represents the feature dimension. The first embedding layer E1 should be understood as a network layer structure containing embedding processing. It should be understood that one or more functional layers can be provided upstream and / or downstream of the first embedding layer E1 to achieve specific data processing functions. Figure 3
[0057] In the embodiment shown, the first bond property data can be converted into an intermediate feature of n*n*d form by means of the second embedding layer E2 in the encoder, and the intermediate feature can be converted into a second feature of n*d form by means of the first aggregation layer S1. The second embedding layer E2 should be understood as a network layer structure containing embedding processing. The first aggregation layer S1 can be exemplarily configured as a summation layer, for example, performing summation operation in the atomic dimension. The summation operation can accumulate the intermediate feature of n*n*d form in the atomic dimension, thereby realizing the aggregation of local features. It should be understood that one or more functional layers can be provided upstream, in the middle, and / or downstream of the second embedding layer E2 and the first aggregation layer S1 to achieve specific data processing functions. Figure 3
[0058] Figure 3 In the illustrated embodiment, the first atomic coordinate data can be converted into the third feature in the form of n*d by means of at least one linear layer L1-1, L1-2 (two linear layers in the figure) in the encoder. The linear layer L1-1, L1-2 can be understood as a linear transformation layer structure based on matrix multiplication, allowing dimension mapping and feature transformation of the input data. It should be understood that one or more functional layers can be arranged upstream, intermediate, and / or downstream of these linear layers L1-1, L1-2 to achieve specific data processing functions.
[0059] In Figure 3 In the illustrated embodiment, the first feature, the second feature, and the third feature can be aggregated into the latent feature in the form of n*d by means of a second aggregation layer S2 in the encoder. Since the first feature, the second feature, and the third feature are all feature vectors of equal dimensions, they can be aggregated by summation or concatenation to obtain the latent feature. It should be understood that one or more functional layers can be arranged upstream and / or downstream of the second aggregation layer S2 to achieve specific data processing functions.
[0060] Figure 4 A block diagram illustrating an exemplary implementation of decoding the latent feature LF into a reconstructed data sample by means of the decoder in the above-described model training method is shown. As Figure 4 As shown, the decoder can be configured to decode the latent feature LF in the latent space into a first reconstruction matrix M1' (or second atomic property data), a second reconstruction matrix M2' (or second key property data), and a third reconstruction matrix M3' (or second atomic coordinate data).
[0061] In Figure 4 In the illustrated embodiment, the latent feature LF can be converted into the second atomic property data by means of a first multi-layer perceptron MLP1 and a first linear layer L1 in the decoder. The first multi-layer perceptron MLP1 in the decoder can perform nonlinear feature extraction and feature mapping on the input latent feature LF. The feature processed by the first multi-layer perceptron MLP1 can be further input to the first linear layer L1, which can implement a classification output function using an activation function, such as a softmax activation function. For example, to output type data about the atomic number, the formal charge number, and the number of connected hydrogen atoms, respectively, corresponding first linear layers L1 can be arranged respectively. In this way, the decoder can efficiently implement the conversion process from the latent feature LF in the latent space to specific atomic property data. It should be understood that one or more functional layers can be arranged upstream, between, and / or downstream of the first multi-layer perceptron MLP1 and the first linear layer L1 to achieve specific data processing functions.
[0062] In Figure 4In the illustrated embodiment, the latent feature LF can be converted into the second bond property data by means of a product processing layer TP, a second multi-layer perceptron MLP2 and a second linear layer L2 in the decoder. The product processing layer TP can be configured to organize the latent feature LF into a matrix structure of row features and column features respectively, and perform a feature product operation on both, e.g. an element-wise product operation on the ith and jth atomic feature. The feature transformed by the product processing layer TP can be input into the second multi-layer perceptron MLP2, which can perform a non-linear feature extraction and feature mapping on the input feature. The feature processed by the second multi-layer perceptron MLP2 can be further input into the second linear layer L2, which can implement a classification output function by means of an activation function, e.g. a softmax activation function. In this way, the decoder can efficiently implement a conversion process from the latent feature LF in the latent space to the specific bond property data. It should be understood that one or more functional layers can be provided upstream, between and / or downstream of the product processing layer TP, the second multi-layer perceptron MLP2 and the second linear layer L2 to implement specific data processing functions.
[0063] In Figure 4 In the illustrated embodiment, the latent feature LF can be converted into the second atomic coordinate data by means of a third multi-layer perceptron MLP3 and a third linear layer L3 in the decoder. The third multi-layer perceptron MLP3 in the decoder can perform a non-linear feature extraction and feature mapping on the input latent feature LF. The feature processed by the third multi-layer perceptron MLP3 can be further input into the third linear layer L3. The third linear layer L3 can be understood as a linear transformation layer structure based on matrix multiplication, allowing dimension mapping and feature transformation on the input data. In this way, a conversion process from the latent feature LF in the latent space to the specific atomic coordinate data is implemented. It should be understood that one or more functional layers can be provided upstream, between and / or downstream of the third multi-layer perceptron MLP3 and the third linear layer L3 to implement specific data processing functions.
[0064] Figure 5 A flowchart illustrating an encoding method according to some embodiments of the present disclosure is shown. The encoding method can advantageously be performed by means of an encoder trained by a model training method according to some embodiments of the present disclosure. As shown in Figure 5 As shown, the encoding method can comprise: a step S1A of obtaining atomic property data for a plurality of atoms of the molecule, bond property data for the plurality of atoms, and atomic coordinate data for the plurality of atoms; a step S2A of converting the atomic property data into first features, the bond property data into second features, and the atomic coordinate data into third features; and a step S3A of aggregating the first features, the second features, and the third features into a latent feature LF for the molecule.
[0065] In some embodiments, the first atomic property data can be converted into first features of n*d form by means of a first embedding layer E1 in the encoder, where n represents the number of atoms and d represents the feature dimension. The first embedding layer E1 should be understood as a network layer structure containing embedding processing. It should be understood that one or more functional layers can be arranged upstream and / or downstream of the first embedding layer E1 to achieve specific data processing functions.
[0066] In some embodiments, the first key property data can be converted into intermediate features of n*n*d form by means of a second embedding layer E2 in the encoder, and the intermediate features can be converted into second features of n*d form by means of a first aggregation layer S1. The second embedding layer E2 should be understood as a network layer structure containing embedding processing. The first aggregation layer S1 can be exemplarily configured as a summation layer, for example, performing summation operation in the atom dimension. The summation operation can accumulate the intermediate features of n*n*d form in the atom dimension, thereby realizing the aggregation of local features. It should be understood that one or more functional layers can be arranged upstream, in the middle, and / or downstream of the second embedding layer E2 and the first aggregation layer S1 to achieve specific data processing functions.
[0067] In some embodiments, the first atomic coordinate data can be converted into third features of n*d form by means of at least one linear layer (two linear layers in the figure) in the encoder. The linear layer can be understood as a linear transformation layer structure based on matrix multiplication, allowing dimension mapping and feature transformation of input data. It should be understood that one or more functional layers can be arranged upstream, in the middle, and / or downstream of these linear layers to achieve specific data processing functions.
[0068] In some embodiments, the first features, the second features, and the third features are aggregated into the latent features LF of n*d form by means of a second aggregation layer S2 in the encoder. Since the first features, the second features, and the third features are all feature vectors of equal dimension, they can be aggregated by summation or splicing to obtain the latent features LF. It should be understood that one or more functional layers can be arranged upstream and / or downstream of the second aggregation layer S2 to achieve specific data processing functions.
[0069] The above describes the encoding method according to some embodiments of the present disclosure, which realizes the unified mapping of mixed modality data for jointly representing molecules to a shared latent space, thereby realizing efficient and unified latent feature representation of mixed modality data, effectively balancing the information density difference between mixed modality data. Figure 5 The encoding method according to some embodiments of the present disclosure is introduced, which realizes the unified mapping of mixed modality data for jointly representing molecules to a shared latent space, thereby realizing efficient and unified latent feature representation of mixed modality data, effectively balancing the information density difference between mixed modality data.
[0070] Figure 6A flowchart illustrating a decoding method according to some embodiments of the present disclosure is shown. The decoding method can be advantageously performed by means of a decoder trained according to a model training method according to some embodiments of the present disclosure. As shown, the decoding method can comprise: a step S1B of obtaining latent features for a molecule; a step S2B of determining, based on the latent features, atomic property data for atoms of the molecule, bond property data for the atoms, atomic coordinate data for the atoms. Figure 6
[0071] In some embodiments, the latent features LF can be converted into the second atomic property data by means of a first multi-layer perceptron MLP1 and a first linear layer L1 in the decoder. The first multi-layer perceptron MLP1 in the decoder can perform non-linear feature extraction and feature mapping on the input latent features LF. The features processed by the first multi-layer perceptron MLP1 can be further input to the first linear layer L1, which can implement a classification output function by means of an activation function, such as a softmax activation function. For example, in order to output type data about atomic number, formal charge number, and number of connected hydrogen atoms respectively, corresponding first linear layers L1 can be respectively provided. In this way, the decoder can efficiently implement a conversion process from the latent features LF in the latent space to specific atomic property data. It should be understood that one or more functional layers can be provided upstream, between, and / or downstream of the first multi-layer perceptron MLP1 and the first linear layer L1 to implement specific data processing functions.
[0072] In some embodiments, the latent features LF can be converted into the second bond property data by means of a product processing layer TP, a second multi-layer perceptron MLP2, and a second linear layer L2 in the decoder. The product processing layer TP can be configured to organize the latent features LF into a matrix structure of row features and column features respectively, and perform feature product operations on the two, such as element-level product operations on the i-th and j-th atomic features. The features transformed by the product processing layer TP can be input to the second multi-layer perceptron MLP2, which can perform non-linear feature extraction and feature mapping on the input features. The features processed by the second multi-layer perceptron MLP2 can be further input to the second linear layer L2, which can implement a classification output function by means of an activation function, such as a softmax activation function. In this way, the decoder can efficiently implement a conversion process from the latent features LF in the latent space to specific bond property data. It should be understood that one or more functional layers can be provided upstream, between, and / or downstream of the product processing layer TP, the second multi-layer perceptron MLP2, and the second linear layer L2 to implement specific data processing functions.
[0073] In some embodiments, the latent feature LF can be converted into the second atomic coordinate data by means of a third multi-layer perception MLP3 and a third linear layer L3 in the decoder. The third multi-layer perception MLP3 in the decoder can perform nonlinear feature extraction and feature mapping on the input latent feature LF. The feature processed by the third multi-layer perception MLP3 can be further input to the third linear layer L3, which can be understood as a linear transformation layer structure based on matrix multiplication, allowing dimension mapping and feature transformation on the input data, thereby realizing the conversion process from the latent feature LF in the latent space to the specific atomic coordinate data. It should be understood that one or more functional layers can be arranged upstream, between and / or downstream of the third multi-layer perception MLP3 and the third linear layer L3 to realize specific data processing functions.
[0074] The above describes the decoding method according to some embodiments of the present disclosure, which realizes the reconstruction, restoration or decoding of the latent feature in the latent space into the mixed modality data representing the molecule as output data, so as to generate the specific molecular chemical structure from the latent feature. Figure 6 The decoding method according to some embodiments of the present disclosure is introduced, which realizes the reconstruction, restoration or decoding of the latent feature in the latent space into the mixed modality data representing the molecule as output data, so as to generate the specific molecular chemical structure from the latent feature.
[0075] Figure 7 A flowchart of a model training method according to some embodiments of the present disclosure is shown. As shown in FIG. 1C, the model training method can include the following steps. Figure 7 As shown in FIG. 1C, the model training method can include the following steps. Step S1C, obtaining a training data set, the training data set including a plurality of original data samples, each original data sample including first atomic attribute data of a plurality of atoms of a molecule, first bond attribute data of the plurality of atoms, and first atomic coordinate data of the plurality of atoms; step S2C, encoding an original data sample selected from the training data set into an original latent feature of the molecule by means of an encoder; step S3C, applying noise to the original latent feature to generate a noisy latent feature; step S4C, denoising the noisy latent feature by means of a denoising network to obtain a denoised latent feature; and step S5C, training the denoising network according to the difference between the original latent feature and the denoised latent feature.
[0076] In order to train the conditional diffusion model, some embodiments of the present disclosure introduce a conditional input to realize conditional guided denoising, for example, by means of a cross-attention mechanism. Figure 8 A flowchart of a model training method according to some embodiments of the present disclosure is shown. As shown in FIG. 1C, the model training method can include the following steps. Figure 8As shown, the model training method can include: step S1D, obtaining a training data set, the training data set including a plurality of original data samples, each of the original data samples including first atomic attribute data of a plurality of atoms of a molecule, first bond attribute data of the plurality of atoms, and first atomic coordinate data of the plurality of atoms; step S2D, encoding an original data sample selected from the training data set into an original hidden feature of the molecule by means of an encoder; step S3D, applying noise to the original hidden feature to generate a noisy hidden feature; step S4D, obtaining a conditional hidden feature; step S5D, generating an aggregated hidden feature based on the conditional hidden feature and the noisy hidden feature; step S6D, denoising the aggregated hidden feature by means of the denoising network to obtain the denoised hidden feature; and step S7D, training the denoising network according to a difference between the original hidden feature and the denoised hidden feature.
[0077] The above model training method can be configured as a model training method for a denoising network to be used in a diffusion model. The denoising network in the diffusion model is a core component of the reverse denoising process. The denoising network can take a noisy hidden feature and a time embedding as input, gradually refine the features through multiple layers of nonlinear transformation (such as convolution, self-attention mechanism), and output a predicted value of the original data sample (e.g., the original hidden feature) and / or the noise.
[0078] To train the denoising network, the present disclosure provides at least one training data set, each of which can include a plurality of original data samples, each of which can be configured as mixed modality data capable of jointly representing a molecule, for example, its chemical structure. Here, each original data sample can include first atomic attribute data of a plurality of atoms of a molecule (i.e., for a predetermined molecule), first bond attribute data of the plurality of atoms, and first atomic coordinate data of the plurality of atoms. The present disclosure proposes to describe a specific molecule from three aspects of atomic attributes, bond attributes, and atomic coordinates, thereby achieving an effective mathematical representation of the molecule.
[0079] The encoder can uniformly map the original data samples of mixed modalities to a shared latent space and aggregate into an original latent feature, e.g., an original latent feature vector, for the molecule, and the original latent feature still contains feature components associated with atomic properties, bond properties, and atomic coordinates of the molecule. To this end, the encoder can be configured to convert the atomic property data, the bond property data, and the atomic coordinate data into feature vectors of equal dimensionality, respectively, and then aggregate to generate a uniform original latent feature representation. For example, encoding an original data sample selected from the training dataset into an original latent feature representation for the molecule by the encoder can include converting or mapping the first atomic property data into a first feature, converting or mapping the first bond property data into a second feature, converting or mapping the first atomic coordinate data into a third feature, and aggregating the first feature, the second feature, and the third feature into the original latent feature. The first feature, the second feature, and the third feature can each have the same feature dimensionality and thus can be efficiently aggregated into a uniform original latent feature.
[0080] To implement noise introduction, a noise can be imposed on the original latent feature output by the encoder by means of a noise imposer, e.g., a noise scheduler, to generate a noisy latent feature. For example, the noise imposer can superimpose a certain noise on the original latent feature according to a pre-set rule or algorithm to generate the noisy latent feature. This process can regulate the timing and magnitude of noise injection, providing a basis for training of the denoising network.
[0081] To implement condition introduction, a corresponding condition input data can be encoded into a condition latent feature by means of at least one encoder, which can advantageously have the same dimensionality as the original latent feature. Thus, the aggregated latent feature generated from the condition latent feature and the noisy latent feature can be efficiently implemented by merging or concatenating. In some embodiments, the condition latent feature can include at least one of a molecule fragment condition latent feature, a pharmacophore condition latent feature, and a protein condition latent feature.
[0082] The denoising network can take the noisy latent feature or the aggregated latent feature (usually also together with a temporal embedding) as input, and perform denoising processing on the noisy latent feature or the aggregated latent feature through multiple layers of nonlinear transformation, e.g., convolution, self-attention mechanism, to obtain a denoised latent feature.
[0083] To train the denoising network, a loss function value between the original latent feature and the denoised latent feature can be calculated, and based on the loss function value, e.g., using mean square error loss or error absolute value loss, the parameters of the denoising network can be updated using backpropagation.
[0084] The above is described in combination with Figure 7 and 8The model training method according to some embodiments of the present disclosure allows the denoising network of the diffusion model to be trained, realizes the unified mapping of the mixed modality data used to jointly represent the molecules to the shared hidden space, and further realizes the efficient and unified hidden feature representation of the mixed modality data, effectively balancing the information density difference between the mixed modality data. In addition, the model training method according to some embodiments of the present disclosure introduces conditional input, which advantageously realizes a conditional diffusion model to realize conditional guided denoising, for example, through a cross-attention mechanism.
[0085] To facilitate understanding of the model training method of the embodiments of the present disclosure, the following will be described in combination with Figure 9 The exemplary embodiments of the steps in the model training method are described in detail. Those skilled in the art should understand that, Figure 9 The block diagram of the exemplary embodiments of the steps in the model training method is only one example that can be realized by the embodiments of the present disclosure. The scope of application of the embodiments of the present disclosure is not limited by any aspect of the block diagram. Based on the above description, the model training method provided by the present disclosure will be described in detail in combination with the drawings.
[0086] As Figure 9 shown, the first encoder N1 can encode the original data samples selected from the training data set into original hidden features LF0 (for example, features in the form of n*d) for the molecules. The noise adder AN can add noise to the original hidden features LF0 output by the first encoder N1 to generate noisy hidden features LF1 (for example, features in the form of n*d).
[0087] To realize the introduction of conditions, the corresponding conditional input data can be encoded into conditional hidden features LF2, LF3 by means of at least one encoder. In Figure 9 In the embodiments shown, the molecular fragment data can be encoded into molecular fragment conditional hidden features LF2 (for example, features in the form of a*d, where a represents the number of atoms and d represents the feature dimension) by means of the second encoder N2. Here, obtaining the conditional hidden features LF2, LF3 can include: obtaining molecular fragment data, the molecular fragment data including atomic attribute data of a plurality of atoms for the molecular fragment, bond attribute data for the plurality of atoms, atomic coordinate data for the plurality of atoms; and encoding the molecular fragment data into the molecular fragment conditional hidden features LF2. Here, for example, the molecular fragment data can be encoded into the molecular fragment conditional hidden features LF2 by means of the encoder introduced according to the present disclosure.
[0088] Furthermore, the pharmacophore data can be encoded into a pharmacophore conditional latent feature LF3 (e.g., a feature in the form of b*d) by means of a third encoder N3. Acquiring the conditional latent features LF2 and LF3 can include: acquiring pharmacophore data, the pharmacophore data including pharmacophore type data and pharmacophore coordinate data; and encoding the pharmacophore data into the pharmacophore conditional latent feature LF3.
[0089] Figure 10 is a block diagram of an exemplary embodiment of the third encoder N3. Figure 10 As shown, the third encoder N3 can include a third embedding layer E3 for converting the pharmacophore type data into a first feature of the form b*d, where b represents the number of pharmacophores and d represents the feature dimension. The third encoder can include a fourth linear layer L4 for converting the pharmacophore coordinate data into a second feature of the form b*d. Furthermore, the pharmacophore conditional latent feature LF3 can be obtained by summing the first and second features.
[0090] Additionally or alternatively, the protein data may be encoded into a protein conditional latent feature or a protein pocket conditional latent feature LF4 by means of a fourth encoder (not shown). In some embodiments, obtaining the conditional latent feature may include: obtaining protein data, the protein data including amino acid type data for the protein, amino acid atom property data for the protein, and amino acid atom coordinate data for the protein; and encoding the protein data into the protein conditional latent feature LF4.
[0091] Figure 11 is a block diagram of an exemplary embodiment of a fourth encoder. Figure 11 As shown, the fourth encoder may have a fourth embedding layer E4 to convert amino acid type data into amino acid type features. The fourth encoder may have a fifth embedding layer E5, a fifth linear layer L5, and a third polymerization layer S3. The fifth embedding layer E5 is used to convert the atomic property data (e.g., atomic number) of each atom contained in the amino acid into atomic property features (e.g., atomic number features). The fifth linear layer L5 is used to convert the atomic coordinate data of each atom contained in the amino acid into atomic coordinate features. The third polymerization layer S3 is used to add the atomic property features and atomic coordinate features of all atoms in the amino acid to generate the atomic features of the amino acid. The fourth encoder may have a fourth polymerization layer S4 and a fifth polymerization layer S5. The fourth polymerization layer S4 is used to add the amino acid type features and atomic features of the amino acid to generate the amino acid features of the amino acid. The fifth polymerization layer S5 is used to splice the amino acid features of multiple amino acids to generate the protein conditional latent feature LF4.
[0092] exist Figure 9In the illustrated embodiment, the conditional latent features (e.g. molecular fragment conditional latent feature LF2 and pharmacophore conditional latent feature LF3) can advantageously have the same dimension as the original latent feature LF0. Thus, the conversion from the conditional latent features LF2, LF3 and the noisy latent feature LF1 to the aggregated latent feature LF5 (e.g. feature in the form of (a+b+n)*d) can be efficiently realized by merging or concatenating.
[0093] The denoising network N4 can receive the aggregated latent feature LF5 and possibly a temporal embedding, and perform denoising processing on the aggregated latent feature LF5 by multi-layer nonlinear transformation (e.g. convolution, self-attention mechanism) to obtain a denoised latent feature LF6 (e.g. feature in the form of n*d). Thus, the denoising network N4 can be trained by calculating a loss function value between the original latent feature LF0 and the denoised latent feature LF6, and based on the loss function value, using backpropagation.
[0094] Figure 12 A flowchart illustrating a method of molecule generation based on diffusion model according to some embodiments of the present disclosure is shown. As shown in Figure 12 As shown, the model training method can include: S10, obtaining a noisy latent feature; S20, obtaining a conditional latent feature; S30, generating an aggregated latent feature based on the noisy latent feature and the conditional latent feature; S40, performing denoising processing on the aggregated latent feature to obtain a denoised latent feature; S50, obtaining atomic attribute data for a plurality of atoms of the molecule, bond attribute data for the plurality of atoms, and atomic coordinate data for the plurality of atoms based on the denoised latent feature.
[0095] In some embodiments, obtaining a noisy latent feature can include generating the noisy latent feature based on random noise (e.g. random Gaussian noise). In some embodiments, obtaining a noisy latent feature can include obtaining input data (e.g. sample data for one predetermined molecule), encoding and adding noise to the input data to generate the noisy latent feature. For example, the encoding can be performed by means of the encoding method introduced in the present disclosure, and the adding noise can be performed by means of the noise adder introduced above.
[0096] In some embodiments, obtaining the conditional latent feature can comprise: obtaining molecule fragment data, the molecule fragment data comprising atomic property data for a plurality of atoms of the molecule fragment, bond property data for the plurality of atoms, atomic coordinate data for the plurality of atoms; encoding the molecule fragment data into the molecule fragment conditional latent feature. In some embodiments, obtaining the conditional latent feature can comprise: obtaining pharmacophore data, the pharmacophore data comprising pharmacophore type data and pharmacophore coordinate data; encoding the pharmacophore data into the pharmacophore conditional latent feature. In some embodiments, obtaining the conditional latent feature can comprise: obtaining protein data, the protein data comprising amino acid type data for the protein, amino acid atomic property data for the protein, amino acid atomic coordinate data for the protein; encoding the protein data into the protein conditional latent feature.
[0097] In the foregoing Figure 12 The molecule generation method based on diffusion model according to some embodiments of the present disclosure is introduced, which realizes the unified mapping of mixed modal data for jointly representing molecules to a shared latent space, and further realizes the efficient and unified latent feature representation of mixed modal data, effectively balancing the information density difference between mixed modal data. In addition, the model training method according to some embodiments of the present disclosure introduces conditional input, which advantageously realizes a conditional diffusion model to realize conditional guided molecule generation, for example, through a cross-attention mechanism.
[0098] Figure 13 A block diagram of a data processing apparatus 7 according to some embodiments of the present disclosure is shown. As Figure 13 shown, the data processing apparatus 7 comprises at least one memory 71 and at least one processor 72 coupled to the at least one memory 71, the at least one processor 72 being configured to perform the model training method according to any of the preceding embodiments based on instructions stored in the at least one memory 71.
[0099] The memory 71 is configured to store one or more computer-readable instructions. The memory 71 can include any combination of various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory, including, but not limited to, random access memory (RAM), dynamic random access memory (DRAM), static random access memory (SRAM), read-only memory (ROM), flash memory. The memory 111 may, for example, store an operating system, application programs, a boot loader (BootLoader), a database, and other programs, etc., and can also store various application programs and various data, etc.
[0100] The processor 72 is configured to execute computer readable instructions to implement the model training method, the encoding method, the decoding method, or the molecule generation method according to any of the foregoing embodiments. The specific implementation of each step of the method can refer to the foregoing embodiments, and the repeated parts are not described herein.
[0101] The data processing apparatus of the present disclosure allows the unified mapping of mixed modal data representing a joint representation molecule, such as a chemical structure, to a shared hidden space, solving the problem of difficulty in balancing noise due to differences in information density between mixed modal data.
[0102] The processor 72 can be embodied as various processing apparatuses, such as a central processing unit (CPU), a network processing unit (NP), etc.; and can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The central processing unit (CPU) can be X86 or ARM architecture, etc.
[0103] The processor 72 and the memory 71 can communicate with each other directly or indirectly. For example, the processor 72 and the memory 71 can communicate with each other through a network. The network can include a wireless network, a wired network, and / or any combination of a wireless network and a wired network. The processor 72 and the memory 71 can also communicate with each other through a system bus, and the present disclosure does not limit the communication between the processor 72 and the memory 71.
[0104] It should be noted that Figure 13 The components of the data processing apparatus 7 shown are exemplary only and are not limiting, and the data processing apparatus 7 can also have other components according to actual application needs. The processor 72 can control other components in the data processing apparatus to perform the desired functions.
[0105] The data processing apparatus 7 can be implemented by software, firmware and / or hardware, and can be integrated into a device with related application programs installed.
[0106] Figure 14 A block diagram of an electronic device 8 according to some embodiments of the present disclosure is shown.
[0107] Figure 14 The electronic device 8 shown can be a computer system with a special hardware structure, which can perform corresponding functions when related application programs are installed.
[0108] Electronic devices include but are not limited to mobile terminals such as smart phones, laptops, personal digital assistants (PDAs), tablet personal computers (Tablet PCs), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable devices, etc., as well as fixed terminals such as digital televisions, desktop computers, etc.
[0109] like Figure 14 As shown, the central processing unit (CPU) 81 performs various processes according to the program stored in the read-only memory (ROM) 82 or the program loaded from the storage part 88 to the random access memory (RAM) 83. In the RAM 83, data required when the CPU 81 performs various processes is stored as needed. The central processing unit is only exemplary and it can also be other types of processors, such as the various processors described above. The ROM 82, RAM 83 and the storage part 88 can be various forms of computer-readable storage media. It should be noted that although Figure 8 ROM 82, RAM 83 and storage portion 88 are shown separately in FIG, but one or more of them may be combined or located in the same or different memory or storage modules.
[0110] The CPU 81, the ROM 82, and the RAM 83 are connected to one another via a bus 84. An input / output interface 85 is also connected to the bus 84.
[0111] The following components are connected to the input / output interface 85: an input portion 86 such as a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output portion 87 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage portion 88 including a hard disk, a magnetic tape, etc.; and a communication portion 89 including a network interface card such as a LAN card, a modem, etc. The communication portion 89 allows communication processing to be performed via a network such as the Internet. It is easy to understand that although Figure 8 Parts of the electronic device 8 are shown to communicate via bus 84, but they may also communicate via a network or other means, where the network may include a wireless network, a wired network, and / or any combination of wireless networks and wired networks.
[0112] A drive 810 is also connected to the input / output interface 85 as needed. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is mounted on the drive 810 as needed so that a computer program read therefrom is installed in the storage section 88 as needed.
[0113] In a case where the above series of processes are realized by software, the program constituting the software can be installed from a network such as the Internet or a storage medium 811 or the like.
[0114] According to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product that, when run on a computer, causes the computer to implement the model training method, the encoding method, the decoding method, or the molecule generation method described in any of the preceding embodiments. The computer program product includes computer instructions carried on a computer-readable medium, containing program codes for executing the methods shown in the flowcharts. In such embodiments, the computer instructions can be downloaded and installed from a network by means of the communication section 89, or installed from the storage section 88, or installed from the ROM 82. When the computer program is executed by the CPU 81, the methods of the embodiments of the present disclosure are executed.
[0115] The model training method, the encoding method, the decoding method, or the molecule generation method described above allow joint representation of mixed modality data, e.g., chemical structures of molecules, to be uniformly mapped to a shared latent space, solving the problem of difficulty in balancing noise due to differences in information density between mixed modality data.
[0116] It should be noted that, in the context of the present disclosure, the computer-readable medium can be a tangible medium that can contain or store a program for use by or in connection with an instruction execution system, apparatus, or device.
[0117] The computer-readable medium can be a computer-readable storage medium, or a computer-readable signal medium, or any combination of the two.
[0118] The computer-readable storage medium includes, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, the computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus, or device. The computer-readable storage medium stores computer instructions that, when executed by a processor, implement the model training method, the encoding method, the decoding method, or the molecule generation method described in any of the preceding embodiments.
[0119] The model training method, the encoding method, the decoding method, or the molecule generation method allow joint representation of mixed modal data, such as chemical structures of molecules, to be uniformly mapped to a shared hidden space, and solve the problem that it is difficult to balance noise due to differences in information density between mixed modal data.
[0120] The computer readable signal medium can include a computer readable instruction code in a baseband or propagated as a carrier wave in a propagation medium. Such a propagated signal can take a variety of forms, including, but not limited to, electro-magnetic signal, optical signal, or any suitable combination thereof. Computer readable signal medium can be any computer readable medium other than a computer readable storage medium, which can be used to carry program codes for use by or in connection with an instruction execution system, apparatus or device. Program codes contained in the computer readable medium can be transmitted using any suitable medium, including, but not limited to, a wire, cable, optical fiber, RF (radio frequency), or any suitable combination thereof.
[0121] The computer readable medium described above can be included in the electronic device described above; or can exist separately from the electronic device and be not assembled into the electronic device.
[0122] In some embodiments, a computer program is also provided, including instructions, which, when executed by a processor, cause the processor to perform the method described in any of the preceding embodiments. For example, the instructions can be embodied in computer program code.
[0123] In embodiments of the present disclosure, computer program code for carrying out operations of the present disclosure can be written in one or more programming languages or combinations of languages including object oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0124] The computer program product of the first aspect can include one or more non-transitory computer-readable media storing instructions that, when executed by one or more processors of a computing device, cause the one or more processors to perform the operations of the method of the first aspect. The one or more non-transitory computer-readable media can include one or more of the following: a magnetic storage device, an optical storage device, a solid-state storage device, a hard disk drive, a flash drive, a RAM, a ROM, a database, and a cache. The one or more processors can include one or more of the following: a central processing unit (CPU), a microprocessor, a microcontroller, a microcomputer, a microprocessor-based or microcontroller-based system, a programmable logic unit (PLU), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), a system-on-chip (SoC), and a complex programmable logic device (CPLD).
[0125] The functions described above can be performed, at least in part, by one or more hardware logic components. For example, and without limitation, non-limiting examples of hardware logic components that can be used include field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SOCs), complex programmable logic devices (CPLDs), etc.
[0126] While certain aspects of the present disclosure have been described with respect to one or more particular implementations thereof, it is to be understood that the disclosure is not limited in this regard. For example, although the disclosure has been described with respect to particular implementations thereof, other implementations can be employed and the generic principles and features described herein can be applied to other implementations and applications without departing from the scope of the present disclosure. Accordingly, the disclosure is not to be seen as limited to the particular implementations described herein, but is to be interpreted to cover all alterations, modifications, and improvements that fall within the scope of the present disclosure. Various modifications can be made to the embodiments described in the disclosure without departing from the scope and spirit of the present disclosure. The scope of the present disclosure is defined by the appended claims.
Claims
1. A model training method, comprising: Acquire a training data set, the training data set comprising a plurality of raw data samples, each of the raw data samples comprising first atomic property data for a plurality of atoms in a molecule, first bond property data for the plurality of atoms, and first atomic coordinate data for the plurality of atoms; encoding, by means of an encoder, raw data samples selected from the training dataset into latent features for the molecule; Decoding the latent features into reconstructed data samples using a decoder, the reconstructed data samples comprising second atomic property data for a plurality of atoms in the molecule, second bond property data for the plurality of atoms, and second atomic coordinate data for the plurality of atoms; The encoder and the decoder are trained based on the difference between the original data samples and the reconstructed data samples.
2. The model training method according to claim 1, wherein: The first atomic property data is represented in a first original matrix form, the first bond property data is represented in a second original matrix form, and the first atomic coordinate data is represented in a third original matrix form; The second atomic property data is represented in a first reconstruction matrix form, the second bond property data is represented in a second reconstruction matrix form, and the second atomic coordinate data is represented in a third reconstruction matrix form.
3. The model training method according to claim 1, wherein: The first atomic property data and the second atomic property data respectively include an atomic number and at least one of a formal charge number and a number of connected hydrogen atoms; The first bond attribute data and the second bond attribute data respectively include multiple items of no bond, single bond, double bond, triple bond, delocalized π bond, coordination bond, hydrogen bond, van der Waals force, ionic bond, and π-π stacking effect.
4. The model training method according to claim 1, wherein: Encoding the raw data samples selected from the training dataset into latent features for the molecule by means of an encoder comprises: converting the first atomic property data into a first feature; converting the first key attribute data into a second feature; converting the first atomic coordinate data into a third feature; The first feature, the second feature, and the third feature are aggregated into the latent feature.
5. The model training method according to claim 4, wherein: Converting the first atom property data into a first feature includes: converting the first atom property data into a first feature in the form of n*d by using a first embedding layer in the encoder, where n represents the number of atoms and d represents the feature dimension; Converting the first key attribute data into a second feature includes: converting the first key attribute data into an intermediate feature in the form of n*n*d by means of a second embedding layer in the encoder; and converting the intermediate feature into a second feature in the form of n*d by means of a first aggregation layer; Converting the first atomic coordinate data into a third feature includes: converting the first atomic coordinate data into a third feature in n*d form by means of at least one linear layer in the encoder; Aggregating the first feature, the second feature, and the third feature into the latent feature includes: aggregating the first feature, the second feature, and the third feature into the latent feature in the form of n*d by means of a second aggregation layer in an encoder.
6. The model training method according to claim 1, wherein: Decoding the latent features into reconstructed data samples by means of a decoder includes: Converting the latent features into the second atomic attribute data by means of a first multi-layer perceptron and a first linear layer in the decoder; Converting the latent features into the second key attribute data by means of a product processing layer, a second multilayer perceptron, and a second linear layer in the decoder; The latent features are converted into the second atomic coordinate data by means of a third multi-layer perceptron and a third linear layer in the decoder.
7. A model training method comprising: Acquire a training data set, the training data set comprising a plurality of raw data samples, each of the raw data samples comprising first atomic property data for a plurality of atoms in a molecule, first bond property data for the plurality of atoms, and first atomic coordinate data for the plurality of atoms; Encoding the original data samples selected from the training data set into original latent features for the molecule by means of an encoder; Adding noise to the original latent feature to generate a noisy latent feature; De-noising the noisy latent features using a denoising network to obtain denoised latent features; The denoising network is trained according to the difference between the original latent features and the denoised latent features.
8. The model training method according to claim 7, further comprising: Obtain conditional latent features; Based on the conditional latent features and the noisy latent features, an aggregated latent feature is generated. The denoising network is used to denoise the noisy latent features, and the denoised latent features obtained include: The aggregated latent features are denoised by means of the denoising network to obtain the denoised latent features.
9. The model training method according to claim 8, wherein: The conditional latent features include at least one of molecular fragment conditional latent features, pharmacophore conditional latent features, and protein conditional latent features.
10. The model training method according to claim 9, wherein: Obtaining conditional latent features includes: Acquiring molecular fragment data, the molecular fragment data including atomic property data for a plurality of atoms in the molecular fragment, bond property data for the plurality of atoms, and atomic coordinate data for the plurality of atoms; The molecular fragment data is encoded into the molecular fragment conditional latent features.
11. The model training method according to claim 9, wherein: Obtaining conditional latent features includes: Acquiring pharmacophore data, wherein the pharmacophore data includes pharmacophore type data and pharmacophore coordinate data; The pharmacophore data is encoded as the pharmacophore conditional latent features.
12. The model training method according to claim 9, wherein: Obtaining conditional latent features includes: Acquiring protein data, wherein the protein data includes amino acid type data for the protein, amino acid atom property data for the protein, and amino acid atom coordinate data for the protein; The protein data is encoded as the protein conditional latent features.
13. A coding method comprising: Acquiring atomic property data for a plurality of atoms of a molecule, bond property data for the plurality of atoms, and atomic coordinate data for the plurality of atoms; converting the atomic property data into a first feature, converting the bond property data into a second feature, and converting the atomic coordinate data into a third feature; The first feature, the second feature, and the third feature are aggregated into a latent feature for the molecule.
14. A decoding method, comprising: Obtain latent features for molecules; Based on the latent features, atomic property data for a plurality of atoms in the molecule, bond property data for the plurality of atoms, and atomic coordinate data for the plurality of atoms are determined.
15. A method for molecular generation based on a diffusion model, comprising: Obtain noisy hidden features; Obtain conditional latent features; generating an aggregated latent feature based on the noisy latent feature and the conditional latent feature; Performing denoising on the aggregated latent features to obtain denoised latent features; Based on the denoising hidden features, atomic property data for the multiple atoms of the molecule, bond property data for the multiple atoms, and atomic coordinate data for the multiple atoms are obtained.
16. The method for generating a molecule according to claim 15, wherein Obtaining noisy hidden features includes: generating the noisy hidden feature based on random noise; or Input data is acquired, and the input data is encoded and denoised to generate the noisy latent features.
17. The method for generating a molecule according to claim 15, wherein The conditional latent features include at least one of molecular fragment conditional latent features, pharmacophore conditional latent features, and protein conditional latent features.
18. A data processing device comprising: at least one memory; as well as At least one processor coupled to the at least one memory, the at least one processor being configured to execute the model training method according to any one of claims 1 to 12, the encoding method according to claim 13, the decoding method according to claim 14, or the molecule generation method according to any one of claims 15 to 17 based on instructions stored in the at least one memory.
19. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the model training method according to any one of claims 1 to 12, the encoding method according to claim 13, the decoding method according to claim 14, or the molecule generation method according to any one of claims 15 to 17.
20. A computer program product, which, when run on a computer, enables the computer to implement the model training method according to any one of claims 1 to 12, the encoding method according to claim 13, the decoding method according to claim 14, or the molecule generation method according to any one of claims 15 to 17.
Citation Information
Patent Citations
Multi-target molecule generation method and system based on diffusion model
CN117727374A
Protein-binding small molecule generation method and device, electronic equipment and storage medium
CN118841065A
Molecular force field parameter determination method, device and equipment and readable storage medium
CN118942558A
Training method and device for 3D molecule generation model
CN119274693A
Drug molecule optimization method based on hidden space diffusion model
CN119314590A