Molecular representation method, molecular representation model training method and device
By constructing a fully connected graph of molecules and aggregation to update atomic and edge vector representations, a high-quality molecular vector representation is generated, which solves the problem of inaccurate prediction of drug molecule attributes in the existing technology, improves drug research and development efficiency, and reduces costs.
Patent Information
- Application Number
- CN202210314863.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-28
- Publication Date
- 2024-09-10
- Estimated Expiration
- 2042-03-28
AI Technical Summary
Existing deep learning technology is difficult to comprehensively and accurately express the characteristics of molecules in the prediction of drug molecule attributes, resulting in low efficiency and high cost of drug development.
By constructing a fully connected graph of molecules, generating atomic vector and edge vector representations, and performing aggregation updates, high-quality molecular vector representations are generated to improve the accuracy of molecular attribute prediction.
It achieves a comprehensive and accurate expression of the characteristics of molecules and improves the accuracy of prediction of drug molecule attributes, thus improving the efficiency of drug research and development and reducing costs.
Smart Images

Figure CN114694769B
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence technology, in particular to the field of biological computing and deep learning technology, and specifically to a molecular representation method and device, a molecular representation model training method and device, an electronic device, a computer-readable storage medium, and a computer program product. Background Art
[0002] Artificial Intelligence (AI) is a discipline that studies how computers can simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.). It includes both hardware-level and software-level technologies. AI hardware technologies generally include technologies such as sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing; AI software technologies mainly include computer vision technology, speech recognition technology, natural language processing technology, machine learning / deep learning technology, big data processing technology, knowledge graph technology, and other major directions.
[0003] In recent years, AI-driven drug design has attracted increasing attention, and deep learning technology has been used to predict the properties of drug molecules, such as drug toxicity, stability, and affinity of drug ligands to protein receptors.
[0004] The methods described in this section are not necessarily methods that have been previously conceived or employed. Unless otherwise indicated, it should not be assumed that any method described in this section is considered to be prior art simply because it is included in this section. Similarly, unless otherwise indicated, the issues mentioned in this section should not be considered to have been recognized in any prior art. Summary of the invention
[0005] The present disclosure provides a molecular representation method and device, a molecular representation model training method and device, an electronic device, a computer-readable storage medium, and a computer program product.
[0006] According to one aspect of the present disclosure, a molecular representation method is provided, comprising: acquiring characteristic information of a molecule to be represented, the molecule comprising a plurality of atoms; generating a fully connected graph of the plurality of atoms, the fully connected graph comprising a plurality of edges; based on the characteristic information, generating a plurality of atomic vector representations and a plurality of edge vector representations, the plurality of atomic vector representations respectively corresponding to the plurality of atoms, and the plurality of edge vector representations respectively corresponding to the plurality of edges; based on the fully connected graph, aggregating the plurality of atomic vector representations and the plurality of edge vector representations at least once to obtain a plurality of updated atomic vector representations; and generating a molecular vector representation of the molecule based on the plurality of updated atomic vector representations.
[0007] According to one aspect of the present disclosure, a method for training a molecular representation model is provided, comprising: obtaining input features and attribute labels of a sample molecule, the sample molecule comprising a plurality of atoms, the input features comprising a fully connected graph of the plurality of atoms, a plurality of atom vector representations and a plurality of edge vector representations, the plurality of atom vector representations respectively corresponding to the plurality of atoms, and the plurality of edge vector representations respectively corresponding to a plurality of edges included in the fully connected graph; inputting the input features into the molecular representation model to obtain a molecular vector representation of the sample molecule output by the molecular representation model; inputting the molecular vector representation into a predictor to obtain a predicted attribute of the sample molecule output by the predictor; and adjusting parameters of the molecular representation model based on the predicted attribute and the attribute label.
[0008] According to one aspect of the present disclosure, a molecular representation device is provided, comprising: an acquisition unit configured to acquire feature information of a molecule to be represented, the molecule comprising a plurality of atoms; a first generation unit configured to generate a fully connected graph of the plurality of atoms, the fully connected graph comprising a plurality of edges; a second generation unit configured to generate a plurality of atomic vector representations and a plurality of edge vector representations based on the feature information, the plurality of atomic vector representations respectively corresponding to the plurality of atoms, and the plurality of edge vector representations respectively corresponding to the plurality of edges; an aggregation update unit configured to aggregate the plurality of atomic vector representations and the plurality of edge vector representations at least once based on the fully connected graph to obtain a plurality of updated atomic vector representations; and a third generation unit configured to generate a molecular vector representation of the molecule based on the plurality of updated atomic vector representations.
[0009] According to one aspect of the present disclosure, a training device for a molecular representation model is provided, comprising: an acquisition unit, configured to acquire input features and attribute labels of a sample molecule, wherein the sample molecule comprises a plurality of atoms, the input features comprise a fully connected graph of the plurality of atoms, a plurality of atom vector representations and a plurality of edge vector representations, the plurality of atom vector representations respectively corresponding to the plurality of atoms, and the plurality of edge vector representations respectively corresponding to a plurality of edges included in the fully connected graph; a representation unit, configured to input the input features into the molecular representation model to obtain a molecular vector representation of the sample molecule output by the molecular representation model; a prediction unit, configured to input the molecular vector representation into a predictor to obtain a predicted attribute of the sample molecule output by the predictor; and an adjustment unit, configured to adjust parameters of the molecular representation model based on the predicted attribute and the attribute label.
[0010] According to one aspect of the present disclosure, there is provided an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor, the memory storing instructions executable by the at least one processor, the instructions being executed by the at least one processor so that the at least one processor can execute any of the methods of the above aspects.
[0011] According to one aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to enable a computer to execute any of the above methods.
[0012] According to one aspect of the present disclosure, a computer program product is provided, including a computer program, which implements any of the above methods when executed by a processor.
[0013] According to one or more embodiments of the present disclosure, the generated molecular vector representation can fully and accurately express the characteristics of the molecule.
[0014] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The accompanying drawings exemplarily illustrate the embodiments and constitute a part of the specification, and together with the text description of the specification, are used to explain the exemplary implementation of the embodiments. The embodiments shown are for illustrative purposes only and do not limit the scope of the claims. In all drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0016] Figure 1 A flowchart showing a molecular representation method according to some embodiments of the present disclosure is shown;
[0017] Figure 2 A schematic diagram showing a fully connected graph of atoms according to some embodiments of the present disclosure is shown;
[0018] Figure 3 A schematic diagram showing an updated atomic vector representation according to some embodiments of the present disclosure is shown;
[0019] Figure 4 A schematic diagram showing an updated edge vector representation according to some embodiments of the present disclosure is shown;
[0020] Figure 5 A schematic diagram showing edge vector representation aggregation based on adjacent edge pairs according to some embodiments of the present disclosure is shown;
[0021] Figure 6A flowchart of a method for training a molecular representation model according to some embodiments of the present disclosure is shown;
[0022] Figure 7 A schematic diagram showing a training process of a molecular representation model according to some embodiments of the present disclosure is shown;
[0023] Figure 8 shows a structural block diagram of a molecule representation model according to some embodiments of the present disclosure;
[0024] Fig. 9 A structural block diagram of an aggregation update module according to some embodiments of the present disclosure is shown;
[0025] Fig.10 A schematic diagram of an atom-edge attention mechanism according to some embodiments of the present disclosure is shown;
[0026] Fig.11 A schematic diagram of a side attention mechanism according to some embodiments of the present disclosure is shown;
[0027] Fig.12 shows a structural block diagram of a molecule representation device according to an embodiment of the present disclosure;
[0028] Fig.13 A structural block diagram of a molecular representation model training device according to an embodiment of the present disclosure is shown; and
[0029] Fig.14 A structural block diagram of an exemplary electronic device that can be used to implement the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0030] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope of the present disclosure. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.
[0031] In the present disclosure, unless otherwise specified, the use of the terms "first", "second", etc. to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of these elements, and such terms are only used to distinguish one element from another element. In some examples, the first element and the second element may refer to the same instance of the element, and in some cases, based on the description of the context, they may also refer to different instances.
[0032] The terms used in the description of various examples in this disclosure are only for the purpose of describing specific examples and are not intended to be limiting. Unless the context clearly indicates otherwise, if the number of elements is not specifically limited, the element can be one or more. In addition, the term "and / or" used in this disclosure covers any one of the listed items and all possible combinations.
[0033] In this disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information are in compliance with relevant laws and regulations and do not violate public order and good morals.
[0034] In recent years, AI-driven drug design has attracted more and more attention, and deep learning technology has been used to predict the properties of drug molecules, such as drug toxicity, stability, and affinity between drug ligands and protein receptors. High-quality molecular characterization can improve the accuracy of molecular property prediction, greatly improve the efficiency of drug research and development, and reduce costs.
[0035] To this end, an embodiment of the present disclosure provides a molecular representation method that can obtain high-quality molecular vector representation, thereby improving the accuracy of molecular property prediction.
[0036] The embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
[0037] Figure 1 The flowchart of the molecular representation method 100 according to the embodiment of the present disclosure is shown. The method 100 can be executed at a server or at a client device. That is, the execution subject of each step of the method 100 can be a server or a client device.
[0038] like Figure 1 As shown, the method 100 includes S110 - S150 .
[0039] In step S110 , characteristic information of a molecule to be represented is obtained, where the molecule includes a plurality of atoms.
[0040] In step S120, a fully connected graph of the plurality of atoms is generated, where the fully connected graph includes a plurality of edges.
[0041] In step S130, based on the feature information, multiple atomic vector representations and multiple edge vector representations are generated. The multiple atomic vector representations correspond to the multiple atoms respectively, and the multiple edge vector representations correspond to the multiple edges in the fully connected graph respectively.
[0042] In step S140, based on the fully connected graph, the multiple atomic vector representations and the multiple edge vector representations are aggregated at least once to obtain multiple updated atomic vector representations.
[0043] In step S150, a molecular vector representation of the molecule is generated based on the updated plurality of atomic vector representations.
[0044] The properties of molecules are essentially the result of the interaction between atoms, and the edges between atoms can express the connectivity and interaction between atoms. According to the embodiments of the present disclosure, by constructing a fully connected graph of atoms and aggregating the atomic vector representation and the edge vector representation, the atomic information and the edge information can be fully interacted, thereby obtaining a more comprehensive and accurate molecular vector representation.
[0045] The molecular vector representation of the embodiment of the present disclosure can fully and accurately express the characteristics of the molecule. Furthermore, the molecular vector representation of the embodiment of the present disclosure can be used to predict the properties of the molecule, which can improve the accuracy of the molecular property prediction, thereby greatly improving the efficiency of drug research and development.
[0046] The molecular representation method of the embodiment of the present disclosure is suitable for processing molecules including multiple atoms and multiple chemical bonds.
[0047] In an embodiment of the present disclosure, based on the multiple atoms included in the molecule, a fully connected graph of the multiple atoms can be constructed. In the fully connected graph, any two atoms are connected by an edge. It can be understood that the number of edges included in the fully connected graph is N(N-1) / 2, where N is the number of atoms.
[0048] The multiple edges of the fully connected graph include at least multiple chemical bonds in the molecule. When each pair of atoms in the molecule is connected by chemical bonds, the multiple edges of the fully connected graph are all chemical bonds. When there are pairs of atoms in the molecule that are not connected by chemical bonds, the multiple edges of the fully connected graph include virtual edges between these pairs of atoms that are not connected by chemical bonds in addition to the chemical bonds in the molecule. It should be understood that in the embodiments of the present disclosure, the virtual edge refers to any edge other than multiple chemical bonds among the multiple edges included in the fully connected graph.
[0049] Figure 2 FIG. 1 is a schematic diagram of a fully connected graph of atoms according to an embodiment of the present disclosure. Figure 2 As shown, molecule 200 includes four atoms A, B, C, and D, and three chemical bonds AB, BC, and BD between the atoms. Figure 2 In , chemical bonds are represented by solid lines. By constructing a fully connected graph, a virtual edge AC is added between atoms A and C, a virtual edge AD is added between atoms A and D, and a virtual edge CD is added between atoms C and D. Figure 2 In the figure, virtual edges are represented by dashed lines.
[0050] With respect to step S130 , according to some embodiments, the characteristic information of the molecule includes atomic characteristic information of each of the multiple atoms and chemical bond information of each of the multiple chemical bonds.
[0051] Atomic characteristic information includes, for example, the serial number of each atom, spatial coordinates, hybridization mode, degree (ie, the number of connected atoms), the number of connected hydrogen atoms, valence, whether it is in an aromatic system, whether it is in a ring, etc.
[0052] The chemical bond characteristic information includes, for example, the type of chemical bond, stereoisomerism, bond length, bond angle, whether it is an aromatic bond, whether it is in a ring, etc.
[0053] According to some embodiments, the characteristic information of a molecule can be obtained by parsing the molecular description data such as the SMILES (Simplified Molecular Input Line Entry Specification) expression of the molecule, the SDF (Structure Data File) chemical data file, etc. According to other embodiments, the characteristic information of a molecule can also be obtained through an open source toolkit for chemical informatics such as RDKit.
[0054] Based on the characteristic information of the molecule, an atomic vector representation of each atom and an edge vector representation of each edge can be generated. Specifically, based at least on the corresponding atomic characteristic information, an atomic vector representation of each atom can be generated. Based at least on the corresponding chemical bond characteristic information, an edge vector representation of each chemical bond can be generated. In the case where the fully connected graph includes virtual edges (i.e., in the case where the number of edges included in the fully connected graph is greater than the number of chemical bonds), the edge vector representation of the virtual edge can be set to a preset value.
[0055] According to some embodiments, for any atom, the atomic characteristic information of the atom can be encoded to generate its atomic vector representation. According to other embodiments, for any atom, the atomic characteristic information of the atom and the chemical bond characteristic information of the chemical bond connected to the atom can be encoded to generate its atomic vector representation.
[0056] According to some embodiments, for any chemical bond, the chemical bond characteristic information of the chemical bond can be encoded to generate its edge vector representation. According to other embodiments, for any chemical bond, the chemical bond characteristic information of the chemical bond and the atomic characteristic information of the atoms connected by the chemical bond can be encoded to generate its edge vector representation.
[0057] In the case where the fully connected graph includes virtual edges, the edge vector representation of the virtual edges may be set to a preset value, for example, to an all-zero vector.
[0058] According to some embodiments, the dimension of the atomic vector representation is the same as the dimension of the edge vector representation (for example, both are 100 dimensions), thereby improving the computational efficiency of subsequent steps.
[0059] It should be understood that the atomic vector representation and edge vector representation generated based on the characteristic information of the molecule are both initial values. In the subsequent step S140, each atomic vector representation and edge vector representation is iteratively updated at least once.
[0060] Specifically, in step S140, based on the fully connected graph, multiple atomic vector representations and multiple edge vector representations are aggregated at least once, and after each aggregation, the values of the multiple atomic vector representations and multiple edge vector representations are updated to obtain updated multiple atomic vector representations and multiple edge vector representations.
[0061] According to some embodiments, each polymerization in the at least one polymerization includes the following steps S142-S146.
[0062] In step S142, for any atom among the multiple atoms, the current multiple atomic vector representations and the current multiple edge vector representations are aggregated based on the attention mechanism to obtain an updated atomic vector representation of the atom.
[0063] In step S144, for any edge among the multiple edges, based on the updated atomic vector representations of the two atoms connected by the edge, the current edge vector representation of the edge is updated to obtain a first edge vector representation of the edge.
[0064] In step S146, for any edge among the multiple edges, multiple first edge vector representations of the multiple edges are aggregated based on the attention mechanism to obtain an updated edge vector representation of the edge.
[0065] According to the above embodiment, in each aggregation process, each atomic vector representation and each edge vector representation are first aggregated to update each atomic vector representation (step S142 of the current aggregation). Subsequently, the updated atomic vector representation is passed to the edge vector representation (step S144 of the current aggregation). Finally, each edge vector representation is aggregated to update each edge vector representation (step S146 of the current aggregation). The updated edge vector representation can be used to update the atomic vector representation in the next aggregation (step S142 of the next aggregation). Thus, full interaction between atomic information and edge information can be achieved, so that each atomic vector representation and edge vector representation can learn more comprehensive and accurate information, thereby improving the accuracy of the final molecular vector representation.
[0066] Figure 3 A schematic diagram of updating an atomic vector representation according to some embodiments of the present disclosure is shown. Figure 3 The process shown corresponds to step S142 described above.
[0067] like Figure 3As shown, molecule 300 includes four atoms A, B, C, and D. Taking atom A as an example, based on the attention mechanism, the atomic vector representations of atoms A, B, C, and D and the edge vector representations of edges AB, AC, AD, BC, BD, and CD are aggregated (the direction of information aggregation is shown by the gray arrow in the figure), and an updated atomic vector representation of atom A can be obtained. In the aggregation process, the attention weights of each vector representation (including the atomic vector representation and the edge vector representation) can be obtained in advance through training.
[0068] Figure 4 A schematic diagram of updating edge vector representation according to some embodiments of the present disclosure is shown. Figure 4 The process shown corresponds to the above-mentioned steps S144 and S146.
[0069] like Figure 4 As shown, molecule 400 includes six edges, namely AB, AC, AD, BC, BD, and CD. Taking edge AB as an example, first, based on the updated atomic vector representations of atoms A and B, the vector representation of edge AB is updated (the direction of information update is shown by the gray arrow in the left figure), and the first edge vector representation of edge AB is obtained. Similarly, the first edge vector representations of the other five edges, namely, the edges AC, AD, BC, BD, and CD, can also be obtained. Subsequently, still taking edge AB as an example, based on the attention mechanism, its own first edge vector representation is aggregated with the first edge vector representations of the other five edges (the direction of information aggregation is shown by the gray arrow in the right figure), and the updated edge vector representation of edge AB is obtained. In this aggregation process, the attention weights of each edge vector representation can be obtained in advance through training.
[0070] According to some embodiments, the above step S144 of “updating the current edge vector representation of the edge based on the updated atomic vector representations of the two atoms connected by the edge to obtain a first edge vector representation of the edge” further includes the following steps S1442 and S1444:
[0071] Step S1442, determining a change in the vector representation of the edge based on the updated atomic vector representations of the two atoms connected by the edge; and
[0072] Step S1444: superimpose the current edge vector representation of the edge and the vector representation change to obtain a first edge vector representation of the edge.
[0073] According to the above embodiment, the updated atomic vector representation can be transferred to the edge vector representation, thereby achieving the supplementation and enhancement of the edge information.
[0074] Specifically, for the above step S1442, the outer product of the updated atomic vector representations of the two atoms can be calculated to obtain a matrix, and then the matrix can be reduced to a vector by methods such as averaging, linear transformation, etc. The vector is the vector representation change of the corresponding edge. Subsequently, for step S1444, the current edge vector representation of the edge can be added to the vector representation change to obtain the first edge vector representation of the edge.
[0075] According to some embodiments, the above step S146 of “aggregating multiple first edge vector representations of multiple edges based on the attention mechanism to obtain an updated edge vector representation of the edge” further includes the following steps S1462 and S1464:
[0076] Step S1462: determine at least one adjacent edge pair of the edge, wherein each adjacent edge pair in the at least one adjacent edge pair includes two adjacent edges of the edge, and the two adjacent edges are connected with the edge to form a triangle;
[0077] Step S1464: Based on the attention mechanism, aggregate the first edge vector representation of the edge and each adjacent edge in the at least one adjacent edge pair to obtain an updated edge vector representation of the edge.
[0078] The three sides of a triangle constrain each other, and the characteristics of a certain side are greatly affected by its adjacent sides of the triangle. According to the above embodiment, when updating the edge vector representation of a certain side by aggregation, only the edge vector representations of the adjacent sides that have a triangle relationship with the side are aggregated, which can greatly reduce the amount of calculation (compared to aggregating the edge vector representations of all sides) and improve the calculation efficiency while ensuring that key information is not missed.
[0079] Figure 5 FIG. 4 is a schematic diagram showing edge vector representation aggregation based on adjacent edge pairs according to some embodiments of the present disclosure. Figure 5 As shown, molecule 500 includes six edges, AB, AC, AD, BC, BD, and CD. Taking edge AB as an example, the edge includes two adjacent edge pairs, namely (AC, BC) and (AD, BD). Accordingly, based on the attention mechanism, edge AB can be aggregated with the first edge vector representations of each adjacent edge in the adjacent edge pair, namely, edges AC, BC, AD, and BD (the direction of information aggregation is shown by the gray arrow in the figure) to obtain an updated edge vector representation of edge AB.
[0080] According to some embodiments, the two adjacent edges of each adjacent edge pair include a first adjacent edge connected to the first endpoint of the edge (also referred to as the "starting point" of the edge) and a second adjacent edge connected to the second endpoint of the edge (also referred to as the "end point" of the edge). Accordingly, the above step S1464 of "aggregating the first edge vector representation of the edge and each adjacent edge in the at least one adjacent edge pair based on the attention mechanism to obtain an updated edge vector representation of the edge" further includes the following steps S14642 and S14644:
[0081] Step S14642: Aggregate the first edge vector representations of the edge and each first adjacent edge in at least one adjacent edge pair based on the attention mechanism to obtain a second edge vector representation of the edge; and
[0082] Step S14644: Based on the attention mechanism, aggregate the second edge vector representations of the edge and each second adjacent edge in at least one adjacent edge pair to obtain an updated edge vector representation of the edge.
[0083] According to the above embodiment, the first adjacent edges connected to the first endpoint are aggregated first, and then the second adjacent edges connected to the second endpoint are aggregated, so that sufficient interaction of edge-to-edge information can be achieved.
[0084] According to some embodiments, in the edge attention mechanism of steps S1464, S14642, and S14644, the attention weight of the edge and each adjacent edge in at least one adjacent edge pair is determined based on at least the shortest chemical bond distance between the corresponding two atoms. Thus, the chemical bond distance information between atoms can be introduced into the process of edge information aggregation, so that the updated edge vector representation incorporates the spatial structure information of the molecule, thereby obtaining a more comprehensive and accurate molecular vector representation.
[0085] The shortest chemical bond distance refers to the number of chemical bonds included in the shortest chemical bond path connecting two atoms. According to some embodiments, the weight of the edge and each adjacent edge may be obtained in advance through training based on the shortest chemical bond distance between the corresponding two atoms.
[0086] Through at least one aggregation in step S140 , multiple updated atomic vector representations and multiple edge vector representations can be obtained.
[0087] Subsequently, in step S150 , a molecular vector representation of the molecule may be generated based on the updated plurality of atomic vector representations.
[0088] There are several ways to generate a molecule vector representation based on multiple atomic vector representations.
[0089] According to some embodiments, multiple atomic vector representations may be concatenated to obtain a molecule vector representation.
[0090] According to other embodiments, elements at corresponding positions of multiple atomic vectors may be added to obtain a molecular vector representation.
[0091] According to some other embodiments, the weighted sum of multiple atomic vectors may be represented as a molecular vector.
[0092] According to some other embodiments, a plurality of atomic vectors may be input into a trained multi-layer perceptron (MLP), and the output of the MLP may be represented as a molecular vector.
[0093] The molecular vector representation obtained in step S150 can be used to predict the properties of the molecule. That is, according to some embodiments, the method 100 further includes: predicting the properties of the molecule based on the molecular vector representation.
[0094] Since the molecular vector representation generated according to the embodiment of the present disclosure can fully and accurately express the characteristics of the molecule, predicting the properties of the molecule based on the molecular vector representation of the embodiment of the present disclosure can improve the accuracy of the molecular property prediction, thereby greatly improving the efficiency of drug research and development.
[0095] According to some embodiments, the properties of the molecule may include at least one of the following: water solubility, toxicity, degree of matching with a preset protein, compound reaction characteristics, stability, degradability, and energy.
[0096] According to some embodiments, the molecule vector representation may be input into a trained predictor to obtain the properties of the molecule output by the predictor. The predictor may be, for example, a feed-forward neural network.
[0097] According to some embodiments, the above steps S140 and S150 can be implemented by a trained molecular representation model. Specifically, the fully connected graph, multiple atomic vector representations and multiple edge vector representations are input into the trained molecular representation model to obtain the molecular vector representation output by the molecular representation model.
[0098] More specifically, the trained molecular representation model may include an aggregation update module and a representation module. Accordingly, step S140 may further include: inputting the fully connected graph, the multiple atomic vector representations, and the multiple edge vector representations into the aggregation update module of the trained molecular representation model to obtain the updated multiple atomic vector representations output by the aggregation update module. Step S150 may further include: inputting the updated multiple atomic vector representations into the representation module of the molecular representation model to obtain the molecular vector representation of the molecule output by the representation module.
[0099] According to an embodiment of the present disclosure, a method for training a molecular representation model is also provided. Figure 66 shows a flow chart of a method 600 for training a molecular representation model according to an embodiment of the present disclosure. The method 600 is usually executed at a server, but can also be executed at a client device. That is, the execution subject of each step of the method 600 can be a server or a client device. Figure 6 As shown, method 600 includes steps S610-S640.
[0100] In step S610, the input features and attribute labels of the sample molecule are obtained. The sample molecule includes multiple atoms, and the input features include a fully connected graph of the multiple atoms, multiple atomic vector representations, and multiple edge vector representations, wherein the multiple atomic vector representations correspond to the multiple atoms, and the multiple edge vector representations correspond to the multiple edges included in the fully connected graph.
[0101] In step S620, the input feature is input into the molecular representation model to obtain a molecular vector representation of the sample molecule output by the molecular representation model.
[0102] In step S630, the molecule vector representation is input into the predictor to obtain the predicted attribute of the sample molecule output by the predictor.
[0103] In step S640 , parameters of the molecular representation model are adjusted based on the predicted attributes and the attribute labels.
[0104] According to the embodiments of the present disclosure, a trained molecular representation model can be obtained. The molecular representation model can quickly and efficiently generate a molecular vector representation of a molecule. Moreover, the molecular representation model of the embodiments of the present disclosure is jointly trained with a predictor of molecular properties, so that the molecular vector representation output by the molecular representation model can achieve a good property prediction effect and can realize accurate prediction of molecular properties.
[0105] According to some embodiments, the predictor may be, for example, a feed-forward neural network.
[0106] According to some embodiments, step S640 further comprises: calculating a loss value based on the predicted attribute and the attribute label; and adjusting parameters of the molecular representation model based on the loss value. According to some embodiments, parameters of the predictor may also be adjusted based on the loss value.
[0107] The specific calculation method of the loss value (i.e., the expression of the loss function) can be determined according to the prediction task of the predictor. For example, when the prediction task is a classification task, a loss function such as Cross Entropy can be used; when the prediction task is a regression task, a loss function such as MAE (Mean Absolute Error) or MSE (Mean Square Error) can be used.
[0108] It should be understood that the above steps S610-S640 can be executed repeatedly until a preset termination condition (e.g., the loss value is less than a preset value, the number of cycles reaches a preset maximum number of cycles, etc.) is met, the model training process is terminated, and a trained molecular representation model is obtained. According to some embodiments, a trained predictor can also be obtained.
[0109] Figure 7 A schematic diagram of the training process of a molecular representation model according to some embodiments of the present disclosure is shown. Figure 7 As shown, the input features of the sample molecule (including the fully connected graph, multiple atomic vector representations, and multiple edge vector representations) are input into the molecular representation model 710, and the molecular representation model 710 outputs the molecular vector representation of the sample molecule. Subsequently, the molecular vector representation is input into the predictor 720, and the predictor 720 outputs the predicted attribute of the sample molecule. Subsequently, based on the predicted attribute (predicted value) and the attribute label (true value) of the sample molecule, the loss value of the molecular representation model 710 and the predictor 720 is calculated. Subsequently, based on the loss value, an algorithm such as back propagation is used to adjust the parameters of the molecular representation model 710 and the predictor 720.
[0110] According to some embodiments, the sample molecule also includes multiple chemical bonds between the multiple atoms, and the multiple edges include at least the multiple chemical bonds. Method 600 also includes: obtaining atomic characteristic information of each of the multiple atoms and chemical bond characteristic information of each of the multiple chemical bonds; generating an atomic vector representation of each atom based at least on the corresponding atomic characteristic information; generating an edge vector representation of each chemical bond based at least on the corresponding chemical bond characteristic information; and in response to determining that the number of the multiple edges is greater than the number of the multiple chemical bonds, setting the edge vector representation of each virtual edge to a preset value, wherein the virtual edge is any edge among the multiple edges except the multiple chemical bonds.
[0111] The generation methods of the atomic vector representation, the edge vector representation of the chemical bond, and the edge vector representation of the virtual edge can refer to the above description of step S130, which will not be repeated here.
[0112] According to some embodiments, the attribute label and the predicted attribute respectively include at least one of the following: water solubility, toxicity, degree of matching with a preset protein, compound reaction characteristics, stability, degradability, and energy.
[0113] The structure of the molecular representation model of the embodiment of the present disclosure is described in detail below.
[0114] Figure 8 FIG. 8 is a block diagram showing a molecular representation model 800 according to some embodiments of the present disclosure. Figure 8As shown, the molecular representation model 800 includes an aggregation update module 810 and a representation module 820. Accordingly, the above step S620 further includes: inputting the input features into the aggregation update module 810 to obtain updated multiple atomic vector representations output by the aggregation update module 810, wherein the updated multiple atomic vector representations are obtained by performing at least one aggregation on the multiple atomic vector representations and the multiple edge vector representations based on the fully connected graph; and inputting the updated multiple atomic vector representations into the representation module 820 to obtain the molecular vector representation output by the representation module 820.
[0115] It should be understood that the aggregate update module 810 can be used to implement the reference Figure 1 Step S140 in the method 100 described above; the representation module 820 can be used to implement the reference Figure 1 Step S150 in the method 100 described.
[0116] Fig. 9 The structure block diagram of the aggregation update module 900 according to the embodiment of the present disclosure is further shown. Fig. 9 As shown, the aggregation update module 900 includes cascaded N (N≥1) aggregation update units 910-1, 910-2, ..., 910-N. The structures of the aggregation update units 910 are the same. Each aggregation update unit 910 is used to aggregate multiple atomic vector representations and multiple edge vector representations. For example, each aggregation update unit 910 can be used to implement steps S142-S146 in the method 100 described above.
[0117] like Fig. 9 As shown, each aggregation update unit 910 further includes an atom-edge attention unit (Node-EdgeAttention) 911, a feedforward unit (Feed Forward Network) 912, an edge superposition update unit (Outer ProductMean) 913, a first edge attention unit (First Triangle Attention) 914, a second edge attention unit (Second Triangle Attention) 915 and a feedforward unit (Feed Forward Network) 916.
[0118] The atom-edge attention unit 911 is used to update the atomic vector representation. Specifically, the atom-edge attention unit 911 aggregates the current multiple atomic vector representations and the current multiple edge vector representations based on the attention mechanism to obtain the updated multiple atomic vector representations.
[0119] The atom-edge attention unit 911 can be used to implement step S142 in the method 100 described above.
[0120] Fig.10 A schematic diagram showing the calculation process of the atom-edge attention mechanism according to an embodiment of the present disclosure is shown. Fig.10 The calculation process shown can be expressed as the following formulas (1)-(8).
[0121] q T ,k_n,v_n=f(n) (1)
[0122] k_e=f(e) (2)
[0123] k=k_n+k_e (3)
[0124] v_e=f(e) (4)
[0125] v=v_n+v_e (5)
[0126] g=g(f(n)) (6)
[0127]
[0128] n′=g⊙∑av (8)
[0129] In the above equations (1)-(8), q, k, and v represent the query matrix (query), the key matrix (key), and the value matrix (value), respectively. T represents transpose. n represents the current multiple atomic vector representations. e represents the current multiple edge vector representations. f and g are functional layer processing functions, such as linear transformation functions (Linear), sigmoid activation functions, etc. a represents the attention weight. c represents the dimension of the atomic vector representation. ⊙ represents the element-wise product (element-wise product), also known as the Hadamard product. n' represents the updated multiple edge vector representations.
[0130] The feed-forward unit 912 is used to perform linear transformation on the updated multiple atomic vector representations output by the atom-edge attention unit 911 to improve the fitting ability of the model.
[0131] The edge superposition updating unit 913 is used to superimpose the updated multiple atomic vector representations onto the current multiple edge vector representations, so as to supplement and enhance the edge information. That is, for any edge among the multiple edges, based on the updated atomic vector representations of the two atoms connected by the edge, the current edge vector representation of the edge is updated to obtain the first edge vector representation of the edge.
[0132] Specifically, for any edge among the multiple edges, the edge superposition update unit 913 determines the vector representation change of the edge based on the updated atomic vector representation of the two atoms connected by the edge; and superimposes the current edge vector representation of the edge with the vector representation change to obtain the first edge vector representation of the edge.
[0133] The edge overlay updating unit 913 may be used to implement steps S144 , S1442 , and S1444 in the method 100 described above.
[0134] The first edge attention unit 914 and the second edge attention unit 915 are used to implement the aggregation of edge vector representations based on adjacent edge pairs. Since an edge and its adjacent edge pair can form a triangle, the edge attention unit can also be called a triangle attention unit. Specifically, for any edge among the multiple edges, the first edge attention unit 914 aggregates the first edge vector representation of the edge and each first adjacent edge in at least one adjacent edge pair based on the attention mechanism to obtain the second edge vector representation of the edge. The second edge attention unit 915 aggregates the second edge vector representation of the edge and each second adjacent edge in at least one adjacent edge pair based on the attention mechanism to obtain the updated edge vector representation of the edge.
[0135] The first side attention unit 914 and the second side attention unit 915 are jointly used to implement steps S146 and S1464 in the above-described method 100. More specifically, the first side attention unit 914 and the second side attention unit 915 can be used to implement steps S14642 and S14644 in the above-described method 100, respectively.
[0136] Fig.11 A schematic diagram of the edge attention (triangle attention) mechanism according to some embodiments of the present disclosure is shown. The first edge attention unit 914 and the second edge attention unit 915 can both adopt Fig.11 The calculation process shown in Figure 2 is to reflect Fig.11 The universality of the first side attention unit 914 and the second side attention unit 915, Fig.11 The subscripts i, j, and k of the parameters are not indicated.
[0137] refer to Fig.11 , the calculation process of the first edge attention unit 914 can be expressed as the following formulas (9)-(15).
[0138]
[0139] k_d ij ,v_d ij =f(d ij ) (10)
[0140] k ik =k_e ij +k_d ij (11)
[0141] v ik =v_e ij +v_d ij (12)
[0142]
[0143] g ij =g(f(e ij )) (14)
[0144] e ij ′=g ij ⊙∑ k a ijk v ik (15)
[0145] In formulas (9)-(15), q, k, and v represent the query matrix (query), key matrix (key), and value matrix (value), respectively. T represents transposition. ij The first edge vector representation of edge ij (i.e., the edge between atom i and atom j). ij ' represents the second edge vector representation of edge ij. f and g are function layer processing functions, such as linear transformation function (Linear), sigmoid activation function, etc. a ijk represents the attention weight of edge ik. c represents the dimension of edge vector representation. ⊙ represents element-wise product, also known as Hadamard product.
[0146] d is the triangle distance tensor. d is a four-dimensional tensor, where the first three dimensions represent the three atoms i, j, and k of the triangle, and the fourth dimension represents the shortest chemical bond distance between atoms ij, ik, and jk. ij Represents the element in the tensor d whose first dimension is i and whose second dimension is j.
[0147] refer to Fig.11 , the calculation process of the second edge attention unit 915 can be expressed as the following formulas (16)-(22).
[0148]
[0149] k_d ij ,v_d ij =f(d ij ) (17)
[0150] kkj =k_e ij +k_d ij (18)
[0151] v kj =v_e ij +v_d ij (19)
[0152]
[0153] g ij =g(f(e ij )) (twenty one)
[0154] e ij ′=g ij ⊙∑ k a ijk v kj (twenty two)
[0155] In formulas (16)-(22), q, k, and v represent the query matrix (query), the key matrix (key), and the value matrix (value), respectively. T represents transposition. ij The second edge vector representation of edge ij (i.e., the edge between atom i and atom j). ij ' represents the edge vector representation after the edge ij is updated. f and g are function layer processing functions, such as linear transformation function (Linear), sigmoid activation function, etc. a ijk represents the attention weight of edge kj. c represents the dimension of edge vector representation. ⊙ represents element-wise product, also known as Hadamard product.
[0156] d is the triangle distance tensor. d is a four-dimensional tensor, where the first three dimensions represent the three atoms i, j, and k of the triangle, and the fourth dimension represents the shortest chemical bond distance between atoms ij, ik, and jk. ij Represents the element in the tensor d whose first dimension is i and whose second dimension is j.
[0157] The feed-forward unit 916 is used to perform a linear transformation on the updated multiple edge vector representations output by the second edge attention unit 915 to improve the fitting ability of the model.
[0158] According to an embodiment of the present disclosure, a molecule representation device is also provided. Fig.12 FIG. 1 shows a structural block diagram of a molecule representation device 1200 according to an embodiment of the present disclosure. Fig.12 As shown, the apparatus 1200 includes:
[0159] An acquisition unit 1210 is configured to acquire characteristic information of a molecule to be represented, wherein the molecule includes a plurality of atoms;
[0160] A first generating unit 1220 is configured to generate a fully connected graph of the plurality of atoms, wherein the fully connected graph includes a plurality of edges;
[0161] A second generating unit 1230 is configured to generate a plurality of atomic vector representations and a plurality of edge vector representations based on the feature information, wherein the plurality of atomic vector representations correspond to the plurality of atoms respectively, and the plurality of edge vector representations correspond to the plurality of edges respectively;
[0162] An aggregation updating unit 1240 is configured to aggregate the multiple atomic vector representations and the multiple edge vector representations at least once based on the fully connected graph to obtain multiple updated atomic vector representations; and
[0163] The third generating unit 1250 is configured to generate a molecular vector representation of the molecule based on the updated multiple atomic vector representations.
[0164] The properties of molecules are essentially the result of the interaction between atoms, and the edges between atoms can express the connectivity and interaction between atoms. According to the embodiments of the present disclosure, by constructing a fully connected graph of atoms and aggregating the atomic vector representation and the edge vector representation, the atomic information and the edge information can be fully interacted, thereby obtaining a more comprehensive and accurate molecular vector representation.
[0165] The molecular vector representation of the embodiment of the present disclosure can fully and accurately express the characteristics of the molecule. Furthermore, the molecular vector representation of the embodiment of the present disclosure can be used to predict the properties of the molecule, which can improve the accuracy of the molecular property prediction, thereby greatly improving the efficiency of drug research and development.
[0166] According to an embodiment of the present disclosure, a training device for a molecular representation model is also provided. Fig.13 FIG. 1 shows a structural block diagram of a training device 1300 for a molecular representation model according to an embodiment of the present disclosure. Fig.13 As shown, the apparatus 1300 includes:
[0167] The acquisition unit 1310 is configured to acquire input features and attribute labels of a sample molecule, wherein the sample molecule includes a plurality of atoms, the input features include a fully connected graph of the plurality of atoms, a plurality of atom vector representations, and a plurality of edge vector representations, the plurality of atom vector representations respectively correspond to the plurality of atoms, and the plurality of edge vector representations respectively correspond to a plurality of edges included in the fully connected graph;
[0168] A representation unit 1320, configured to input the input feature into the molecular representation model to obtain a molecular vector representation of the sample molecule output by the molecular representation model;
[0169] A prediction unit 1330 is configured to input the molecular vector representation into a predictor to obtain a predicted attribute of the sample molecule output by the predictor; and
[0170] The adjusting unit 1340 is configured to adjust the parameters of the molecular representation model based on the predicted attribute and the attribute label.
[0171] According to the embodiments of the present disclosure, a trained molecular representation model can be obtained. The molecular representation model can quickly and efficiently generate a molecular vector representation of a molecule. Moreover, the molecular representation model of the embodiments of the present disclosure is jointly trained with a predictor of molecular properties, so that the molecular vector representation output by the molecular representation model can achieve a good property prediction effect and can realize accurate prediction of molecular properties.
[0172] It should be understood that Fig.12 The various units of the apparatus 1200 shown in FIG. 1 can be used in conjunction with the reference Figure 1 The various steps in the method 100 described above correspond to each other. Fig.13 The various units of the apparatus 1300 shown in FIG. 1 can be used in conjunction with the reference Figure 6 Thus, the operations, features, and advantages described above for method 100 are also applicable to device 1200 and the units included therein, and the operations, features, and advantages described above for method 600 are also applicable to device 1300 and the units included therein. For the sake of brevity, some operations, features, and advantages are not described in detail herein.
[0173] Although specific functions are discussed above with reference to specific units, it should be noted that the functions of the various units discussed herein can be divided into multiple units, and / or at least some functions of multiple units can be combined into a single unit. For example, the first generation unit 1220 and the second generation unit 1230 described above can be combined into a single unit in some embodiments.
[0174] It should also be understood that various techniques may be described herein in the general context of software hardware elements or program units. Fig.12 , Fig.13The various units described can be implemented in hardware or in hardware in combination with software and / or firmware. For example, these units can be implemented as computer program codes / instructions, which are configured to be executed in one or more processors and stored in a computer-readable storage medium. Alternatively, these units can be implemented as hardware logic / circuits. For example, in some embodiments, one or more of units 1210-1340 can be implemented together in a system on chip (System on Chip, SoC). SoC may include an integrated circuit chip (which includes a processor (e.g., a central processing unit (CPU), a microcontroller, a microprocessor, a digital signal processor (DSP), etc.), a memory, one or more communication interfaces, and / or one or more components in other circuits), and may optionally execute the received program code and / or include embedded firmware to perform functions.
[0175] According to an embodiment of the present disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor, the memory storing instructions executable by the at least one processor, the instructions being executed by the at least one processor so that the at least one processor can execute the molecular representation method and / or the molecular representation model training method according to the embodiment of the present disclosure.
[0176] According to one aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, wherein the computer instructions are used to cause a computer to execute a molecular representation method and / or a molecular representation model training method according to an embodiment of the present disclosure.
[0177] According to one aspect of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the molecular representation method and / or the molecular representation model training method according to the embodiments of the present disclosure.
[0178] refer to Fig.14, a block diagram of an electronic device 1400 that can be used as a server or client of the present disclosure will now be described, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0179] like Fig.14 As shown, the electronic device 1400 includes a computing unit 1401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 1402 or a computer program loaded from a storage unit 1408 into a random access memory (RAM) 1403. In the RAM 1403, various programs and data required for the operation of the device 1400 can also be stored. The computing unit 1401, the ROM 1402, and the RAM 1403 are connected to each other via a bus 1404. An input / output (I / O) interface 1405 is also connected to the bus 1404.
[0180] Multiple components in the electronic device 1400 are connected to the I / O interface 1405, including: an input unit 1406, an output unit 1407, a storage unit 1408, and a communication unit 1409. The input unit 1406 can be any type of device that can input information to the device 1400. The input unit 1406 can receive input digital or character information and generate key signal input related to user settings and / or function control of the electronic device, and can include but is not limited to a mouse, a keyboard, a touch screen, a trackpad, a trackball, a joystick, a microphone and / or a remote control. The output unit 1407 can be any type of device that can present information, and can include but is not limited to a display, a speaker, a video / audio output terminal, a vibrator and / or a printer. The storage unit 1408 can include but is not limited to a disk and an optical disk. The communication unit 1409 allows the device 1400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks, and can include but is not limited to a modem, a network card, an infrared communication device, a wireless communication transceiver and / or a chipset, such as Bluetooth TM devices, 802.11 devices, Wi-Fi devices, WiMAX devices, cellular communication devices, and / or the like.
[0181] The computing unit 1401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 1401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 1401 performs the various methods and processes described above, such as method 100 and method 600. For example, in some embodiments, method 100 and / or method 600 may be implemented as a computer software program, which is tangibly included in a machine-readable medium, such as a storage unit 1408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 1400 via ROM 1402 and / or communication unit 1409. When the computer program is loaded into RAM 1403 and executed by the computing unit 1401, one or more steps of the method 100 and / or method 600 described above may be performed. Alternatively, in other embodiments, the computing unit 1401 may be configured to execute the method 100 and / or the method 600 in any other appropriate manner (eg, by means of firmware).
[0182] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0183] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0184] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 foregoing.
[0185] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0186] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0187] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0188] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0189] Although the embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it should be understood that the above-mentioned methods, systems and devices are merely exemplary embodiments or examples, and the scope of the present invention is not limited by these embodiments or examples, but only by the claims after authorization and their equivalent scope. Various elements in the embodiments or examples can be omitted or replaced by their equivalent elements. In addition, each step can be performed in an order different from that described in the present disclosure. Further, the various elements in the embodiments or examples can be combined in various ways. It is important that with the evolution of technology, many elements described herein can be replaced by equivalent elements that appear after the present disclosure.
Claims
1. A molecular representation method, comprising: Acquiring characteristic information of a molecule to be represented, wherein the molecule includes a plurality of atoms; generating a fully connected graph of the plurality of atoms, wherein the fully connected graph comprises a plurality of edges; Based on the feature information, generate a plurality of atomic vector representations and a plurality of edge vector representations, wherein the plurality of atomic vector representations correspond to the plurality of atoms respectively, and the plurality of edge vector representations correspond to the plurality of edges respectively; Based on the fully connected graph, the multiple atomic vector representations and the multiple edge vector representations are aggregated at least once to obtain multiple updated atomic vector representations, wherein each aggregation of the at least one aggregation includes: For any atom among the multiple atoms, aggregating the current multiple atom vector representations and the current multiple edge vector representations based on the attention mechanism to obtain an updated atom vector representation of the atom; and For any edge of the plurality of edges: based on updated atomic vector representations of two atoms connected by the edge, updating a current edge vector representation of the edge to obtain a first edge vector representation of the edge; and aggregating a plurality of first edge vector representations of the plurality of edges based on an attention mechanism to obtain an updated edge vector representation of the edge; as well as generating a molecular vector representation of the molecule based on the updated plurality of atomic vector representations, Among them, the step of aggregating the multiple atomic vector representations and the multiple edge vector representations at least once based on the fully connected graph to obtain the updated multiple atomic vector representations and the step of generating the molecular vector representation of the molecule based on the updated multiple atomic vector representations are achieved through a trained molecular representation model.
2. The method according to claim 1, wherein: The molecule further includes a plurality of chemical bonds between the plurality of atoms, the characteristic information includes atomic characteristic information of each of the plurality of atoms and chemical bond characteristic information of each of the plurality of chemical bonds, the plurality of edges include at least the plurality of chemical bonds, and generating a plurality of atomic vector representations and a plurality of edge vector representations based on the characteristic information includes: generating an atomic vector representation of each atom based at least on the corresponding atomic feature information; generating an edge vector representation of each chemical bond based at least on the corresponding chemical bond feature information; and In response to determining that the number of the plurality of edges is greater than the number of the plurality of chemical bonds, an edge vector representation of each virtual edge is set to a preset value, wherein the virtual edge is any edge of the plurality of edges other than the plurality of chemical bonds.
3. The method according to claim 1, wherein: The updating of the current edge vector representation of the edge based on the updated atomic vector representation of the two atoms connected by the edge to obtain a first edge vector representation of the edge includes: Determining a change in the vector representation of the edge based on the updated atomic vector representations of the two atoms connected by the edge; and The current edge vector representation of the edge is superimposed with the vector representation change to obtain a first edge vector representation of the edge.
4. The method according to claim 1, wherein: The aggregating the plurality of first edge vector representations of the plurality of edges based on the attention mechanism to obtain an updated edge vector representation of the edge includes: Determine at least one adjacent edge pair of the edge, wherein each of the at least one adjacent edge pair includes two adjacent edges of the edge, and the two adjacent edges are connected with the edge to form a triangle; and Based on the attention mechanism, the first edge vector representation of the edge and each adjacent edge in the at least one adjacent edge pair is aggregated to obtain an updated edge vector representation of the edge.
5. The method according to claim 4, wherein: The two adjacent edges of each adjacent edge pair include a first adjacent edge connected to a first endpoint of the edge and a second adjacent edge connected to a second endpoint of the edge, and wherein, based on the attention mechanism, aggregating the first edge vector representation of the edge and each adjacent edge in the at least one adjacent edge pair to obtain an updated edge vector representation of the edge includes: Aggregating the first edge vector representation of the edge and each first adjacent edge in the at least one adjacent edge pair based on an attention mechanism to obtain a second edge vector representation of the edge; and Based on the attention mechanism, the second edge vector representation of the edge and each second adjacent edge in the at least one adjacent edge pair is aggregated to obtain an updated edge vector representation of the edge.
6. The method according to claim 4 or 5, wherein: The attention weight of the edge and each adjacent edge in the at least one adjacent edge pair is determined based on at least the shortest chemical bond distance between the corresponding two atoms.
7. The method according to claim 1, further comprising: Based on the molecular vector representation, a property of the molecule is predicted.
8. The method according to claim 7, wherein: The attributes include at least one of the following: Water solubility, toxicity, degree of match with the preset protein, compound reaction characteristics, stability, degradability, and energy.
9. The method according to claim 1, wherein: The step of aggregating the multiple atomic vector representations and the multiple edge vector representations at least once based on the fully connected graph to obtain multiple updated atomic vector representations includes: Inputting the fully connected graph, the multiple atomic vector representations, and the multiple edge vector representations into an aggregation update module of a trained molecular representation model to obtain updated multiple atomic vector representations output by the aggregation update module; And wherein, generating the molecular vector representation of the molecule based on the updated multiple atomic vector representations includes: The updated multiple atomic vector representations are input into the representation module of the molecular representation model to obtain the molecular vector representation of the molecule output by the representation module.
10. A method for training a molecular representation model, wherein the molecular representation model is used to implement the molecular representation method according to any one of claims 1 to 9, the training method comprising: Acquire input features and attribute labels of a sample molecule, wherein the sample molecule includes a plurality of atoms, the input features include a fully connected graph of the plurality of atoms, a plurality of atom vector representations, and a plurality of edge vector representations, the plurality of atom vector representations respectively correspond to the plurality of atoms, and the plurality of edge vector representations respectively correspond to a plurality of edges included in the fully connected graph; Inputting the input feature into the molecular representation model to obtain a molecular vector representation of the sample molecule output by the molecular representation model; Inputting the molecular vector representation into a predictor to obtain the predicted attribute of the sample molecule output by the predictor; and Based on the predicted attribute and the attribute label, a parameter of the molecular representation model is adjusted.
11. The method according to claim 10, wherein: The sample molecule further includes a plurality of chemical bonds between the plurality of atoms, the plurality of edges at least include the plurality of chemical bonds, and the method further includes: Acquire atomic characteristic information of each of the plurality of atoms and chemical bond characteristic information of each of the plurality of chemical bonds; generating an atomic vector representation of each atom based at least on the corresponding atomic feature information; generating an edge vector representation of each chemical bond based at least on the corresponding chemical bond feature information; and In response to determining that the number of the plurality of edges is greater than the number of the plurality of chemical bonds, an edge vector representation of each virtual edge is set to a preset value, wherein the virtual edge is any edge of the plurality of edges other than the plurality of chemical bonds.
12. The method according to claim 10 or 11, wherein: The molecular representation model includes an aggregation update module and a representation module, wherein the step of inputting the input feature into the molecular representation model to obtain a molecular vector representation of the sample molecule output by the molecular representation model includes: Inputting the input features into the aggregation update module to obtain updated multiple atomic vector representations output by the aggregation update module, wherein the updated multiple atomic vector representations are obtained by aggregating the multiple atomic vector representations and the multiple edge vector representations at least once based on the fully connected graph; and The updated multiple atomic vector representations are input into the representation module to obtain the molecular vector representation output by the representation module.
13. The method according to claim 10, wherein: The attribute label and the predicted attribute each include at least one of the following: Water solubility, toxicity, degree of match with the preset protein, compound reaction characteristics, stability, degradability, and energy.
14. A molecular representation device comprising: an acquisition unit, configured to acquire characteristic information of a molecule to be represented, wherein the molecule includes a plurality of atoms; A first generating unit is configured to generate a fully connected graph of the plurality of atoms, wherein the fully connected graph includes a plurality of edges; A second generating unit is configured to generate a plurality of atomic vector representations and a plurality of edge vector representations based on the feature information, wherein the plurality of atomic vector representations correspond to the plurality of atoms respectively, and the plurality of edge vector representations correspond to the plurality of edges respectively; An aggregation updating unit is configured to perform at least one aggregation on the multiple atomic vector representations and the multiple edge vector representations based on the fully connected graph to obtain multiple updated atomic vector representations, wherein each aggregation of the at least one aggregation includes: For any atom among the multiple atoms, aggregating the current multiple atom vector representations and the current multiple edge vector representations based on the attention mechanism to obtain an updated atom vector representation of the atom; and For any edge of the plurality of edges: based on updated atomic vector representations of two atoms connected by the edge, updating a current edge vector representation of the edge to obtain a first edge vector representation of the edge; and aggregating a plurality of first edge vector representations of the plurality of edges based on an attention mechanism to obtain an updated edge vector representation of the edge; as well as A third generating unit is configured to generate a molecular vector representation of the molecule based on the updated plurality of atomic vector representations, Wherein, the aggregation updating unit and the third generating unit are implemented by a trained molecular representation model.
15. A training device for a molecular representation model, wherein the molecular representation model is used to implement the molecular representation device according to claim 14, the training device comprising: an acquisition unit configured to acquire input features and attribute labels of a sample molecule, wherein the sample molecule includes a plurality of atoms, the input features include a fully connected graph of the plurality of atoms, a plurality of atom vector representations, and a plurality of edge vector representations, the plurality of atom vector representations respectively corresponding to the plurality of atoms, and the plurality of edge vector representations respectively corresponding to a plurality of edges included in the fully connected graph; a representation unit configured to input the input feature into the molecular representation model to obtain a molecular vector representation of the sample molecule output by the molecular representation model; a prediction unit configured to input the molecular vector representation into a predictor to obtain a predicted attribute of the sample molecule output by the predictor; and An adjustment unit is configured to adjust a parameter of the molecular representation model based on the predicted attribute and the attribute label.
16. An electronic device, comprising: at least one processor; as well as a memory communicatively coupled to the at least one processor; in The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 13.
17. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to make a computer execute the method according to any one of claims 1-13.
18. A computer program product comprising a computer program, wherein: When the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.
