An Explainable Drug Recommendation Method and System Based on Knowledge-Enhanced Hypergraph Convolutional Networks
By constructing a hierarchical hypergraph structure and introducing external knowledge graph relationships through a knowledge-enhanced hypergraph convolutional network, the problem of modeling high-order interactions and negative relationships in drug recommendation is solved, and personalized, safe and interpretable drug recommendation results are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-17
- Publication Date
- 2026-03-10
AI Technical Summary
Existing drug recommendation methods struggle to effectively capture high-level, diverse interaction patterns among healthcare entities in personalized medicine, and lack modeling and interpretability of negative relationships, resulting in insufficient safety and accuracy in the recommendation results.
We employ a knowledge-enhanced hypergraph convolutional network to construct a hierarchical hypergraph structure, introducing external knowledge graph relationships and generalized meta-paths. Through hypergraph convolution and meta-path convolution mechanisms, combined with self-attention mechanisms and multilayer perceptrons, we generate drug recommendation results. Furthermore, we introduce binary cross-entropy, multi-label marginal loss, DDI loss, and taboo relation loss into the loss function to improve the interpretability and safety of the model.
It significantly improves the accuracy and safety of drug recommendations, can more accurately depict the patient's condition and the evolution of medication, and provides transparent and interpretable personalized drug combination recommendations, which are suitable for complex medical practice scenarios.
Smart Images

Figure CN121354795B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of healthcare informatics technology, and in particular to an interpretable drug recommendation method and system based on knowledge-enhanced hypergraph convolutional networks. Background Technology
[0002] In the field of personalized medicine, medication recommendation systems aim to provide patients with more accurate and safer medication advice, enabling personalized treatment based on their medical history and current condition. Unlike traditional standardized treatment pathways, personalized medication recommendations can combine a patient's unique medical history and current symptoms to improve the effectiveness and safety of treatment.
[0003] In recent years, with the widespread application of Electronic Health Records (EHRs), the accumulation of clinical data has provided a solid data foundation for drug recommendation. EHRs contain multi-dimensional clinical event sequences, including patient demographics, diagnoses, surgeries, and medications, making it possible to model a patient's complete medical trajectory. However, EHR data exhibits high sparsity, meaning that the frequency of patient-drug interactions is far lower than in other recommendation scenarios (such as e-commerce and short videos), making it difficult to comprehensively characterize patient features based solely on limited historical medication information. Furthermore, existing methods often model the relationships between medical entities using simple binary relationships, failing to fully explore higher-order dependencies and complex interactions between multiple entities such as diseases, surgeries, and medications, thus limiting the responsiveness of recommendation systems to individual patient needs.
[0004] To alleviate the problem of data sparsity, existing studies have introduced auxiliary information such as drug molecular structures, medical ontology encoding, and knowledge graphs to enhance the accuracy of drug recommendations through heterogeneous data. However, most of these methods only focus on positive associations between entities, rarely systematically utilizing negative relationships (such as the contraindication between diseases and drugs), and they also suffer from shortcomings in model interpretability. Especially in high-risk medical scenarios, the interpretability of recommendation results is of great significance for clinical application and safety assurance.
[0005] In recent years, Graph Neural Networks (GNNs) have been widely used in drug recommendation due to their advantages in modeling structured data and capturing complex relationships. However, existing GNN-based methods mainly rely on traditional graph structures, focusing on simple relationships between pairs of entities, and are unable to effectively capture high-order, diverse interaction patterns of medical entities. In addition, while knowledge graph-enhanced recommendation methods have improved the expressive power of the models, they still have significant shortcomings in areas such as negative relationship modeling and interpretability improvement.
[0006] The existing patent solution, "A Drug Recommendation Method and System Based on Heterogeneous EHR Network Representation Learning," models the relationship between patients and drugs using ordinary graphs and aggregates information using graph neural networks. However, it can only express binary relationships and struggles to characterize complex high-order interactions and multidimensional attributes. This invention proposes an innovative knowledge-enhanced hypergraph convolutional network. By introducing external knowledge graph relationships and generalized meta-paths, it not only alleviates the modeling challenges caused by the sparsity of EHR data but also improves the interpretability of the recommendation results. This method designs a hierarchical hypergraph structure that can fully capture the multi-level complex relationships between medical entities and explicitly introduces negative relationships, such as contraindications between diseases and drugs, into the loss function, thereby improving the safety of drug recommendations.
[0007] In summary, existing methods still have significant shortcomings in capturing complex interactions, modeling high-order relationships, and providing interpretability, making it difficult to fully meet the urgent needs of clinical practice for personalized, safe, and interpretable drug recommendations. This invention addresses these issues by proposing an innovative solution that integrates knowledge enhancement and hierarchical hypergraph structures, providing a technical foundation for improving the accuracy, safety, and interpretability of drug recommendations. Summary of the Invention
[0008] To overcome the limitations of existing technologies, this invention proposes an interpretable drug recommendation method and system based on knowledge-enhanced hypergraph convolutional networks, which can generate interpretable drug recommendation results more accurately and securely.
[0009] To achieve the above objectives, the technical solution of the present invention includes the following:
[0010] An interpretable drug recommendation method based on knowledge-enhanced hypergraph convolutional networks, the method comprising:
[0011] Construct a hierarchical hypergraph containing visitor and patient levels, and import test instances into this hypergraph; where the visitor level contains access hyperedges. Based on medical records disease collection in Surgical Collection and drug collection Construction, patient super-border in patient hierarchy By connecting those belonging to the same patient All access hyperedges The test instance is generated as an access hyperedge based on the target patient's current disease set, current surgery set, and last treatment medication set. The hypergraph nodes in the hierarchical hypergraph include: disease nodes, surgery nodes, and medication nodes.
[0012] The features of hypergraph nodes and access hyperedges are updated by using the hypergraph convolution mechanism to obtain the embedding representations of hypergraph nodes and access hyperedges.
[0013] Define meta-paths in the external medical knowledge base, and construct a generalized meta-path that includes access hyperedges and meta-paths based on the external medical knowledge base;
[0014] By introducing a knowledge graph-based meta-path convolution mechanism, an embedded representation of generalized meta-path nodes is generated; wherein, the generalized meta-path nodes include: access hyperedge nodes, disease nodes, surgery nodes, drug nodes, classification nodes, and molecular structure nodes;
[0015] Based on the embedding representations of hypergraph nodes, access hyperedges, and generalized element path nodes, the drug recommendation results for the test instance are obtained.
[0016] Furthermore, feature updates are performed on hypergraph nodes and visited hyperedges using a hypergraph convolution mechanism to obtain the embedding representations of hypergraph nodes and visited hyperedges, including:
[0017] Through embedding matrix Mapping diseases, surgeries, and drugs yields initial embedding representations of disease nodes, surgery nodes, and drug nodes. , , Indicates disease nodes, Indicates surgical nodes, Indicates drug nodes;
[0018] The disease node, surgery node, and drug node are calculated using the hypergraph convolution mechanism at the [missing information]. Layer Embedded Representation ;in, Indicates the first Access to hyperedge The set of nodes contained within. Shared learnable weights representing different node types Represents a node In the Layer embedding representation;
[0019] Get access to the superedge The supergraph contains hypergraph nodes, and the embedding representation of each hypergraph node is used. We obtain the access superedge by weighted aggregation using the self-attention mechanism. Embedded representation.
[0020] Furthermore, the generalized meta-path includes: accessing the hyperedge - containing - disease - treatment - drug, accessing the hyperedge - containing - surgery - treatment - drug, accessing the hyperedge - containing - disease - molecular structural abnormality - molecular structure - positive treatment of molecular abnormality - drug, and accessing the hyperedge - containing - disease - classification - classification - drug.
[0021] Furthermore, by introducing a knowledge graph-based meta-path convolution mechanism, embedding representations of generalized meta-path nodes are generated, including:
[0022] Through embedding matrix Mapping diseases, surgeries, drugs, classifications, and molecular structures yields initial embedding representations for disease nodes, surgery nodes, drug nodes, classification nodes, and molecular structure nodes. , , Indicates disease nodes, Indicates surgical nodes, Indicates drug nodes, Represents molecular structure nodes. Represents a category node;
[0023] Get access to the superedge The supergraph contains hypergraph nodes, and the embedding representation of each hypergraph node is used. We obtain the access superedge by weighted aggregation using the self-attention mechanism. initial embedding representation ;
[0024] By aggregating generalized path By accessing information from all neighboring nodes, the target node can be obtained. Along this generalized element path Node semantic embedding , ;
[0025] Aggregate target nodes Along each generalized element path Node semantic embedding This yields the embedded representation of the generalized element path node.
[0026] Furthermore, based on the embedding representations of hypergraph nodes, access hyperedges, and generalized element path nodes, the drug recommendation results for the test instance are obtained, including:
[0027] The embedding representations of hypergraph nodes and access hyperedges are updated by combining the embedding representations of generalized element path nodes, resulting in the final embedding representations of hypergraph nodes and access hyperedges.
[0028] Based on the final embedding representation of the accessed superedge, generate the embedding representation of the target patient superedge and the embedding representation of the other patient superedges;
[0029] Based on the similarity between the final embedding representation of the drug node and the final embedding representation of the access hyperedge corresponding to the test instance, calculate the matching probability between the test case and each drug.
[0030] Based on the similarity between the embedding representation of the target patient's hyperedge and the embedding representation of the hyperedge of other patients, the similarity of disease course among different patients is obtained.
[0031] Based on the matching probability between test cases and each drug, and the similarity of disease course among different patients, the drug recommendation results for the test cases are obtained.
[0032] Furthermore, the embedding representations of hypergraph nodes and access hyperedges are updated by combining the embedding representations of generalized element path nodes, resulting in the final embedding representations of hypergraph nodes and access hyperedges, including:
[0033] The embedding representation of the generalized element path node is concatenated with the embedding representation of the hypergraph node and the embedding representation of the access hyperedge, respectively.
[0034] The splicing results are then processed through a masking mechanism and a multilayer perceptron to obtain the final embedded representation of the hypergraph nodes and the final embedded representation of the accessed hyperedges.
[0035] An interpretable drug recommendation system based on a knowledge-enhanced hypergraph convolutional network, the system comprising:
[0036] The hierarchical hypergraph construction module is used to construct a hierarchical hypergraph containing a visitor hierarchy and a patient hierarchy, and to import test instances into this hierarchical hypergraph; among them, the access hyperedges in the visitor hierarchy... Based on medical records disease collection in Surgical Collection and drug collection Construction, patient super-border in patient hierarchy By connecting those belonging to the same patient All access hyperedges The test instance is generated as an access hyperedge based on the target patient's current disease set, current surgery set, and last treatment medication set. The hypergraph nodes in the hierarchical hypergraph include: disease nodes, surgery nodes, and medication nodes.
[0037] The generalized meta-path generation module is used to define meta-paths in an external medical knowledge base and construct generalized meta-paths containing access hyperedges and meta-paths based on the external medical knowledge base.
[0038] Drug recommendation models are used for:
[0039] The features of hypergraph nodes and access hyperedges are updated by using the hypergraph convolution mechanism to obtain the embedding representations of hypergraph nodes and access hyperedges.
[0040] By introducing a knowledge graph-based meta-path convolution mechanism, an embedded representation of generalized meta-path nodes is generated; wherein, the generalized meta-path nodes include: access hyperedge nodes, disease nodes, surgery nodes, drug nodes, classification nodes, and molecular structure nodes;
[0041] Based on the embedding representations of hypergraph nodes, access hyperedges, and generalized element path nodes, the drug recommendation results for the test instance are obtained.
[0042] Furthermore, it is characterized by, based on the binary cross-entropy loss Multi-label marginal loss DDI loss Loss of taboo relationships To generate the total loss To train the drug recommendation model; wherein the binary cross-entropy loss The multi-label marginal loss is used to measure the difference between the predicted probability and the actual binary label for each drug. The DDI loss is used to measure the difference between relevant and irrelevant drug scores. To prevent adverse drug interactions, the contraindication relationship is lost. Used to prevent contraindications between drugs and diseases.
[0043] Furthermore, the binary cross-entropy loss ;
[0044] The multi-label marginal loss ;
[0045] The DDI loss ;
[0046] The taboo relationship loss ;
[0047] in, Indicates the first Drug The true label, Indicates the first Drug exist The predicted probability at time t. Indicates a collection of drugs. Represents a collection of diseases. Indicates the first Disease exist Predicted labels at time points, DDI adjacency matrix , Indicates the first The drug and the first The drugs interact with each other; the contraindication relationship adjacency matrix , Indicates the first Disease and the first These drugs interact with each other.
[0048] Furthermore, the total loss Among them, parameters Used to control the strength of regularization and For hyperparameters, parameters , This represents the observed rate of negative interactions. This represents an acceptable harmful threshold for clinical applications. This is a correction factor for adjusting influence based on proportional relationships.
[0049] Compared with existing technologies, this invention fully integrates the rich semantic information of external knowledge graphs with the high-order relation modeling advantages of hierarchical hypergraph convolutional networks, significantly improving the performance of drug recommendation systems in practical application scenarios such as sparse EHR data and complex relationships. In this method, the invention introduces external knowledge graph relationships to construct generalized meta-paths and embeds them into a hypergraph convolutional framework, effectively alleviating the modeling challenges caused by sparse interactions in electronic health records, ensuring the accuracy of drug recommendations and the interpretability of the model. Addressing the issues of complex internal structures and high-order dependencies among multiple entities in EHR data, this invention designs a hierarchical hypergraph structure and knowledge-driven hypergraph convolution technology, capable of deeply mining multi-level and multi-dimensional interactions between medical entities such as diseases, surgeries, and drugs, and learning global and local feature representations, thereby more accurately depicting patient states and evolutionary processes. Furthermore, this invention further introduces negative relational information from the knowledge graph into the loss function, such as clinical knowledge of contraindications between diseases and drugs, to achieve explicit constraints and improvements on the safety of drug recommendations, effectively reducing potential medication risks. Through the collaborative output of multiple modules, a transparent, interpretable, highly personalized, and safety-conscious drug combination prediction mechanism is formed, which has broad clinical application value and promising prospects for promotion. Attached Figure Description
[0050] Figure 1 This is a flowchart of an interpretable drug recommendation method based on knowledge-driven hypergraph convolutional networks. Detailed Implementation
[0051] The present invention will be further described in detail below with reference to the accompanying drawings and embodiments. The following embodiments are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
[0052] The present invention provides an interpretable drug recommendation method based on a knowledge-driven hypergraph convolutional network, such as... Figure 1 As shown, it includes the following steps.
[0053] Step 1: Construct a hierarchical hypergraph containing the visitor level and the patient level, and import test instances into this hierarchical hypergraph.
[0054] The hierarchical hypergraph of this invention includes a consultation level and a patient level. For the consultation level, this invention unifies all diseases, surgeries, and medications involved in the same consultation into a single access hyperedge, realizing high-order relationship modeling of medical entities; for the patient level, by aggregating all historical access hyperedges of the patient, a patient-level hyperedge is formed, comprehensively reflecting the patient's longitudinal diagnosis and treatment trajectory.
[0055] Specifically, let's set Indicates the first The hyperedge of each visit contains the set of diseases for that particular medical visit. Surgical Collection and drug collection ; Indicates the patient The historical superedges are aggregated, along with all their access superedges. It should be noted that, for test instances, this invention includes the current disease and surgery, as well as medication information from the previous visit, to better capture temporal dependencies and medication evolution.
[0056] Step 2: Update the features of the hypergraph nodes and access hyperedges through the hypergraph convolution mechanism to obtain the embedding representations of the hypergraph nodes and access hyperedges.
[0057] This technical solution first updates the features of nodes and accessed hyperedges within the same medical visit using a hypergraph convolution mechanism. Specifically, this invention first initializes the features of the hierarchical hypergraph nodes, and then updates the features of nodes and accessed hyperedges within the same medical visit using a hypergraph convolution mechanism.
[0058] In the feature initialization phase, this invention first assigns trainable features to each type of hierarchical hypergraph node (including disease, surgery, and drug). 3D embedding vector. Specifically, the training device uses an embedding matrix. Each entity node Mapping to its corresponding embedding , .
[0059] Subsequently, in order to update the features of co-occurrence relationships of medical entities such as diseases, surgeries, and drugs, higher-order co-occurrence patterns of medical entities within the same access are captured. For each layer... Entity node The embedded representation is updated as follows:
[0060]
[0061] in, Indicates the first Node embeddings updated after convolutional layers Indicates the first Access to hyperedge The set of nodes contained within. Shared learnable weights representing different node types The activation function is sigmoid. These represent disease, surgery, and medication, respectively. This approach effectively aggregates the characteristics of different types of entities within a single medical visit, enhancing the expressive power of entity nodes.
[0062] Subsequently, to characterize the comprehensive medical entity relationships of each visit, this invention weighted aggregates the embedding representations of all associated entity nodes according to a self-attention mechanism to obtain the embedding representation of the visited superedge:
[0063]
[0064] in, Representatives visited the super-border In the Layer embedding, Representing different nodes The model employs self-attention weights. Through this mechanism, the model can automatically focus on the most representative disease, surgery, or drug node for the current visit, thereby enhancing the expressive power of visit-level hyperedges.
[0065] Step 3: Define meta-paths in the external medical knowledge base, and construct a generalized meta-path that includes access hyperedges and meta-paths based on the external medical knowledge base.
[0066] To enhance the model's semantic understanding capabilities and filter out noise, this invention further extracts and filters clinically positive generalized meta-paths based on external knowledge graphs such as the Unified Medical Language System (UMLS). Meta-paths are defined as alternating sequences of entities and relationships, including: (disease, treatment, drug) representing a direct therapeutic relationship between disease and drug; (surgery, treatment, drug) representing a direct therapeutic relationship between surgery and drug; (disease, molecular structural abnormality, molecular structure, positive therapeutic molecular abnormality, drug) indirectly linking disease and drug through molecular targets; and (disease, classification, classification, drug) linking disease and drug through category relationships.
[0067] In addition to traditional meta-paths, this invention innovatively introduces generalized meta-paths that include visit hyperedges, including: visit hyperedge - contain - disease - treatment - drug, visit hyperedge - contain - surgery - treatment - drug, visit hyperedge - contain - disease - molecular structure abnormality - molecular structure - positive treatment molecular abnormality - drug, and visit hyperedge - contain - disease - classify - classify - drug. This enables the model to capture fine-grained co-occurrence relationships of entities within the same visit, enhancing its high-order semantic expression capabilities.
[0068] Step 4: By introducing a knowledge graph-based meta-path convolution mechanism, an embedded representation of the generalized meta-path node is generated.
[0069] To further explore the semantic relationships in medical knowledge, this invention introduces a knowledge graph-based meta-path convolution mechanism and obtains the embeddings of each entity node through meta-path aggregation and meta-path fusion.
[0070] In the feature initialization phase, this invention first initializes each type of medical entity node. (including diseases) ,Operation ,drug Molecular structure ,Classification (etc.) Assign trainable 3D embedding vector. Specifically, the training device uses an embedding matrix. Each medical entity node The mapping is to its corresponding initial embedding representation. .
[0071] Then, for each generalized element path, the medical entity nodes contained in the generalized element path are aggregated to obtain the initial embedding representation of the access hyperedge in the generalized element path. In this way, each node in the generalized element path can be obtained. initial embedding representation , .
[0072] Finally, for each metapath First, perform Intra-Metapath Aggregation: for the target node Aggregate its metapath By analyzing the information of all neighboring nodes, we can obtain the semantic embedding of nodes along this meta-path:
[0073]
[0074] in Representative node Based on metapath Aggregate the updated embeddings, Represents a node The set of neighboring nodes along this specific meta-path includes both one-hop and multi-hop neighbors. Attention score. Measuring neighboring nodes For nodes The importance of For learnable weight matrix, These represent disease, surgery, drug, molecular structure, classification, and access hyperedge, respectively. Subsequently, inter-metapath fusion is performed: for each node, its aggregated embedding across all metapaths is weighted according to a predefined prior weight. and learnable weights Weighted summation:
[0075]
[0076] in, Prior weights for different types of metapaths (such as treatment relationships, molecular mechanisms, clinical classifications, etc.). These are learnable weight parameters. This mechanism not only integrates semantic information from multiple paths but also provides explicit interpretability for the recommendation results.
[0077] Step 5: Based on the embedding representations of hypergraph nodes, access hyperedges, and generalized element path nodes, obtain the drug recommendation results for the test instance.
[0078] First, this invention concatenates the embedded representations obtained by each node under hypergraph convolution and metapath convolution, and then fuses them with a multilayer perceptron (MLP) through a masking mechanism to obtain the final node representation:
[0079]
[0080] The masking mechanism dynamically selects effective information to input into the MLP based on the node type and available convolution types, ensuring that only relevant features are processed and suppressing noise interference.
[0081] Secondly, after obtaining the multi-level embedding representation of the test patient instance, this invention employs a multi-perspective fusion drug prediction mechanism, fully combining knowledge semantics and historical treatment information to improve the accuracy and personalization of drug recommendations. Specifically, firstly, based on the meta-path perspective, the matching probability between the embedding representation of the current visit hyperedge and the embedding representations of each drug is calculated. Then, through softmax-normalized cosine similarity, the association strength between the current visit and each candidate drug is quantified, thereby capturing rich medical semantic relationships.
[0082] Furthermore, from an instance perspective, to further reflect the patient's longitudinal disease progression information, this invention performs attention-weighted aggregation on all historical hyperedges of the patient to obtain a patient-level hyperedge embedding representation. Subsequently, the similarity between the current patient's and other patients' patient-level hyperedge embeddings is calculated. Cosine similarity is used to measure the similarity of disease progression among different patients, thereby drawing on validated and effective medication combinations from similar cases to improve the robustness and personalization of recommendations. For the current patient, its similarity is set to 1 to ensure that historically effective medications are prioritized for recommendation.
[0083] Then, this invention fuses the drug matching probability from the meta-path perspective with the patient similarity from the instance perspective to obtain the final drug recommendation score. Specifically, the product of the two achieves complementary integration of multi-perspective information, thereby selecting the top-k most relevant drug set as the final recommendation result. This mechanism not only fully utilizes the rich semantic information provided by the knowledge graph but also effectively integrates patients' historical treatment experience, achieving more accurate, safe, and interpretable personalized drug combination recommendations.
[0084] After obtaining the final drug recommendation score, the top-k optimal drug set is selected based on these high-match access hyperedges to form the final drug recommendation result.
[0085] Furthermore, this invention also discloses an interpretable drug recommendation system based on a knowledge-enhanced hypergraph convolutional network, including a hierarchical hypergraph construction module, a generalized metapath generation module, and a drug recommendation model.
[0086] The hierarchical hypergraph construction module is used to construct a hierarchical hypergraph containing a visitor hierarchy and a patient hierarchy, and to import test instances into this hierarchical hypergraph; among them, the access hyperedges in the visitor hierarchy... Based on medical records disease collection in Surgical Collection and drug collection Construction, patient super-border in patient hierarchy By connecting those belonging to the same patient All access hyperedges The test instance is generated as an access hyperedge based on the target patient's current disease set, current surgery set, and last treatment medication set. The hypergraph nodes in the hierarchical hypergraph include: disease nodes, surgery nodes, and medication nodes.
[0087] The generalized meta-path generation module is used to define meta-paths in an external medical knowledge base and construct generalized meta-paths containing access hyperedges and meta-paths based on the external medical knowledge base.
[0088] A drug recommendation model is used to: update the features of hypergraph nodes and access hyperedges through a hypergraph convolution mechanism to obtain the embedding representations of hypergraph nodes and access hyperedges; generate the embedding representations of generalized meta-path nodes by introducing a knowledge graph-based meta-path convolution mechanism; wherein, the generalized meta-path nodes include: access hyperedge nodes, disease nodes, surgery nodes, drug nodes, classification nodes, and molecular structure nodes; and obtain the drug recommendation results for test instances based on the embedding representations of hypergraph nodes, access hyperedges, and generalized meta-path nodes.
[0089] Furthermore, this invention introduces a combined loss to better balance safety and accuracy in drug combination recommendation. Accuracy and DDI values often improve simultaneously during training because drug-drug interactions exist in real-world EHR data. Therefore, both incorrect and correct drug predictions can increase the DDI rate. To obtain an accurate model with a low DDI rate, a balance needs to be found. To this end, this technical solution introduces a combined loss. Specifically, this technical solution first uses two commonly used loss functions: binary cross-entropy loss and multi-label marginal loss. Binary cross-entropy loss measures the difference between the predicted probability of each drug and the actual binary label, while multi-label marginal loss measures the difference between the scores of relevant and irrelevant drugs to ensure appropriate ranking. Simultaneously, this invention also designs DDI loss and contra loss to improve safety.
[0090] Specifically, the advantage of using a combined loss function design is that it can simultaneously consider the accuracy of drug recommendations and the risks of drug-drug interactions (DDI) and drug-disease contraindications, thus effectively balancing the contradictions between these two aspects. Traditional drug recommendation models typically focus on optimizing prediction accuracy but often neglect the potential risks of drug-drug interactions and drug-disease contraindications, which may lead to unsafe drug combinations for patients in practice. Conversely, focusing solely on DDI rates may result in overly conservative recommendations, affecting both accuracy and effectiveness. By introducing binary cross-entropy loss and multi-label marginal loss, the model can accurately predict the recommendation probability of each drug while ensuring that the ranking order of drugs aligns with actual medication logic. Binary cross-entropy loss. It allows for precise measurement of whether a drug should be recommended to a patient, while multi-label marginal loss By introducing the relative relationships between drugs, the bias of the recommendation model is avoided and the quality of the recommendations is improved.
[0091]
[0092]
[0093] in, Indicates the first Drug The true label, Indicates the first Drug exist The predicted probability at time t. It represents a collection of drugs.
[0094] In addition, DDI loss Loss of taboo relationships The introduction of this approach allows the model to not only focus on the accuracy of drug prediction, but also actively consider potential adverse interactions between drugs and between drugs and diseases during training, thereby suppressing the generation of high-risk drug combinations. By reducing the disease-in-disease (DDI) rate, the model can recommend drug combinations that are both effective and safe, thus improving the feasibility and safety of clinical recommendations.
[0095]
[0096]
[0097] Where · is the dot product between scalars. Represents a collection of diseases. Indicates the first Disease exist Predicted labels at time points. DDI adjacency matrix. , Indicates the first The drug and the first The drugs interact; the contraindication adjacency matrix , Indicates the first Disease and the first The drugs interact with each other. This loss function is defined for a single visit. During model training, backpropagation of the loss will be performed at the patient level using the average loss across all visits.
[0098] Ultimately, the design of the combined loss function achieves multi-dimensional optimization of drug recommendations, enabling the model to improve recommendation accuracy while effectively controlling adverse interactions between drugs and between drugs and diseases. This design not only meets the clinical practice's demand for high accuracy and low risk in drug recommendation systems but also provides strong support for personalized medicine and precision treatment.
[0099]
[0100]
[0101] in, This represents the observed rate of negative interactions. This represents an acceptable harmful threshold for clinical applications. This is a correction factor to adjust the influence based on the proportional relationship. Parameter Used to control the strength of regularization and These are hyperparameters that control the DDI loss function and the tabu relation loss function, respectively.
[0102] In one embodiment, after training the prototype network using the objective function, the training device can also output the trained prototype network to the execution device (e.g., a terminal device, an edge device, or other target device). In the above embodiments of this application, it is specifically described that the prototype network trained by the training device can be sent to the execution device, where the execution device can specifically apply the trained prototype network. This separates the training and application processes of the prototype network, reducing the computational load on the execution device and saving its computing power.
[0103] In summary, the interpretable drug recommendation method using knowledge-driven hypergraph convolutional networks proposed in this invention demonstrates significant superiority in practical drug recommendation tasks. Extensive experimental results fully validate the effectiveness and generalizability of the proposed model in terms of drug recommendation accuracy, medication safety, and model generalization ability. The method possesses strong flexibility and adaptability, readily handling diverse patient backgrounds and complex, ever-changing medical practice scenarios. Through multi-perspective information fusion and knowledge injection mechanisms, this invention efficiently achieves personalized and accurate drug recommendations. The method architecture is scientifically sound, the reasoning process is efficient and transparent, and it is easy to integrate and deploy in various clinical systems, providing technical support and innovative impetus for intelligent interpretable drug recommendation and patient safe medication management in medical institutions at all levels.
[0104]
[0105] Table 1
[0106] Table 1 compares the experimental performance of the proposed method with existing drug combination recommendation methods, where KEHGCN represents the proposed method. The dataset selected for this invention is a standard dataset commonly used in existing methods. This dataset was obtained from a real hospital setting, and patient information was anonymized. The proposed method demonstrates superior recommendation accuracy and a lower DDI value on this dataset.
[0107] Finally, the method of this invention is merely a preferred embodiment and is not intended to limit the scope of protection of this invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. An interpretable drug recommendation method based on knowledge-enhanced hypergraph convolutional network, characterized in that, The method comprises: Construct a hierarchical hypergraph containing visitor and patient levels, and import test instances into this hypergraph; where the visitor level contains access hyperedges. Based on medical records disease collection in Surgical Collection and drug collection Construction, patient super-border in patient hierarchy By connecting those belonging to the same patient All access hyperedges The test instance is generated as an access hyperedge based on the target patient's current disease set, current surgery set, and last treatment medication set. The hypergraph nodes in the hierarchical hypergraph include: disease nodes, surgery nodes, and medication nodes. updating features of the hypergraph nodes and the access hyperedge through a hypergraph convolution mechanism to obtain an embedded representation of the hypergraph nodes and an embedded representation of the access hyperedge; defining a meta-path in an external medical knowledge base, and constructing a generalized meta-path containing the access hyperedge and the meta-path based on the external medical knowledge base; introducing a meta-path convolution mechanism based on a knowledge graph to generate an embedded representation of a generalized meta-path node; wherein the generalized meta-path node comprises an access hyperedge node, a disease node, a surgery node, a drug node, a classification node, and a molecular structure node; obtaining a drug recommendation result of a test instance based on the embedded representation of the hypergraph nodes, the embedded representation of the access hyperedge, and the embedded representation of the generalized meta-path node.
2. The method of claim 1, wherein, The method comprises: by embedding matrices mapping diseases, procedures, and drugs to obtain initial embedding representations of disease nodes, procedure nodes, and drug nodes , , representing disease nodes, representing procedure nodes, representing drug nodes; The embedding representation of the disease node, the surgery node, and the drug node at the j-th layer is calculated by the hypergraph convolution mechanism ; wherein, represents the j-th access hyperedge , contains a set of nodes, represents shared learnable weights for different node types, represents the embedding representation of the node at the j-th layer; and the embedding representation of the disease node, the surgery node, and the drug node at the j-th layer is calculated by the hypergraph convolution mechanism Acquiring access hyperedge The hypergraph nodes contained in the access hyperedge are aggregated according to the self-attention mechanism to obtain the embedding representation of the access hyperedge. The embedding representation of each hypergraph node is obtained by aggregating the embedding representation of each hypergraph node contained in the access hyperedge according to the self-attention mechanism. The embedding representation of each hypergraph node is obtained by aggregating the embedding representation of each hypergraph node contained in the access hyperedge according to the self-attention mechanism.
3. The method of claim 1, wherein, The generalized meta-path comprises: access hyperedge-contains-disease-treatment-drug, access hyperedge-contains-surgery-treatment-drug, access hyperedge-contains-disease-molecular structure abnormality-molecular structure-positive treatment molecular abnormality-drug, and access hyperedge-contains-disease-classified-classification-drug.
4. The method of claim 1, wherein, The method comprises: By embedding matrices Mapping diseases, surgeries, drugs, categories, and molecular structures to obtain initial embedding representations of disease nodes, surgery nodes, drug nodes, category nodes, and molecular structure nodes , , representing a disease node, representing a surgery node, representing a drug node, representing a molecular structure node, representing a category node; Acquiring access hyperedge The hypergraph nodes contained in the access hyperedge are aggregated according to the self-attention mechanism to obtain the initial embedding representation of the access hyperedge The hypergraph nodes contained in the access hyperedge are aggregated according to the self-attention mechanism to obtain the initial embedding representation of the access hyperedge The hypergraph nodes contained in the access hyperedge are aggregated according to the self-attention mechanism to obtain the initial embedding representation of the access hyperedge ; By aggregating generalized meta-paths The information of all the neighbor nodes of the target node Along the generalized meta-path The node semantic embedding , ; aggregation target node along each generalized meta-path node semantic embeddings resulting in an embedded representation of the generalized meta-path nodes.
5. The method of claim 1, wherein, The method comprises: The method comprises: The method comprises: The method comprises: The system comprises: a generalized meta-path generation module configured to define a meta-path in an external medical knowledge base, and construct a generalized meta-path containing an access hyperedge and the meta-path based on the external medical knowledge base; 6. The method of claim 5, wherein, a drug recommendation model configured to: update features of the hypergraph nodes and the access hyperedge through a hypergraph convolution mechanism to obtain an embedded representation of the hypergraph nodes and an embedded representation of the access hyperedge; 7. An interpretable drug recommendation system based on knowledge-enhanced hypergraph convolutional networks, characterized in that, The hierarchical hypergraph construction module is used to construct a hierarchical hypergraph containing a visitor hierarchy and a patient hierarchy, and to import test instances into this hierarchical hypergraph; among them, the access hyperedges in the visitor hierarchy... Based on medical records disease collection in Surgical Collection and drug collection Construction, patient super-border in patient hierarchy By connecting those belonging to the same patient All access hyperedges The test instance is generated as an access hyperedge based on the target patient's current disease set, current surgery set, and last treatment medication set. The hypergraph nodes in the hierarchical hypergraph include: disease nodes, surgery nodes, and medication nodes. By introducing a meta-path convolution mechanism based on a knowledge graph, an embedding representation of a generalized meta-path node is generated; wherein the generalized meta-path node includes: an access hyperedge node, a disease node, a surgery node, a drug node, a classification node and a molecular structure node; Based on the embedding representation of the hypergraph node, the embedding representation of the access hyperedge and the embedding representation of the generalized meta-path node, a drug recommendation result of a test instance is obtained.
8. The system of claim 7, wherein, According to a binary cross-entropy loss , a multi-label margin loss , a DDI loss , and a contraindication relationship loss to generate a total loss for training the drug recommendation model; wherein the binary cross-entropy loss is used to measure the difference between the predicted probability of each drug and the actual binary label, the multi-label margin loss is used to measure the difference between the scores of related and unrelated drugs, the DDI loss is used to prevent adverse interactions between drugs, and the contraindication relationship loss is used to prevent contraindications between drugs and diseases.
9. The system of claim 8, wherein, the binary cross-entropy loss ; The multi-label margin loss ; the DDI loss ; The contraindication relationship loss ; in, Indicates the first Drug The true label, Indicates the first Drug exist The predicted probability at time t. Indicates a collection of drugs. Represents a collection of diseases. Indicates the first Disease exist Predicted labels at time points, DDI adjacency matrix , Indicates the first The drug and the first The drugs interact with each other; the contraindication relationship adjacency matrix , Indicates the first Disease and the first These drugs interact with each other.
10. The system of claim 8, wherein, the total loss ; where the parameters for controlling the regularization strength, and is a hyperparameter, the parameter , denotes the observed rate of negative interaction occurrences, is a threshold of harm acceptable in clinical applications, is a correction factor that adjusts the impact according to a proportional relationship.
Citation Information
Patent Citations
Vulnerability detection method and system based on self-supervised learning and multichannel hypergraph neural network
CN113609488A
Medicine combination recommendation method and system based on hierarchical hypergraph convolutional network
CN120108778A