Drug interaction prediction method and system based on graph neural network and multiple attention mechanism

By employing a method based on graph neural networks and multiple attention mechanisms, the problem of not considering the importance of substructures in drug interaction prediction is addressed, thereby improving prediction accuracy and efficiency and achieving better drug interaction prediction results.

CN119560178BActive Publication Date: 2026-02-10HUNAN UNIV OF CHINESE MEDICINE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411264351.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-10
Publication Date
2026-02-10
Estimated Expiration
2044-09-10

AI Technical Summary

Technical Problem

Existing drug interaction prediction methods fail to effectively consider the importance of drug substructures themselves and the degree of drug-to-substructure interaction, resulting in unsatisfactory prediction results.

Method used

The method employs graph neural networks and multiple attention mechanisms, including converting the SMILES sequences of drug pairs into graph data, obtaining the embedding matrix using multi-layer GIN operations, extracting the feature matrix through self-attention mechanism encoders and interactive attention mechanism encoders, and combining multi-layer perceptrons for prediction.

Benefits of technology

It improves the accuracy and efficiency of drug interaction prediction, and better captures drug interactions through self-attention and interactive attention mechanisms, achieving better prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119560178B_ABST
    Figure CN119560178B_ABST
Patent Text Reader

Abstract

The application discloses a drug interaction prediction method and system based on a graph neural network and a multiple attention mechanism. The method comprises the following steps: converting SMILES sequences of a drug pair into graph data, and obtaining an embedding matrix of the drug pair by using a multilayer GIN operation; extracting a self-attention feature matrix of the drug pair from the embedding matrix of the drug by using a self-attention mechanism encoder, calculating a cosine similarity matrix of the drug pair, and obtaining a self-attention feature vector of the drug pair after a flattening operation; processing the embedding matrix of the drug pair by using an interactive attention mechanism encoder, obtaining an interactive attention coefficient feature matrix, performing average pooling operation on the interactive attention coefficient feature matrix of the two drugs respectively, then performing standardization, and then obtaining an interactive feature vector of the drug pair; and inputting the self-attention feature vector and the interactive feature vector of the drug pair into a multilayer perceptron to predict the interaction between the drug pair. The application can better predict the interaction between drugs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of machine learning and drug efficacy prediction technology, and in particular to a method and system for predicting drug interactions based on graph neural networks and multiple attention mechanisms. Background Technology

[0002] Drug interactions refer to the effects that occur when two or more drugs are used simultaneously, potentially leading to enhanced or diminished drug efficacy, or even serious adverse reactions. These interactions can have a significant impact on patient safety and treatment outcomes. Adverse drug reactions are a common problem in medical practice, and according to the World Health Organization, they are a leading cause of hospitalization and medical complications. In some cases, drug interactions can lead to unexpected toxic reactions, which is particularly common in elderly patients using multiple medications to treat multiple conditions such as hypertension, diabetes, or heart disease. Adverse drug effects are a significant risk in the drug development process and can lead to the withdrawal of marketed drugs. Historically, many drugs have been forced to withdraw from the market due to the discovery of serious adverse reactions after marketing, resulting in significant economic losses and impacting patient trust. Therefore, developing effective methods to predict drug interactions and identify potential adverse drug reactions in advance is crucial for improving drug safety and efficacy.

[0003] In traditional prediction methods, drug interactions are directly conducted through in vitro simulated environments or animal experiments. These methods have drawbacks such as special experimental environment requirements, complex operation, long experimental cycles, and high costs. Therefore, it is necessary to design an efficient and accurate calculation method to guide biological experiments and make the prediction of drug interactions more efficient.

[0004] For example, Zhao et al.'s CSGNN, published in IJCAI 2021, injects a hybrid skip neighborhood aggregator into a GNN to capture higher-order dependencies in drug interaction networks and utilizes a contrastive self-supervised learning task as a regularizer, making it a drug interaction prediction method. Wang et al.'s DeepDDS, proposed in Bionformatics 2022, is a deep learning model based on GNN and attention mechanisms for identifying synergistic drug combinations and predicting drug interactions. Li et al.'s DSN-DDI, proposed in Bionformatics 2023, is a dual-view drug representation learning network capable of learning drug substructures from both single drugs and drug pairs, making it a drug interaction prediction method. Wang et al.'s MIRACLE, disclosed in Proceedings of the Web Conference 2021, is also a drug interaction prediction method.

[0005] While the methods described above are effective for studying drug interactions, they still have many limitations. On the one hand, some methods fail to consider the importance of substructures within the drug itself; on the other hand, some methods do not investigate the extent of substructural interactions between drug pairs. Ultimately, this leads to less than ideal predictive results. Summary of the Invention

[0006] The purpose of this invention is to provide a method and system for predicting drug interactions based on graph neural networks and multiple attention mechanisms, in order to solve the technical problem that existing drug interaction studies do not consider the importance between drug substructures themselves and the degree of drug-to-substructure interaction, resulting in unsatisfactory prediction results.

[0007] To achieve the above objectives, this invention provides a drug interaction prediction method based on graph neural networks and multiple attention mechanisms, comprising the following steps:

[0008] The SMILES sequences of drug pairs are converted into graph data, and the embedding matrix of the drugs is obtained by multi-level GIN operation.

[0009] The self-attention feature matrix of drug pairs is extracted from the embedding matrix of drugs by a self-attention mechanism encoder (GSAT), the cosine similarity matrix of drug pairs is calculated, and the self-attention feature vector of drug pairs is obtained after flattening.

[0010] The embedding matrix of the drug pair is processed by the Interactive Attention Mechanism Encoder (GIAT) to obtain the feature matrix with interactive attention coefficients. The interactive attention coefficient feature matrix is ​​then subjected to average pooling and standardization to obtain the interactive feature vector of the drug pair.

[0011] The self-attention feature vectors and interaction feature vectors of drug pairs are concatenated and input into a multilayer perceptron to predict the interactions between drug pairs.

[0012] As a further improvement to the method of the present invention:

[0013] Preferably, before using multi-layer GIN operations, the node dimension of the drug is first transformed to 60 using a linear layer.

[0014] Preferably, the multi-layer GIN operation includes: using GIN to aggregate the information of the neighboring nodes of the drug atoms through multi-layer GIN to obtain the embedding matrix of the drug pairs. The calculation method is as follows:

[0015] The GNN aggregates neighbor node features in the following way:

[0016]

[0017] The specific calculation method of GIN is as follows: The method of aggregating the features of layer l in the (l+1)th layer is as follows:

[0018]

[0019] The formula for GIN feature update is as follows:

[0020]

[0021] FC (k) (h)=hW (k) +b (k)

[0022] in, Let ν be the hidden state of node ν after the update at level l+1; It is a function that accepts the current hidden state and the aggregated message; Let ν be the hidden state of node ν at layer l. It is a function that aggregates messages from the neighborhood; Let ν be the set of neighbors of node ν; This represents a pair consisting of the hidden states of node ν and its neighbor node u at level l. This indicates that a multilayer perceptron (MLP) is applied to the input h. This represents the activation functions of each layer in an MLP; This represents the computation result of the fully connected layer on the k-th layer for input h; h represents the input vector. This represents the weight matrix of the k-th layer; The bias vector of the k-th layer.

[0023] Preferably, the self-attention feature matrix of drug pairs is extracted from the drug embedding matrix using a self-attention mechanism encoder, including: obtaining the keys and values ​​of individual drugs, calculating the self-attention scores between drug substructures using the Transformer method, and the embedding matrix of drug pairs. Obtain the self-attention feature matrix:

[0024] For a single drug, first use W K and W V For input The transformation yields a key (K) and value (V) matrix. The `to_dense_batch` function processes the keys and values, converting them to a dense batch format and generating a mask to handle the varying sizes of different batches. The processing method is as follows:

[0025] Q = Q0W Q K = K0W KV = V0W V

[0026] The attention score is calculated using the dot product of the query (Q) and the key (K), and the score is adjusted using the softmax function. The calculation method is as follows:

[0027]

[0028] Multiply the obtained attention coefficient matrix A by the original feature matrix X to obtain the self-attention feature matrix;

[0029] The calculation process for using the ReLU function to perform nonlinear transformation is as follows:

[0030] O = ReLU((Q + AV)W0)

[0031] Where Q, K, and V represent query, key, and value, respectively; d represents the embedding dimension; the function ReLU() represents the corrected linear unit activation function; W Q W K W V W0 represents the learnable weights.

[0032] Preferably, the cosine similarity matrix of the drug pairs is calculated, and after a flattening operation, the self-attention feature vector of the drug pairs is obtained. The calculation formula is as follows:

[0033]

[0034] H1 = flatten(S) ij )

[0035] Where, when the feature embedding matrices of the drug pair are x1 and x2 respectively, for feature embedding matrices x1 and x2, where It is the representative vector of the i-th drug 1. H1 is the j-th representative vector of drug 2, and H1 is the self-attention feature vector of the drug pair. S ij is the cosine similarity matrix of the drug pairs.

[0036] Preferably, the embedding matrix of the drug pair is processed by an interactive attention mechanism encoder to obtain a feature matrix with interactive attention coefficients, including:

[0037] Obtain the keys and values ​​of the two drug matrices, calculate the interaction attention score between one drug and the other drug substructure, multiply it by the original feature matrix X of the drugs, and obtain the interaction attention coefficient feature matrix:

[0038] The feature embedding matrices x1 and x2 of the drug pair are weighted by different weight matrices W. K and W VIt is converted into a vector of keys (K) and values ​​(V), and the calculation formula is:

[0039] K1 = W K (x1),V1=W V (x1)

[0040] K2 = W K (x2),V2=W V (x2)

[0041] The `to_dense_batch` function processes the key (K) and value (V) of two drugs, converting them to a dense batch format and generating a mask to handle different batch sizes. Interactive attention scores are calculated using the dot product of query (Q) and key (K), and the softmax function is applied to adjust the scores. The calculation method for a specific drug pair is as follows:

[0042]

[0043] The obtained interactive attention coefficient feature matrix is ​​multiplied element-wise with the embedding matrix of the drug pair. This process can be summarized as follows: The calculation method is as follows:

[0044] O1 = ReLU(W O ((Q1+A1V2))), O2=ReLU(W O ((Q2+A2V1)))

[0045] The resulting interactive attention coefficient feature matrices are O1 and O2.

[0046] Preferably, the feature matrices of the two drugs are averaged and pooled separately, then standardized to obtain the interaction feature vector of the drug pair, including the following steps:

[0047] The interactive attention coefficient feature matrices O1 and O2 obtained after processing by the interactive attention mechanism are subjected to average pooling and then standardization. First, the mean μ1 and μ2 are calculated using the following formulas:

[0048] μ1=mean(O1,1),μ2=mean(O2,1)

[0049] Calculate the mean and standard deviation of each drug pair: mean1, std1, mean2, and std2, using the following formulas:

[0050] mean1=mean(μ1,1,keepdim=True),std1=std(μ1,1,keepdim=True)

[0051] mean2=mean(μ2,1,keepdim=True),std2=std(μ2,1,keepdim=True)

[0052] Finally, after standardization, we obtain the interaction feature vectors inter1 and inter2 of the drug pairs, which are calculated using the following formula:

[0053]

[0054] Where, inter1 and inter2 represent the interaction vectors between different drugs; mean1 and mean2 represent the average values ​​of μ1 and μ2, respectively; std1 and std2 represent the standard deviations of μ1 and μ2, respectively.

[0055] Preferably, the self-attention feature vector and interaction feature vector of the drug pair are concatenated and input into a multilayer perceptron to predict the interaction between the drug pairs. The calculation method is as follows:

[0056] y = MLP([inter1||inter2||H1])

[0057] Where H1 is the self-attention feature vector of the drug pair, and inter1 and inter2 are the interaction feature vectors of the drug pair.

[0058] Preferably, the multilayer perceptron uses the cross-entropy loss function as the model's loss function:

[0059]

[0060] Among them, y i For the output of the i-th drug pair; y′ i ∈{0,1} is the label of the i-th drug pair; σ(·) is the sigmoid function, and n is the number of drug pairs.

[0061] As a general technical concept, the present invention also provides a drug interaction prediction system based on graph neural networks and multiple attention mechanisms, comprising:

[0062] The GNN encoder module is used to convert the SMILES sequences of drug pairs into graph data and obtain the embedding matrix of drug pairs using multi-layer GIN operations.

[0063] The self-attention mechanism encoder is used to extract the self-attention feature matrix of drug pairs from the drug embedding matrix, calculate the cosine similarity matrix of drug pairs, and obtain the self-attention feature vector of drug pairs after flattening operation.

[0064] An interactive attention mechanism encoder is used to process the embedding matrix of drug pairs, obtain a feature matrix with interactive attention coefficients, perform average pooling on the interactive attention coefficient feature matrices of the two drugs respectively, and then standardize them to obtain the interactive feature vector of the drug pair.

[0065] The concatenation prediction module concatenates the self-attention feature vectors and interaction feature vectors of the drug pairs and inputs them into the multilayer perceptron to predict the interactions between the drug pairs.

[0066] The present invention has the following beneficial effects:

[0067] This invention presents a drug interaction prediction method and system based on graph neural networks and multiple attention mechanisms. By applying the Transformer to drug interaction prediction, it improves accuracy compared to traditional GNN architecture methods. It employs self-attention and inter-cross-attention mechanisms, distributing attention to a specific region around the sampling point rather than globally in the drug interaction prediction task, thus improving model training efficiency. Simply using self-attention or inter-cross-attention mechanisms alone has limitations in drug interaction prediction. This invention combines the two, using a self-attention encoder (GSAT) and an inter-cross-attention encoder (GIAT) to acquire drug features for better prediction of drug interactions, thereby achieving superior prediction results. Attached Figure Description

[0068] The accompanying drawings, which form part of this application, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:

[0069] Figure 1 This is a flowchart illustrating a preferred embodiment of the drug interaction prediction method based on graph neural networks and multiple attention mechanisms of the present invention.

[0070] Figure 2 This is a schematic diagram of the structure of a drug interaction prediction device based on graph neural networks and multiple attention mechanisms according to a preferred embodiment of the present invention;

[0071] Figure 3 This is a schematic diagram of the structure of the Self Attention Mechanism Encoder (GSAT) based on the drug interaction prediction method using graph neural networks and multiple attention mechanisms according to a preferred embodiment of the present invention.

[0072] Figure 4This is a schematic diagram of the interactive attention mechanism encoder (GIAT) based on a preferred embodiment of the drug interaction prediction method using graph neural networks and multiple attention mechanisms of the present invention. Detailed Implementation

[0073] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings, but the present invention can be implemented in many different ways as defined and covered by the claims.

[0074] See Figure 1 The drug interaction prediction method based on graph neural networks and multiple attention mechanisms according to embodiments of the present invention includes the following steps:

[0075] S1: Transform the SMILES sequences of the drug pairs into graph data (implemented using RDKit), and obtain the drug embedding matrix using multi-layer GIN operations. Before applying the multi-layer GIN operations, the node dimension of the drugs is first transformed to 60 using a linear layer.

[0076] In practice, multi-layer GIN operations include: using GIN to aggregate the information of the neighboring nodes of drug atoms through multi-layer GIN to obtain the embedding matrix of drug pairs. The calculation method is as follows:

[0077] The GNN aggregates neighbor node features in the following way:

[0078]

[0079] The specific calculation method of GIN is as follows: The method of aggregating the features of layer l in the (l+1)th layer is as follows:

[0080]

[0081] The formula for GIN feature update is as follows:

[0082] MLP(h)=f (K) (f (K-1) (…f (1) (h)…))

[0083] f (k) (h)=ReLU(BN (k) (FC (k) (h)))

[0084] FC (k) (h)=hW (k) +b (k)

[0085] in, Let ν be the hidden state of node ν after the update at level l+1; It is a function that accepts the current hidden state and the aggregated message; Let ν be the hidden state of node ν at layer l. It is a function that aggregates messages from the neighborhood; Let ν be the set of neighbors of node ν; This represents a pair consisting of the hidden states of node ν and its neighbor node u at level l. This indicates that a multilayer perceptron (MLP) is applied to the input h. This represents the activation functions of each layer in an MLP; This represents the computation result of the fully connected layer on the k-th layer for input h; h represents the input vector. This represents the weight matrix of the k-th layer; The bias vector of the k-th layer.

[0086] S2A: The self-attention feature matrix of drug pairs is extracted from the drug embedding matrix by the self-attention mechanism encoder (GSAT), the cosine similarity matrix of drug pairs is calculated, and the self-attention feature vector of drug pairs is obtained after flattening operation.

[0087] In implementation, a self-attention mechanism encoder extracts the self-attention feature matrix of drug pairs from the drug embedding matrix. This includes obtaining the keys and values ​​of individual drugs, calculating the self-attention score between drug substructures using the Transformer method, and obtaining the embedding matrix of the drug pairs. Obtain the self-attention feature matrix:

[0088] For a single drug, first use W K and W V For input The transformation yields a key (K) and value (V) matrix. The `to_dense_batch` function processes the keys and values, converting them to a dense batch format and generating a mask to handle the varying sizes of different batches. The processing method is as follows:

[0089] Q = Q0W Q K = K0W K V = V0W V

[0090] Attention scores are calculated using the dot product of query (Q) and key (K), and adjusted using a softmax function to better predict drug-drug interactions. The calculation method is as follows:

[0091]

[0092] Multiply the obtained attention coefficient matrix A by the original feature matrix X to obtain the self-attention feature matrix;

[0093] The calculation process for using the ReLU function to perform nonlinear transformation is as follows:

[0094] O = ReLU((Q + AV)W0)

[0095] Where Q, K, and V represent query, key, and value, respectively; d represents the embedding dimension; the function ReLU() represents the corrected linear unit activation function; W Q W K W V W0 represents the learnable weights.

[0096] In practice, the cosine similarity matrix of the drug pairs is calculated, and after a flattening operation, the self-attention feature vectors of the drug pairs are obtained to better predict drug interactions. The calculation formula is as follows:

[0097]

[0098] H1 = flatten(S) ij )

[0099] Where, when the feature embedding matrices of the drug pair are x1 and x2 respectively, for feature embedding matrices x1 and x2, where It is the representative vector of the i-th drug 1. H1 is the j-th representative vector of drug 2, and H1 is the self-attention feature vector of the drug pair. S ij is the cosine similarity matrix of the drug pairs.

[0100] S2B: See Figure 3 The embedding matrix of the drug pair is processed by the interactive attention mechanism encoder (GIAT) to obtain the feature matrix with interactive attention coefficients. The feature matrices of the two drugs are then averaged and pooled before being standardized to obtain the interactive feature vector of the drug pair.

[0101] In implementation, the embedding matrix of the drug pairs is processed by an interactive attention mechanism encoder to obtain a feature matrix with interactive attention coefficients, including:

[0102] Obtain the keys and values ​​of the two drug matrices, calculate the interaction attention score between one drug and the other drug substructure, multiply it by the original feature matrix X of the drugs, and obtain the interaction attention coefficient feature matrix:

[0103] The feature embedding matrices x1 and x2 of the drug pair are weighted by different weight matrices W. K and W V It is converted into a vector of keys (K) and values ​​(V), and the calculation formula is:

[0104] K1 = W K (x1),V1=W V (x1)

[0105] K2 = W K (x2),V2=W V (x2)

[0106] The `to_dense_batch` function processes the key (K) and value (V) of two drugs, converting them to a dense batch format and generating a mask to handle different batch sizes. Inter-cross attention scores are calculated using the dot product of query (Q) and key (K), and a softmax function is applied to adjust the scores. The calculation method for a specific drug pair is as follows:

[0107]

[0108] The obtained interactive attention coefficient feature matrix is ​​multiplied element-wise with the embedding matrix of the drug pair. This process can be summarized as follows: The calculation method is as follows:

[0109] O1 = ReLU(W O ((Q1+A1V2))), O2=ReLU(W O ((Q2+A2V1)))

[0110] The resulting interactive attention coefficient feature matrices are O1 and O2.

[0111] In practice, the feature matrices of the two drugs are averaged and then standardized to obtain the interaction feature vectors of the drug pairs. This includes the following steps:

[0112] The interactive attention coefficient feature matrices O1 and O2 obtained after processing by the interactive attention mechanism are subjected to average pooling and then standardization. First, the mean μ1 and μ2 are calculated using the following formulas:

[0113] μ1=mean(O1,1),μ2=mean(O2,1)

[0114] Calculate the mean and standard deviation of each drug pair: mean1, std1, mean2, and std2, using the following formulas:

[0115] mean1=mean(μ1,1,keepdim=True),std1=std(μ1,1,keepdim=True)

[0116] mean2=mean(μ2,1,keepdim=True),std2=std(μ2,1,keepdim=True)

[0117] Finally, after standardization, we obtain the interaction feature vectors inter1 and inter2 of the drug pairs, which are calculated using the following formula:

[0118]

[0119] Where, inter1 and inter2 represent the interaction vectors between different drugs; mean1 and mean2 represent the average values ​​of μ1 and μ2, respectively; std1 and std2 represent the standard deviations of μ1 and μ2, respectively.

[0120] S3: See also Figure 4 The self-attention feature vector and interaction feature vector of the drug pair are concatenated and input into a multilayer perceptron to predict the interaction between the drug pairs.

[0121] In practice, the self-attention feature vector and interaction feature vector of the drug pair are concatenated and input into a multilayer perceptron to predict the interaction between the drug pairs. The calculation method is as follows:

[0122] y = MLP([inter1||inter2||H1])

[0123] Where H1 is the self-attention feature vector of the drug pair, and inter1 and inter2 are the interaction feature vectors of the drug pair.

[0124] In practice, the multilayer perceptron uses the cross-entropy loss function as the model's loss function:

[0125]

[0126] Among them, y i For the output of the i-th drug pair; y′ i ∈{0,1} is the label of the i-th drug pair; σ(·) is the sigmoid function, and n is the number of drug pairs.

[0127] By employing a multilayer perceptron, we can better learn the interaction patterns between drugs, thereby enabling better prediction of drug interactions.

[0128] See Figure 2 This invention also provides a drug interaction prediction system based on graph neural networks and multiple attention mechanisms, comprising:

[0129] The GNN encoder module is used to convert the SMILES sequences of drug pairs into graph data and obtain the embedding matrix of drug pairs using multi-layer GIN operations.

[0130] The self-attention mechanism encoder is used to extract the self-attention feature matrix of drug pairs from the drug embedding matrix, calculate the cosine similarity matrix of drug pairs, and obtain the self-attention feature vector of drug pairs after flattening operation.

[0131] An interactive attention mechanism encoder is used to process the embedding matrix of drug pairs, obtain a feature matrix with interactive attention coefficients, perform average pooling on the interactive attention coefficient feature matrices of the two drugs respectively, and then standardize them to obtain the interactive feature vector of the drug pair.

[0132] The concatenation prediction module concatenates the self-attention feature vectors and interaction feature vectors of the drug pairs and inputs them into the multilayer perceptron to predict the interactions between the drug pairs.

[0133] Effect verification:

[0134] Table 1 shows the experimental results of MSDAFL and other baseline methods of this invention on multiple datasets. In the comparative experiments, ten state-of-the-art methods were compared: MR-GNN, GCN-BMP, EPGCN-DS, DeepDruga, SSI-DDI, CSGNN, DeepDDS, DSN-DDI, and HTCL. Specifically: Mr-GNNXu et al. (2019) employed a multi-resolution architecture to capture local features of each graph and extract interaction features between paired graphs. Chen et al. (2020) used an end-to-end graph representation learning framework to perform DDI prediction using GNNs. Sun et al. (2020) used an encoder with expressive GCN layers and a decoder that outputs DDI probabilities to detect DDI from molecular structures. Cao et al. (2020) used residual graph convolutional networks (RGCNs) and convolutional networks (CNNs) to improve the accuracy of DDI prediction. Miracle, Wang et al. (2021) provided a multi-view framework that simultaneously captures intermolecular molecular structure and intermolecular drug-drug interactions (DDI). SSI-DDI Nyamabo et al. (2021) deconstructed the DDI prediction task between two drugs to determine pairwise interactions between their respective substructures. CSGNN Zhao et al. (2021) incorporated a hybrid skip neighborhood aggregator into a GNN to capture high-order dependencies in the DDI network and utilized a contrastive self-supervised learning task as a regularizer. DeepDDS Wang et al. (2022) is a deep learning model that uses a GNN and an attention mechanism to identify synergistic drug combinations. DSN-DDI Li et al. (2023) is a dual-view drug representation learning network designed to learn drug substructures simultaneously from individual drugs and drug pairs. HTCL-DDI Zhang et al. (2023) is a hierarchical three-view contrastive learning framework for predicting drug-drug interactions.

[0135] To evaluate the scalability and robustness of MSDAFL, the model of this invention was tested on three public datasets of different sizes and densities. The size of the datasets was determined by the number of drugs included. Observed drug pairs (DDIs) were used as positive samples, and non-existent DDIs were randomly sampled to generate negative samples. A hierarchical split was performed, dividing all drug pairs into training, validation, and test sets in a 6:2:2 ratio. Experiments were conducted on three randomized folds. As shown in Supplementary Table 1, the statistics of the preprocessed datasets are as follows: Zhang DDI dataset (Zhang et al., 2017) is small, consisting of 544 drugs and 45,720 DDI pairs. ChCh-Miner dataset (Ma et al., 2018) is medium-sized, consisting of 997 drugs and 21,486 DDI pairs. DeepDDI dataset (Gilmer et al., 2017) is large-scale, consisting of 1,704 drugs and 191,870 DDI pairs.

[0136] Table 1. Experimental results of the MSDAFL of this invention and other baseline methods on multiple datasets.

[0137]

[0138] As shown in Table 1, the MSDAFL of this invention consistently demonstrates superior performance across multiple evaluation metrics and datasets. On the Zhang DDI dataset, HTCL-DDI achieves outstanding results in AP and F1 metrics by utilizing different view relationships and integrating multi-view features for DDI prediction. On the ChCh-Miner and DeepDDI datasets, MSDAL shows significant improvements compared to HTCL. For example, on DeepDDI, MSDAFL improves AUROC by approximately 5% and ACC by approximately 6%. SSI-DDI deconstructs the DDI prediction task between drug pairs to identify pairwise interactions between their respective substructures.

[0139] In summary, the drug interaction prediction method and system based on graph neural networks and multiple attention mechanisms of this invention apply Transformer to drug interaction prediction, improving accuracy compared to traditional GNN architecture methods. It utilizes self-attention and inter-cross-attention mechanisms, distributing attention to a specific region around the sampling point rather than globally in the drug interaction prediction task, thus improving model training efficiency. Simply using self-attention or inter-cross-attention mechanisms alone has limitations in drug interaction prediction. This invention combines the two, using a self-attention encoder (GSAT) and an inter-cross-attention encoder (GIAT) to acquire drug features for better prediction of drug interactions, thereby achieving better prediction results.

[0140] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for predicting drug interactions based on graph neural networks and multiple attention mechanisms, characterized in that, Includes the following steps: The SMILES sequences of drug pairs are converted into graph data, and the embedding matrix of drug pairs is obtained by multi-level GIN operation. The self-attention mechanism encoder extracts the self-attention feature matrix of drug pairs from the drug embedding matrix; the cosine similarity matrix of the drug pairs is calculated, and after flattening, the self-attention feature vector of the drug pairs is obtained. The calculation formula is as follows: Wherein, when the feature embedding matrices of the drug pair are respectively and When, for the feature embedding matrix and ,in It is the representative vector of the i-th drug 1. It is the j-th representative vector of drug 2. Let be the self-attention feature vector of the drug pair. Let be the cosine similarity matrix of the drug pairs; The embedding matrix of the drug pair is processed by an interactive attention mechanism encoder to obtain a feature matrix with interactive attention coefficients. The interactive attention coefficient feature matrices of the two drugs are then subjected to average pooling and standardization to obtain the interactive feature vector of the drug pair. This process includes the following steps: The interaction attention coefficient feature matrix obtained after processing by the interaction attention mechanism and After performing average pooling and then standardization, the mean is calculated first. 1, 2. The calculation formula is as follows: Calculate the mean and standard deviation of each drug pair: mean1, std1, mean2, and std2, using the following formulas: Finally, after standardization, we obtain the interaction feature vectors inter1 and inter2 of the drug pairs, which are calculated using the following formula: Where inter1 and inter2 represent the interaction vectors between different drugs; mean1 and mean2 respectively represent... and The average value; std1 and std2 represent the average values ​​respectively. and Standard deviation; The self-attention feature vectors and interaction feature vectors of drug pairs are concatenated and input into a multilayer perceptron to predict the interactions between drug pairs.

2. The prediction method according to claim 1, characterized in that, Before using multi-layer GIN operations, the node dimension of the drug is first transformed to 60 using a linear layer.

3. The prediction method according to claim 1 or 2, characterized in that, The multi-layer GIN operation includes: using GIN to aggregate the information of the neighboring nodes of drug atoms through multi-layer GIN to obtain the embedding matrix of drug pairs. The calculation method is as follows: The GNN aggregates neighbor node features in the following way: The specific calculation method of GIN is as follows: The method of aggregating the features of layer l in the (l+1)th layer is as follows: The formula for GIN feature update is as follows: in, Let ν be the hidden state of node ν after the update at level l+1; It is a function that accepts the current hidden state and the aggregated message; Let ν be the hidden state of node ν at layer l. It is a function that aggregates messages from the neighborhood; Let ν be the set of neighbors of node ν; This represents a pair consisting of the hidden states of node ν and its neighbor node u at level l. This indicates that a multilayer perceptron (MLP) is applied to the input h. Represents the activation functions of each layer in an MLP; This represents the computation result of the fully connected layer on the k-th layer for input h; h represents the input vector. This represents the weight matrix of the k-th layer; The bias vector of the k-th layer.

4. The prediction method according to claim 2, characterized in that, The step of extracting the self-attention feature matrix of drug pairs from the drug embedding matrix using a self-attention mechanism encoder includes: obtaining the keys and values ​​of individual drugs, calculating the self-attention score between drug substructures using the Transformer method, and multiplying it by the embedding matrix of the drug pairs. Obtain the self-attention feature matrix: For a single drug, first use and For input The transformation yields a key (K) and value (V) matrix. The `to_dense_batch` function processes the keys and values, converting them to a dense batch format and generating a mask to handle the varying sizes of different batches. The processing method is as follows: The attention score is calculated using the dot product of the query (Q) and the key (K), and the score is adjusted using the softmax function. The calculation method is as follows: Multiply the obtained attention coefficient matrix A by the original feature matrix X to obtain the self-attention feature matrix; The calculation process for using the ReLU function to perform nonlinear transformation is as follows: Where Q, K, and V represent query, key, and value, respectively; d represents the embedding dimension; the function ReLU() represents the corrected linear unit activation function; W Q W K W V W0 represents the learnable weights.

5. The prediction method according to claim 1, characterized in that, The embedding matrix of the drug pair is processed by an interactive attention mechanism encoder to obtain a feature matrix with interactive attention coefficients, including: Obtain the keys and values ​​of the two drug matrices, calculate the interaction attention score between one drug and the other drug substructure, multiply it by the original feature matrix X of the drugs, and obtain the interaction attention coefficient feature matrix: Feature embedding matrix of drug pairs and Through different weight matrices and It is converted into a vector of keys (K) and values ​​(V), and the calculation formula is: The `to_dense_batch` function processes the key (K) and value (V) of two drugs, converting them to a dense batch format and generating a mask to handle different batch sizes. Interactive attention scores are calculated using the dot product of query (Q) and key (K), and then applied. The function is used to adjust the score; the calculation method for a specific drug pair is as follows: The obtained interactive attention coefficient feature matrix is ​​multiplied element-wise with the embedding matrix of the drug pair. This process can be summarized as follows: The calculation method is as follows: The obtained interaction attention coefficient feature matrix and .

6. The prediction method according to claims 1 to 1, characterized in that, The self-attention feature vector and interaction feature vector of the drug pair are concatenated and input into a multilayer perceptron to predict the interaction between the drug pairs. The calculation method is as follows: in, Let inter1 be the self-attention feature vector of the drug pair, and inter2 be the interaction feature vector of the drug pair.

7. The prediction method according to claims 6 to 1, characterized in that, The multilayer perceptron uses the cross-entropy loss function as the model's loss function: in, This is the output for the i-th drug pair; ∈{0,1} is the label of the i-th drug pair; σ(·) is the sigmoid function, and n is the number of drug pairs.

8. A drug interaction prediction system based on graph neural networks and multiple attention mechanisms, characterized in that, include: The GNN encoder module is used to convert the SMILES sequences of drug pairs into graph data and obtain the embedding matrix of drug pairs using multi-layer GIN operations. The self-attention mechanism encoder is used to extract the self-attention feature matrix of drug pairs from the drug embedding matrix; the cosine similarity matrix of the drug pairs is calculated, and after flattening, the self-attention feature vector of the drug pairs is obtained. The calculation formula is as follows: Wherein, when the feature embedding matrices of the drug pair are respectively and When, for the feature embedding matrix and ,in It is the representative vector of the i-th drug 1. It is the j-th representative vector of drug 2. Let be the self-attention feature vector of the drug pair. Let be the cosine similarity matrix of the drug pairs; An interactive attention mechanism encoder is used to process the embedding matrix of drug pairs to obtain a feature matrix with interactive attention coefficients. The interactive attention coefficient feature matrices of the two drugs are then subjected to average pooling and normalization to obtain the interactive feature vector of the drug pairs. This process includes the following steps: The interaction attention coefficient feature matrix obtained after processing by the interaction attention mechanism and After performing average pooling and then standardization, the mean is calculated first. 1, 2. The calculation formula is as follows: Calculate the mean and standard deviation of each drug pair: mean1, std1, mean2, and std2, using the following formulas: Finally, after standardization, we obtain the interaction feature vectors inter1 and inter2 of the drug pairs, which are calculated using the following formula: Where inter1 and inter2 represent the interaction vectors between different drugs; mean1 and mean2 respectively represent... and The average value; std1 and std2 represent the average values ​​respectively. and Standard deviation; The concatenation prediction module concatenates the self-attention feature vectors and interaction feature vectors of the drug pairs and inputs them into the multilayer perceptron to predict the interactions between the drug pairs.

Citation Information

Patent Citations

  • Deep learning drug interaction prediction method and device, medium and equipment

    CN114530258A

  • TransGAT-based drug-target interaction prediction method

    CN116312808A