Molecular structure prediction method based on multi-granularity graph neural network
Patent Information
- Application Number
- CN202511037634.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-28
- Publication Date
- 2025-11-14
AI Technical Summary
Existing molecular representation learning methods fail to effectively capture important local substructures and complex ring structures in molecules, resulting in the loss of local information and the inability to fully integrate multi-level information, thus affecting the model's learning ability.
We employ a multi-granularity graph neural network to construct feature representations at three levels: atomic, substructure, and graph. By using a multi-granularity fusion modeling approach, we capture rich semantic information of molecular structures at different levels, improve the message passing mechanism, and utilize the unique information of molecular structures at each level to avoid information compression or loss.
It improves the accuracy of molecular structure prediction, reduces prediction error, enhances feature expression ability, and alleviates the problem of insufficient information utilization.
Smart Images

Figure CN120954544A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of molecular representation learning, and specifically relates to methods for predicting molecular structures. Background Technology
[0002] With the rapid development of computational chemistry and artificial intelligence, molecular data is growing exponentially. Faced with such a vast library of compounds, researchers urgently need to quickly identify molecules with specific properties or functions from massive molecular structures in drug discovery, materials design, and environmental assessment. Molecular representation learning has emerged to address this need and has become a research hotspot in recent years. This technology aims to transform complex molecular structural information into computer-processable numerical vectors (i.e., molecular embeddings) for downstream tasks such as molecular property prediction, bioactivity prediction, and toxicity assessment. Through efficient molecular representation, models can better understand the intrinsic characteristics of molecules and their relationships with other molecules. Molecular representation learning establishes a mapping relationship between molecular structure and its physical, chemical, and biological properties. On the one hand, it helps researchers quickly screen for molecules with potential value; on the other hand, it makes the design and optimization of new molecules more efficient, thereby achieving scientific innovation and industrial applications.
[0003] Currently, methods for molecular representation learning are constantly being innovated, and can be mainly divided into the following categories:
[0004] Methods based on descriptors, strings, and graph neural networks include descriptor-based methods. Descriptor-based methods use a set of features to mathematically describe molecular structures, typically based on the physicochemical properties or topological structure of molecules. The advantage of this method is its simplicity and directness, but it requires a lot of manual feature engineering and is difficult to handle complex nonlinear relationships.
[0005] Converting molecules into linearized string representations using string representation and processing them with sequence models has the advantage of directly handling linear representations of molecules, but it may not effectively capture the three-dimensional topological information of molecules.
[0006] The graph neural network-based method models molecules as graph structures, with atoms as nodes and bonds as edges, and uses graph neural networks for representation learning.
[0007] Despite improvements in molecular representation learning, current techniques still fail to address the following issues:
[0008] (1) How to fully preserve and capture molecular structure
[0009] Traditional methods typically focus only on the direct connections between nodes (atoms) and edges (bonds), neglecting important local substructures in molecules, such as specific functional groups or complex ring structures. This leads to the loss of local information, which has a crucial impact on molecular properties, but existing methods often fail to effectively capture these details.
[0010] (2) How to integrate more comprehensive information into molecular diagram representation
[0011] Many existing methods rely on graph representations at only a single level. For example, considering only atomic-level features may fail to capture complex functional groups in molecules, while considering only graph-level features ignores local interactions between atoms and lacks the ability to handle complex edge properties. In other words, failing to fully integrate this additional information will limit the learning ability of the model. Summary of the Invention
[0012] The technical problem to be solved by the present invention is to overcome the shortcomings of the prior art and provide a molecular structure prediction method based on multi-granularity graph neural network with high prediction accuracy, small prediction error and full utilization of information.
[0013] The technical solution adopted to solve the above technical problems involves the following steps:
[0014] (1) Dataset preprocessing
[0015] 249,456 unlabeled SMILES expressions were selected from the ZINC15 dataset, and the dataset was divided into training, validation, and test sets in an 8:1:1 ratio.
[0016] (2) Constructing multi-granularity level data features
[0017] 1) Constructing atomic-level diagrams
[0018] Using the RDKit toolkit, the SMILES expression is parsed into the corresponding molecular graph, and atomic nodes V1 are connected by connecting edges E1 to construct an atomic-level graph G1:
[0019] G1 = (V1, E1)
[0020] 2) Constructing a substructure level diagram
[0021] Fragmenting the molecule using the BRICS rule yields a set of non-overlapping or partially overlapping substructures, C:
[0022] C = {C1,C2,...,C} m}
[0023] Among them, C m denoted as a substructure segment, and m represents the sequence number of the substructure segment.
[0024] Each substructure segment is treated as a substructure node V2, and the substructure nodes V2 are connected by connecting edges E2 to construct a substructure-level graph G2:
[0025] G2 = (V2, E2)
[0026] 3) Construct fine-grained molecular maps
[0027] Connect supernode V3 with all substructure nodes V2 using connection relationship E3 to construct a fine-grained graph-level molecular graph G3:
[0028] G3=(V′,E′)
[0029] V′=(V1,V2,V3)
[0030] E′=(E1,E2,E3)
[0031] Where V′ represents a graph-level node and E′ represents a graph-level node connecting edge.
[0032] (3) Constructing a multi-granularity graphical neural network
[0033] A multi-granularity graph neural network is composed of atomic-level granularity sub-networks, substructure-level granularity sub-networks, and graph-level granularity sub-networks connected in parallel.
[0034] (4) Training a multi-granularity graph neural network
[0035] 1) Constructing the loss function
[0036] The loss function L is constructed as follows:
[0037] L=η1L1+η2L2+η3L3+η4L4+η5L5
[0038] Where η1, η2, η3, η4, and η5 are the corresponding learnable vector weights, L1 represents the loss function for predicting whether a bond exists, L2 represents the loss function for predicting the bond type, L3 represents the loss function for predicting the atom type, L4 represents the loss function for predicting the number of atoms, and L5 represents the loss function for predicting the number of bonds.
[0039] The following formula determines whether the prediction loss function L1 exists:
[0040]
[0041] Where V represents the number of atomic nodes, y ij Indicates whether a connection exists between two nodes, y ij =1 indicates that a connection exists, y ij =0 indicates that there is no connection relationship. Indicates y ij The predicted value.
[0042] The L2 loss function for key type prediction is determined by the following formula:
[0043]
[0044] Where E represents the connecting edge, K1 represents the number of bonds in the atomic-level data, and y e,k Indicate whether the type of edge e is k, y e,k =1 indicates that the edge type is k, y e,k =0 indicates that the edge type is not k. Indicates y e,k The predicted value.
[0045] The atom type prediction loss function L3 is determined by the following formula:
[0046]
[0047] Where K2 represents the number of atomic nodes, y v,k Indicates whether the type of node v is k, y v,k =1 indicates that the node type is k, y v,k =0 indicates that the node type is not k. Indicates y v,k The predicted value.
[0048] The atom number prediction loss function L4 is determined by the following formula:
[0049]
[0050] Among them, y a Indicates the number of atomic nodes. This is expressed as the predicted number of atomic nodes.
[0051] The following formula determines the loss function L5 for predicting the number of keys:
[0052]
[0053] Among them, y b Indicates the number of keys. This represents the predicted number of keys.
[0054] 2) Constructing the evaluation function
[0055] The evaluation functions include the evaluation function ACC, the evaluation function AUC, and the evaluation function RMSE.
[0056] Construct the evaluation function ACC as follows:
[0057]
[0058] Where TP represents a true positive, TN represents a true negative, FP represents a false positive, and FN represents a false negative.
[0059] The evaluation function AUC is determined by the following formula:
[0060]
[0061] The true positive rate is the proportion of positive samples that are correctly predicted as positive, while the false positive rate is the proportion of negative samples that are incorrectly predicted as positive.
[0062] The evaluation function RMSE is determined by the following formula:
[0063]
[0064] Where N represents the number of samples, and its value is a finite positive integer, y i Represents the true value of the sample. This represents the predicted value of the sample.
[0065] 3) Training a multi-granularity graphical neural network
[0066] The training set is input into the multi-granularity graph neural network for training. During training, the training parameters are: the learning rate of the multi-granularity graph neural network is lr∈[1×10]. -3 3×10 -3 The decay rate dr ∈ [0.2, 0.5] is used. The Adam optimizer is used, and the number of iterations is 7795. The training continues until the loss function L converges.
[0067] (5) Validate the multi-granularity graph neural network
[0068] The validation set is input into the trained multi-granularity graph neural network, and the performance of the multi-granularity graph neural network is evaluated using an evaluation function.
[0069] (6) Testing multi-granularity graphical neural networks
[0070] The test set is input into the trained multi-granularity graph neural network for testing, and the multi-granularity graph neural network outputs the molecular structure prediction results.
[0071] In step (3) of the present invention, the multi-granularity graph neural network is constructed by connecting the edge feature embedding layer 1, the GINConv convolutional layer, the MLP convolutional layer, and the residual attention layer 1 in series.
[0072] In step (3) of the present invention, the multi-granularity graph neural network is constructed by connecting the substructure level granularity subnetwork in sequence with the edge feature embedding layer 2, the gate control layer, the degree normalization layer, the GCNConv convolutional layer, and the residual attention layer 2.
[0073] In step (3) of the present invention, the multi-granularity graph neural network is constructed by connecting the edge feature embedding layer 3, the message construction layer, the GraphSAGEConv convolutional layer, and the residual attention layer 3 in sequence.
[0074] In step (3) of this invention, which involves constructing a multi-granularity graph neural network, the method for constructing the atomic-level granularity sub-network is as follows:
[0075] Construct atomic-level subnetworks according to equation (1)
[0076]
[0077] H mlp (H gin ) = MLP(H gin )
[0078]
[0079]
[0080] in, This represents the initial characteristics of the j-th atomic node. H represents the initial characteristic of the i-th atomic node. gin This represents a GINConv convolutional layer, ∈ represents learnable parameters, AGG represents the neighbor aggregation operation, and γ represents the GINConv convolutional layer. e (·) indicates edge feature embedding layer 1, and e1 indicates atomic level graph connection edges. This indicates the type embedding of edges in the atomic-level graph. H represents the directional embedding of edges in an atomic-level diagram. mlp H represents an MLP convolutional layer, where MLP stands for Multilayer Perceptron, and H... res Let represent residual attention layer 1, α1 represent the residual attention fusion weights with values in (0,1], and σ1 represent the Sigmoid nonlinear activation function. represents a multilayer perceptron with residual attention mechanism, (·||·) represents the splicing operation, and l represents the forward propagation round of the atomic-level subnetwork, with a value ranging from 3 to 5.
[0081] In step (3) of this invention, which involves constructing a multi-granularity graph neural network, the method for constructing the sub-structure level granularity sub-network is as follows:
[0082] Construct subnetworks at the substructure level according to equation (2).
[0083]
[0084] Sgcn (S gate = ADD(Norm × S) gate )
[0085]
[0086] in, Let represent the initial characteristics of the j-th substructure node. S represents the initial feature of the i-th substructure node. gate Indicates the gate control layer. E2 represents the edge feature embedding layer 2, and E2 represents the substructure level graph connection edges. This indicates the type embedding of edges in the substructure level graph. Indicates the directional embedding of edges in the substructure level graph, g ij σ represents the gating factor, which is an intermediate variable. s W represents the Sigmoid nonlinear activation function. gate S represents the gate control weight matrix. gcn This indicates a GCNConv convolutional layer, ADD indicates an addition operation, Norm indicates a degree normalization layer, and d i d represents the degree of substructure node i. j Let σ² represent the degree of the neighboring substructure node j, and let σ² represent the Sigmoid nonlinear activation function. res This represents residual attention layer 2, where α2 represents the residual attention fusion weights, with values ranging from (0, 1]. A multilayer perceptron representing the residual attention mechanism.
[0087] In step (3) of this invention, which involves constructing a multi-granularity graph neural network, the method for constructing the graph-level granularity sub-network is as follows:
[0088] Construct graph-level granular subnetworks according to equation (3).
[0089]
[0090] φ e (E′)=E t +E d
[0091] F graphage (F msg )=σ f (W g ×Mean(F msg )+b g )
[0092]
[0093] in, Let represent the initial characteristics of the j-th graph structure node. Let F represent the initial features of the i-th graph structure node. msg Represents the message building layer, φ e (·) indicates edge embedding layer 3, E′ indicates fine-grained graph-level molecular graph connection edge, E t E represents the type embedding of edges in a graph at the graph level. d F represents the directional embedding of edges in the graph at the graph level. graphsage F represents the GraphSAGEConv convolutional layer. res Represents residual attention layer 3, W g With b g Let σ represent a learnable linear mapping, Mean represent the mean operation, and σ represent the mean value. f α represents the ReLU nonlinear activation function, α3 represents the residual attention fusion weights with values in (0,1], and σ3 represents the Sigmoid nonlinear activation function. A multilayer perceptron representing the residual attention mechanism.
[0094] This invention employs a novel molecular graph construction method, including feature representation at three levels: atomic, substructure, and graph. This multi-granularity fusion modeling approach captures rich semantic information of molecular structures at different levels, avoiding information compression or loss, resulting in more complete molecular representations with stronger structural discriminative power. The message passing mechanism of the multi-granularity graph neural network is improved. A multi-granularity molecular graph data structure is trained using a multi-granularity graph neural network, with each channel corresponding to a molecular graph structure at a specific granularity level. Embedding calculations and local-global information aggregation are performed independently, fully utilizing the unique information of each level of molecular structure, avoiding information interference, and enhancing feature representation capabilities. Compared with existing technologies, this invention improves prediction accuracy, reduces errors, and alleviates the problems of local information loss and insufficient information utilization in prediction methods, enabling the prediction of molecular structures. Attached Figure Description
[0095] Figure 1 This is a flowchart of Embodiment 1 of the present invention.
[0096] Figure 2 This is a schematic diagram of the structure of a multi-granularity graphical neural network.
[0097] Figure 3 yes Figure 2 Schematic diagram of the structure of subnetworks at the atomic level
[0098] Figure 4 yes Figure 2 Schematic diagram of neutron structure-level granular subnetwork
[0099] Figure 5 yes Figure 2 Schematic diagram of subnetwork structure at the medium level Detailed Implementation
[0100] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments, but the present invention is not limited to the following embodiments.
[0101] Example 1
[0102] The molecular structure prediction method based on multi-granularity graph neural networks in this embodiment consists of the following steps (see...). Figure 1 ):
[0103] (1) Dataset preprocessing
[0104] 249,456 unlabeled SMILES expressions were selected from the ZINC15 dataset, and the dataset was divided into training, validation, and test sets in an 8:1:1 ratio.
[0105] (2) Constructing multi-granularity level data features
[0106] 1) Constructing atomic-level diagrams
[0107] Using the RDKit toolkit, the SMILES expression is parsed into the corresponding molecular graph, and atomic nodes V1 are connected by connecting edges E1 to construct an atomic-level graph G1:
[0108] G1 = (V1, E1)
[0109] 2) Constructing a substructure level diagram
[0110] Fragmenting the molecule using the BRICS rule yields a set of non-overlapping or partially overlapping substructures, C:
[0111] C = {C1, C2, ..., C} m}
[0112] Among them, C m denoted as a substructure segment, and m represents the sequence number of the substructure segment.
[0113] Each substructure segment is treated as a substructure node V2, and the substructure nodes V2 are connected by connecting edges E2 to construct a substructure-level graph G2:
[0114] G2 = (V2, E2)
[0115] 3) Construct fine-grained molecular maps
[0116] Connect supernode V3 with all substructure nodes V2 using connection relationship E3 to construct a fine-grained graph-level molecular graph G3:
[0117] G3 = (V′, E′)
[0118] V′=(V1, V2, V3)
[0119] E′=(E1,E2,E3)
[0120] Where V′ represents a graph-level node and E′ represents a graph-level node connecting edge.
[0121] (3) Constructing a multi-granularity graphical neural network
[0122] Figure 2 A schematic diagram of the multi-granularity graph neural network structure in this embodiment is provided. Figure 2 In this embodiment, the multi-granularity graph neural network is composed of atomic-level granularity sub-networks, substructure-level granularity sub-networks, and graph-level granularity sub-networks connected in parallel.
[0123] Figure 3 Given Figure 2 A schematic diagram of the structure of a subnetwork at the atomic level. Figure 3 In this embodiment, the atomic-level granular subnetwork is composed of an edge feature embedding layer 1, a GINConv convolutional layer, an MLP convolutional layer, and a residual attention layer 1 connected in series.
[0124] The method for constructing atomic-level granular subnetworks in this embodiment is as follows:
[0125] Construct atomic-level subnetworks according to equation (1)
[0126]
[0127] H mlp (H gin ) = MLP(H gin )
[0128]
[0129] in, This represents the initial characteristics of the j-th atomic node. H represents the initial characteristics of the i-th atomic node. gin This represents a GINConv convolutional layer, ∈ represents learnable parameters, AGG represents the neighbor aggregation operation, and γ e (·) indicates edge feature embedding layer 1, and E1 indicates atomic level graph connection edges. This indicates the type embedding of edges in the atomic-level graph. H represents the directional embedding of edges in an atomic-level diagram. mlp H represents an MLP convolutional layer, where MLP stands for Multilayer Perceptron, and H... resLet represent residual attention layer 1, α1 represent the residual attention fusion weights, α1∈(0,1], in this embodiment α1 is taken as 0.5, and σ1 represent the Sigmoid nonlinear activation function. The multilayer perceptron represents the residual attention mechanism, (·||·) represents the splicing operation, and l represents the forward propagation round of the atomic-level granular subnetwork, with a value ranging from 3 to 5. In this embodiment, l is set to 4.
[0130] Figure 4 Given Figure 2 A schematic diagram of the neutron structure-level granular subnetwork. Figure 4 In this embodiment, the sub-structure level granularity sub-network is composed of an edge feature embedding layer 2, a gate control layer, a degree normalization layer, a GCNConv convolutional layer, and a residual attention layer 2 connected in series.
[0131] The method for constructing sub-networks at the substructure level in this embodiment is as follows:
[0132] Construct subnetworks at the substructure level according to equation (2).
[0133]
[0134] S gcn (S gate = ADD(Norm × S) gate )
[0135]
[0136] in, Let represent the initial characteristics of the j-th substructure node. S represents the initial feature of the i-th substructure node. gate Indicates the gate control layer. E2 represents the edge feature embedding layer 2, and E2 represents the substructure level graph connection edges. This indicates the type embedding of edges in the substructure level graph. S represents the directional embedding of edges in the substructure level graph. gcn G represents the GCNConv convolutional layer. ij σ represents the gating factor. s W represents the Sigmoid nonlinear activation function. gate The gate control weight matrix is represented by ADD, the addition operation is represented by Norm, and the degree normalization layer is represented by d. i d represents the degree of substructure node i. j Let σ² represent the degree of the neighboring substructure node j, and let σ² represent the Sigmoid nonlinear activation function. resLet α2 represent residual attention layer 2, and let α2 represent the residual attention fusion weights, where α2 ∈ (0, 1]. In this embodiment, α2 is set to 0.5. A multilayer perceptron representing the residual attention mechanism.
[0137] . Figure 5 Given Figure 2 A schematic diagram of the structure of a subnetwork at the medium-level granularity. Figure 5 In this embodiment, the graph-level granular subnetwork is composed of an edge feature embedding layer 3, a message construction layer, a GraphSAGEConv convolutional layer, and a residual attention layer 3 connected in series.
[0138] The method for constructing graph-level granular subnetworks in this embodiment is as follows:
[0139] Construct graph-level granular subnetworks according to equation (3).
[0140]
[0141] φ e (E′)=E t +E d
[0142] F graphsage (F msg )=σ f (W g ×Mean(F msg )+b g )
[0143]
[0144] in, Let represent the initial characteristics of the j-th graph structure node. Let F represent the initial features of the i-th graph structure node. msg Represents the message building layer, φ e (·) indicates edge embedding layer 3, E′ indicates fine-grained graph-level molecular graph connection edge, E t E represents the type embedding of edges in a graph at the graph level. d F represents the directional embedding of edges in the graph at the graph level. graphsage F represents the GraphSAGEConv convolutional layer. res Represents residual attention layer 3, W g With b g Let σ represent a learnable linear mapping, Mean represent the mean operation, and σ represent the mean value. f Let α3 represent the ReLU nonlinear activation function, α3 represent the residual attention fusion weights, α3∈(0,1], and in this embodiment, α3 is taken as 0.5. σ3 represents the Sigmoid nonlinear activation function. A multilayer perceptron representing the residual attention mechanism.
[0145] (4) Training a multi-granularity graph neural network
[0146] 1) Constructing the loss function
[0147] The loss function L is constructed as follows:
[0148] L=η1L1+η2L2+η3L3+η4L4+η5L5
[0149] Where η1, η2, η3, η4, and η5 are the corresponding learnable vector weights, L1 represents the loss function for predicting whether a bond exists, L2 represents the loss function for predicting the bond type, L3 represents the loss function for predicting the atom type, L4 represents the loss function for predicting the number of atoms, and L5 represents the loss function for predicting the number of bonds.
[0150] The following formula determines whether the prediction loss function L1 exists:
[0151]
[0152] Where V represents the number of atomic nodes, y ij Indicates whether a connection exists between two nodes, y ij =1 indicates that a connection exists, y ij =0 indicates that there is no connection relationship. Indicates y ij The predicted value.
[0153] The L2 loss function for key type prediction is determined by the following formula:
[0154]
[0155] Where E represents the connecting edge, K1 represents the number of bonds in the atomic-level data, and y e,k Indicate whether the type of edge e is k, y e,k =1 indicates that the edge type is k, y e,k =0 indicates that the edge type is not k. Indicates y e,k The predicted value.
[0156] The atom type prediction loss function L3 is determined by the following formula:
[0157]
[0158] Where K2 represents the number of atomic nodes, y v,k Indicates whether the type of node v is k, y v,k =1 indicates that the node type is k, y v,k=0 indicates that the node type is not k. Indicates y v,k The predicted value.
[0159] The atom number prediction loss function L4 is determined by the following formula:
[0160]
[0161] Among them, y a Indicates the number of atomic nodes. This is expressed as the predicted number of atomic nodes.
[0162] The following formula determines the loss function L5 for predicting the number of keys:
[0163]
[0164] Among them, y b Indicates the number of keys. The predicted value representing the number of keys;
[0165] 2) Constructing the evaluation function
[0166] The evaluation functions include the evaluation functions ACC, AUC, and RMSE;
[0167] Construct the evaluation function ACC as follows:
[0168]
[0169] Where TP represents a true positive, TN represents a true negative, FP represents a false positive, and FN represents a false negative.
[0170] The evaluation function AUC is determined by the following formula:
[0171]
[0172] The true positive rate is the proportion of positive samples that are correctly predicted as positive, while the false positive rate is the proportion of negative samples that are incorrectly predicted as positive.
[0173] The evaluation function RMSE is determined by the following formula:
[0174]
[0175] Where N represents the number of samples, and its value is a finite positive integer, y i Represents the true value of the sample. Represents the predicted value of the sample;
[0176] 3) Training a multi-granularity graphical neural network
[0177] The training set is input into the multi-granularity graph neural network for training. During training, the training parameters are: the learning rate of the multi-granularity graph neural network is lr∈[1×10]. -3 3×10 -3 In this embodiment, the value of lr is 2 × 10. -3 The decay rate dr ∈ [0.2, 0.5], and in this embodiment, dr is 0.3. The Adam optimizer is used, and the number of iterations is 7795, until the loss function L converges.
[0178] (5) Validate the multi-granularity graph neural network
[0179] The validation set is input into the trained multi-granularity graph neural network, and the performance of the multi-granularity graph neural network is evaluated using an evaluation function.
[0180] (6) Testing multi-granularity graphical neural networks
[0181] The test set is input into the trained multi-granularity graph neural network for testing, and the molecular structure prediction results are output.
[0182] A molecular structure prediction method based on multi-granularity graph neural networks was developed.
[0183] Example 2
[0184] The molecular structure prediction method based on multi-granularity graph neural networks in this embodiment consists of the following steps (see...). Figure 1 ):
[0185] (1) Dataset preprocessing
[0186] The steps are the same as in Example 1.
[0187] (2) Constructing multi-granularity level data features
[0188] The steps are the same as in Example 1.
[0189] (3) Constructing a multi-granularity graphical neural network
[0190] The multi-granularity graph neural network in this embodiment is composed of atomic-level granularity sub-networks, substructure-level granularity sub-networks, and graph-level granularity sub-networks connected in parallel.
[0191] The method for constructing atomic-level granular subnetworks in this embodiment is as follows:
[0192] Construct atomic-level subnetworks according to equation (1)
[0193] The expression of equation (1) is the same as that in Example 1.
[0194] In equation (1), α1 represents the residual attention fusion weight, α1∈(0,1], and in this embodiment, α1 is 0.1; l represents the forward propagation round of the atomic-level granular subnetwork, and l ranges from 3 to 5, and in this embodiment, l is 3. The meanings and value ranges of other parameters and variables are the same as in embodiment 1.
[0195] The structure of the sub-structure level granularity subnet in this embodiment is the same as that in Embodiment 1.
[0196] The method for constructing sub-networks at the substructure level in this embodiment is as follows:
[0197] Construct subnetworks at the substructure level according to equation (2).
[0198] The expression of equation (2) is the same as that in Example 1.
[0199] In equation (2), α2 represents the residual attention fusion weight, α2∈(0,1], and in this embodiment, α2 takes the value of 0.1; the meanings and value ranges of other parameters and variables are the same as in embodiment 1.
[0200] The structure of the graph-level granular subnetwork in this embodiment is the same as that in Embodiment 1.
[0201] The method for constructing graph-level granular subnetworks in this embodiment is as follows:
[0202] Construct graph-level granular subnetworks according to equation (3).
[0203] The expression of equation (3) is the same as that in Example 1.
[0204] In equation (3), α3 represents the residual attention fusion weight, a3∈(0,1], and in this embodiment, α3 is 0.1; the meanings and value ranges of other parameters and variables are the same as in embodiment 1.
[0205] (4) Training a multi-granularity graph neural network
[0206] 1) Constructing the loss function
[0207] The expression for the loss function L is the same as in Example 1.
[0208] The parameters, variables, and their ranges in the loss function L are the same as in Example 1.
[0209] 2) Constructing the evaluation function
[0210] The expression for the evaluation function RMSE is the same as in Example 1.
[0211] The parameters, variables, and their ranges in the evaluation function RMSE are the same as in Example 1.
[0212] 3) Training a multi-granularity graphical neural network
[0213] The training set is input into the multi-granularity graph neural network for training. During training, the training parameters are: the learning rate of the multi-granularity graph neural network is lr∈[1×10]. -3 3×10 -3 In this embodiment, the value of lr is 1×10. -3 The decay rate dr ∈ [0.2, 0.5], and in this embodiment, dr is 0.2. The Adam optimizer is used, and the number of iterations is 7795, until the loss function L converges.
[0214] The other steps are the same as in Example 1, thus completing the molecular structure prediction method based on multi-granularity graph neural network.
[0215] Example 3
[0216] The molecular structure prediction method based on multi-granularity graph neural networks in this embodiment consists of the following steps (see...). Figure 1 ):
[0217] (1) Dataset preprocessing
[0218] The steps are the same as in Example 1.
[0219] (2) Constructing multi-granularity level data features
[0220] The steps are the same as in Example 1.
[0221] (3) Constructing a multi-granularity graphical neural network
[0222] The multi-granularity graph neural network in this embodiment is composed of atomic-level granularity sub-networks, substructure-level granularity sub-networks, and graph-level granularity sub-networks connected in parallel.
[0223] The method for constructing atomic-level granular subnetworks in this embodiment is as follows:
[0224] Construct atomic-level subnetworks according to equation (1)
[0225] The expression of equation (1) is the same as that in Example 1.
[0226] In equation (1), α1 represents the residual attention fusion weight, α1∈(0,1], and in this embodiment, α1 is 1; l represents the forward propagation round of the atomic-level granular subnetwork, and l ranges from 3 to 5, and in this embodiment, l is 5. The meanings and value ranges of other parameters and variables are the same as in embodiment 1.
[0227] The structure of the sub-structure level granularity subnet in this embodiment is the same as that in Embodiment 1.
[0228] The method for constructing sub-networks at the substructure level in this embodiment is as follows:
[0229] Construct subnetworks at the substructure level according to equation (2).
[0230] The expression of equation (2) is the same as that in Example 1.
[0231] In equation (2), α2 represents the residual attention fusion weight, α2∈(0,1], and in this embodiment, α2 takes the value 1; the meanings and value ranges of other parameters and variables are the same as in embodiment 1.
[0232] The structure of the graph-level granular subnetwork in this embodiment is the same as that in Embodiment 1.
[0233] The method for constructing graph-level granular subnetworks in this embodiment is as follows:
[0234] Construct graph-level granular subnetworks according to equation (3).
[0235] The expression of equation (3) is the same as that in Example 1.
[0236] In equation (3), α3 represents the residual attention fusion weight, α3∈(0,1], and in this embodiment, α3 takes the value of 1; the meanings and value ranges of other parameters and variables are the same as in embodiment 1.
[0237] (4) Training a multi-granularity graph neural network
[0238] 1) Constructing the loss function
[0239] The expression for the loss function L is the same as in Example 1.
[0240] The parameters, variables, and their ranges in the loss function L are the same as in Example 1.
[0241] 2) Constructing the evaluation function
[0242] The expression for the evaluation function RMSE is the same as in Example 1.
[0243] The parameters, variables, and their ranges in the evaluation function RMSE are the same as in Example 1.
[0244] 3) Training a multi-granularity graphical neural network
[0245] The training set is input into the multi-granularity graph neural network for training. During training, the training parameters are: the learning rate of the multi-granularity graph neural network is lr∈[1×10].-3 3×10 -3 In this embodiment, the value of lr is 3 × 10. -3 The decay rate dr ∈ [0.2, 0.5], and in this embodiment, dr is 0.5. The Adam optimizer is used, and the number of iterations is 7795, until the loss function L converges.
[0246] The other steps are the same as in Example 1, thus completing the molecular structure prediction method based on multi-granularity graph neural network.
[0247] To verify the beneficial effects of the present invention, the inventors conducted a comparative experiment using the molecular structure prediction method based on multi-granularity graph neural network of Example 1 of the present invention and hierarchical molecular graph self-supervised learning (hereinafter referred to as Hi Mol). The evaluation index functions AUC, ACC, and RMSE in step (4) of training the multi-granularity graph neural network were calculated. The experimental and calculation results are shown in Table 1.
[0248] Table 1 Comparative experimental results of the present invention and the Hi Mol method
[0249]
[0250] As shown in Table 1, the method of the present invention improves the AUC index of bond presence by 0.32%, the ACC index of bond type prediction by 0.07%, the ACC index of atom type prediction by 0.68%, reduces the RMSE index of atom number prediction by 1.98%, and reduces the RMSE index of bond number prediction by 2.81% compared with Hi Mol.
Claims
1. A molecular structure prediction method based on multi-granularity graphical neural networks, characterized in that... It consists of the following steps: (1) Dataset preprocessing 249,456 unlabeled SMILES expressions were selected from the ZINC15 dataset, and the dataset was divided into training, validation, and test sets in an 8:1:1 ratio. (2) Constructing multi-granularity level data features 1) Constructing atomic-level diagrams Using the RDKit toolkit, the SMILES expression is parsed into the corresponding molecular graph, and atomic nodes V1 are connected by connecting edges E1 to construct an atomic-level graph G1: G1 = (V1, E1) 2) Constructing a substructure level diagram Fragmenting the molecule using the BRICS rule yields a set of non-overlapping or partially overlapping substructures, C: C={C1,C2,...,C m } Among them, C m represents a substructure segment, and m represents the sequence number of the substructure segment; Each substructure segment is treated as a substructure node V2, and the substructure nodes V2 are connected by connecting edges E2 to construct a substructure-level graph G2: G2 = (V2, E2) 3) Construct fine-grained molecular maps Connect supernode V3 with all substructure nodes V2 using connection relationship E3 to construct a fine-grained graph-level molecular graph G3: G3 = (V′, E′) V′=(V1,V3,V3) E′=(E1,E2,E3) Where V′ represents a graph-level node and E′ represents a graph-level node connecting edge; (3) Constructing a multi-granularity graphical neural network Multi-granularity graph neural networks are composed of atomic-level granularity subnetworks, substructure-level granularity subnetworks, and graph-level granularity subnetworks connected in parallel; (4) Training a multi-granularity graph neural network 1) Constructing the loss function The loss function L is constructed as follows: L=eta1L1+eta2L2+eta3L3+eta4L4+eta5L5 Where η1, η2, η3, η4, and η5 are the corresponding learnable vector weights, L1 represents the loss function for predicting whether a bond exists, L2 represents the loss function for predicting the type of a bond, L3 represents the loss function for predicting the type of atom, L4 represents the loss function for predicting the number of atoms, and L5 represents the loss function for predicting the number of bonds. The following formula determines whether the prediction loss function L1 exists: Where V represents the number of atomic nodes, y ij Indicates whether a connection exists between two nodes, y ij =1 indicates that a connection exists, y ij =0 indicates that there is no connection relationship. Indicates y ij The predicted value; The L2 loss function for key type prediction is determined by the following formula: Where E represents the connecting edge, K1 represents the number of bonds in the atomic-level data, and y e,k Indicate whether the type of edge e is k, y e,k =1 indicates that the edge type is k, y e,k =0 indicates that the edge type is not k. Indicates y e,k The predicted value; The atom type prediction loss function L3 is determined by the following formula: Where K2 represents the number of atomic nodes, y v,k Indicates whether the type of node v is k, y v,k =1 indicates that the node type is k, y v,k =0 indicates that the node type is not k. Indicates y v,k The predicted value; The atom number prediction loss function L4 is determined by the following formula: Among them, y a Indicates the number of atomic nodes. This is expressed as a predicted value for the number of atomic nodes; The following formula determines the loss function L5 for predicting the number of keys: Among them, y b Indicates the number of keys. The predicted value representing the number of keys; 2) Constructing the evaluation function The evaluation functions include the evaluation functions ACC, AUC, and RMSE; Construct the evaluation function ACC as follows: Where TP represents a true positive, TN represents a true negative, FP represents a false positive, and FN represents a false negative; The evaluation function AUC is determined by the following formula: The true positive rate is the proportion of positive samples that are correctly predicted as positive, while the false positive rate is the proportion of negative samples that are incorrectly predicted as positive. The evaluation function RMSE is determined by the following formula: Where N represents the number of samples, and its value is a finite positive integer, y i Represents the true value of the sample. Represents the predicted value of the sample; 3) Training a multi-granularity graphical neural network The training set is input into the multi-granularity graph neural network for training. During training, the training parameters are: the learning rate of the multi-granularity graph neural network is lr∈[1×10]. -3 3×10 -3 The decay rate dr ∈ [0.2, 0.5] is used. The Adam optimizer is used, and the number of iterations is 7795. The training continues until the loss function L converges. (5) Validate the multi-granularity graph neural network The validation set is input into the trained multi-granularity graph neural network, and the performance of the multi-granularity graph neural network is evaluated using an evaluation function. (6) Testing multi-granularity graphical neural networks The test set is input into the trained multi-granularity graph neural network for testing, and the multi-granularity graph neural network outputs the molecular structure prediction results.
2. The molecular structure prediction method based on multi-granularity graph neural networks according to claim 1, characterized in that: In step (3), the multi-granularity graph neural network is constructed by sequentially connecting the edge feature embedding layer 1 with the GINConv convolutional layer, the MLP convolutional layer, and the residual attention layer 1.
3. The molecular structure prediction method based on multi-granularity graph neural networks according to claim 1, characterized in that: In step (3), the multi-granularity graph neural network is constructed by connecting the substructure-level granularity subnetwork in sequence, consisting of the edge feature embedding layer 2, the gate control layer, the degree normalization layer, the GCNConv convolutional layer, and the residual attention layer 2.
4. The molecular structure prediction method based on multi-granularity graph neural network according to claim 1, characterized in that: In step (3), the multi-granularity graph neural network is constructed by sequentially connecting the edge feature embedding layer 3, the message construction layer, the GraphSAGEConv convolutional layer, and the residual attention layer 3.
5. The molecular structure prediction method based on multi-granularity graph neural network according to claim 1, characterized in that: In step (3), the method for constructing the atomic-level granularity sub-network in the multi-granularity graph neural network is as follows: Construct atomic-level subnetworks according to equation (1) H mlp (H gin )=MLP(H gin ) in, This represents the initial characteristics of the j-th atomic node. H represents the initial characteristic of the i-th atomic node. gin This represents a GINConv convolutional layer, ∈ represents learnable parameters, AGG represents the neighbor aggregation operation, and γ e (·) indicates edge feature embedding layer 1, and E1 indicates atomic level graph connection edges. This indicates the type embedding of edges in the atomic-level graph. H represents the directional embedding of edges in an atomic-level diagram. mlp H represents an MLP convolutional layer, where MLP stands for Multilayer Perceptron, and H... res This represents residual attention layer 1, where α1 represents the residual attention fusion weights with values in the range (0, 1), and σ1 represents the Sigmoid nonlinear activation function. represents a multilayer perceptron with residual attention mechanism, (·||·) represents the splicing operation, and l represents the forward propagation round of the atomic-level subnetwork, with a value ranging from 3 to 5.
6. The molecular structure prediction method based on multi-granularity graph neural network according to claim 1, characterized in that: In step (3) of constructing a multi-granularity graph neural network, the method for constructing the sub-structure level granularity sub-network is as follows: Construct subnetworks at the substructure level according to equation (2). in, Let represent the initial characteristics of the j-th substructure node. S represents the initial feature of the i-th substructure node. gate Indicates the gate control layer. E2 represents the edge feature embedding layer 2, and E2 represents the substructure level graph connection edges. This indicates the type embedding of edges in the substructure level graph. Indicates the directional embedding of edges in the substructure level graph, g ij σ represents the gating factor, which is an intermediate variable. s W represents the Sigmoid nonlinear activation function. gate S represents the gate control weight matrix. gcn This indicates a GCNConv convolutional layer, ADD indicates an addition operation, Norm indicates a degree normalization layer, and d i d represents the degree of substructure node i. j Let σ² represent the degree of the neighboring substructure node j, and let σ² represent the Sigmoid nonlinear activation function. res This represents residual attention layer 2, where α2 represents the residual attention fusion weights, with values ranging from (0, 1]. A multilayer perceptron representing the residual attention mechanism.
7. The molecular structure prediction method based on multi-granularity graph neural network according to claim 1, characterized in that: In step (3), the method for constructing the graph-level granularity sub-network in the construction of the multi-granularity graph neural network is as follows: Construct graph-level granular subnetworks according to equation (3). φ e (E′)=E t +E d F graphsage (F msg )=σ f (W g ×Mean(F msg )+b g ) in, Let represent the initial characteristics of the j-th graph structure node. Let F represent the initial features of the i-th graph structure node. msg Represents the message building layer, φ e (·) indicates edge embedding layer 3, E′ indicates fine-grained graph-level molecular graph connection edge, E t E represents the type embedding of edges in a graph at the graph level. d F represents the directional embedding of edges in the graph at the graph level. graphsage F represents the GraphSAGEConv convolutional layer. res Represents residual attention layer 3, W g With b g Let σ represent a learnable linear mapping, Mean represent the mean operation, and σ represent the mean value. f Let α represent the ReLU nonlinear activation function, α3 represent the residual attention fusion weights with values in (0, 1], and σ3 represent the Sigmoid nonlinear activation function. A multilayer perceptron representing the residual attention mechanism.
Citation Information
Cited By
Drug performance prediction method and system based on neural network
CN122091272A
Adverse drug reaction prediction method and system based on graph neural network
CN122091277A