A method and system for predicting drug-drug interactions based on graph comparison learning

By constructing a balanced dataset and generating enhanced views using a multi-head graph attention network, and combining balanced contrastive loss to optimize the shared graph neural network, the long-tail distribution problem in drug-drug interaction prediction is solved, improving the prediction performance for rare drug combinations.

CN123120370APending Publication Date: 2026-11-17QUFU NORMAL UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611609669.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-10-19
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In drug-drug interaction prediction, existing technologies suffer from insufficient predictive performance for rare drug combinations due to long-tailed distributions. Traditional methods also ignore the problem of data imbalance, resulting in significantly poor predictive performance for tail categories.

Method used

By constructing a balanced dataset, class prototype features are generated, and a multi-head graph attention network is used to adaptively generate enhanced views. The shared graph neural network is optimized by combining balanced contrastive loss and main classification loss to fill in the missing tail class representations and improve prediction ability.

Benefits of technology

It effectively improves the ability to predict and distinguish new drugs and rare drug combinations, maintains the accuracy of identifying common drug interactions, and solves the problem of insufficient learning caused by long-tail distribution.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123120370A_ABST
    Figure CN123120370A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of drug interaction prediction technology, specifically involving a drug-drug interaction prediction method and system based on graph contrastive learning. Addressing the long-tail distribution problem of drug-drug interaction data, it constructs a balanced dataset to obtain class prototype features, compensating for the lack of samples at the tail end of the batch. Then, it uses a multi-head graph attention network to adaptively generate multiple sets of enhanced views, training the batch to incorporate all class prototype features to fill the gaps in tail class representation. Constraint optimization is achieved by combining balanced contrastive loss. Finally, it fuses the main classification loss, balanced contrastive loss, and auxiliary balanced loss, backpropagating to jointly optimize the shared graph neural network. This allows it to retain the recognition accuracy for common head drug interactions with sufficient samples while improving the prediction and discrimination ability for tail interaction types such as new drugs and rare drug combinations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of drug interaction prediction technology, specifically relating to a drug-drug interaction prediction method and system based on graph comparison learning. Background Technology

[0002] Drug-drug interactions (DDIs) refer to the phenomenon where the simultaneous action of two or more drugs on the same receptor or metabolic pathway may alter the pharmacokinetics or pharmacodynamics of one or more drugs, potentially enhancing or weakening therapeutic effects, or even causing adverse reactions. Accurate prediction of DDIs can effectively reduce the risk of adverse reactions caused by inappropriate drug use in clinical diagnosis. In recent years, graph neural networks (GNNs) have demonstrated significant advantages in DDI prediction tasks, thanks to their natural ability to handle graph-structured data. Through message passing mechanisms, GNNs can effectively utilize the association structure between drug nodes, aggregating neighborhood information to learn richer drug feature representations, thereby identifying potential interaction patterns. Therefore, graph neural network-based DDI prediction methods significantly outperform traditional machine learning methods; however, this approach still faces challenges in addressing the long-tailed distribution problem of DDI data.

[0003] In clinical diagnosis, common drug interactions (DDIs) are extensively studied and have a wealth of historical data, resulting in numerous observational records. Conversely, new or rare drug interactions, due to their shorter clinical application time and fewer cases, lack sufficient clinical observation. This phenomenon directly leads to a significant long-tailed distribution in DDI data. Existing prediction methods often focus too much on the head category (common drug interactions), resulting in significantly insufficient predictive performance for the tail category (rare or novel drug interactions). Therefore, the long-tailed distribution of DDI data severely limits the performance of DDI prediction. However, successfully predicting rare DDI categories generally has higher clinical value because rare DDIs are more likely to reveal unknown, potentially high-risk drug interactions.

[0004] In recent years, DDI prediction methods based on graph contrastive learning have attracted significant attention due to their excellent performance. These methods perturb the edges and nodes of the drug molecule graph or DDI event graph to generate enhanced views, utilize a graph neural network (GNN) as an encoder to extract feature representations from all views, and combine contrastive loss to bring positive sample pairs closer and push away negative sample pairs to optimize the GNN and improve the representational power of drug features. These methods have achieved satisfactory results by extracting structural or interaction information of drugs. However, most methods ignore the impact of imbalanced DDI data on prediction performance. For imbalanced data, some works have shown that the head class has an absolute advantage in each batch processing and dominates in contrastive learning, while instances of some tail classes may be missing, resulting in the inability to effectively learn the features of the tail classes. Summary of the Invention

[0005] To address the problems raised in the background art, this invention provides a method and system for predicting drug-drug interactions based on graph contrastive learning.

[0006] The technical solution of the present invention is as follows: This invention provides a drug-drug interaction prediction method based on graph contrastive learning, comprising: S1: Resample the original long-tail drug-drug interaction data to construct a balanced dataset. After the balanced dataset is processed by a shared graph neural network, the auxiliary balance loss value is calculated, and the class weights corresponding to each class are extracted. The class prototype features corresponding to each class are generated through linear mapping. S2: For the original long-tailed drug-drug interaction data, drugs are used as nodes and drug-drug interactions are used as edges. The data is then adaptively processed by a multi-head graph attention network to generate an even number of enhanced views. Features are extracted from all enhanced views using a shared graph neural network to obtain the enhanced features. After supplementing each batch of training samples with prototype features of all categories, the balanced contrastive loss value is calculated by combining the enhanced features and contrastive learning. S3: Construct the original dataset using the original long-tail drug-drug interaction data. After processing the original dataset with a shared graph neural network, calculate the main classification loss value. After fusing the main classification loss, the balanced contrast loss, and the auxiliary balancing loss, backpropagation is used to jointly optimize the shared graph neural network and update all learnable parameters.

[0007] Based on the drug-drug interaction prediction method based on graph contrast learning described above, step S2, which generates an even number of enhanced views through adaptive processing using a multi-head graph attention network, specifically involves: For each enhanced view, a single attention head adaptive edge weight is calculated by a single-layer feedforward neural network combined with the Leaky ReLU activation function, and the attention weight is normalized by fusing the drug node features at both ends through vector concatenation operation.

[0008] Based on the drug-drug interaction prediction method based on graph contrastive learning described above, the original dataset in S3, after being processed by a shared graph neural network, calculates the main classification loss value, specifically as follows: After the original dataset is processed by a shared graph neural network, a multilayer perceptron and a softmax function are used to predict the processed features to obtain the drug-drug interaction category probability. The main classification loss value is calculated using cross-entropy loss.

[0009] Based on the drug-drug interaction prediction method based on graph contrast learning described above, the equilibrium dataset in S1, after being processed by a shared graph neural network, calculates the auxiliary equilibrium loss value, specifically as follows: After the balanced dataset is processed by a shared graph neural network, a multilayer perceptron and a softmax function are used to predict the processed features to obtain the drug-drug interaction category probabilities. The cross-entropy loss is used to calculate the auxiliary balance loss value.

[0010] Based on the drug-drug interaction prediction method based on graph contrast learning described above, S3 further includes utilizing a shared graph neural network to share feature extraction parameters, unifying the drug feature representation space, and using formulas... To achieve; In the formula, This represents the feature representation of node v after the update at layer L+1. This represents the set consisting of all interaction relationship categories. Represents a node Feature representation at layer L, Represents a node In the Layer feature representation, and Indicates learnable parameters, This represents the neighboring nodes of node v under the interaction category r.

[0011] This invention also provides a drug-drug interaction prediction system based on graph contrastive learning, comprising: Prototype perception module: The original long-tail drug-drug interaction data is resampled to construct a balanced dataset. After the balanced dataset is processed by a shared graph neural network, the auxiliary balance loss value is calculated, and the category weights corresponding to each category are extracted. The category prototype features corresponding to each category are generated through linear mapping. Prototype Graph Comparison Learning Module: For the original long-tailed drug-drug interaction data, drugs are used as nodes and drug-drug interactions are used as edges. After adaptive processing by a multi-head graph attention network, an even number of enhanced views are generated. Features are extracted from all enhanced views using a shared graph neural network to obtain enhanced features. After supplementing each batch of training samples with prototype features of all categories, the balanced contrastive loss value is calculated by combining the enhanced features and contrastive learning. Multi-loss joint optimization module: Construct the original dataset from the original long-tail drug-drug interaction data, and calculate the main classification loss value after the original dataset is processed by the shared graph neural network; After fusing the main classification loss, the balanced contrast loss, and the auxiliary balancing loss, backpropagation is used to jointly optimize the shared graph neural network and update all learnable parameters.

[0012] Based on the above-described graph-based drug-drug interaction prediction system, in the prototype graph contrast learning module, the generation of an even number of enhanced views through adaptive processing via a multi-head graph attention network specifically involves: For each enhanced view, a single attention head adaptive edge weight is calculated by a single-layer feedforward neural network combined with the Leaky ReLU activation function, and the attention weight is normalized by fusing the drug node features at both ends through vector concatenation operation.

[0013] Based on the above-described graph-based contrastive learning-based drug-drug interaction prediction system, in the multi-loss joint optimization module, after the original dataset is processed by a shared graph neural network, the main classification loss value is calculated as follows: After the original dataset is processed by a shared graph neural network, a multilayer perceptron and a softmax function are used to predict the processed features to obtain the drug-drug interaction category probability. The main classification loss value is calculated using cross-entropy loss.

[0014] Based on the above-described graph-based contrastive learning-based drug-drug interaction prediction system, in the prototype perception module, after the equilibrium dataset is processed by a shared graph neural network, the auxiliary equilibrium loss value is calculated as follows: After the balanced dataset is processed by a shared graph neural network, a multilayer perceptron and a softmax function are used to predict the processed features to obtain the drug-drug interaction category probabilities. The cross-entropy loss is used to calculate the auxiliary balance loss value.

[0015] Based on the above-described graph-based contrastive learning-based drug-drug interaction prediction system, the multi-loss joint optimization module further includes utilizing a shared graph neural network to share feature extraction parameters, unify the drug feature representation space, and use formulas... To achieve; In the formula, This represents the feature representation of node v after the update at layer L+1. This represents the set consisting of all interaction relationship categories. Represents a node Feature representation at layer L, Represents a node In the Layer feature representation, and Indicates learnable parameters, This represents the neighboring nodes of node v under the interaction category r.

[0016] Beneficial effects This invention addresses the long-tail distribution problem of drug-drug interaction data. It constructs a balanced dataset to obtain class prototype features, which serve as globally representative features for that class, thus compensating for the lack of tail samples in batches. Then, a multi-head graph attention network adaptively generates multiple enhanced views that retain the sparse structure of the original graph. This enhances the batch by incorporating all class prototype features to fill the gaps in tail class representation. A balanced contrastive loss is used to optimize the constraints of bringing similar samples closer to prototype features and separating dissimilar features. Finally, the main classification loss, balanced contrastive loss, and auxiliary balanced loss are fused and backpropagated to jointly optimize a shared graph neural network, updating all learnable parameters. This ensures that the network retains the accuracy for identifying common drug interactions with sufficient samples while effectively compensating for the learning deficiencies caused by missing tail samples and gradient imbalances in traditional graph contrastive learning. This improves the predictive and discriminative capabilities for high-clinical-value tail interactions such as new drugs and rare drug combinations. Attached Figure Description

[0017] Figure 1 This is a flowchart of a drug-drug interaction prediction method based on graph contrastive learning, as described in Example 1.

[0018] Figure 2 The results are from ablation experiments on the Deng dataset. Detailed Implementation

[0019] The following examples are intended to illustrate the present invention, and not to further limit the invention.

[0020] Example 1 This embodiment provides a drug-drug interaction prediction method based on graph contrastive learning, such as... Figure 1 As shown, it includes: S1: Resample the original long-tail drug-drug interaction data to construct a balanced dataset. After the balanced dataset is processed by a shared graph neural network, the auxiliary balance loss value is calculated, and the category weights corresponding to each category are extracted. The category prototype features corresponding to each category are generated through linear mapping.

[0021] For raw long-tailed drug-drug interaction data, the long-tailed distribution refers to a highly uneven distribution of data across different categories, with a few categories having a large number of samples (head categories) and most categories having only a small number of samples (tail categories). In the drug-drug interaction (DDI) prediction scenario of this invention, the head categories refer to common drug interaction types with sufficient sample size and adequate clinical research; the tail categories refer to interaction types of new drugs or rare drug combinations with sparse sample size and limited clinical observation.

[0022] In the specific implementation process, a balanced dataset is constructed to alleviate long-tail bias at the data level, as follows.

[0023] S11: Resampling of raw long-tailed drug-drug interaction data using a resampling strategy Sampling is performed to obtain a balanced dataset. The balanced sampling probability is defined as: .

[0024] in, Indicates sample features, The label represents the feature of the sample. To balance the dataset, we represent the balanced distribution of sampled data; Indicates category The probability of being selected for sampling. Indicates category The original long-tail drug-drug interaction data sample set, Represents any relation category For the corresponding original sample set, this strategy assigns higher sampling weights to classes with fewer samples, thus balancing the proportion of each class in the balanced dataset. Taking the absolute value is for discarding... Possible direction sign, ensuring weight It is always positive to ensure that the probability value obtained by normalization calculation is legal and valid.

[0025] S12: Balanced Dataset After processing by the shared graph neural network, the auxiliary balancing loss value is calculated, and the class weights corresponding to each class are extracted. Perform a linear mapping to generate category prototypes. , which serves as the category prototype feature for each category.

[0026] Category prototype features serve as globally representative features for that category, thus compensating for the lack of samples at the tail of the batch.

[0027] Furthermore, after the balanced dataset is processed by a shared graph neural network, the auxiliary balancing loss value is calculated. Specifically: After the balanced dataset is processed by a shared graph neural network, a multilayer perceptron (MLP) and a softmax function are used to predict the processed features to obtain the drug-drug interaction category probabilities (see the following formula). The cross-entropy loss is used to calculate the auxiliary balancing loss value. .

[0028] ,in, Represents node pairs The joint feature representation vector, which is extracted from the balanced dataset; This represents the predicted value for the balanced dataset.

[0029] The class prototypes learned from balanced datasets can accurately represent the global feature distribution of each class, making up for the lack of tail class representation in the original long-tail data, providing accurate class anchors for contrastive learning, and thus alleviating long-tail bias at the data level.

[0030] S2: For the original long-tailed drug-drug interaction data, drugs are used as nodes and drug-drug interactions are used as edges. The data is then adaptively processed by a multi-head graph attention network to generate an even number of enhanced views. Features are extracted from all enhanced views using a shared graph neural network to obtain the enhanced features. After supplementing each batch of training samples with prototype features of all categories, the balanced contrastive loss value is calculated through contrastive learning, combined with the enhanced features.

[0031] Furthermore, the adaptive processing via the multi-head graph attention network generates an even number of enhanced views, specifically as follows: For each enhanced view, a single attention head adaptive edge weight is calculated by a single-layer feedforward neural network combined with the Leaky ReLU activation function, and the attention weight is normalized by fusing the drug node features at both ends through vector concatenation operation.

[0032] In the specific implementation process, the balanced contrastive loss value is calculated through contrastive learning to bring intra-class features closer together and push apart features between different classes. The operation is as follows.

[0033] S21: For the original long-tailed drug-drug interaction data, with drugs as nodes and drug-drug interactions as edges, a multi-head graph attention network is used to adaptively learn the weights of the edges to generate K (K∈2N) augmented views for comparative learning.

[0034] For each K, node pair The adaptive edge weights are calculated using a single-layer feedforward neural network: .

[0035] in, Indicates the first Each attention node For neighboring nodes Normalized attention weights , , Represents a node , , The initial input feature vector, This represents a vector concatenation operation. and Indicates the first The trainable weight matrix and weight vector in each attention head. Represents a node The neighboring nodes, and If in the original image At that time, it will be forced This ensures the sparse structure of the graph. This indicates that the node is being traversed. All neighboring nodes and nodes It performs the summation operation within the set of nodes.

[0036] S22: Use a shared graph neural network (RGCN) as an encoder to encode each enhanced view to obtain the enhanced features of the drug node.

[0037] To avoid gradient imbalance caused by missing samples of the tail classes in the training batch and to ensure that all classes are represented in the training batch, a balanced contrastive loss is constructed through contrastive learning. .

[0038] .

[0039] in, Indicates batch size, Indicates the number of categories in the batch. For the current sample index, Indicates the positive sample index. Indicates category The prototype, This indicates an operation that performs a class average on negative samples of the same type within a batch. This is a temperature coefficient used to scale the inner product similarity of sample features, adjust the sharpness of the softmax probability distribution, and control the difficulty of distinguishing between positive and negative samples in contrastive learning tasks. Indicates sample The L2-normalized feature embedding vector obtained after passing through the Lth layer of the network Indicates positive samples The normalized feature embedding vector after the Lth layer Indicates negative samples The normalized feature embedding vector after the Lth layer. From the set Remove sample i from the set, and the set of the remaining elements is formed. Indicates the subset identifier The corresponding set of negative samples.

[0040] This invention utilizes multi-head graph attention to generate multiple sets of enhanced views that retain the original graph structure information while enriching the training data distribution. The balanced contrastive loss addresses the issue of missing representations of tail categories during batch training by introducing prototypes of all categories. Both factors work together in the optimization process of the shared graph neural network, maintaining the accuracy of head category recognition while enhancing the ability to discriminate tail categories.

[0041] S3: Construct the original dataset using the original long-tail drug-drug interaction data. After processing the original dataset with a shared graph neural network, calculate the main classification loss value. After fusing the main classification loss, the balanced contrast loss, and the auxiliary balancing loss, backpropagation is used to jointly optimize the shared graph neural network and update all learnable parameters.

[0042] In this step, this embodiment uses a weighted fusion of multiple loss optimization shared graph neural networks to alleviate head category bias. The specific operation is as follows.

[0043] By utilizing shared graph neural networks to share feature extraction parameters, a unified drug feature representation space is achieved, and this is accomplished through formulas. This is achieved to ensure the consistency of feature representation.

[0044] In the formula, This represents the feature representation of node v after the update at layer L+1. This represents the set consisting of all interaction relationship categories. Represents a node In the Layer feature representation, Represents a node In the Layer feature representation, and Indicates learnable parameters, This represents the neighboring nodes of node v under the interaction category r.

[0045] After the original dataset is processed by a shared graph neural network, the main classification loss value is calculated as follows: After the original dataset is processed by a shared graph neural network, a multilayer perceptron (MLP) and a softmax function are used to predict the processed features to obtain the drug-drug interaction category probabilities (see the following formula). The main classification loss value is calculated using cross-entropy loss. .

[0046] ,in, Represents node pairs The joint feature representation vector, which is extracted from the original data; This represents the predicted value of the original dataset.

[0047] In summary, both the main classification loss and the auxiliary balancing loss in this invention are supervised classification losses, providing complementary classification supervision signals from different data perspectives. The balancing contrast loss, on the other hand, is an unsupervised contrast constraint, organizing the feature space structure without relying on labels. These three types of losses work synergistically from three dimensions, maintaining head recognition accuracy while improving tail discrimination ability.

[0048] This invention addresses the long-tail distribution problem of drug-drug interaction data. It constructs a balanced dataset to obtain class prototype features, which serve as globally representative features for that class, thus compensating for the lack of tail samples in batches. Then, a multi-head graph attention network adaptively generates multiple enhanced views that retain the sparse structure of the original graph. This enhances the batch by incorporating all class prototype features to fill the gaps in tail class representation. A balanced contrastive loss is used to optimize the constraints of bringing similar samples closer to prototype features and separating dissimilar features. Finally, the main classification loss, balanced contrastive loss, and auxiliary balanced loss are fused and backpropagated to jointly optimize a shared graph neural network, updating all learnable parameters. This ensures that the network retains the accuracy for identifying common drug interactions with sufficient samples while effectively compensating for the learning deficiencies caused by missing tail samples and gradient imbalances in traditional graph contrastive learning. This improves the predictive and discriminative capabilities for high-clinical-value tail interactions such as new drugs and rare drug combinations.

[0049] Example 2 Based on Example 1, this example provides a drug-drug interaction prediction system based on graph contrastive learning, including: Prototype perception module: The original long-tail drug-drug interaction data is resampled to construct a balanced dataset. After the balanced dataset is processed by a shared graph neural network, the auxiliary balance loss value is calculated, and the category weights corresponding to each category are extracted. The category prototype features corresponding to each category are generated through linear mapping.

[0050] Furthermore, in the prototype perception module, after the balanced dataset is processed by the shared graph neural network, the auxiliary balance loss value is calculated, specifically as follows: After the balanced dataset is processed by a shared graph neural network, a multilayer perceptron and a softmax function are used to predict the processed features to obtain the drug-drug interaction category probabilities. The cross-entropy loss is used to calculate the auxiliary balance loss value.

[0051] Prototype Graph Comparison Learning Module: For the original long-tailed drug-drug interaction data, drugs are used as nodes and drug-drug interactions are used as edges. After adaptive processing by a multi-head graph attention network, an even number of enhanced views are generated. Features are extracted from all enhanced views using a shared graph neural network to obtain enhanced features. After supplementing each batch of training samples with prototype features of all categories, the balanced contrastive loss value is calculated through contrastive learning, combined with the enhanced features.

[0052] Furthermore, in the prototype image comparison learning module, the generation of an even number of enhanced views through adaptive processing via a multi-head image attention network specifically involves: For each enhanced view, a single attention head adaptive edge weight is calculated by a single-layer feedforward neural network combined with the Leaky ReLU activation function, and the attention weight is normalized by fusing the drug node features at both ends through vector concatenation operation.

[0053] Multi-loss joint optimization module: Construct the original dataset from the original long-tail drug-drug interaction data, and calculate the main classification loss value after the original dataset is processed by the shared graph neural network; After fusing the main classification loss, the balanced contrast loss, and the auxiliary balancing loss, backpropagation is used to jointly optimize the shared graph neural network and update all learnable parameters.

[0054] Furthermore, in the multi-loss joint optimization module, after the original dataset is processed by the shared graph neural network, the main classification loss value is calculated, specifically as follows: After the original dataset is processed by a shared graph neural network, a multilayer perceptron and a softmax function are used to predict the processed features to obtain the drug-drug interaction category probability. The main classification loss value is calculated using cross-entropy loss.

[0055] Furthermore, the multi-loss joint optimization module also includes utilizing shared graph neural networks to share feature extraction parameters, unifying the drug feature representation space, and using formulas... To achieve this.

[0056] In the formula, This represents the feature representation of node v after the update at layer L+1. This represents the set consisting of all interaction relationship categories. Represents a node In the Layer feature representation, Represents a node In the Layer feature representation, and Indicates learnable parameters, This represents the neighboring nodes of node v under the interaction category r.

[0057] Application Example 1 To verify the effectiveness of the invention, this application example tests the performance of the invention in terms of drug-drug interaction prediction.

[0058] 1. Dataset and Evaluation Metrics (1) Dataset The prediction method of this application is evaluated on publicly available benchmark datasets.

[0059] The Deng dataset contains 572 drugs and a total of 37,264 DDI samples, covering 65 interaction types.

[0060] To ensure fairness and reproducibility, the dataset was divided into training, validation, and test sets in a 7:1:2 ratio, with each subset containing samples of all types of drug-drug interactions. All experiments were independently repeated across five different random data partitions, and the final result was the average of all metrics from the five experiments used to evaluate the model's performance.

[0061] (2) Evaluation indicators In the multi-class classification task of drug-drug interactions, to comprehensively evaluate the performance of the model corresponding to the prediction method of this application, this application example uses accuracy as the overall evaluation index, while introducing precision, recall, and F1 score as auxiliary indicators. Precision, recall, and F1 score are calculated by first calculating the corresponding index for each category and then taking the arithmetic mean, treating each type of DDI event equally. This effectively avoids the head category dominating the evaluation results, thus more realistically reflecting the model's generalization ability under long-tailed distributions.

[0062] 2. Comparative Analysis of Experimental Results ablation experiment The prediction performance of this application's prediction method (denoted as balSCLDDI) is compared with that of three variants on the Deng dataset, as follows: Figure 2 As shown.

[0063] Specifically, when the complete balSCLDDI model is used, the model achieves optimal performance, indicating that the synergistic effect of the prototype perception module, the prototype graph contrast learning module, and the multi-loss joint optimization module can effectively improve the overall performance of drug-drug interaction prediction.

[0064] The model performance degraded most significantly when the balanced contrastive loss (denoted as w / o bclloss) was removed, indicating that balanced contrastive learning plays a key role in improving the learning effect of tail categories.

[0065] When the auxiliary balancing loss (denoted as w / o balloss) is removed, the model achieves suboptimal performance. This not only verifies the effectiveness of generating class prototypes based on balanced data, but also proves the necessity of this classification loss in the optimization of the auxiliary classifier.

[0066] Furthermore, removing the auxiliary balancing loss (w / o balmlp) from the prototype awareness module also degrades the model's predictive performance. This is because category prototypes learned from balanced data are closer to the overall feature distribution of each category, while category prototypes generated solely from long-tail data struggle to fully capture the discriminative information of the tail categories, thus limiting performance improvement.

[0067] Therefore, the prediction method provided in this application can generate more representative category prototypes, which is of great significance for enhancing the model optimization effect and improving the prediction performance of drug-drug interactions.

[0068] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

Claims

1. A drug-drug interaction prediction method based on graph contrastive learning, characterized in that, include: S1: Resample the original long-tail drug-drug interaction data to construct a balanced dataset. After the balanced dataset is processed by a shared graph neural network, the auxiliary balance loss value is calculated, and the class weights corresponding to each class are extracted. The class prototype features corresponding to each class are generated through linear mapping. S2: For the original long-tailed drug-drug interaction data, with drugs as nodes and drug-drug interactions as edges, an even number of enhanced views are generated through adaptive processing of a multi-head graph attention network. The enhanced features are obtained by extracting features from all enhanced views using a shared graph neural network. After supplementing each batch of training samples with prototype features of all categories, the balanced contrastive loss value is calculated by combining the enhanced features and contrastive learning. S3: Construct the original dataset using the original long-tail drug-drug interaction data. After processing the original dataset with a shared graph neural network, calculate the main classification loss value. After fusing the main classification loss, the balanced contrast loss, and the auxiliary balancing loss, backpropagation is used to jointly optimize the shared graph neural network and update all learnable parameters.

2. The graph contrastive learning based drug-drug interaction prediction method of claim 1, wherein, S2 describes the process of adaptively processing via a multi-head graph attention network to generate an even number of enhanced views, specifically: For each enhanced view, a single attention head adaptive edge weight is calculated by a single-layer feedforward neural network combined with the Leaky ReLU activation function, and the attention weight is normalized by fusing the drug node features at both ends through vector concatenation operation.

3. The graph contrastive learning based drug-drug interaction prediction method of claim 1, wherein, The original dataset described in S3, after being processed by a shared graph neural network, has its main classification loss value calculated as follows: After the original dataset is processed by a shared graph neural network, a multilayer perceptron and a softmax function are used to predict the processed features to obtain the drug-drug interaction category probability. The main classification loss value is calculated using cross-entropy loss.

4. The graph contrastive learning based drug-drug interaction prediction method of claim 1, wherein, The balanced dataset described in S1, after being processed by a shared graph neural network, calculates the auxiliary balancing loss value, specifically as follows: After the balanced dataset is processed by a shared graph neural network, a multilayer perceptron and a softmax function are used to predict the processed features to obtain the drug-drug interaction category probabilities. The cross-entropy loss is used to calculate the auxiliary balance loss value.

5. The drug-drug interaction prediction method based on graph contrastive learning according to claim 1, characterized in that, S3 also includes sharing feature extraction parameters using a shared graph neural network, unifying drug feature representation space, and being implemented by formula ​ wherein, denotes the updated feature representation of node v at the L+1th layer, denotes a set of all interaction relation categories, denotes the feature representation of node v at the Lth layer, denotes the feature representation of node v at the Lth layer, denotes the updated feature representation of node v at the L+1th layer, denotes the feature representation of node v at the Lth layer, denotes the feature representation of node v at the Lth layer, denotes the updated feature representation of node v at the L+1th layer, and denotes a learnable parameter, denotes the neighbor nodes of node v under the interaction category r.

6. A drug-drug interaction prediction system based on graph contrastive learning, characterized in that, include: Prototype perception module: The original long-tail drug-drug interaction data is resampled to construct a balanced dataset. After the balanced dataset is processed by a shared graph neural network, the auxiliary balance loss value is calculated, and the category weights corresponding to each category are extracted. The category prototype features corresponding to each category are generated through linear mapping. Prototype Graph Comparison Learning Module: For the original long-tailed drug-drug interaction data, with drugs as nodes and drug-drug interactions as edges, an even number of enhanced views are generated through adaptive processing by a multi-head graph attention network. The enhanced features are obtained by extracting features from all enhanced views using a shared graph neural network. After supplementing each batch of training samples with prototype features of all categories, the balanced contrastive loss value is calculated by combining the enhanced features and contrastive learning. Multi-loss joint optimization module: Construct the original dataset from the original long-tail drug-drug interaction data, and calculate the main classification loss value after the original dataset is processed by the shared graph neural network; After fusing the main classification loss, the balanced contrast loss, and the auxiliary balancing loss, backpropagation is used to jointly optimize the shared graph neural network and update all learnable parameters.

7. The drug-drug interaction prediction system based on graph contrastive learning according to claim 6, characterized in that, In the prototype image comparison learning module, the generation of an even number of enhanced views through adaptive processing via a multi-head image attention network is specifically as follows: For each enhanced view, a single attention head adaptive edge weight is calculated by a single-layer feedforward neural network combined with the Leaky ReLU activation function, and the attention weight is normalized by fusing the drug node features at both ends through vector concatenation operation.

8. The drug-drug interaction prediction system based on graph contrastive learning according to claim 6, characterized in that, In the multi-loss joint optimization module, after the original dataset is processed by a shared graph neural network, the main classification loss value is calculated, specifically as follows: After the original dataset is processed by a shared graph neural network, a multilayer perceptron and a softmax function are used to predict the processed features to obtain the drug-drug interaction category probability. The main classification loss value is calculated using cross-entropy loss.

9. The drug-drug interaction prediction system based on graph contrastive learning according to claim 6, characterized in that, In the prototype perception module, after the balanced dataset is processed by a shared graph neural network, the auxiliary balance loss value is calculated, specifically as follows: After the balanced dataset is processed by a shared graph neural network, a multilayer perceptron and a softmax function are used to predict the processed features to obtain the drug-drug interaction category probabilities. The cross-entropy loss is used to calculate the auxiliary balance loss value.

10. The drug-drug interaction prediction system based on graph contrastive learning according to claim 6, characterized in that, The multi-loss joint optimization module also includes using shared graph neural networks to share feature extraction parameters, unify the drug feature representation space, and use formulas. To achieve; In the formula, This represents the feature representation of node v after the update at layer L+1. This represents the set consisting of all interaction relationship categories. Represents a node Feature representation at layer L, Represents a node Feature representation at layer L, and Indicates learnable parameters, This represents the neighboring nodes of node v under the interaction category r.