Drug-drug interaction prediction method based on time step attention map neural network
The Time-Step Attention Graph Neural Network (TSA-GNN) addresses the semantic deviation and cold-start problems in drug-drug interaction prediction, achieving more accurate and efficient drug feature representation, thereby improving the efficiency of drug safety assessment and the speed of clinical application of new drugs.
Patent Information
- Application Number
- CN202511578488.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-31
- Publication Date
- 2026-01-09
AI Technical Summary
Existing graph neural networks suffer from semantic deviation of drug nodes and cold start problems in drug-drug interaction prediction, resulting in low prediction accuracy and efficiency.
We employ a temporal attention graph neural network (TSA-GNN) to balance semantic preservation and new information acquisition of drug nodes through a temporal attention mechanism, and utilize the drug similarity propagation mechanism to effectively represent new drug features in cold start scenarios.
It improves the accuracy and efficiency of drug interaction prediction, especially showing significant advantages in cold-start scenarios, supporting the safety assessment of new drugs and accelerating their clinical application.
Smart Images

Figure CN121306325A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of drug safety assessment technology and deep learning, specifically to a drug-drug interaction prediction method based on a time-step attention graph neural network. Background Technology
[0002] With the widespread use of combination therapies in clinical practice, drug-drug interactions (DDIs) have become a key factor affecting patient safety. The rate of adverse reactions caused by multidrug combination therapy increases significantly with the number of drugs used, not only endangering patient health but also resulting in a significant waste of medical resources. Accurate prediction of DDIs is crucial for drug safety monitoring and new drug development, effectively preventing potential adverse reactions, reducing medical costs, and accelerating the new drug approval process.
[0003] Traditional laboratory research and clinical trials for identifying drug discovery defects (DDIs) suffer from high costs and long processing times, making computational methods, especially deep learning techniques, a hot research topic in this field. Graph Neural Networks (GNNs), with their advantage in processing graph-structured data, are widely used for DDI prediction. They represent drugs and their interactions as graph structures, learning drug features and predicting interaction relationships through message passing. However, existing GNN methods have two major drawbacks: first, drug nodes are prone to deviating from their original semantics during the iterative aggregation of neighbor information; second, they rely on graph structure connections, resulting in a significant performance drop in cold-start scenarios (predicting DDIs containing new drugs), where new drug features cannot be effectively represented.
[0004] Therefore, developing a DDI prediction method that can balance the preservation of original semantics with the acquisition of new information and effectively solve the cold start problem is of great significance for improving the efficiency of drug safety assessment. Summary of the Invention
[0005] The purpose of this invention is to overcome the shortcomings of existing technologies and provide a drug-drug interaction prediction method based on a time-step attention graph neural network (TSA-GNN). The TSA-GNN improves upon existing methods through two main mechanisms: first, the time-step attention mechanism assigns adaptive weights to the intermediate representations of neighbor aggregations, balancing the preservation of original semantics with the acquisition of new information; second, the drug similarity propagation mechanism integrates drug similarity features during training, allowing new drugs to be effectively represented through first- and second-order similarity during inference. This addresses the semantic deviation and cold-start problems inherent in existing GNN models for drug-drug interaction (DDI) prediction.
[0006] To achieve the above objectives, the present invention provides the following technical solution:
[0007] A drug-drug interaction prediction method based on a time-step attention graph neural network includes the following steps:
[0008] S1. Constructing a multi-dimensional drug knowledge graph: Based on drug-chemical entity datasets, drug-substructure datasets, drug-drug interaction datasets, and drug-molecular structure datasets, four complementary knowledge graphs are constructed to capture the chemical entity associations, molecular substructure composition, drug interaction relationships, and molecular structure attribute information of drugs, respectively.
[0009] S2. Drug Feature Learning: The four knowledge graphs are processed by four independent GNN modules. Each GNN module is configured with multiple time steps. A GRU-like gating mechanism is used to update the drug features at each time step. The weights of each time step are calculated and weighted by a time step attention mechanism. Then, similar drug features are integrated by combining a drug similarity fusion strategy. Finally, the output of the four GNN modules is fused to obtain a comprehensive drug feature representation.
[0010] S3. DDI prediction during training phase: The feature representation of the drug pairs to be predicted is processed by a collaborative attention mechanism. The bidirectional importance weights between drugs are calculated through query-key-value transformation. After updating the feature representation, the result is input into the fully connected layer and the prediction result is output.
[0011] S4. Inference Stage DDI Prediction: For drug pairs containing new drugs, the most similar drugs in the training set are identified based on the Jaccard similarity algorithm. The new drug features are obtained by aggregating the comprehensive drug feature representation, and the results are output through the prediction process in step S3.
[0012] This is a further optimization of a drug-drug interaction prediction method based on a time-step attention graph neural network.
[0013] Preferably, the knowledge graph in step S1 is constructed as follows: each knowledge graph is a graph structure, in which drugs are the core nodes, the corresponding associated entities, substructures, other drugs or molecular attributes are the neighbor nodes, and the association, inclusion, interaction or attribute relationships between nodes are the edges.
[0014] Preferably, the drug feature update formula for each time step in step S2 is:
[0015]
[0016] In this equation, Indicates drug In the passage Time step eigenvectors, where It is the embedded dimension; This represents the features of the previous time step; Indicates drug node Feature information aggregated from its two neighbors; ,in It is the total number of drugs; Indicates the time step index; This represents the channel index corresponding to four different knowledge graphs; GRU refers to the gated recurrent unit mechanism, which is used to control the information update process.
[0017] Preferably, the time-step attention mechanism calculation in step S2 includes:
[0018] E1. Calculate the similarity score to assess the degree of preservation of the original semantics of the features, and calculate the information gain score to assess the increment of new information;
[0019] The similarity score is used to assess how well a feature retains its original semantics.
[0020]
[0021] Information gain score: Used to evaluate the new information increment introduced at each time step.
[0022]
[0023] E2. To ensure comparability between scores on different scales, the two scores are normalized separately:
[0024]
[0025] E3. Calculate the attention weights at each time step using the softmax function:
[0026]
[0027] in It is a learnable parameter used to adjust the relative importance of similarity score and information gain score;
[0028] Time-step feature fusion: Fusion of multiple time-step features based on attention weights:
[0029] .
[0030] Preferably, the drug similarity fusion strategy in step S2 is as follows: In each knowledge graph, the set of drugs most similar to each drug is identified using the Jaccard similarity algorithm, and the drug's own features and similar drug features are weighted and fused, with the following formula:
[0031]
[0032] in Indicates related to drugs The most similar set of drugs These are learnable parameters;
[0033] The outputs of the four GNN modules are fused through a fusion layer to generate a comprehensive drug feature representation:
[0034]
[0035] FL stands for Fusion Layer Operation, which includes attention mechanisms and nonlinear transformations, used to integrate complementary information from different knowledge graphs.
[0036] Preferably, the processing procedure of the collaborative attention mechanism in step S3 is as follows:
[0037] The features of drug pair (A,B) are transformed by query (Q), key (K), and value (V) respectively;
[0038] The mechanism for calculating the attention weight from drug A to drug B uses query (Q), key (K), and value (V) transformations to calculate the importance weight:
[0039]
[0040]
[0041] Attention shifted from drug B to drug A is calculated as follows:
[0042]
[0043] Update drug feature representation based on attention weights:
[0044]
[0045] Finally, DDI prediction is performed after fusion:
[0046] .
[0047] Preferably, the method for obtaining new drug features in step S4 is as follows: the new drug obtains feature representation by aggregating first-order similarity relations (features of directly similar drugs) and second-order similarity relations (indirect features of similar drugs of similar drugs), wherein both the first-order and second-order similarity relations are identified from four knowledge graphs based on the Jaccard similarity algorithm.
[0048] Preferably, the method is applicable to three scenarios: hot start (old drug-old drug), semi-cold start (new drug-old drug), and complete cold start (new drug-new drug). The corresponding dataset partitioning methods are as follows: the hot start scenario uses 5-fold hierarchical cross-validation, the semi-cold start scenario ensures that the test set drug pairs contain one new drug and one old drug, and the complete cold start scenario ensures that all test set drug pairs are combinations of new drugs.
[0049] Beneficial effects
[0050] This invention solves the semantic deviation problem of drug nodes through a time-step attention mechanism, breaks through the feature representation bottleneck in cold-start scenarios through a two-stage similarity propagation mechanism, and achieves comprehensive drug feature learning by combining a multi-dimensional knowledge graph.
[0051] This invention proposes a Temporal Step Attention Graph Neural Network (TSA-GNN) model, a graph neural network framework that utilizes multiple knowledge graphs for Drug Discovery Injection (DDI) prediction. For known drugs, the temporal step attention mechanism balances semantic bias and information acquisition; similar drug feature fusion provides an additional information acquisition method beyond graph connectivity for drug feature learning. For new drugs, a two-stage similarity propagation mechanism achieves efficient representation of new drug features through first-order and second-order similarity relationships, overcoming the challenges of cold-start scenarios.
[0052] As the proportion of novel drugs in drug-to-drug pairs increases, TSA-GNN demonstrates increasingly significant advantages over baseline models, with the most pronounced advantage observed in a completely cold-start scenario. This method provides effective technical support for the safety assessment of new drugs, and is expected to accelerate the clinical application of new drugs while improving patient medication safety. Attached Figure Description
[0053] Figure 1 This demonstrates the forward propagation process of TSA-GNN during the training phase;
[0054] Figure 2 The reasoning process of the model is demonstrated;
[0055] Figure 3 This is a radar chart comparison of the four models in Task 2 across 65 types of drug interactions;
[0056] Figure 4 (a) and (b) are box plots of AUPR and Precision scores for the four models in Task 2, respectively.
[0057] Figure 5 This is a comparative analysis of the AUPR performance of the four models in Task 3, (a) the cumulative distribution function (CDF) of AUPR values, and (b) the AUPR ranking distribution of each model in 65 drug interaction categories;
[0058] Figure 6 This is a comparative analysis of the accuracy performance of the four models in Task 3, (a) the cumulative distribution function (CDF) of accuracy values, and (b) the accuracy ranking distribution of each model in 65 drug interaction categories. Detailed Implementation
[0059] To make the above-mentioned objectives, features, and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to examples. The following content is merely an example and illustration of the concept of the present invention. Those skilled in the art can make various modifications or additions to the described specific embodiments or use similar methods to replace them, as long as they do not deviate from the concept of the invention, they should all fall within the protection scope of the present invention.
[0060] The preparation method of the present invention will be described below through specific embodiments and comparative examples.
[0061] Example
[0062] (1) Dataset preparation
[0063] This invention uses two types of data sources: one is an SQLite relational database extraction table containing 572 drugs, 37,624 drug pairs, and 65 DDI relation categories; the other is four types of datasets: drug-chemical entity, drug-substructure, drug-drug interaction, and drug-molecular structure, used to construct a knowledge graph.
[0064] (2) Knowledge Graph Construction
[0065] The construction rules for the four knowledge graphs are as follows:
[0066] Drug-Chemical Entity Knowledge Graph: Drugs are the core nodes, related chemical entities are the neighboring nodes, and the relationships are the edges;
[0067] Drug-Substructure Knowledge Graph: Drugs are the core nodes, molecular chemical substructures are the neighbor nodes, and inclusion relationships are the edges;
[0068] Drug-Drug Knowledge Graph: Drugs are the core nodes, other drugs that interact with each other are the neighbor nodes, and the interaction relationships are the edges;
[0069] Drug-Molecular Structure Knowledge Graph: Drugs are the core nodes, molecular structure attributes are the neighbor nodes, and attribute relationships are the edges.
[0070] (3) Model parameter settings
[0071] The Adam optimizer was used with a learning rate of 0.01 and a weight decay of 1e-8. The GNN layer embedding dimension was 128, the neighbor sampling size was 2, and the dropout rate was 0.3. The batch size was 1024, and the training lasted for 120 epochs. Each GNN module had 3 time steps. The initial values of the time step attention mechanism balance coefficient α and the drug similarity fusion coefficient β were both learnable parameters.
[0072] (4) Model training and inference
[0073] Training phase: The four GNN modules process the corresponding knowledge graphs respectively, fuse multi-time step features through time step attention mechanism, and then fuse similar drug features and multi-channel features to obtain comprehensive drug features; a collaborative attention mechanism is used to process drug pair features, and the fully connected layer outputs the prediction results.
[0074] Inference phase: For known drugs, the pre-trained comprehensive features are directly invoked; for new drugs, the Jaccard similarity algorithm is used to identify similar drugs from four knowledge graphs, and the first-order and second-order similarity features are aggregated to obtain the features of the new drug. The prediction results are then output through a collaborative attention mechanism and a fully connected layer.
[0075] (5) Scene adaptation
[0076] Hot start scenario: Using 5-fold stratified cross-validation, predict the DDI of new combinations of known drugs;
[0077] Semi-cold start scenario: The test set of drug pairs includes one new drug and one old drug to verify the DDI prediction ability of the new drug and the known drugs;
[0078] Complete cold start scenario: The test set consists of new drug combinations to verify the predictive performance under extreme cold start conditions.
[0079] Test Results and Analysis
[0080] To effectively model drug characteristics and predict drug-drug interactions, we first constructed four complementary knowledge graphs to capture multidimensional drug information. These knowledge graphs collectively provide a rich structured data foundation for TSA-GNN, enabling the model to comprehensively understand drug properties.
[0081] Each knowledge graph is essentially a graph structure. In a drug-chemical entity knowledge graph, each drug is considered a node, and chemical entities related to the drug are considered its neighbors, with the relationships being considered edges. In a drug-substructure knowledge graph, each drug is considered a node, and the chemical substructures that make up the drug molecule are considered its neighbors, with inclusion relationships being considered edges. In a drug-drug knowledge graph, each drug is considered a node, and other drugs that interact with it are considered its neighbors, with interaction relationships being considered edges. In a drug-molecular structure knowledge graph, each drug is considered a node, and the molecular structural attributes that describe the drug's properties are considered its neighbors, with attribute relationships being considered edges.
[0082] TSA-GNN consists of two components: a feature learning component (part 1) and a prediction component (part 2). Figure 1 The forward propagation process of TSA-GNN during the training phase is demonstrated.
[0083] Part 1 illustrates the learning process of drug feature representations during the training phase. Four different knowledge graphs are processed by four independent GNN modules (GNN1-GNN4), forming four information processing channels (channels 0-3). Each GNN is configured with three time steps. At each time step, a gating mechanism similar to a gated recurrent unit (GRU) is used to aggregate new neighbor information for the drug node based on the previous time step. By balancing the degree to which drug node features retain their original semantics with the information gain magnitude of each time step, different weights are assigned to different time steps. Finally, the drug node features from all time steps are weighted and fused. Subsequently, based on the different knowledge graphs, the Jaccard similarity algorithm is used to identify the most similar drug for each drug node. The model further enhances the drug node feature representation by weightedly fusing the drug's own features with the features of its most similar drug. Finally, the outputs of these four channels are merged through a fusion layer to generate the final drug node feature representation.
[0084] Part 2 illustrates the DDI prediction process during the training phase. For the drug pair to be predicted (drug A and drug B), their feature representations are located from the drug feature space generated in Part 1. Then, they are processed through a collaborative attention mechanism, enabling the two drugs in the pair to focus on important elements in each other's feature vectors. Finally, the processed features of drug A and drug B are input into a fully connected layer to output the prediction result.
[0085] Figure 2 The reasoning process of the model is demonstrated. For the drug pair to be predicted (drug C and drug D), if both are known drugs, their feature representations are directly located from the drug feature space generated in Part 1. If a new drug exists, denoted as drug X (X ∈ {C, D}), the Jaccard similarity algorithm is used to identify the drug most similar to drug X in the training set based on different knowledge graphs, and then... Figure 1 In the generated drug feature space of Part 1, the features of the most similar drugs are located and aggregated to obtain the feature representation of drug X.
[0086] Task 1
[0087] Table 1: Overall performance comparison of different models in Task 1
[0088] index TSA-GNN MKG-FENN ACDGNN MDF-SA-DDI DNN RF KNN LR ACC 0.9415 0.9409 0.9275 0.9301 0.8797 0.7775 0.7214 0.7920 AUPR 0.9803 0.9786 0.9801 0.9737 0.9134 0.8349 0.7716 0.8400 AUC 0.9953 0.9989 0.9942 0.9989 0.9963 0.9956 0.9813 0.9960 F1 0.9118 0.8958 0.8818 0.8878 0.7223 0.5936 0.4831 0.5948 Pre 0.9280 0.9132 0.9099 0.9085 0.8047 0.7893 0.7174 0.7437 Rec 0.8863 0.8876 0.8760 0.8790 0.7027 0.5161 0.4081 0.5236
[0089] Table 1 shows a performance comparison of TSA-GNN with existing methods (MKG-FENN, ACDGNN, MDF-SA-DDI, DNN, RF, KNN, and LR models are from other literature) on the hot-start DDI prediction task. As shown in the table, TSA-GNN outperforms state-of-the-art methods on several key evaluation metrics.
[0090] Compared to the state-of-the-art MKG-FENN model, TSA-GNN achieved an accuracy (ACC) of 0.9415, an improvement of 0.06 percentage points; its F1 score reached 0.9118, an improvement of 1.6 percentage points, demonstrating an advantage in balancing precision and recall; in terms of precision (Pre), TSA-GNN achieved 0.9280, compared to MKG-FENN's 0.9132, an improvement of 1.48 percentage points, which is crucial for reducing false positives in DDI predictions.
[0091] Furthermore, TSA-GNN's area under the precision-recall curve (AUPR) score of 0.9803 is slightly higher than MKG-FENN's 0.9786, further validating TSA-GNN's robustness on imbalanced datasets. Although it is slightly lower than MKG-FENN in AUC and recall metrics, the differences are small.
[0092] These performance advantages are primarily attributed to the time-step attention mechanism and the fusion of similar drug features. The time-step attention mechanism allows the model to acquire new relational information while retaining its understanding of the drugs themselves. The fusion of similar drug features creates an additional information acquisition channel based on similarity, complementing traditional graph-connection-based information acquisition methods. This enables the model to obtain a more comprehensive representation of drug features.
[0093] Task 2
[0094] Table 2: Overall Performance Comparison of Different Models
[0095] index TSA-GNN MKG-FENN ACDGNN ACC 0.6969 0.6805 0.6672 AUPR 0.7210 0.7049 0.6714 AUC 0.9678 0.9673 0.9559 F1 0.5623 0.5394 0.5125 Pre 0.6281 0.6063 0.5709
[0096] As shown in Table 2, in terms of overall performance advantages, TSA-GNN outperforms all comparison models on all key evaluation metrics.
[0097] like Figure 3 and Figure 4 As shown, TSA-GNN demonstrates a significant advantage in the DDI event type prediction task. The radar chart clearly shows that TSA-GNN outperforms other models on most of the 65 DDI event types. Box plots further quantify this performance advantage—the median AUPR distribution of TSA-GNN is approximately 0.6, significantly higher than other models, and the overall position of the corresponding box for TSA-GNN is higher, indicating that TSA-GNN's performance is more concentrated in the high-performance range. For accuracy metrics, TSA-GNN also leads in the upper quartile, median, and lower quartile values, confirming its stable advantage across multiple DDI event types.
[0098] The experimental results clearly demonstrate the performance advantage of TSA-GNN in single-drug cold-start scenarios, primarily attributed to its two-stage drug similarity propagation mechanism. During the inference phase, for known drugs in the drug pair to be predicted, the model processes them in the same way as in Task 1. For new drugs in the drug pair, the model replaces them with the most similar drugs from the training set. Since each drug has already integrated the features of its most similar drugs during training, the model enables new drugs to acquire information through first-order and second-order similarity relationships, thus overcoming, to some extent, the bottleneck of feature representation for new drugs in cold-start scenarios. This mechanism significantly enhances the predictive ability of TSA-GNN in cold-start scenarios, explaining why TSA-GNN significantly outperforms other models in this scenario.
[0099] Task 3
[0100] Table 3: Overall performance comparison of different models in Task 3
[0101] index TSA-GNN MKG-FENN ACDGNN ACC 0.4881 0.4552 0.4219 AUPR 0.4555 0.4162 0.3791 AUC 0.9219 0.9149 0.8754 F1 0.2336 0.2186 0.2124 Pre 0.2845 0.2754 0.2618
[0102] As shown in Table 3, in terms of overall performance advantages, TSA-GNN outperforms all comparison models on all key evaluation metrics.
[0103] In highly imbalanced bioinformatics datasets, an AUPR value exceeding 0.6 indicates excellent predictive ability. For example... Figure 5 As shown in (a), compared with other benchmark models, the TSA-GNN model exhibits a significantly higher proportion of DDI prediction tasks with AUPR values exceeding 0.6. Therefore, its prediction performance is significantly better than other models. Figure 5 (b) This advantage is further validated, with TSA-GNN ranking first in AUPR across approximately 35 tasks, while only 15 tasks (3rd or 4th place) were ranked lower, the fewest among all models. According to Figure 5 (b) The average AUPR ranking of each model can be calculated: TSA-GNN has an average ranking of 1.85, which is significantly better than MKG-FENN (2.14), ACDGNN (2.03) and MDF-SA-DDI (2.14).
[0104] In highly imbalanced bioinformatics datasets, a precision value exceeding 0.8 indicates excellent predictive ability. For example... Figure 6 As shown in (a), compared with other benchmark models, the TSA-GNN model exhibits a significantly higher proportion of DDI prediction tasks with an accuracy value exceeding 0.8. Therefore, its prediction performance is significantly better than other models. Figure 6(b) This advantage is further validated, with TSA-GNN ranking first in accuracy across 39 tasks, significantly outperforming other models. The number of low-ranking tasks (3rd or 4th place) is only 13, the fewest among all models. Based on the ranking distribution plot, the average accuracy ranking of each model can be calculated: TSA-GNN's average ranking is 1.69, significantly better than MKG-FENN (2.05), ACDGNN (1.89), and MDF-SA-DDI (1.74).
[0105] Clearly, in Task 3, TSA-GNN exhibits a more significant advantage compared to other models. This is because, during the inference phase, the drug pairs to be predicted only contain new drugs, causing other GNN models to suffer significant performance degradation due to the lack of graph connectivity information. The two-stage drug similarity propagation mechanism in TSA-GNN effectively overcomes this limitation. For each new drug, TSA-GNN uses the Jaccard similarity algorithm to identify the most similar drugs in the training set and utilizes their features to construct a representation of the new drug. Since each drug has already integrated the features of its most similar drugs during the training phase, the new drug can acquire rich information through first-order and second-order similarity relationships, thus constructing a more comprehensive feature representation.
Claims
1. A method for predicting drug-drug interactions based on a time-step attention graph neural network, characterized in that, Includes the following steps: S1. Constructing a multi-dimensional drug knowledge graph: Based on drug-chemical entity datasets, drug-substructure datasets, drug-drug interaction datasets, and drug-molecular structure datasets, four complementary knowledge graphs are constructed to capture the chemical entity associations, molecular substructure composition, drug interaction relationships, and molecular structure attribute information of drugs, respectively. S2. Drug Feature Learning: The four knowledge graphs are processed by four independent GNN modules. Each GNN module is configured with multiple time steps. A GRU-like gating mechanism is used to update the drug features at each time step. The weights of each time step are calculated and weighted by a time step attention mechanism. Then, the features of similar drugs are integrated by combining a drug similarity fusion strategy. Finally, the output of the four GNN modules is fused to obtain a comprehensive drug feature representation. S3. DDI prediction during training phase: The feature representation of the drug pairs to be predicted is processed by a collaborative attention mechanism. The bidirectional importance weights between drugs are calculated through query-key-value transformation. After updating the feature representation, the result is input into the fully connected layer and the prediction result is output. S4. Inference Stage DDI Prediction: For drug pairs containing new drugs, the most similar drugs in the training set are identified based on the Jaccard similarity algorithm. The new drug features are obtained by aggregating the comprehensive drug feature representation, and the results are output through the prediction process in step S3.
2. The method according to claim 1, characterized in that, The knowledge graph described in step S1 is constructed as follows: each knowledge graph is a graph structure, in which drugs are the core nodes, the corresponding associated entities, substructures, other drugs or molecular attributes are the neighbor nodes, and the association, inclusion, interaction or attribute relationships between nodes are the edges.
3. The method according to claim 1, characterized in that, The formula for updating drug characteristics at each time step in step S2 is as follows: In this equation, Indicates drug In the passage Time step eigenvectors, where It is the embedded dimension; This represents the features of the previous time step; Indicates drug node Feature information aggregated from its two neighbors; ,in It is the total number of drugs; Indicates the time step index; This represents the channel index corresponding to four different knowledge graphs; GRU refers to the gated recurrent unit mechanism.
4. The method according to claim 1, characterized in that, The time-step attention mechanism calculation in step S2 includes: E1. Calculate the similarity score to assess the degree of preservation of the original semantics of the features, and calculate the information gain score to assess the increment of new information; The similarity score is used to assess how well a feature retains its original semantics. Information gain score: Used to evaluate the new information increment introduced at each time step. E2. To ensure comparability between scores on different scales, the two scores are normalized separately: E3. Calculate the attention weights at each time step using the softmax function: in It is a learnable parameter used to adjust the relative importance of similarity score and information gain score.
5. The method according to claim 1, characterized in that, The drug similarity fusion strategy in step S2 is as follows: In each knowledge graph, the set of drugs most similar to each drug is identified using the Jaccard similarity algorithm, and the drug's own features and similar drug features are weighted and fused together, using the following formula: in Indicates related to drugs The most similar set of drugs These are learnable parameters; The outputs of the four GNN modules are fused through a fusion layer to generate a comprehensive drug feature representation: FL stands for Fusion Layer Operation, which includes attention mechanisms and nonlinear transformations, used to integrate complementary information from different knowledge graphs.
6. The method according to claim 1, characterized in that, The processing procedure of the collaborative attention mechanism in step S3 is as follows: The features of drug pair (A,B) are transformed by query (Q), key (K), and value (V) respectively; The mechanism for calculating the attention weight from drug A to drug B uses query (Q), key (K), and value (V) transformations to calculate the importance weight: Attention shifted from drug B to drug A is calculated as follows: Update drug feature representation based on attention weights: Finally, DDI prediction is performed after fusion: 。 7. The method according to claim 1, characterized in that, The method for obtaining new drug features in step S4 is as follows: the new drug is represented by first-order similarity relationship and second-order similarity relationship (the first-order and second-order similarity relationships are both based on the Jaccard similarity algorithm to identify from four knowledge graphs).
8. The method according to claim 1, characterized in that, The method is applicable to three scenarios: hot start, semi-cold start, and full cold start. The corresponding dataset partitioning methods are as follows: the hot start scenario uses 5-fold hierarchical cross-validation; the semi-cold start scenario ensures that the test set drug pairs contain one new drug and one old drug; and the full cold start scenario ensures that all test set drug pairs are combinations of new drugs.