A molecular toxicity prediction method based on global attention mechanism

By combining the self-attention mechanism and graph neural network, molecular features are extracted based on the global attention mechanism, which solves the problems of limited utilization of molecular features and loss of remote atom correlation information in the existing technology, and achieves more accurate molecular toxicity prediction and drug discovery. support.

CN117912597BActive Publication Date: 2024-08-23TIANJIN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410079053.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-19
Publication Date
2024-08-23
Estimated Expiration
2044-01-19

AI Technical Summary

Technical Problem

The existing molecular toxicity prediction methods based on deep learning are too limited in the use of molecular features. The traditional molecular feature extraction method based on graph neural networks causes the loss of a large amount of remote atomic correlation information.

Method used

Combining the self-attention mechanism and the graph neural network, a molecular toxicity prediction method based on the global attention mechanism is proposed. By converting the molecules into graph structure data, the message passing neural network and the multi-head self-attention mechanism are used to extract the local sum of the molecules. Global features to form a more comprehensive representation of molecular features.

Benefits of technology

It significantly improves the accuracy and efficiency of molecular toxicity prediction, can better capture the complex relationship between molecular structure and properties, and provides more accurate support for drug discovery and toxicity assessment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117912597B
    Figure CN117912597B
Patent Text Reader

Abstract

A molecular toxicity prediction method based on a global attention mechanism: The present invention relates to the fields of deep learning, molecular feature extraction and molecular toxicity prediction. This method aims at the problem that the existing molecular toxicity prediction methods based on deep learning are too limited in the use of molecular features, and the traditional molecular feature extraction methods based on graph neural networks cause the loss of a large amount of remote atomic association information. The technical solution adopted by the present invention is: a molecular toxicity prediction method based on a global attention mechanism, including converting molecules in a molecular toxicity dataset into graph structure data, proposing a new molecular feature extraction mechanism, and proposing a molecular toxicity prediction network model based on a global attention mechanism. It can effectively extract molecular features and comprehensively consider the local adjacency relationship and global dependency of atoms and chemical bonds in molecules, so as to obtain better molecular toxicity prediction effects.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the fields of deep learning, molecular feature extraction and molecular toxicity prediction. Background Art

[0002] 1. Molecular toxicity prediction

[0003] Molecular toxicity prediction refers to the prediction of the toxicity of molecular structures by using computational methods or machine learning techniques. Since the safety of drugs is one of the most important properties, chemical toxicology prediction has received increasing attention in drug discovery research. The application of computer toxicology in drug discovery helps to improve efficiency, reduce costs, and reduce animal experiments, while providing researchers with more comprehensive information to promote safe and efficient new drug development.

[0004] Specifically, it is necessary to first collect a data set containing molecular structures and corresponding toxicity labels, which can come from toxicity experimental data measured in the laboratory. Subsequently, by converting the molecular structure into a representation that can be processed by a computer, various machine learning models such as graph neural networks (GNNs) are used. The model can learn the relationship between molecular structure and toxicity, and the trained model can be used to quickly and accurately predict the toxicity of candidate compounds.

[0005] 2. Deep Learning Neural Networks

[0006] A deep learning neural network is a powerful machine learning model that consists of multiple layers of neural networks, each containing multiple neurons. These neurons are connected in a specific pattern so that information can be transmitted and processed in the network. A typical deep learning neural network has multiple hidden layers, each of which consists of many neurons. It processes inputs through nonlinear activation functions to achieve learning of more abstract and complex features.

[0007] Training a deep learning neural network uses the back-propagation algorithm, which calculates the error between the model output and the true value, and uses optimization algorithms such as gradient descent to adjust the network's weights and biases to minimize the error. This process is iterated on the training set until the network is able to produce accurate outputs for a given input.

[0008] The advantage of deep learning neural networks is that they can automatically learn feature representations in input data without manually designing features. This makes deep learning perform well in processing large-scale, high-dimensional data such as images, text, and audio. By increasing the depth of the network, the model can learn more complex and abstract feature representations, thereby improving its expressiveness and performance.

[0009] In the field of chemistry, the powerful feature extraction and classification capabilities of deep learning neural networks enable them to learn the mapping relationship between chemical reactions and their products. By learning the products of known chemical reactions, the model can predict the products of unknown chemical reactions, providing strong support for fields such as chemical synthesis and drug development.

[0010] 3. Molecular feature extraction based on deep learning

[0011] Extracting molecular features in deep learning is a key task in molecular representation learning. Deep learning methods can learn abstract and high-level features in molecules, thus better capturing the relationship between molecular structure and properties.

[0012] Molecular Graph Neural Networks (GNNs) are deep learning models that are specifically designed to process graph-structured data, and therefore have been widely used in molecular biology. GNNs pass information through graph convolutional layers. At each layer, a node updates its representation by aggregating information from its neighboring nodes. However, the graph convolutional layer can only pass information through neighboring nodes, ignoring the influence of remote nodes on the properties of molecules.

[0013] The Self-Attention Mechanism is a mechanism for processing sequence data, which was originally widely used in the field of natural language processing. Its application in deep learning, especially in natural language processing and computer vision tasks, has achieved remarkable success. The application of the self-attention mechanism in graph neural networks is usually called GraphTransformer. This method allows the model to dynamically assign different attention weights to each node when processing graph data, so as to better capture the relationship between nodes and thus better extract features. Summary of the invention

[0014] The technical problem solved by the present invention is that, in view of the fact that the existing molecular toxicity prediction methods based on deep learning are too limited in the use of molecular features, and the traditional molecular feature extraction methods based on graph neural networks cause the loss of a large amount of remote atomic correlation information, a molecular toxicity prediction method is proposed that combines the self-attention mechanism with the graph neural network to extract molecular features from a deeper level.

[0015] The technical solution adopted by the present invention is: a molecular toxicity prediction method based on a global attention mechanism, comprising the following steps:

[0016] Step 1: Convert molecules in the molecular toxicity dataset into graph structure data

[0017] Step 2: Propose a new mechanism for molecular feature extraction

[0018] Step 3: Propose a molecular toxicity prediction network model based on global attention mechanism

[0019] The three steps are described as follows:

[0020] Step 1: Convert molecules in the molecular toxicity dataset into graph structure data

[0021] The main purpose of converting molecules in toxicity datasets into graph-structured data is to use graph-structured models such as graph neural networks (GNNs) to capture the complex relationships and structural information between molecules. Figure 1 As shown in Figure 1, graph-structured data can more naturally represent the topological structure of molecules, where atoms are nodes and bonds are edges, which helps to preserve the spatial information and chemical interactions of molecules. By converting molecules into graph representations, tasks such as molecular toxicity prediction and compound activity prediction can be performed more effectively, improving the model's ability to learn molecular structural features, thereby providing more accurate predictions for drug discovery and toxicity assessment.

[0022] Furthermore, the specific steps of step 1 are as follows:

[0023] Step 101: Read the SMILES format string in the data set, use chemical information processing tools to perform structural analysis on each molecule, and convert it into a graph, including mapping atoms to nodes in the graph and bonds to edges in the graph.

[0024] Step 102: Map the structural information of the molecule to the representation of the graph, and generate a DGL graph for each molecule. Each atom becomes a node of the graph, and each bond becomes an edge of the graph. The node features contain information about the atom, including atom type, chirality, formal charge, partial charge, aromatic atom, hybridization, hydrogen bond donor, hydrogen bond acceptor, the number of rings to which the atom belongs when the ring size is between 3 and 8, etc., and one-hot encoding is used. The edge features contain key information, including whether it is a single bond, double bond, triple bond, aromatic bond, whether the bond is conjugated, whether the bond is located in a ring of any size, the stereo configuration of the bond, etc., and one-hot encoding is used.

[0025] Step 103: Collect the graph representation of each molecule into a graph dataset. Each graph contains nodes, edges and corresponding feature information. Provide data for subsequent network training.

[0026] Step 2: Propose a new mechanism for molecular feature extraction

[0027] In order to obtain the local and overall features of molecules at the same time, the present invention innovatively proposes a new molecular feature extraction mechanism. The main idea of ​​the molecular feature extraction mechanism in the present invention is to first aggregate the adjacent atomic features and chemical bond features according to the structure of the molecular graph to obtain the local features of the molecule, and then perform a self-attention operation on the aggregated features. This operation can take into account the different correlation features between atomic or chemical bond features, that is, it can realize the extraction of correlation information between any atoms or chemical bonds in the molecule to obtain the global features of the molecule, and finally extract and condense the features to comprehensively obtain the overall features of the molecule. Through this method, the local adjacency relationship and global dependency of atoms and chemical bonds in the molecule can be considered as comprehensively as possible, so as to extract as many molecular features as possible and obtain better prediction results.

[0028] First, according to step 1, the molecular graph data is obtained, and each molecule is converted into an undirected graph G with node features x v and edge feature e vw Then it passes through a node feature encoder, which is composed of node degree embedding matrix W d The in-degree of each node can be embedded into the dimension of the node feature and added to the original node feature to obtain a new feature.

[0029] Then, the molecular graph G with new features is input into a message passing neural network (MPNN), which can encode the surrounding environment of each atom. This network consists of a graph convolution layer and a gated recurrent unit (GRU). The graph convolution layer first performs a graph convolution operation on the input graph G, and weights the features of each node and edge and its neighboring nodes and edges to obtain an aggregated feature vector, which is mapped to the hidden layer dimension. This vector is then input into the GRU. As a recurrent neural network, the GRU can well update and reset the information stored in its hidden state. At the same time, this network uses the GRU to more easily fuse information from different nodes and edges. As shown in formulas (1) and (2):

[0030]

[0031]

[0032] Among them, M t is the information function, U t It is an update function. When information is transmitted, the aggregated features are first obtained through the information function. Then the hidden state of each node in the graph Will be based on Update. N(v) represents all neighbor nodes of node v in graph G.

[0033] In general, the above molecular feature extraction process can be expressed as formula (3). Among them, the feature of atom a is v a , whose adjacent atom b has the characteristic v b , the chemical bond connecting these two atoms is characterized by e ab , {.} represents the set of all nodes or edges adjacent to atom a.

[0034] v′ a =MPNN(v a ,{v b},{e ab}) (3)

[0035] After updating the atomic features through MPNN, in order to obtain the chemical bond features, the features of the two connected atoms are concatenated (v′ a ||v′ b ), and then the chemical bond features are obtained through mapping through the fully connected layer. The dimension after mapping is consistent with the atomic features. As shown in formula (4), w is the weight and c is the bias of the fully connected layer.

[0036] e′ ab =w(v′ a ||v′ b )+c (4)

[0037] Since the properties of molecules are not always determined by local structures, some molecular properties may be affected by some remote chemical environments in the molecules. For example, two functional groups that are far apart may affect each other. In order to consider this global dependency and non-local characteristics of molecular properties, the present invention updates the features of all atoms and chemical bonds by applying a global attention mechanism. In order to obtain different influence relationships between atoms and chemical bonds, the present invention applies a multi-head self-attention mechanism to learn different contexts by learning the bonds, queries and values ​​of given features. The features of atoms and chemical bonds are jointly updated and determined by all atoms and chemical bonds in the molecule. The present invention calls this non-local attention operation global molecular attention (GMA). As shown in formula (5), where x a It is the atomic feature obtained after updating by GMA(.).

[0038] x a =GMA(v′ a ,{v′ a} a∈V ,{e′ ab} ab∈E ) (5)

[0039] Finally, multiple atomic features in the same molecular graph G are averaged and max-pooled, and then spliced ​​together to obtain the overall feature h of the molecular graph G. G . As shown in formula (6).

[0040] h G =(max({x a} a∈V ||avg({x a} a∈V )) (6)

[0041] At this point, a molecular feature extraction mechanism that has both local molecular adjacency and global dependencies has been constructed.

[0042] Step 3: Propose a molecular toxicity prediction network model based on global attention mechanism

[0043] According to step 2, the present invention proposes Figure 2 Shown is a molecular toxicity prediction network model based on a global attention mechanism.

[0044] The specific operation steps of the model are as follows:

[0045] 1) According to the SMILES format expression of the molecule, the chemical information processing tool is used to analyze the structure of each molecule, convert it into a DGL graph, and initialize the node features and edge features.

[0046] 2) The obtained molecular graph data is embedded into the matrix through the node degree, the node degree is embedded into the dimension of the node feature and added to the original feature to obtain the new feature.

[0047] 3) The molecular graph with new features is input into the message passing network.

[0048] 4) First, local information is transferred through the graph convolution layer to obtain the aggregated feature vector.

[0049] 5) Update and reset node features and edge features through gated recurrent units.

[0050] 6) Concatenate the updated node features and map them through the fully connected layer to obtain edge features.

[0051] 7) Node features and edge features are used as keys, queries and values, and the global information of the molecule is calculated through a multi-head self-attention mechanism.

[0052] 8) The atomic features of each molecular graph are further aggregated and the overall features of the molecule are obtained by concatenating them through maximum pooling and average pooling.

[0053] 9) The overall characteristics of the molecule are input into the classifier for molecular toxicity prediction.

[0054] 10) Compare with the correct molecular toxicity label and calculate the loss value.

[0055] 11) Back propagation to further learn network parameters.

[0056] The entire model consists of 7 layers of networks. Figure 3 The whole model operation process is shown. BRIEF DESCRIPTION OF THE DRAWINGS

[0057] Figure 1 It is a schematic diagram of converting molecules into graph structure data.

[0058] Figure 2 This is a structural diagram of the molecular toxicity prediction network model based on the global attention mechanism.

[0059] Figure 3 It is the operation flow chart of the model. DETAILED DESCRIPTION

[0060] 1) Model parameter setting.

[0061] Table 1. Parameter settings of neural network model based on global attention mechanism

[0062]

[0063] The neural network model of the present invention uses an NVIDIA 3090 graphics card with a cuda version of 11.4 or above for training. The total number of training times is set to 50. When the loss value of 10 consecutive training times remains basically unchanged, the training is stopped in advance. The learning rate is 5e-6, 16 molecules are input in a batch, and the optimizer uses Adam. The optimizer weight decay is 1e-6, the node feature dimension is 512, the number of transmissions of the message passing neural network is 5, the number of self-attention layers is 1, the number of attention heads is 8, and the number of classifications is 2, that is, there is toxicity and there is no toxicity.

[0064] 2) Training and testing datasets

[0065] The data set used for training and testing in the present invention is the Tox21 data set, which includes a collection of 12 toxicity data sets, each of which includes an expression of a molecule in SMILES format and a toxicity label of each molecule. Training, verification and testing are performed based on the data set, and the data set is divided into a training set, a verification set and a test set in a ratio of 8:1:1.

[0066] 3) Beneficial effects of molecular toxicity prediction methods based on global attention mechanism

[0067] This method was trained and tested on the Tox21 dataset. The test results are shown in Table 2. Compared with other methods, the molecular toxicity prediction results of this method performed well in ROC-AUC.

[0068] Table 2 Beneficial effects of the present invention on the Tox21 dataset

[0069]

Claims

1. A molecular toxicity prediction method based on a global attention mechanism, comprising the following steps: 1) Convert molecules in the molecular toxicity dataset into molecular graph data; 2) Extract molecular features from each molecular graph data, including: (a) According to step 1, the molecular graph data is obtained. Each molecule is converted into an undirected graph with node features x v and edge feature e vw , after a node feature encoder, which is composed of node degree embedding matrix W a Composition: embed the in-degree of each node into the dimension of node features and add it to the original node features to obtain new features; (b) The molecular graph G with new features is input into a message passing neural network, which consists of a graph convolutional layer and a gated recurrent unit. The feature update process of the network is expressed as follows: Among them, N(v) represents all neighbor nodes of node v in the molecular graph G, M t is the information function, U t It is an update function. When information is transmitted, the aggregated features are first obtained through the information function. The hidden state of each node in the molecular graph G Will be based on renew; (c) Using message passing neural network to extract features of all atoms in the molecule, the process is expressed as the following formula: in a =MPNN(in a ,{in b }, {e ab }) (3) Among them, the characteristic of any atom a in the molecule is v a , the adjacent atom b has the characteristic v b , the chemical bond connecting these two atoms is characterized by eab; (d) The atomic features are updated using a message passing neural network. After the atomic features are updated, the features of the two connected atoms are concatenated (v′ a ||v′ b ), and then the chemical bond features are obtained through full connection layer mapping. The dimension after mapping is consistent with the atomic features. The processing process is expressed by the following formula: e′ ab =w(v′ a ||v′ b )+c (4) Among them, w is the weight and c is the bias of the fully connected layer; (e) Apply the global attention mechanism to update the features of all atoms and chemical bonds. This process is expressed as follows: x a =GMA(v′ a ,{v′ a } a∈V ,{e′ ab } ab∈E ) (5) Among them, x a is the atomic feature obtained after updating by GMA(.); (f) Finally, multiple atomic features in the same molecular graph G are averaged and max-pooled, and then concatenated together to obtain the overall feature h of the molecular graph G. G , the process is expressed as the following formula: h G =(max({x a } a∈V ||avg({x a } a∈V )) (6); 3) Construct a molecular toxicity prediction network model based on the global attention mechanism and use this model to predict molecular toxicity.

2. The molecular toxicity prediction method based on the global attention mechanism according to claim 1, characterized in that: The step 1) specifically includes: (1) Read the SMILES format string in the data set and use the chemical information processing tool rdkit to convert the molecule into a DGL graph; (2) One-hot encoding is used to initialize node features and edge features. Node features include atom type, chirality, formal charge, partial charge, aromatic atom, hybridization, hydrogen bond donor, hydrogen bond acceptor, and the number of rings to which the atom belongs when the ring size is between 3 and 8; edge features include whether it is a single bond, double bond, triple bond, aromatic bond, whether the bond is conjugated, whether the bond is located in a ring of any size, and the stereo configuration of the bond.

3. The molecular toxicity prediction method based on the global attention mechanism according to claim 1, characterized in that: In the step 3), the optimal learning rate of the molecular toxicity prediction network model based on the global attention mechanism is 5e-6, the optimal training batch size is 16, the optimal weight decay is 1e-6, the optimal node feature dimension is 512, the optimal number of message passing times is 5, the optimal number of self-attention layers is 2, the optimal number of attention heads is 8, and the optimal neuron shielding amount is 0.

2. The molecular toxicity prediction network model based on the global attention mechanism has a 7-layer network, including an input processing layer, a node degree embedding layer, a message passing layer, a feature splicing layer, a global molecular attention layer, a feature aggregation layer, and a fully connected layer; the input processing layer processes the input molecules according to the method proposed in step 1).