A drug repositioning method based on dual-channel graph contrastive learning
By employing a dual-channel graph contrastive learning method, the graph structure features and semantic similarity features of drugs and diseases are integrated, which solves the noise and redundancy problems of existing models when integrating heterogeneous graphs, and improves the generalization ability and prediction performance of the drug relocation model.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA UNIV OF PETROLEUM (EAST CHINA)
- Filing Date
- 2026-03-30
- Publication Date
- 2026-06-09
AI Technical Summary
Existing drug relocation models suffer from noise and redundant information when integrating structural and semantic features in biomedical heterogeneous graphs, leading to decreased model performance. Furthermore, they rely too much on labeled data and have insufficient generalization ability.
A dual-channel graph contrastive learning approach is adopted, which extracts graph structure features and semantic similarity features of drugs and diseases through heterogeneous graph Transformer and graph Transformer encoder, and optimizes the association probability prediction through contrastive learning loss function, integrating multi-source heterogeneous biomedical data.
By effectively integrating the graph structure information and semantic similarity information of heterogeneous graphs, the model's generalization ability on unseen data is enhanced, and the robustness and predictive performance of drug-disease association prediction are improved.
Smart Images

Figure CN121964192B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of drug relocation technology, specifically relating to a drug relocation method based on dual-channel graph contrastive learning. Background Technology
[0002] In the field of new drug development, traditional de novo drug discovery methods are typically costly and time-consuming. As an alternative, drug repositioning, which explores new therapeutic uses for existing drugs, has received widespread attention in recent years. A core component of this field is drug-disease association prediction, which aims to discover potential associations between drugs and diseases. This is crucial for accelerating drug development, understanding disease mechanisms, and advancing precision medicine.
[0003] Currently, drug-disease association prediction methods are mainly divided into three categories: methods based on similarity calculation, methods based on matrix factorization, and methods based on graph neural networks. While the first two categories have made initial progress, they mostly rely on predefined similarity rules, making it difficult to model the complex interactions between biomedical entities. In recent years, graph neural networks have become the mainstream solution due to their powerful graph structure learning capabilities. Early methods based on homogeneous graphs treated nodes and edges as a single type, but real-world biomedical scenarios involve complex heterogeneous relationships between multiple types of entities, such as drugs, proteins, and diseases. With the increasing scale of biomedical data, using heterogeneous graphs to model different entity types and their diverse relationships has become a trend. These methods capture more refined information by constructing drug-protein-disease networks, significantly improving prediction performance. For example, DRHGCN (a graph convolutional network method for drug relocation) captures semantic relationships in heterogeneous graphs through meta-paths, and DRGCL (a graph contrastive learning method based on causal reasoning) uses a ternary heterogeneous graph attention network to enhance representation consistency. These methods improve both prediction performance and model interpretability.
[0004] Despite significant progress in heterogeneous graph methods, several technical bottlenecks remain: existing models often focus on message passing within the graph structure, neglecting rich semantic features beyond structural connections (such as drug chemical fingerprint similarity, Gaussian interaction contour similarity, and disease phenotypic similarity). These semantic features provide important supplementary information for revealing potential associations between biomedical entities, but they differ significantly from heterogeneous graph representations in distribution, semantics, and scale. Directly concatenating multi-source features without alignment may introduce noise or redundant information, leading to degraded model performance. Therefore, effectively integrating and aligning structural and semantic features has become a core challenge in building more robust predictive models.
[0005] To overcome the aforementioned shortcomings, existing technologies propose a drug relocation method based on dynamic heterogeneous graph neural networks. Its main steps include: extracting drug molecular structural features using a molecular graph convolutional network; generating protein embeddings using a protein sequence encoder; constructing a dynamic heterogeneous graph containing drug-disease-protein associations; capturing dynamic interactions between multiple entities using a time-aware graph attention network; and finally, fusing temporal features based on a multi-head attention mechanism to predict drug-disease associations. Existing technologies also propose a drug relocation framework based on multi-view fusion. This method includes: constructing a drug chemical similarity network, a disease phenotypic similarity network, and a protein interaction network respectively; learning low-dimensional representations of each view using a multi-view graph autoencoder; aligning the embedding spaces of different modalities through cross-view comparison learning; and integrating multi-view features using a collaborative filtering mechanism for association prediction.
[0006] However, the aforementioned methods have significant limitations: First, they rely excessively on labeled data to train supervised models, while labeled data is scarce and extremely costly to obtain in the biomedical field. Second, existing data augmentation methods typically construct contrast samples by randomly adding or deleting nodes or edges in heterogeneous graphs, but such operations may disrupt the inherent pathological meaning and biological logic of biomedical networks. Third, most methods learn graph-level features by first representing nodes and then using global pooling, making it difficult to adaptively capture the importance of key biomedical substructures in the graph (such as drug target clusters and disease co-occurrence modules). These problems severely restrict the generalization ability and application effectiveness of drug relocation models in real-world scenarios. Summary of the Invention
[0007] To address the aforementioned issues, this invention proposes a drug relocation method based on dual-channel graph contrastive learning. It employs a heterogeneous graph Transformer and a graph Transformer encoder for dual-channel feature extraction, followed by fusion and interaction of the dual-channel features to construct an interaction vector for drug-disease pairs. Finally, it predicts the association probability. Simultaneously, a loss function is designed for dual-channel contrastive learning alignment, optimizing the association probability prediction.
[0008] The technical solution of the present invention is as follows:
[0009] A drug relocation method based on dual-channel graph contrastive learning includes the following steps:
[0010] Step 1: Obtain the raw data of drugs, diseases, and proteins and convert them into node features. Construct a heterogeneous biomedical graph based on drug-disease associations, drug-protein effects, and disease-protein associations. Specifically, extract the SMILES structure information of drugs and convert it into drug node features using Mol2Vec. Extract disease phenotypic data and generate disease node features using MeSHHeading2vec. Extract protein sequences and encode them into protein node features using the ESM-2 model.
[0011] Step 2: Use the heterogeneous graph Transformer to extract graph channel features and extract the graph structure features of drugs and diseases;
[0012] Step 3: Extract similarity channel features; specifically: calculate the drug molecule fingerprint similarity matrix and the drug's Gaussian interaction contour similarity matrix, and the disease phenotype similarity matrix and the disease's Gaussian interaction contour similarity matrix, and perform similarity fusion. Based on the fused similarity matrix, construct drug similarity maps and disease similarity maps respectively. Finally, extract the semantic similarity features of drugs and diseases through a graph Transformer encoder.
[0013] Step 4: Fuse the graph structure features of drugs and diseases with semantic similarity features to obtain the final node representations of drugs and diseases; for any drug-disease pair, construct an interaction vector formed by concatenating the corresponding final node representation of the drug, the corresponding final node representation of the disease, the absolute difference between the features of the two, and the element-wise product of the features of the two, and input the interaction vector into a multilayer perceptron to output the drug-disease association probability.
[0014] Step 5: Construct a contrastive learning loss between the graph channel and the similarity channel, and combine it with the supervised learning loss to optimize the association probability prediction.
[0015] Furthermore, in step 1, Mol2Vec is an algorithm that converts chemical molecular structures into fixed-dimensional vectors; MeSHHeading2vec is a method that converts terms into vector representations; and ESM-2 is a pre-trained language model for protein sequences.
[0016] Project the features of each node uniformly into the D-dimensional latent space;
[0017] Heterogeneous Biomedical Diagram ;in, For a set of nodes, For a set of edges with different types, The characteristics of nodes are represented; the constructed heterogeneous biomedical graph includes three types of nodes: drug nodes, disease nodes, and protein nodes, as well as three types of edges: drug-disease association edges, drug-protein interaction edges, and disease-protein association edges.
[0018] Furthermore, the specific process of step 2 is as follows:
[0019] Step 2.1: The heterogeneous graph Transformer uses type-aware linear projection to calculate the query, key, and value vectors;
[0020] Heterogeneous graph Transformer uses Layered network structure, each layer contains The attention head; for the heterogeneous graph Transformer, the first attention head; The first in the layer The formula for calculating the attention points is:
[0021] ;
[0022] ;
[0023] ;
[0024] in, For the heterogeneous graph Transformer, the first... Attention target node The query vector; , These are the first and second lines in the heterogeneous graph Transformer. Each attention-grabbing neighbor node Key-value vectors and value vectors; , , These are the mapping matrices for the query vector, key vector, and value vector in the heterogeneous graph Transformer, respectively. and Representing the target node respectively and neighboring nodes The node type; , These are the first and second lines in the heterogeneous graph Transformer. Layer target node and neighboring nodes eigenvectors;
[0025] Step 2.2: Calculate the heterogeneous attention score:
[0026] ;
[0027] in, For the first Heterogeneous attention scores for each attention head; For the edge; Meta-relations corresponding to edge types The corresponding relational transformation matrix; For dimensions; As a factor of relational importance; For transpose;
[0028] Calculate edges Attention weights :
[0029] ;
[0030] in, It is the softmax function; For the target node The set of neighboring nodes; This is a vector concatenation operation;
[0031] Step 2.3: Aggregate neighborhood information through a message passing mechanism and update node representations using residual connections;
[0032] Step 2.4: Use the feature vectors of the target nodes obtained from the last layer of the heterogeneous graph Transformer as the final graph structure features of drugs and diseases obtained from the graph channels, denoted as drug graph structure features respectively. Disease diagram structural features .
[0033] Furthermore, the specific process of step 2.3 is as follows:
[0034] First, message passing is performed: given from the... Each attention-grabbing neighbor node Value vector Messages are generated by applying a transformation matrix that is related to the edge type:
[0035] ;
[0036] in, For the first A message that attracts attention; Meta-relations corresponding to edge types The relevant transformation matrix;
[0037] Will come from all The messages from each person's attention are pieced together to form the final message representation. :
[0038] ;
[0039] Then target aggregation is performed: for the target node Take it from the neighbor node Messages based on attention weight Perform weighted aggregation:
[0040] ;
[0041] in, For the first Layer target node The weighted aggregated feature vector;
[0042] The node representation update is accomplished jointly through the projection matrix, activation function, and residual connections:
[0043] ;
[0044] in, Indicates node type The corresponding projection matrix; For activation functions; For the heterogeneous graph Transformer, the first... Layer target node eigenvectors.
[0045] Furthermore, the specific process of step 3 is as follows:
[0046] Step 3.1: Calculate the drug molecular fingerprint similarity matrix and the disease phenotype similarity matrix;
[0047] Molecular fingerprinting is used to measure the structural similarity between drugs: First, molecular structures are represented using the SMILES format. Then, molecular fingerprint features are extracted using the RDKit tool. Finally, the similarity between fingerprints of different drugs is calculated using the Tanimoto coefficient, resulting in a drug molecular fingerprint similarity matrix. ,in For the quantity of drugs, For the first The drug and the first The similarity of individual drugs;
[0048] Semantic similarity between diseases is calculated based on phenotypic descriptions: First, disease-related phenotypic terms are extracted from the OMIM public database. Then, the MimMiner tool is used to calculate phenotypic similarity. The MimMiner tool uses text mining technology to identify shared clinical phenotypes between different diseases, and finally generates a disease phenotypic similarity matrix. ,in Indicates the number of diseases. For the first The disease and the first Similarities between diseases;
[0049] Step 3.2: Based on the known drug-disease association, calculate the Gaussian interaction contour similarity matrix for drugs and diseases respectively;
[0050] The Gaussian interaction contour similarity matrix of drugs is defined as follows:
[0051] ;
[0052] in, The Gaussian interactive contour similarity matrix of the drugs; It is an exponential function; Indicates the first The interaction vector between a drug and all diseases; Indicates the first The interaction vector between a drug and all diseases; The bandwidth parameter for the Gaussian kernel of a drug is calculated as follows:
[0053] ;
[0054] in, For hyperparameters; For the first The interaction vector between a drug and all diseases;
[0055] The Gaussian interaction contour similarity matrix of a disease is defined as follows:
[0056] ;
[0057] in, The Gaussian interactive contour similarity matrix for the disease; It is the first The interaction vector between a disease and all drugs; For the first The interaction vector between a disease and all drugs; For the bandwidth parameters of the Gaussian kernel targeting the disease;
[0058] Step 3.3: Employ a fusion strategy to perform similarity fusion and construct a fusion similarity matrix between drugs and diseases;
[0059] Step 3.4: Based on the fusion similarity matrix, construct two isomorphic graphs: a drug similarity graph and a disease similarity graph, and extract the intermediate semantic representation of the nodes using a graph Transformer encoder;
[0060] Step 3.5: The intermediate semantic representation output is further updated by the feedforward network to obtain the final representation of the node;
[0061] Step 3.6: The final representation of the last layer node in the graph Transformer encoder is used as the final semantic similarity feature of the drug and disease obtained from the similarity channel, and is denoted as the drug semantic similarity feature. Disease semantic similarity features .
[0062] Further, in step 3.3, the fusion strategy is as follows: for a drug or disease, if the similarity based on molecular fingerprint or disease phenotype is not zero, the average value of the similarity and the Gaussian interaction contour similarity is taken as the fusion similarity; otherwise, the Gaussian interaction contour similarity is directly used as the fusion similarity.
[0063] Drug fusion similarity matrix Defined as:
[0064] ;
[0065] in, This is a drug molecule fingerprint similarity matrix;
[0066] Disease fusion similarity matrix Defined as:
[0067] ;
[0068] in, This represents the phenotypic similarity matrix of diseases.
[0069] Furthermore, the specific process of step 3.4 is as follows:
[0070] Step 3.4.1: Using drugs or diseases as nodes, directly use the fusion similarity matrix as the weighted adjacency matrix to obtain a weighted undirected graph, which is the isomorphic graph;
[0071] Step 3.4.2: Extract semantic representations of nodes from the isomorphic graph using a graph Transformer encoder; the graph Transformer encoder employs... Layered network structure, each layer contains One attention point; the specific process is as follows:
[0072] First, a linear mapping is performed on the fused similarity matrix to obtain the initial node representation. :
[0073] ;
[0074] in, and These are learnable weights and bias parameters; A fusion similarity matrix representing drugs or diseases;
[0075] In the Transformer encoder of the diagram... In the layer, for the first For each attention head, the query vector, key-value vector, and value vector are calculated as follows:
[0076] ;
[0077] ;
[0078] ;
[0079] in, , , These are the first two lines in the Transformer encoder. Attention head node Query vector, key-value vector, and value vector; , and These are the first two lines in the Transformer encoder. A mapping matrix corresponding to the attention head query vector, key value vector, and value vector; In the Transformer encoder of the graph, the first... Layer nodes The final representation;
[0080] Attention weights are calculated as follows:
[0081] ;
[0082] in, In the first Attention on the head, from the node to its neighboring nodes Attention weights; For the first The dimension of attention head;
[0083] Aggregation based on attention weights yields an intermediate semantic representation:
[0084] ;
[0085] in, For nodes The intermediate semantic representation obtained from aggregation; To output the projection matrix; Represents a node The set of neighboring nodes; For splicing; In the Transformer encoder of the graph, the first... Each attention-grabbing neighbor node The value vector.
[0086] Furthermore, in step 3.5, the output of each layer is:
[0087] ;
[0088] in, Indicates a feedforward network; In the Transformer encoder of the graph, the first... Layer nodes The final representation; In the Transformer encoder of the graph, the first... Layer nodes The intermediate semantic representation obtained by aggregation.
[0089] Furthermore, the specific process of step 4 is as follows:
[0090] Step 4.1: Construct the final node representation of drugs and diseases:
[0091] ;
[0092] ;
[0093] in, and These represent the final node representations of drugs and diseases, respectively.
[0094] Step 4.2: For each drug-disease pair, let and The first The drug and the first The final node representation after disease fusion, and the interaction model between the two are as follows:
[0095] ;
[0096] in, For the first The drug and the first Interaction vectors of each disease; This indicates vector concatenation; The absolute difference at the element level; For Hadamard product;
[0097] Step 4.3: Transfer the interaction vector Input a multilayer perceptron and output the predicted drug-disease association probability:
[0098] ;
[0099] in, For the first The drug and the first The predictive probability of a correlation between two diseases; It is a multilayer perceptron.
[0100] Furthermore, the specific process of step 5 is as follows:
[0101] Step 5.1: Construct the contrastive learning loss;
[0102] Contrast loss at drug nodes Defined as:
[0103] ;
[0104] in, , The loss functions for graph channel to similarity channel and similarity channel to graph channel are respectively, and their calculation formulas are as follows:
[0105] ;
[0106] ;
[0107] ;
[0108] ;
[0109] ;
[0110] ;
[0111] in, The similarity score between the image channel features and the similarity channel features; The similarity score is the score between the similarity channel features and the graph channel features. The similarity score for features within the image channels; Similarity score for features within the similarity channel; , The first The diagrammatic structural features of the drug, the first Semantic similarity features of individual drugs; , The first The semantic similarity features of each drug, the first The graphical structural features of a drug; For temperature parameters;
[0112] Contrast loss of disease nodes Defined as:
[0113] ;
[0114] Final contrastive learning loss for:
[0115] ;
[0116] Step 5.2: Construct a total loss function using the joint supervised learning loss and contrastive learning loss to optimize the association probability prediction; Total Loss Function for:
[0117] ;
[0118] in, The weighting coefficients are used to balance the loss components of supervised learning and contrastive learning. To supervise the learning loss, the formula is:
[0119] ;
[0120] in, For the training sample set; This is the binary cross-entropy loss function with logits; For the first The drug and the first The true probability that there is a correlation between the diseases.
[0121] The beneficial technical effects brought about by this invention are as follows.
[0122] 1. Strong heterogeneous data integration capability: Through dual-channel design, the graph structure information and semantic similarity information of heterogeneous graphs are used simultaneously to achieve deep integration of multi-source heterogeneous biomedical data.
[0123] 2. Effective feature alignment: The introduction of a contrastive learning mechanism effectively solves the problem of differences in distribution and scale between graph structure features and semantic similarity features, avoids noise caused by direct splicing, and enhances the consistency and complementarity of features.
[0124] 3. High model generalization ability: As a self-supervised signal, contrastive learning reduces the dependence on scarce labeled data and enhances the model's generalization ability on unseen data.
[0125] 4. Robust prediction performance: Experimental results on multiple benchmark datasets show that the present invention significantly outperforms the existing state-of-the-art methods in key metrics such as AUC and AUPR, and case studies verify its practical potential in real-world drug repositioning scenarios. Attached Figure Description
[0126] Figure 1 This is a flowchart of the drug relocation method based on dual-channel graph contrastive learning according to the present invention.
[0127] Figure 2 This is a parameter sensitivity analysis diagram of dataset B in the experiment of this invention; where (a) and (b) are the result diagrams of AUC index and AUPR index, respectively.
[0128] Figure 3 This is a sensitivity analysis diagram of the C dataset parameters in the experiment of this invention; where (a) and (b) are the result diagrams of the AUC index and AUPR index, respectively.
[0129] Figure 4 This is a sensitivity analysis diagram of the F dataset parameters in the experiment of this invention; where (a) and (b) are the result diagrams of the AUC index and AUPR index, respectively. Detailed Implementation
[0130] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0131] like Figure 1 As shown, a drug relocation method based on dual-channel graph contrastive learning includes the following steps:
[0132] Step 1: Obtain raw data on drugs, diseases, and proteins, and construct a heterogeneous biomedical graph to characterize three types of relationships: drug-protein, drug-disease, and disease-protein. Unlike most DDA (drug-disease association prediction) methods that only focus on the drug-disease network, this invention's heterogeneous graph further incorporates other biological entities, thereby obtaining a more comprehensive perspective. The specific process is as follows:
[0133] Step 1.1: Convert the acquired raw data into node features. Specifically: extract the SMILES structural information of the drug and convert it into an embedding vector using the Mol2Vec algorithm, i.e., drug node features; extract the phenotypic data of the disease and generate feature vectors using the MeSHHeading2vec method, i.e., disease node features; extract the protein sequence and encode it into a structural embedding using the ESM-2 model, i.e., protein node features. Mol2Vec is an algorithm that converts chemical molecular structures into fixed-dimensional vectors, aiming to provide effective molecular representation for machine learning tasks (such as drug activity prediction, property classification, etc.). The MeSHHeading2vec method is a method for converting MeSH (Medical Subject Headings) terms into vector representations. ESM-2 is a series of protein sequence pre-trained language models developed by Meta AI.
[0134] Step 1.2: To ensure consistency between different modalities, the node feature dimensions are uniformly projected onto the D-dimensional latent space as the input for the subsequent Transformer encoder.
[0135] Step 1.3: Establish three types of biomedical associations based on node characteristics: drug-disease, drug-protein, and disease-protein, thereby forming a heterogeneous biomedical graph. ;in, For a set of nodes, For a set of edges with different types, The characteristics of nodes are represented. Heterogeneous biomedical graphs include three types of nodes: drug nodes, disease nodes, and protein nodes, as well as three types of edges: drug-disease association edges, drug-protein interaction edges, and disease-protein association edges.
[0136] In this embodiment of the invention, raw data and known associations of drugs, diseases, and proteins are obtained from public databases such as DrugBank, OMIM, UniProt, and DisGeNET. For drugs, two-dimensional SMILES sequences are obtained from the DrugBank public database, and the Mol2Vec algorithm is used to convert the SMILES structural information of drugs into 300-dimensional embedding vectors. For diseases, a directed acyclic graph of the Medical Subject Headings (MeSH) is obtained from the OMIM public database, and the MeSHHeading2vec method is used to extract 64-dimensional feature vectors from the phenotypic data of diseases. For proteins, one-dimensional amino acid sequences of proteins are obtained from the UniProt public database, and the protein sequences are encoded into 320-dimensional structural embeddings using the ESM-2 model. All node feature dimensions are uniformly projected to a 256-dimensional latent space before being input into a Transformer encoder. Finally, based on the DisGeNET database, three types of biomedical associations—drug-disease, drug-protein, and disease-protein—are constructed to form a heterogeneous biomedical graph. The heterogeneous biomedical graph contains three node types: drug nodes, disease nodes, and protein nodes; and three edge types: drug-disease association edges, drug-protein interaction edges, and disease-protein association edges. This heterogeneous biomedical graph is a fully annotated heterogeneous graph, where each node carries its own feature vector and its connectivity relationships. This graph is then fed into a Heterogeneous Graph Transformer (HGT) to extract graph channel features for use by the prediction model. The Transformer is an attention-based sequence-to-sequence model.
[0137] This invention performs dual-channel feature extraction based on a heterogeneous graph Transformer and a graph Transformer encoder to obtain graph structure features and semantic similarity features, respectively.
[0138] Step 2: Utilize the Heterogeneous Graph Transformer (HGT) for graph channel feature extraction. Extract topologically aware features of drug and disease nodes from the heterogeneous biomedical graph to obtain the graph structure features of drugs and diseases. Unlike traditional Graph Neural Networks (GNNs) or Graph Convolutional Networks (GCNs), HGT explicitly models the influence of different types of edges during feature extraction, thus better handling the heterogeneity in the graph. HGT models different types of nodes through a multi-head attention mechanism and introduces specific weight matrices for different types of edges to capture heterogeneous semantics. Its computation process mainly includes three parts: heterogeneous attention score calculation, relation-aware message passing, and target node representation update. The specific process is as follows:
[0139] Step 2.1: The heterogeneous graph Transformer uses type-aware linear projection to calculate the query, key, and value vectors;
[0140] The heterogeneous graph Transformer of this invention adopts Layered network structure, each layer contains Each attention head; for the target node and its neighboring nodes In the heterogeneous graph Transformer, the first... In the layer, a linear transformation related to the node type is applied to compute the query vector, key vector, and value vector; for the heterogeneous graph Transformer, the first... The first in the layer Each attention point is calculated as follows:
[0141] ;
[0142] ;
[0143] ;
[0144] in, For the heterogeneous graph Transformer, the first... Attention target node The query vector; , These are the first and second lines in the heterogeneous graph Transformer. Each attention-grabbing neighbor node Key-value vectors and value vectors; , , These are the mapping matrices for the query vector, key vector, and value vector in the heterogeneous graph Transformer, respectively. and Representing the target node respectively and neighboring nodes The node type; , These are the first and second lines in the heterogeneous graph Transformer. Layer target node and neighboring nodes eigenvectors.
[0145] In this embodiment of the invention, the heterogeneous graph Transformer adopts a 4-layer network structure, with each layer containing 8 attention heads and the hidden dimension set to 256.
[0146] Step 2.2: Considering the edge type and its corresponding meta-relation, introduce a relation-specific transformation matrix and a relation importance factor to calculate the heterogeneous attention score:
[0147] ;
[0148] in, For the first Heterogeneous attention scores for each attention head; For the edge; Meta-relations corresponding to edge types The corresponding relation transformation matrix is a learnable variable used to model the impact of different relations on attention; This is a scaling factor used to avoid excessively large inner products; For dimensions; As a factor of relational importance; The meta-relation corresponding to the edge type; For transpose;
[0149] After normalization using the softmax function, the edges Attention weights The calculation is as follows:
[0150] ;
[0151] in, It is the softmax function; For the target node The set of neighboring nodes; This is a vector concatenation (join) operation used to combine vectors... The scores of each attention point are concatenated and then normalized.
[0152] Step 2.3: Aggregate neighborhood information through a message passing mechanism and update node representations using residual connections; the specific process is as follows:
[0153] First, message passing is performed: given from the... Each attention-grabbing neighbor node Value vector Messages are generated by applying a transformation matrix that is related to the edge type:
[0154] ;
[0155] in, For the first A message that attracts attention; Meta-relations corresponding to edge types The relevant transformation matrix;
[0156] Will come from all The messages from each person's attention are pieced together to form the final message representation. :
[0157] ;
[0158] Then target aggregation is performed: for the target node Take it from the neighbor node Messages based on attention weight Perform weighted aggregation:
[0159] ;
[0160] in, For the first Layer target node The weighted aggregated feature vector;
[0161] The node representation is updated through a type-specific projection matrix, an activation function (such as ReLU), and residual connections:
[0162] ;
[0163] in, Indicates node type The corresponding projection matrix; For activation functions; , These are the first and second lines in the heterogeneous graph Transformer. Layer, First Layer target node The feature vectors are summed to form a residual connection, which alleviates the training difficulties of deep networks and preserves information from the previous layer. The resulting embedding can effectively encode the semantic relationships between different node and edge types in heterogeneous graphs, thereby supporting cross-modal alignment and downstream prediction tasks.
[0164] Step 2.4: Use the feature vectors of the target nodes obtained from the last layer of the heterogeneous graph Transformer as the final graph structure features of drugs and diseases obtained from the graph channels, denoted as drug graph structure features respectively. Disease diagram structural features .
[0165] Step 3: Extract similarity channel features; specifically, calculate the similarity matrix between the drug molecule fingerprint and the drug's Gaussian interaction contour similarity matrix, and the similarity matrix between the disease phenotype and the disease's Gaussian interaction contour similarity matrix, and perform similarity fusion. Based on the fused similarity matrices, construct drug similarity maps and disease similarity maps respectively. Finally, extract the semantic similarity features of drugs and diseases using a graph Transformer encoder. Specifically, this invention extracts similarity channel features through similarity calculation, similarity fusion strategies, and a graph Transformer encoder to obtain the semantic similarity features of drug and disease nodes. The graph Transformer encoder enhances node representation by integrating multiple semantic similarity features. The specific process is as follows:
[0166] Step 3.1: Calculate the drug molecular fingerprint similarity matrix and the disease phenotype similarity matrix;
[0167] To measure the structural similarity between drugs, this invention employs molecular fingerprinting. Specifically, molecular structures are first represented using the SMILES format, then molecular fingerprint features are extracted using the RDKit tool, and the similarity between different drug fingerprints is calculated using the Tanimoto coefficient. Finally, a drug molecular fingerprint similarity matrix is obtained. ,in For the quantity of drugs, For the first The drug and the first The similarity between drugs.
[0168] Semantic similarity between diseases is calculated based on their phenotypic descriptions. First, disease-related phenotypic terms are extracted from the OMIM public database. Then, the MimMiner tool is used to calculate phenotypic similarity. MimMiner leverages text mining techniques to identify shared clinical phenotypes between different diseases, ultimately generating a disease phenotypic similarity matrix. ,in Indicates the number of diseases. For the first The disease and the first Similarities between diseases.
[0169] Step 3.2: Based on the known drug-disease association, calculate the Gaussian interaction contour similarity matrix for drugs and diseases respectively;
[0170] To model the relationship between drugs and diseases based on known interactions, Gaussian kernel functions are used to calculate the similarity of Gaussian interaction profiles (GIPs):
[0171] For drugs, the GIP similarity matrix is defined as follows:
[0172] ;
[0173] in, The Gaussian interactive contour similarity matrix of the drugs; It is an exponential function; Indicates the first The interaction vector between a drug and all diseases; Indicates the first The interaction vector between a drug and all diseases; The bandwidth parameter for the Gaussian kernel of a drug is calculated as follows:
[0174] ;
[0175] in, This is a hyperparameter, a fixed constant, usually set to 1; For the first The interaction vector between a drug and all diseases;
[0176] Similarly, for diseases, the GIP similarity matrix is defined as:
[0177] ;
[0178] in, The Gaussian interactive contour similarity matrix for the disease; It is the first The interaction vector between a disease and all drugs; For the first The interaction vector between a disease and all drugs; This refers to the bandwidth parameters of the Gaussian kernel for the disease.
[0179] Step 3.3: Use a fusion strategy to perform similarity fusion and construct a fusion similarity matrix between drugs and diseases. The fusion strategy is as follows: for a drug or disease, if the similarity based on molecular fingerprint or disease phenotype is not zero, then take the average of the similarity and the Gaussian interaction contour similarity as the fusion similarity; otherwise, directly use the Gaussian interaction contour similarity as the fusion similarity.
[0180] Both drugs and diseases can be characterized by multiple semantic similarities. To construct a more robust isomorphic graph, multi-source similarities are fused.
[0181] Drug fusion similarity matrix Defined as:
[0182] ;
[0183] in, This is the drug molecule fingerprint similarity matrix.
[0184] Correspondingly, the fusion similarity matrix of diseases Defined as:
[0185] ;
[0186] in, This represents the phenotypic similarity matrix of diseases.
[0187] Step 3.4: Based on the fused similarity matrix, construct two isomorphic graphs: a drug similarity graph and a disease similarity graph, respectively, and extract the intermediate semantic representations of the nodes using a graph Transformer encoder; the specific process is as follows:
[0188] Step 3.4.1: Using drugs or diseases as nodes, directly use the fusion similarity matrix as the weighted adjacency matrix to obtain a weighted undirected graph, which is the isomorphic graph;
[0189] Step 3.4.2: Extract semantic representations of nodes from the isomorphic graph using a graph Transformer encoder; the graph Transformer encoder employs... Layered network structure, each layer contains One attention point; the specific process is as follows:
[0190] First, a linear mapping is performed on the fused similarity matrix to obtain the initial node representation. :
[0191] ;
[0192] in, and These are learnable weights and bias parameters; This represents the fusion similarity matrix corresponding to a drug or disease.
[0193] In the Transformer encoder of the diagram... In the layer, for the first For each attention head, its query vector, key-value vector, and value vector are calculated as follows:
[0194] ;
[0195] ;
[0196] ;
[0197] in, , , These are the first two lines in the Transformer encoder. Attention head node Query vector, key-value vector, and value vector; , and These are the first two lines in the Transformer encoder. A mapping matrix corresponding to the attention head query vector, key value vector, and value vector; In the Transformer encoder of the graph, the first... Layer nodes The final representation.
[0198] Attention weights are calculated as follows:
[0199] ;
[0200] in, In the first Attention on the head, from the node to its neighboring nodes Attention weights; For the first The dimension of attention heads.
[0201] Aggregation based on attention weights yields an intermediate semantic representation:
[0202] ;
[0203] in, For nodes The intermediate semantic representation obtained from aggregation; This represents the number of attention heads in each layer of the Transformer encoder. To output the projection matrix; Represents a node The set of neighboring nodes; For splicing; In the Transformer encoder of the graph, the first... Each attention-grabbing neighbor node The value vector.
[0204] Step 3.5: The intermediate semantic representation output is further updated by the feedforward network to obtain the final representation of the node;
[0205] The output of each layer is:
[0206] ;
[0207] in, Indicates a feedforward network; In the Transformer encoder of the graph, the first... Layer nodes The final representation; In the Transformer encoder of the graph, the first... Layer nodes The intermediate semantic representation obtained by aggregation.
[0208] Step 3.6: Add the last layer nodes to the graph Transformer encoder. The final representation, as the final semantic similarity features of drugs and diseases obtained from the similarity channel, is denoted as drug semantic similarity features. Disease semantic similarity features .
[0209] Step 4: Perform fusion and interaction of dual-channel features to construct the interaction vector of the drug-disease pair and predict the association probability. This invention fuses the graph structure features and semantic similarity features of drugs and diseases to obtain the final node representations of drugs and diseases. For any drug-disease pair, an interaction vector is constructed by concatenating the corresponding final node representation of the drug, the corresponding final node representation of the disease, the absolute difference between their features, and the element-wise product of their features. The interaction vector is then input into a multilayer perceptron to output the drug-disease association probability. The specific process is as follows:
[0210] Step 4.1: Fuse the features obtained from the two channels to construct the final node representations for the drug and the disease, respectively.
[0211] ;
[0212] ;
[0213] in, and These represent the final nodes of drugs and diseases, respectively.
[0214] Step 4.2: The interaction vector of a drug-disease pair is formed by concatenating the corresponding drug feature, the corresponding disease feature, the absolute value of the difference between their features, and the element-wise product of their features. For each drug-disease pair, let... and The first The drug and the first The node representation after disease fusion, and the interaction model between the two are as follows:
[0215] ;
[0216] in, For the first The drug and the first Interaction vectors of each disease; This indicates vector concatenation; The absolute difference at the element level; For Hadamard products.
[0217] Step 4.3: Transfer the interaction vector Inputting a multilayer perceptron (MLP), the MLP outputs a predicted drug-disease association probability:
[0218] ;
[0219] in, For the first The drug and the first The predictive probability of a correlation between two diseases; It is a multilayer perceptron.
[0220] Step 5: Design a loss function for dual-channel contrastive learning alignment, i.e., construct a contrastive learning loss between the graph channel and the similarity channel, and combine it with the supervised learning loss to optimize the association probability prediction. To enhance the consistency of drug and disease node representations in different channels and improve overall prediction performance, a graph contrastive learning mechanism is introduced on the basis of supervised learning, thereby forming a joint optimization objective. The specific process is as follows:
[0221] Step 5.1: Construct a contrastive learning loss function to align the feature representations of the same node in the graph channel and the similarity channel, strengthening the consistency and complementarity of features to achieve contrastive learning. The specific contrastive learning loss function is as follows: To encourage consistency in node representations across different semantic channels, a contrastive loss is introduced for both drug and disease nodes. Specifically, for drug and disease nodes, the contrastive loss between their graph channel features and similarity channel features is calculated separately. The total contrastive loss is the sum of the contrastive losses for both types of nodes. For any given node, the loss function is calculated as follows: First, the similarity between the node's representations in the two channels is calculated as the positive sample pair similarity. Second, the sum of the similarities between the node and all other nodes in the batch across different channels is calculated as the negative sample pair similarity. Finally, the ratio of the positive sample pair similarity to the sum of the positive and negative sample pair similarities is taken, and the negative logarithm of this ratio is used to obtain the contrastive loss for that node. The specific process is as follows:
[0222] Regarding the drug node, for the first For each drug, the node's positive sample is itself, while the others... Each node constitutes a negative sample. The contrast loss of the drug node. Defined as:
[0223] ;
[0224] in, , The loss functions for graph channel to similarity channel and similarity channel to graph channel are respectively, and their calculation formulas are as follows:
[0225] ;
[0226] ;
[0227] ;
[0228] ;
[0229] ;
[0230] ;
[0231] in, The similarity score between the image channel features and the similarity channel features; The similarity score is the score between the similarity channel features and the graph channel features. The similarity score for features within the image channels; Similarity score for features within the similarity channel; , The first The diagrammatic structural features of the drug, the first Semantic similarity features of individual drugs; , The first The semantic similarity features of each drug, the first The graphical structural features of a drug; This refers to the temperature parameter.
[0232] Similarly, contrast loss of disease nodes Defined as:
[0233] ;
[0234] Final contrastive learning loss for:
[0235] ;
[0236] Step 5.2: Construct the total loss function by combining the supervised learning loss and the contrastive learning loss function; to simultaneously optimize prediction accuracy and consistency of representations across different channels, the supervised learning loss... The total loss function is obtained by weighting and combining the total contrastive learning loss with the total contrastive learning loss. :
[0237] ;
[0238] in, The weighting coefficients are used to balance the supervised learning loss and the total comparative loss.
[0239] The binary classification objective is defined using a binary cross-entropy loss with logits, therefore the supervised learning loss... for:
[0240] ;
[0241] in, For the training sample set; This is the binary cross-entropy loss function with logits; For the first The drug and the first The true probability that there is a correlation between the diseases.
[0242] Table 1 Comparison of experimental results of DCLDR and other methods on three datasets.
[0243] .
[0244] To verify the effectiveness and feasibility of the method of this invention, validation was performed on three benchmark datasets (B / C / F datasets). The statistical characteristics of the datasets are as follows: Dataset B contains 269 drugs, 598 diseases, 1021 proteins, and 18416 drug-disease associations, 3110 drug-protein effects, and 5898 disease-protein associations; Dataset C contains 663 drugs, 409 diseases, 993 proteins, and 2532 drug-disease associations, 3773 drug-protein effects, and 10734 disease-protein associations; Dataset F contains 593 drugs, 313 diseases, 2741 proteins, and 1933 drug-disease associations, 3243 drug-protein effects, and 54265 disease-protein associations.
[0245] Ten-fold cross-validation was used for evaluation, and parameter sensitivity analysis was conducted with AUC and AUPR as the main evaluation indicators. The experimental results are as follows: Figures 2-4 As shown, the experimental results indicate that the AUC of this invention reaches 0.952, 0.937 and 0.926 on the three datasets B, C and F, respectively, and the AUPR reaches 0.961, 0.943 and 0.931, respectively.
[0246] The method of this invention is defined as the DCLDR model. The DCLDR model of this invention is compared with other method models on three datasets, B, C and F. The experimental comparison data is shown in Table 1.
[0247] In Table 1, deepDR is a deep learning-based intelligent auxiliary diagnostic technology for diabetic retinopathy (DR); HNet-DNN is a hybrid deep neural network architecture; DRHGCN is a two-branch residual hybrid graph convolutional network; HINGRL is a model combining graph neural networks and representation learning; DRWBNCF is a hybrid model combining width learning (for fast feature extraction) and neural collaborative filtering (for relation matching); DDAGDL is a bidiscriminative adversarial graph deep learning model; AMDGT is a deep learning model combining graph neural networks and Transformer architecture; DRGCL is a model that transforms fundus images into graph structures and uses graph neural networks (such as graph convolutional networks) for diabetic retinopathy classification; and AdaDR is a diabetic retinopathy diagnostic model that emphasizes adaptability.
[0248] In addition, in the case studies of Alzheimer's disease and breast cancer, Tables 2 and 3 show the top 10 drugs associated with Alzheimer's disease and breast cancer, respectively.
[0249] Table 2. Top 10 drugs associated with Alzheimer's disease in case studies
[0250] .
[0251] Table 3. Top 10 drugs associated with breast cancer case studies
[0252] .
[0253] As can be seen from Tables 2 and 3, this invention successfully predicted the association between seven known drugs (clofarapine, meclofenac, olphenadrine, conjugated estrogen, fiprofen, temozolomide, and vinblastine) and Alzheimer's disease, as well as the association between eight known drugs (bleomycin, goserelin, ruprolin, teniposide, baclofen, betamethasone, carmustine, and bexarotine) and breast cancer, confirming the practical value of the method of this invention in real-world scenarios.
[0254] This invention also proposes a drug relocation system based on dual-channel graph contrastive learning, comprising:
[0255] The heterogeneous graph construction module is configured to extract data from multi-source biomedical databases and construct heterogeneous biomedical graphs containing drugs, diseases, proteins and their associations.
[0256] The graph channel feature extraction module is configured to extract topology-aware features of nodes from heterogeneous biomedical graphs via a heterogeneous graph Transformer.
[0257] The similarity channel calculation module is configured to calculate and fuse multiple similarities between drugs and diseases, and then extract semantic similarity features of nodes through a graph Transformer encoder.
[0258] The contrastive learning alignment module is configured to align graph channel features with similarity channel features in the embedding space through a contrastive learning mechanism.
[0259] The association prediction module is configured to fuse dual-channel features to predict the probability of association between drugs and diseases.
[0260] Of course, the above description is not intended to limit the present invention, and the present invention is not limited to the examples given above. Any changes, modifications, additions or substitutions made by those skilled in the art within the scope of the present invention should also fall within the protection scope of the present invention.
Claims
1. A drug relocation method based on dual-channel graph contrastive learning, characterized in that, Includes the following steps: Step 1: Obtain the raw data of drugs, diseases, and proteins and convert them into node features. Construct a heterogeneous biomedical graph based on drug-disease associations, drug-protein effects, and disease-protein associations. Specifically, extract the SMILES structure information of drugs and convert it into drug node features using Mol2Vec. Extract disease phenotypic data and generate disease node features using MeSHHeading2vec. Extract protein sequences and encode them into protein node features using the ESM-2 model. Step 2: Use the heterogeneous graph Transformer to extract graph channel features and extract the graph structure features of drugs and diseases; Step 3: Extract similarity channel features; specifically: calculate the drug molecule fingerprint similarity matrix and the drug's Gaussian interaction contour similarity matrix, and the disease phenotype similarity matrix and the disease's Gaussian interaction contour similarity matrix, and perform similarity fusion. Based on the fused similarity matrix, construct drug similarity maps and disease similarity maps respectively. Finally, extract the semantic similarity features of drugs and diseases through a graph Transformer encoder. Step 4: Fuse the graph structure features of drugs and diseases with semantic similarity features to obtain the final node representations of drugs and diseases; for any drug-disease pair, construct an interaction vector formed by concatenating the corresponding final node representation of the drug, the corresponding final node representation of the disease, the absolute difference between the features of the two, and the element-wise product of the features of the two, and input the interaction vector into a multilayer perceptron to output the drug-disease association probability. Step 5: Construct a contrastive learning loss between the graph channel and the similarity channel, and combine it with the supervised learning loss to optimize the association probability prediction.
2. The drug relocation method based on dual-channel graph contrastive learning according to claim 1, characterized in that, In step 1, Mol2Vec is an algorithm that converts chemical molecular structures into fixed-dimensional vectors; MeSHHeading2vec is a method that converts terms into vector representations; and ESM-2 is a pre-trained language model for protein sequences. Project the features of each node uniformly into the D-dimensional latent space; Heterogeneous Biomedical Diagram ;in, For a set of nodes, For a set of edges with different types, The characteristics of nodes are represented; the constructed heterogeneous biomedical graph includes three types of nodes: drug nodes, disease nodes, and protein nodes, as well as three types of edges: drug-disease association edges, drug-protein interaction edges, and disease-protein association edges.
3. The drug relocation method based on dual-channel graph contrastive learning according to claim 1, characterized in that, The specific process of step 2 is as follows: Step 2.1: The heterogeneous graph Transformer uses type-aware linear projection to calculate the query, key, and value vectors; Heterogeneous graph Transformer uses Layered network structure, each layer contains The attention head; for the heterogeneous graph Transformer, the first attention head; The first in the layer The formula for calculating the attention points is: ; ; ; in, For the heterogeneous graph Transformer, the first... Attention target node The query vector; , These are the first and second lines in the heterogeneous graph Transformer. Each attention-grabbing neighbor node Key-value vectors and value vectors; , , These are the mapping matrices for the query vector, key vector, and value vector in the heterogeneous graph Transformer, respectively. and Representing the target node respectively and neighboring nodes Node type; , These are the first and second lines in the heterogeneous graph Transformer. Layer target node and neighboring nodes eigenvectors; Step 2.2: Calculate the heterogeneous attention score: ; in, For the first Heterogeneous attention scores for each attention head; For the edge; Meta-relations corresponding to edge types The corresponding relational transformation matrix; For dimensions; As a factor of relational importance; For transpose; Calculate edges Attention weights : ; in, It is the softmax function; For the target node The set of neighboring nodes; This is a vector concatenation operation; Step 2.3: Aggregate neighborhood information through a message passing mechanism and update node representations using residual connections; Step 2.4: Use the feature vectors of the target nodes obtained from the last layer of the heterogeneous graph Transformer as the final graph structure features of drugs and diseases obtained from the graph channels, denoted as drug graph structure features respectively. Disease diagram structural features .
4. The drug relocation method based on dual-channel graph contrastive learning according to claim 3, characterized in that, The specific process of step 2.3 is as follows: First, message passing is performed: given from the... Each attention-grabbing neighbor node Value vector Messages are generated by applying a transformation matrix that is related to the edge type: ; in, For the first A message that attracts attention; Meta-relations corresponding to edge types The relevant transformation matrix; Will come from all The messages from each person's attention are pieced together to form the final message representation. : ; Then target aggregation is performed: for the target node Take it from the neighbor node Messages based on attention weight Perform weighted aggregation: ; in, For the first Layer target node The weighted aggregated feature vector; The node representation update is accomplished jointly through the projection matrix, activation function, and residual connections: ; in, Indicates node type The corresponding projection matrix; For activation functions; For the heterogeneous graph Transformer, the first... Layer target node eigenvectors.
5. The drug relocation method based on dual-channel graph contrastive learning according to claim 4, characterized in that, The specific process of step 3 is as follows: Step 3.1: Calculate the drug molecular fingerprint similarity matrix and the disease phenotype similarity matrix; Molecular fingerprinting is used to measure the structural similarity between drugs: First, molecular structures are represented using the SMILES format. Then, molecular fingerprint features are extracted using the RDKit tool. Finally, the similarity between fingerprints of different drugs is calculated using the Tanimoto coefficient, resulting in a drug molecular fingerprint similarity matrix. ,in For the quantity of drugs, For the first The first drug and the first The similarity of individual drugs; Semantic similarity between diseases is calculated based on phenotypic descriptions: First, disease-related phenotypic terms are extracted from the OMIM public database. Then, the MimMiner tool is used to calculate phenotypic similarity. The MimMiner tool uses text mining technology to identify shared clinical phenotypes between different diseases, and finally generates a disease phenotypic similarity matrix. ,in Indicates the number of diseases. For the first The disease and the first Similarities between diseases; Step 3.2: Based on the known drug-disease association, calculate the Gaussian interaction contour similarity matrix for drugs and diseases respectively; The Gaussian interaction contour similarity matrix of drugs is defined as follows: ; in, The Gaussian interactive contour similarity matrix of the drugs; It is an exponential function; Indicates the first The interaction vector between a drug and all diseases; Indicates the first The interaction vector between a drug and all diseases; The bandwidth parameter for the Gaussian kernel of a drug is calculated as follows: ; in, For hyperparameters; For the first The interaction vector between a drug and all diseases; The Gaussian interaction contour similarity matrix of a disease is defined as follows: ; in, The Gaussian interactive contour similarity matrix for the disease; It is the first The interaction vector between a disease and all drugs; For the first The interaction vector between a disease and all drugs; For the bandwidth parameters of the Gaussian kernel targeting the disease; Step 3.3: Employ a fusion strategy to perform similarity fusion and construct a fusion similarity matrix between drugs and diseases; Step 3.4: Based on the fusion similarity matrix, construct two isomorphic graphs: a drug similarity graph and a disease similarity graph, and extract the intermediate semantic representation of the nodes using a graph Transformer encoder; Step 3.5: The intermediate semantic representation output is further updated by the feedforward network to obtain the final representation of the node; Step 3.6: The final representation of the last layer node in the graph Transformer encoder is used as the final semantic similarity feature of the drug and disease obtained from the similarity channel, and is denoted as the drug semantic similarity feature. Disease semantic similarity features .
6. The drug relocation method based on dual-channel graph contrastive learning according to claim 5, characterized in that, In step 3.3, the fusion strategy is as follows: for a drug or disease, if the similarity based on molecular fingerprint or disease phenotype is not zero, the average value of the similarity and the Gaussian interaction contour similarity is taken as the fusion similarity; otherwise, the Gaussian interaction contour similarity is directly used as the fusion similarity. Drug fusion similarity matrix Defined as: ; in, This is a drug molecule fingerprint similarity matrix; Disease fusion similarity matrix Defined as: ; in, This represents the phenotypic similarity matrix of diseases.
7. The drug relocation method based on dual-channel graph contrastive learning according to claim 6, characterized in that, The specific process of step 3.4 is as follows: Step 3.4.1: Using drugs or diseases as nodes, directly use the fusion similarity matrix as the weighted adjacency matrix to obtain a weighted undirected graph, which is the isomorphic graph; Step 3.4.2: Extract semantic representations of nodes from the isomorphic graph using a graph Transformer encoder; the graph Transformer encoder employs... Layered network structure, each layer contains One point of attention; The specific process is as follows: First, a linear mapping is performed on the fused similarity matrix to obtain the initial node representation. : ; in, and These are learnable weights and bias parameters; A fusion similarity matrix representing drugs or diseases; In the Transformer encoder of the diagram... In the layer, for the first For each attention head, the query vector, key-value vector, and value vector are calculated as follows: ; ; ; in, , , These are the first two lines in the Transformer encoder. Attention head node Query vector, key-value vector, and value vector; , and These are the first two lines in the Transformer encoder. A mapping matrix corresponding to the attention head query vector, key value vector, and value vector; In the Transformer encoder of the graph, the first... Layer nodes The final representation; Attention weights are calculated as follows: ; in, In the first Attention on the head, from the node to its neighboring nodes Attention weights; For the first The dimension of attention head; Aggregation based on attention weights yields an intermediate semantic representation: ; in, For nodes The intermediate semantic representation obtained from aggregation; To output the projection matrix; Represents a node The set of neighboring nodes; For splicing; In the Transformer encoder of the graph, the first... Each attention-grabbing neighbor node The value vector.
8. The drug relocation method based on dual-channel graph contrastive learning according to claim 7, characterized in that, In step 3.5, the output of each layer is: ; in, Indicates a feedforward network; In the Transformer encoder of the graph, the first... Layer nodes The final representation; In the Transformer encoder of the graph, the first... Layer nodes The intermediate semantic representation obtained by aggregation.
9. The drug relocation method based on dual-channel graph contrastive learning according to claim 8, characterized in that, The specific process of step 4 is as follows: Step 4.1: Construct the final node representation of drugs and diseases: ; ; in, and These represent the final node representations of drugs and diseases, respectively. Step 4.2: For each drug-disease pair, let and The first The first drug and the first The final node representation after disease fusion, and the interaction model between the two are as follows: ; in, For the first The first drug and the first Interaction vectors of each disease; This indicates vector concatenation; The absolute difference at the element level; For Hadamard product; Step 4.3: Transfer the interaction vector Input a multilayer perceptron, output the predicted drug-disease association probability: ; in, For the first The first drug and the first The predictive probability of a correlation between two diseases; It is a multilayer perceptron.
10. The drug relocation method based on dual-channel graph contrastive learning according to claim 9, characterized in that, The specific process of step 5 is as follows: Step 5.1: Construct the contrastive learning loss; Contrast loss at drug nodes Defined as: ; in, , The loss functions for graph channel to similarity channel and similarity channel to graph channel are respectively, and their calculation formulas are as follows: ; ; ; ; ; ; in, The similarity score between the image channel features and the similarity channel features; The similarity score is the score between the similarity channel features and the graph channel features. The similarity score for features within the image channels; Similarity score for features within the similarity channel; , The first The diagrammatic structural features of the drug, the first Semantic similarity features of individual drugs; , The first The semantic similarity features of each drug, the first The graphical structural features of a drug; For temperature parameters; Contrast loss of disease nodes Defined as: ; Final contrastive learning loss for: ; Step 5.2: Construct a total loss function using the joint supervised learning loss and contrastive learning loss to optimize the association probability prediction; Total Loss Function for: ; in, The weighting coefficients are used to balance the loss components of supervised learning and contrastive learning. To supervise the learning loss, the formula is: ; in, For the training sample set; This is the binary cross-entropy loss function with logits; For the first The first drug and the first The true probability that there is a correlation between the diseases.