A multi-source fusion drug recommendation system oriented to diagnosis and treatment differences and dynamic preferences
By generating patient preference feature vectors using multilayer perceptrons and recurrent neural networks, and constructing multi-graph networks for information fusion, the problem of dynamic medication preferences and heterogeneity of medical visits in drug recommendation systems is solved, thereby improving the accuracy and safety of drug recommendations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SOUTH CHINA UNIV OF TECH
- Filing Date
- 2025-07-30
- Publication Date
- 2026-07-31
AI Technical Summary
Existing drug recommendation systems fail to effectively capture patients' dynamically changing medication preferences. In particular, they lack accuracy and safety in recommending patients with sparse information from a single visit, and they fail to perform differentiated information fusion processing for patients with different lengths of medical history.
A multi-source fusion drug recommendation system was designed. It uses multilayer perceptrons and recurrent neural networks to mine implicit associations between medical entities, generate patient preference feature vectors, and construct a comprehensive preference relationship graph, drug relationship graph, and drug molecular structure graph. Graph neural networks are used for information fusion, and the information fusion strategy is dynamically adjusted to adapt to the needs of patients with single or multiple visits.
It significantly improves the personalization and accuracy of drug recommendations, especially for patients with sparse information from a single visit, enhancing the safety and precision of recommendations and addressing the issue of heterogeneity in patient visits.
Smart Images

Figure CN121122606B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the technical field of drug recommendation, and in particular to a multi-source fusion drug recommendation system oriented towards differences in diagnosis and treatment and dynamic preferences. Background Technology
[0002] With the advancement of digitalization, the field of smart healthcare has made significant progress. Massive amounts of patient data, such as electronic health records (EHRs), have been transformed into valuable digital assets, providing a solid data foundation for various healthcare tasks, particularly drug recommendation. Drug recommendation systems, as a key component of clinical decision support, aim to automatically recommend personalized and appropriate drug combinations based on a patient's overall health condition, thereby improving diagnostic and treatment efficiency and reducing the prescribing burden on physicians.
[0003] Unlike conventional recommendation systems that prioritize click-through rates or accuracy, the core technical challenge in drug recommendation lies in ensuring both accuracy and rigorous safety. Inappropriate drug recommendations may not only have minimal therapeutic effect but also potentially trigger serious adverse drug reactions, such as potential drug-drug interactions (DDIs), thereby posing a direct threat to patient safety. Therefore, accurately learning and deeply integrating complex clinical expertise to achieve safe and effective personalized drug recommendations remains a key technological focus in this field.
[0004] Current technologies face complex challenges in providing personalized medication recommendations due to individual patient differences and the dynamic nature of disease progression. Analysis shows that even patients diagnosed with the same disease can have significantly different clinical presentations and medication needs. For example, two patients diagnosed with colitis may require different treatments depending on their presentation: one may require antibiotics (such as ampicillin) due to inflammation, while the other may require electrolyte supplements (such as potassium chloride) due to diarrhea and low potassium levels. Some early medication recommendation methods relied solely on the patient's current diagnosis and surgical information, neglecting the disease progression reflected in historical medical data, resulting in insufficient personalization of recommendations.
[0005] To capture the dynamic changes in patients' health status, subsequent methods have begun to utilize patients' longitudinal medical records. However, these methods typically perform time-series modeling of non-pharmacological data such as diagnoses and surgeries, failing to fully explore the longitudinal correlations within the pharmacological data itself. In fact, patients' medication preferences and needs evolve dynamically; for example, patients with chronic diseases may use specific medications long-term, while acute illnesses may require temporary medication. Existing methods fail to effectively distinguish and assess the applicability of historical medication records in the current medical context—that is, how to accurately identify long-term medication preferences and dynamically determine whether historical medications remain relevant in the present—remains an unresolved challenge in current technology.
[0006] Furthermore, existing technologies have significant limitations when dealing with patients with varying lengths of medical history, especially for patients with sparse information from a single visit (first visit). Due to the lack of historical medication records, recommendations for these patients rely solely on their current health status, which is extremely difficult. To address this issue, some methods (such as GAMENet) attempt to supplement the representation of single-visit patients by finding similar patients. However, this method risks introducing irrelevant or misleading information, potentially leading to incorrect recommendations. On the other hand, other methods (such as SafeDrug and MoleRec), while improving the recommendation performance for single-visit patients to some extent by integrating global drug knowledge and drug molecular structure information, generally employ a uniform fusion strategy for all patients. This "one-size-fits-all" approach fails to differentiate information fusion and processing based on the fundamental differences in information availability between single-visit patients (sparse information) and patients with multiple visits (rich information), thus limiting the personalization and final accuracy of recommendations. Summary of the Invention
[0007] The purpose of this invention is to overcome the shortcomings and deficiencies of the prior art and provide a multi-source fusion drug recommendation system that is oriented towards differences in diagnosis and treatment and dynamic preferences. This system can accurately capture the dynamic needs of patients and effectively solve the problem of heterogeneity in medical visits, significantly improving the accuracy and safety of drug recommendations for various types of patients, especially those with sparse information and only one visit.
[0008] To achieve the above objectives, the technical solution provided by this invention is: a multi-source fusion drug recommendation system oriented towards diagnostic and treatment differences and dynamic preferences, comprising:
[0009] The data acquisition module is used to acquire basic data, including clinical data, drug-drug interaction data, and drug molecule data, and to perform preprocessing, including cleaning the data to remove invalid and duplicate data, converting the molecular structure representation of the cleaned drug molecule data into a structured molecular feature vector, and encoding the diagnosis, surgery, and symptom records in the cleaned clinical data into a standardized medical entity sequence.
[0010] The medical entity feature vector acquisition module uses a multilayer perceptron to mine the implicit associations between medical entities such as drugs, diagnoses, surgeries, and symptoms from preprocessed clinical data in order to obtain initialized medical entity feature vectors.
[0011] The patient preference feature vector generation module is used to generate a unified patient preference feature vector, including: analyzing the patient's historical medication frequency to obtain their preference feature vector; using a recurrent neural network to encode the diagnosis, surgery, and symptoms in the clinical data to convert them into a clinical data feature vector; introducing a dynamic demand selection mechanism to filter the preference features most relevant to the current clinical data; and fusing the filtered preference features with the clinical data feature vector.
[0012] The multi-source information fusion module is used to fuse multi-source information, including: constructing three types of graphs: a comprehensive preference relationship graph, a drug relationship graph, and a drug molecule structure graph; extracting multi-source information feature vectors from the three types of graphs using a graph neural network model; using a unified patient preference feature vector to guide the fusion of multi-source information feature vectors; and implementing differentiated fusion strategies for patients with single visits and multiple visits.
[0013] The drug recommendation list generation module generates a drug recommendation list based on the fused multi-source information.
[0014] Furthermore, the data acquisition module acquires clinical data from the MIMIC-III and MIMIC-IV datasets, drug-drug interaction data from the TWOSIDES dataset, and drug molecule data from the DrugBank dataset.
[0015] Furthermore, the medical entity feature vector acquisition module performs the following operations:
[0016] S21: Generate medical entity embedding vectors, including: for the current medical record v t Diagnostic data set Surgical Dataset and symptom data set Map it to an embedding space of dimension dim according to the following formula:
[0017]
[0018] In the formula, and These represent the generated diagnostic embedding vector, surgical embedding vector, and symptom embedding vector, respectively. and These represent the embedding matrices for learnable diagnoses, surgeries, and symptoms, respectively. Represents the set of real numbers. These represent the total number of categories for diagnosis, surgery, and symptoms, respectively.
[0019] Regarding the previous medical visit t-1 Drug combination used Encode according to the following formula:
[0020]
[0021] In the formula, This represents the generated historical medication embedding vector. If the current visit is the first visit, then... Initialize as a zero vector. Represents a learnable drug embedding matrix. Indicates the total number of drugs;
[0022] S22: Construct a comprehensive medical visit representation, including: weighting and concatenating the diagnostic embedding vector, surgical embedding vector, symptom embedding vector, and historical medication embedding vector according to the following formula to generate a comprehensive medical visit representation vector. :
[0023]
[0024] In the formula, CONCAT represents the concatenation operation, and ⊙ represents the element-wise multiplication operation. and These are learnable weight vectors corresponding to the embeddings of diagnosis, surgery, symptoms, and medication, respectively.
[0025] S23: Optimize the medical entity embedding vector through a pre-training task, including: transforming the comprehensive medical visit representation vector e t The input is fed into a multilayer perceptron; through a series of nonlinear transformations by the multilayer perceptron, the transformation results are fed into a sigmoid activation function to output the predicted probability of each drug in the current t-th visit. And the medical entity embedding vectors optimized during pre-training, i.e. and Used as the initial medical entity feature vector.
[0026] Furthermore, the patient preference feature vector generation module performs the following operations:
[0027] S31: Modeling patient needs and preferences, including: statistically analyzing the m values for each drug based on the patient's complete medication history. i The normalized frequency of occurrence freq(m) i To construct an original medication preference vector. in, Represents the set of real numbers, m i Indicates the i-th drug, The total number of drugs; and according to the following formula, the original medication preference vector is... With a learnable drug preference embedding matrix Perform element-wise multiplication to generate a patient needs preference embedding vector. dim represents the dimension size:
[0028] e dp =v dp ⊙E dp
[0029] In the formula, ⊙ represents element-wise multiplication;
[0030] S32: Dynamically adjust and select demand preferences, including: First, adjust the diagnostic embedding vector obtained in step S2. Surgical embedding vector and symptom embedding vector Context encoding is performed using recurrent neural networks (RNNs), and the output of the RNN is added to the input through residual connections to generate enhanced clinical state embedding vectors. and The calculation formula is as follows:
[0031]
[0032] In the formula, and They represent and The output, and Represents a recurrent neural network;
[0033] Secondly, the enhanced clinical state embedding vectors are concatenated and processed through a feedforward neural network. Projection is performed to generate a comprehensive demand representation vector as the query vector. :
[0034]
[0035] In the formula, CONCAT represents the connection operation;
[0036] Then, a multi-head attention mechanism is adopted. The query vector q is combined with the patient demand preference embedding vector e, which serves as both key and value. dp Interact to calculate attention weights :
[0037]
[0038] Next, the attention weight ω is used dp Through diagonal functions Embedded vector e of patient needs and preferences dpAdjustments are made to obtain the adjusted drug preference vector. :
[0039]
[0040] Subsequently, through a linear transformation Calculate the adjusted drug preference score S, and then apply the sparsity maxing method Spa_max(·) to the score to obtain the sparsified score S:
[0041]
[0042] And according to the selection ratio Dynamically calculate the selection quantity k to select the top k most relevant drug preferences:
[0043]
[0044] In the formula, max(·) represents taking the maximum value. This indicates the selection ratio, × indicates the multiplication operation, size(e′) dp () represents the total number of features. This represents the floor function;
[0045] Finally, the sparsification score S is applied to the adjusted drug preference vector e′. dp The selection is performed and aggregated by summing along the drug axis to generate a comprehensive drug preference vector. :
[0046]
[0047] In the formula, e″ dp This represents the vector representation of the selected drug demand preference. This represents the summation operation;
[0048] S33: Generate a patient preference feature vector, including: embedding the enhanced clinical state into the vector using an adaptive weighted fusion mechanism. and the comprehensive drug preference vector e″′ dp The data is fused to generate the final patient preference representation. This mechanism generates functions that satisfy the four input features respectively. scalar attention weights w1, w2, w3, w4, w i′ Let represent the scalar attention weight of the i′th digit, and perform feature fusion according to the following formula:
[0049]
[0050] In the formula, This indicates an adaptive weighted fusion mechanism.
[0051] Furthermore, the multi-source information fusion module performs the following operations:
[0052] S41: Constructing a multi-graph network, including: First, quantifying the correlation between entities based on normalized co-occurrence frequencies, and drug-diagnosis correlation. in, Indicates drug m i and diagnosis d j The correlation between them Indicates drug m i and diagnosis d j The frequency of co-occurrence, / indicates the division symbol, Indicates all related to drug m i The sum of the frequencies of related diagnoses, where Σ represents the summation sign and h represents the index variable for the summation; drug-surgery correlation. in, Indicates drug m i and surgery p j The correlation between them Indicates drug m i and surgery p j The frequency of co-occurrence, Indicates all related to drug m i The sum of the frequencies of related surgeries; drug-symptom correlation in, Indicates drug m i and symptoms j The correlation between them Indicates drug m i and symptoms j The frequency of co-occurrence, Indicates all related to drug m i The sum of the frequencies of related symptoms; drug-drug correlation in, Indicates drug m i and drugs m j The correlation between them Indicates drug m i and drugs m j The frequency of co-occurrence, Indicates all related to drug m i The sum of the frequencies of the related drugs;
[0053] Construct a comprehensive preference relationship graph: targeting the current medical visit v t Drug-diagnosis graphs were constructed respectively. Drug-Surgery Diagram Medication-Symptom Chart The weights of the edges in these three graphs are determined by the previously calculated drug-surgery correlation. Drug-surgery correlation Drug-symptom correlation Drug-drug correlation Initialization; a variant of the Graph Convolutional Network (GCN) is used to transfer and update information in the three graphs mentioned above. The embedding update of the diagnosis, surgery, or symptom node (entity u) is as follows:
[0054]
[0055] In the formula, This represents the embedding vector of entity u in the l-th layer. Let represent the embedding vector of entity u in the (l-1)th layer, where l represents the layer number of the GCN. This means that 'u' represents any entity in the diagnosis, surgery, or symptom. and Let these represent the sets of diagnostic data, surgical data, and symptom data at time t, respectively. This represents the update function for entity u. This represents the message passing function for entity u. This represents all drugs m in layer l-1. i The set of embedded vectors, Indicates from drug m i The weight of the edge to entity u;
[0056] Finally, the final diagnostic representations are obtained through aggregation functions. Surgical indication and symptoms :
[0057]
[0058] In the formula, and These represent specific aggregation functions used for diagnosis, surgery, and symptoms, respectively, where L is the last layer of the GCN. and These represent the diagnostic, surgical, and symptom embedding vectors of the last layer of the GCN, respectively.
[0059] Constructing a drug relationship graph: This involves creating an undirected graph representing the drugs involved in the current medical visit. Its edge weight Co-occurrence correlation between drugs Drug Interaction DDI Adjacency Matrix The value in Weighted summation yields:
[0060]
[0061] In the formula, θ is a learnable parameter;
[0062] GCN is used to transfer and update information in the drug relationship diagram:
[0063]
[0064] In the formula, Indicates drug m in layer l j Embedded vector, Indicates drug m j The update function, This indicates that drug m is in layer l-1. j Embedded vector, Indicates drug m j The message passing function, Neighbors(m j ) indicates the relationship with drug m j The set of all directly connected neighboring nodes, m j Indicates the j-th drug, Indicates from drug m i To drug m j The weight of the edge;
[0065] Through aggregate functions Drug indications :
[0066]
[0067] In the formula, This represents the drug embedding vector of the last layer of the GCN;
[0068] Global DDI adjacency matrix and the global drug co-occurrence matrix Learn to obtain a global graph representation and And integrate them to obtain global drug knowledge Represents the set of real numbers. The total number of drugs is represented by dim, which indicates the size of the dimension.
[0069]
[0070] In the formula, ρ is a learnable parameter;
[0071] The aforementioned diagnostic, surgical, symptom, and drug representations are concatenated and then processed using a feedforward neural network. Obtain the multi-view electronic medical record (EHR) features of the current patient visit. :
[0072]
[0073] Through multi-head attention mechanism Will As a query, for both key and value Perform a query to obtain a context-sensitive global information representation adjusted for the patient's current state. :
[0074]
[0075] Constructing drug molecular structure maps: Graph neural networks (GNNs) are applied to encode the global molecular map and key local molecular structures of each drug to obtain global structure embeddings. and local molecular structure embedding in, Represents the set of real numbers. The total number of local structures of the drug; and the cross-attention mechanism is employed. The global and local structure embeddings are fused to generate an information-enhanced molecular structure representation. :
[0076]
[0077] S42: Execution preference-guided differential information fusion, including:
[0078] a. Integration of global information to differentiate medical treatment:
[0079] Project the final patient preference representation q′ obtained in step S3 onto dimension . The vector q″ is represented by a gating parameter α∈[0,1] that can be adjusted according to the type of visit, i.e., single or multiple visits, and is associated with the context-related global information obtained in step S41. By performing fusion, a drug characterization that incorporates patient preferences is obtained. :
[0080]
[0081] In the formula, · represents the product;
[0082] b. Contextual aggregation of differentiated medical visits:
[0083] Calculate the current relevance context c current By calculating the final patient preference representation q′ and the global drug information after fusing patient preferences, The correlation weight w between them current And based on this, Perform weighted aggregation:
[0084]
[0085] In the formula, For the Softmax function, It is a diagonal function. Indicates the transpose symbol;
[0086] Calculate the historical relevance context c history Differentiate based on the type of visit: For patients with a single visit, let c history =c current For patients who have visited multiple times, their historical medical needs records (H) k and historical medication information H v The calculation is as follows:
[0087]
[0088] v agg =w history ·H v
[0089]
[0090] The current relevance context c current and historical relevance context c history The data is spliced together and processed through a feedforward neural network. Fusion, resulting in aggregated memory context c memory :
[0091]
[0092] c. Integration of drug molecule information based on patient differentiation:
[0093] Calculate the final patient preference representation q′ and the molecular structure representation G obtained in step S41. mole_all The correlation weight w between them mole Based on this, a weighted aggregation is performed to obtain drug molecule information G related to the current preference. mole :
[0094]
[0095]
[0096] Finally, the aggregated memory context c is controlled by a gating parameter β that can be adjusted according to the type of visit. memory With the drug molecule information G mole The components are fused to generate the final comprehensive characterization H for drug recommendation:
[0097] H = β·c memory+(1-β)·G mole .
[0098] Furthermore, the drug recommendation list generation module performs the following operations:
[0099] S51: Calculate the drug recommendation probability, including: applying the final comprehensive representation H obtained in step S4 to a sigmoid activation function σ(·) to generate m for each drug. i Predicted probability :
[0100]
[0101] In the formula, To predict the probability, a value close to 1 indicates that the recommended drug m is... i A value close to 0 indicates that it is not recommended; and based on the predicted probability Generate the final list of recommended drugs;
[0102] S52: Define and optimize the composite loss function, including: constructing the drug recommendation problem as a multi-label binary classification task, and using a composite loss function that incorporates considerations of accuracy and safety. The drug recommendation list generation module is optimized, and the composite loss function is... It consists of a weighted average of the following three loss terms:
[0103] a. Binary cross-entropy loss Used to measure prediction probability With drug m in the dataset i Differences between them:
[0104]
[0105] In the formula, The total number of drugs;
[0106] b. Multi-tab margin loss Used to increase the difference in predicted probabilities between recommended and non-recommended drugs:
[0107]
[0108] In the formula, m i =1 indicates that the drug at index i is a drug that should be recommended, m j Let m represent the j-th drug. j =0 indicates that the j-th drug is a drug that should not be recommended, and max(·) is the maximum value function. The total number of drugs;
[0109] c. Drug Interaction DDI Loss This is used to improve the safety of recommendations by penalizing the co-occurrence probability of drug pairs that are known to interact:
[0110]
[0111] In the formula, Indicates drug m i and drugs m j The interaction between them A value of 1 indicates that drug m i and drugs m j There are interactions between them; a value of 0 indicates that there are no interactions.
[0112] Final composite loss function The weighted sum of the three loss items mentioned above:
[0113]
[0114] In the formula, λ and μ are hyperparameters used to balance the three loss terms.
[0115] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0116] 1. This invention designs a method to utilize historical medication frequency and dynamically select personalized needs representations, which can effectively capture patients' dynamically changing medication preferences and focus on the most relevant needs of the current medical visit, thereby improving the personalization of recommendations.
[0117] 2. This invention constructs a multi-graph network that integrates implicit and explicit associations. It mines deep connections between entities through pre-training tasks and integrates direct associations between entities, drug interactions, and drug molecular structure information through the graph network, providing a more comprehensive information foundation for accurate recommendations.
[0118] 3. This invention proposes a multi-source information fusion module guided by personalized needs and oriented towards heterogeneous medical visits. It can adaptively adjust the information fusion strategy and weights according to whether the patient has a single visit or multiple visits, effectively solving the problem of information sparsity for patients with single visits and improving the recommendation accuracy for various types of patients.
[0119] In summary, this invention can improve the targeting of recommendations by dynamically capturing personalized medication preferences, enhance the richness of information representation by constructing a comprehensive multi-graph network, and solve the problem of heterogeneity in medical visits by utilizing differentiated multi-source information fusion modules. It can fully explore the correlation between patients' dynamic needs and multi-source medical knowledge, effectively bridging the gap between patients' personalized needs and general medical knowledge, thereby improving the accuracy and safety of drug recommendations. Attached Figure Description
[0120] Figure 1 This is a flowchart of the system of the present invention.
[0121] Figure 2 This is a schematic diagram illustrating the discovery of implicit associations in clinical data according to the present invention.
[0122] Figure 3 This is a schematic diagram illustrating the generation of a unified patient preference feature vector according to the present invention.
[0123] Figure 4 This is a schematic diagram illustrating the fusion of multi-source information according to the present invention. Detailed Implementation
[0124] The present invention will be further described in detail below with reference to the embodiments and accompanying drawings, but the embodiments of the present invention are not limited thereto.
[0125] like Figures 1 to 4 As shown, this embodiment discloses a multi-source fusion drug recommendation system oriented towards diagnostic and treatment differences and dynamic preferences, including:
[0126] The data acquisition module is used to acquire basic data, including clinical data, drug-drug interaction data, and drug molecule data, and to perform preprocessing, including cleaning the data to remove invalid and duplicate data, converting the molecular structure representation of the cleaned drug molecule data into a structured molecular feature vector, and encoding the diagnosis, surgery, and symptom records in the cleaned clinical data into a standardized medical entity sequence.
[0127] The medical entity feature vector acquisition module uses a multilayer perceptron to mine the implicit associations between medical entities such as drugs, diagnoses, surgeries, and symptoms from preprocessed clinical data in order to obtain initialized medical entity feature vectors.
[0128] The patient preference feature vector generation module is used to generate a unified patient preference feature vector, including: analyzing the patient's historical medication frequency to obtain their preference feature vector; using a recurrent neural network to encode the diagnosis, surgery, and symptoms in the clinical data to convert them into a clinical data feature vector; introducing a dynamic demand selection mechanism to filter the preference features most relevant to the current clinical data; and fusing the filtered preference features with the clinical data feature vector.
[0129] The multi-source information fusion module is used to fuse multi-source information, including: constructing three types of graphs: a comprehensive preference relationship graph, a drug relationship graph, and a drug molecule structure graph; extracting multi-source information feature vectors from the three types of graphs using a graph neural network model; using a unified patient preference feature vector to guide the fusion of multi-source information feature vectors; and implementing differentiated fusion strategies for patients with single visits and multiple visits.
[0130] The drug recommendation list generation module generates a drug recommendation list based on the fused multi-source information.
[0131] Specifically, the electronic health record (EHR) data used by the data acquisition module comes from two widely recognized medical information databases: MIMIC-III and MIMIC-IV. These two datasets contain a large amount of anonymized patient clinical data, including but not limited to diagnostic records, surgical records, symptom records, medication information, and admission information, and are commonly used benchmark datasets for related research in this field.
[0132] Furthermore, this embodiment integrates data from other sources to enrich the information dimensions. Specifically, drug-drug interaction (DDI) data are sourced from the TWOSIDES database, while drug molecular structure data are obtained from the DrugBank database.
[0133] To ensure the effective use of the acquired data, this embodiment performs efficient preprocessing on the raw data. The preprocessing steps mainly include data cleaning, entity alignment, feature extraction, and screening for specific patients and medical records, as detailed below:
[0134] Patient screening: Only records of patients who have visited the clinic once or more are retained.
[0135] Medical records are filtered so that for each visit, only records containing at least one diagnosis, one medication, one surgery, and one symptom are retained to ensure the completeness of the information.
[0136] Entity coding maps the diagnoses, surgeries, symptoms, and drug names described in the text to standard, unified coding systems, such as ICD-9 and ATC, to facilitate model processing.
[0137] After the above preprocessing is completed, the final dataset is randomly divided into training set, validation set and test set in a 4:1:1 ratio for model training, parameter tuning and final performance evaluation.
[0138] The loaded clinical data, drug interaction data, and drug molecule data are cleaned to remove invalid and duplicate data;
[0139] The molecular structure representation of the cleaned drug molecule data is converted into a structured molecular feature vector;
[0140] The diagnostic, surgical, and symptom records in the cleaned clinical data are encoded into standardized medical entity sequences.
[0141] Specifically, the medical entity feature vector acquisition module performs the following operations:
[0142] S21: Generate medical entity embedding vectors, including: for the current medical record v t Diagnostic data set Surgical Dataset and symptom data set Map it to an embedding space of dimension dim according to the following formula:
[0143]
[0144] In the formula, and These represent the generated diagnostic embedding vector, surgical embedding vector, and symptom embedding vector, respectively. and These represent the embedding matrices for learnable diagnoses, surgeries, and symptoms, respectively. Represents the set of real numbers. These represent the total number of categories for diagnosis, surgery, and symptoms, respectively.
[0145] Regarding the previous medical visit t-1 Drug combination used Encode according to the following formula:
[0146]
[0147] In the formula, This represents the generated historical medication embedding vector. If the current visit is the first visit, then... Initialize as a zero vector. Represents a learnable drug embedding matrix. Indicates the total number of drugs;
[0148] S22: Construct a comprehensive medical visit representation, including: weighting and concatenating the diagnostic embedding vector, surgical embedding vector, symptom embedding vector, and historical medication embedding vector according to the following formula to generate a comprehensive medical visit representation vector. :
[0149]
[0150] In the formula, CONCAT represents the concatenation operation, and ⊙ represents the element-wise multiplication operation. and These are learnable weight vectors corresponding to the embeddings of diagnosis, surgery, symptoms, and medication, respectively.
[0151] S23: Optimize the medical entity embedding vector through a pre-training task, including: transforming the comprehensive medical visit representation vector e tThe input is fed into a multilayer perceptron; through a series of nonlinear transformations by the multilayer perceptron, the transformation results are fed into a sigmoid activation function to output the predicted probability of each drug in the current t-th visit. And the medical entity embedding vectors optimized during pre-training, i.e. and Used as the initial medical entity feature vector.
[0152] Specifically, the patient preference feature vector generation module performs the following operations:
[0153] S31: Modeling patient needs and preferences, including: statistically analyzing the m values for each drug based on the patient's complete medication history. i The normalized frequency of occurrence freq(m) i To construct an original medication preference vector. in, Represents the set of real numbers, m i Indicates the i-th drug, The total number of drugs; and according to the following formula, the original medication preference vector is... With a learnable drug preference embedding matrix Perform element-wise multiplication to generate a patient needs preference embedding vector. dim represents the dimension size:
[0154]
[0155] In the formula, ⊙ represents element-wise multiplication;
[0156] S32: Dynamically adjust and select demand preferences, including: First, adjust the diagnostic embedding vector obtained in step S2. Surgical embedding vector and symptom embedding vector Context encoding is performed using recurrent neural networks (RNNs), and the output of the RNN is added to the input through residual connections to generate enhanced clinical state embedding vectors. and The calculation formula is as follows:
[0157]
[0158] In the formula, and They represent and The output, and Represents a recurrent neural network;
[0159] Secondly, the enhanced clinical state embedding vectors are concatenated and processed through a feedforward neural network. Projection is performed to generate a comprehensive demand representation vector as the query vector. :
[0160]
[0161] In the formula, CONCAT represents the connection operation;
[0162] Then, a multi-head attention mechanism is adopted. The query vector q is combined with the patient demand preference embedding vector e, which serves as both key and value. dp Interact to calculate attention weights :
[0163]
[0164] Next, the attention weights are utilized. Through diagonal functions Embedded vector e of patient needs and preferences dp Adjustments are made to obtain the adjusted drug preference vector. :
[0165]
[0166] Subsequently, through a linear transformation Calculate the adjusted drug preference score S, and then apply the sparsity maxing method Spa_max(·) to the score to obtain the sparsified score S:
[0167]
[0168] And according to the selection ratio Dynamically calculate the selection quantity k to select the top k most relevant drug preferences:
[0169]
[0170] In the formula, max(·) represents taking the maximum value. This indicates the selection ratio, × indicates the multiplication operation, size(e′) dp () represents the total number of features. This represents the floor function;
[0171] Finally, the sparsification score S is applied to the adjusted drug preference vector e′. dp The selection is performed and aggregated by summing along the drug axis to generate a comprehensive drug preference vector. :
[0172]
[0173] In the formula, e″ dp This represents the vector representation of the selected drug demand preference. This represents the summation operation;
[0174] S33: Generate a patient preference feature vector, including: embedding the enhanced clinical state into the vector using an adaptive weighted fusion mechanism. and the comprehensive drug preference vector e″′ dp The data is fused to generate the final patient preference representation. This mechanism generates functions that satisfy the four input features respectively. scalar attention weights w1, w2, w3, w4, w i′ Let represent the scalar attention weight of the i′th digit, and perform feature fusion according to the following formula:
[0175]
[0176] In the formula, This indicates an adaptive weighted fusion mechanism.
[0177] Specifically, the multi-source information fusion module performs the following operations:
[0178] S41: Constructing a multi-graph network, including: First, quantifying the correlation between entities based on normalized co-occurrence frequencies, and drug-diagnosis correlation. in, Indicates drug m i and diagnosis d j The correlation between them Indicates drug m i and diagnosis d j The frequency of co-occurrence, / indicates the division symbol, Indicates all related to drug m i The sum of the frequencies of related diagnoses, where Σ represents the summation sign and h represents the index variable for the summation; drug-surgery correlation. in, Indicates drug m i and surgery p j The correlation between them Indicates drug m i and surgery p j The frequency of co-occurrence, / indicates the division symbol, Indicates all related to drug m i The sum of the frequencies of related surgeries, where Σ represents the summation sign and h represents the index variable for the summation; drug-symptom correlation. in, Indicates drug m i and symptoms j The correlation between them Indicates drug m i and symptoms j The frequency of co-occurrence, / indicates the division symbol, Indicates all related to drug m i The sum of the frequencies of related symptoms, where Σ represents the summation sign and h represents the index variable for the summation; drug-drug correlation. in, Indicates drug m i and drugs m j The correlation between them Indicates drug m i and drugs m j The frequency of co-occurrence, / indicates the division symbol, Indicates all related to drug m i The sum of the frequencies of related drugs, where Σ represents the summation symbol and h represents the index variable for the summation;
[0179] Construct a comprehensive preference relationship graph: targeting the current medical visit v t Drug-diagnosis graphs were constructed respectively. Drug-Surgery Diagram Medication-Symptom Chart The weights of the edges in these three graphs are determined by the previously calculated drug-surgery correlation. Drug-surgery related Drug-symptom correlation Drug-drug correlation Initialization; a variant of the Graph Convolutional Network (GCN) is used to transfer and update information in the three graphs mentioned above. The embedding update of the diagnosis, surgery, or symptom node (entity u) is as follows:
[0180]
[0181] In the formula, This represents the embedding vector of entity u in the l-th layer. Let represent the embedding vector of entity u in the (l-1)th layer, where l represents the layer number of the GCN. This means that 'u' represents any entity in the diagnosis, surgery, or symptom. and Let these represent the sets of diagnostic data, surgical data, and symptom data at time t, respectively. This represents the update function for entity u. This represents the message passing function for entity u. This represents all drugs m in layer l-1. i The set of embedded vectors, Indicates from drug mi The weight of the edge to entity u;
[0182] Finally, the final diagnostic representations are obtained through aggregation functions. Surgical indication and symptoms :
[0183]
[0184] In the formula, and These represent specific aggregation functions used for diagnosis, surgery, and symptoms, respectively, where L is the last layer of the GCN. and These represent the diagnostic, surgical, and symptom embedding vectors of the last layer of the GCN, respectively.
[0185] Constructing a drug relationship graph: This involves creating an undirected graph representing the drugs involved in the current medical visit. Its edge weight Co-occurrence correlation between drugs Drug Interaction DDI Adjacency Matrix The value in Weighted summation yields:
[0186]
[0187] In the formula, θ is a learnable parameter;
[0188] GCN is used to transfer and update information in the drug relationship diagram:
[0189]
[0190] In the formula, Indicates drug m in layer l j Embedded vector, Indicates drug m j The update function, This indicates that drug m is in layer l-1. j Embedded vector, Indicates drug m j The message passing function, Neighbors(m j ) indicates the relationship with drug m j The set of all directly connected neighboring nodes, m j Indicates the j-th drug, Indicates from drug m i To drug m j The weight of the edge;
[0191] Through aggregate functions Drug indications :
[0192]
[0193] In the formula, This represents the drug embedding vector of the last layer of the GCN;
[0194] Global DDI adjacency matrix and the global drug co-occurrence matrix Learn to obtain a global graph representation and And integrate them to obtain global drug knowledge Represents the set of real numbers. The total number of drugs is represented by dim, which indicates the size of the dimension.
[0195]
[0196] In the formula, ρ is a learnable parameter;
[0197] The aforementioned diagnostic, surgical, symptom, and drug representations are concatenated and then processed using a feedforward neural network. Obtain the multi-view electronic medical record (EHR) features of the current patient visit. :
[0198]
[0199] Through multi-head attention mechanism G ehr As a query, for both key and value Perform a query to obtain a context-sensitive global information representation adjusted for the patient's current state. :
[0200]
[0201] Constructing drug molecular structure maps: Graph neural networks (GNNs) are applied to encode the global molecular map and key local molecular structures of each drug to obtain global structure embeddings. and local molecular structure embedding in, Represents the set of real numbers. The total number of local structures of the drug; and the cross-attention mechanism is employed. The global and local structure embeddings are fused to generate an information-enhanced molecular structure representation. :
[0202]
[0203] S42: Execution preference-guided differential information fusion, including:
[0204] a. Integration of global information to differentiate medical treatment:
[0205] Project the final patient preference representation q′ obtained in step S3 onto dimension . The vector q″ is represented by a gating parameter α∈[0,1] that can be adjusted according to the type of visit, i.e., single or multiple visits, and is associated with the context-related global information obtained in step S41. By performing fusion, a drug characterization that incorporates patient preferences is obtained. :
[0206]
[0207] In the formula, · represents the product;
[0208] b. Contextual aggregation of differentiated medical visits:
[0209] Calculate the current relevance context c current By calculating the final patient preference representation q′ and the global drug information after fusing patient preferences, The correlation weight w between them current And based on this, Perform weighted aggregation:
[0210]
[0211] In the formula, For the Softmax function, It is a diagonal function, and T denotes the transpose sign;
[0212] Calculate the historical relevance context c history Differentiate based on the type of visit: For patients with a single visit, let c history =c current For patients who have visited multiple times, their historical medical needs records (H) k and historical medication information H v The calculation is as follows:
[0213]
[0214] v agg =w history ·H v
[0215]
[0216] The current relevance context c current and historical relevance context c historyThe data is spliced together and processed through a feedforward neural network. Fusion, resulting in aggregated memory context c memory :
[0217]
[0218] c. Integration of drug molecule information based on patient differentiation:
[0219] Calculate the final patient preference representation q′ and the molecular structure representation G obtained in step S41. mole_all The correlation weight w between them mole Based on this, a weighted aggregation is performed to obtain drug molecule information G related to the current preference. mole :
[0220]
[0221] Finally, the aggregated memory context c is controlled by a gating parameter β that can be adjusted according to the type of visit. memory With the drug molecule information G mole The components are fused to generate the final comprehensive characterization H for drug recommendation:
[0222] H = β·c memory +(1-β)·G mole .
[0223] Specifically, the drug recommendation list generation module performs the following operations:
[0224] S51: Calculate the drug recommendation probability, including: applying the final comprehensive representation H obtained in step S4 to a sigmoid activation function σ(·) to generate m for each drug. i Predicted probability :
[0225]
[0226] In the formula, To predict the probability, a value close to 1 indicates that the recommended drug m is... i A value close to 0 indicates that it is not recommended; and based on the predicted probability Generate the final list of recommended drugs;
[0227] S52: Define and optimize the composite loss function, including: constructing the drug recommendation problem as a multi-label binary classification task, and using a composite loss function that incorporates considerations of accuracy and safety. The drug recommendation list generation module is optimized, and the composite loss function is... It consists of a weighted average of the following three loss terms:
[0228] a. Binary cross-entropy loss Used to measure prediction probability With drug m in the dataset i Differences between them:
[0229]
[0230] In the formula, The total number of drugs;
[0231] b. Multi-tab margin loss Used to increase the difference in predicted probabilities between recommended and non-recommended drugs:
[0232]
[0233] In the formula, m i =1 indicates that the drug at index i is a drug that should be recommended, m j Let m represent the j-th drug. j =0 indicates that the j-th drug is a drug that should not be recommended, and max(·) is the maximum value function. The total number of drugs;
[0234] c. Drug Interaction DDI Loss This is used to improve the safety of recommendations by penalizing the co-occurrence probability of drug pairs that are known to interact:
[0235]
[0236] In the formula, Indicates drug m i and drugs m j The interaction between them A value of 1 indicates that drug m i and drugs m j There are interactions between them; a value of 0 indicates that there are no interactions.
[0237] Final composite loss function The weighted sum of the three loss items mentioned above:
[0238]
[0239] In the formula, λ and μ are hyperparameters used to balance the three loss terms.
[0240] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A multi-source fusion drug recommendation system oriented to diagnosis and treatment differences and dynamic preferences, characterized in that, include: The data acquisition module is used to acquire basic data, including clinical data, drug-drug interaction data, and drug molecule data, and to perform preprocessing, including cleaning the data to remove invalid and duplicate data, converting the molecular structure representation of the cleaned drug molecule data into a structured molecular feature vector, and encoding the diagnosis, surgery, and symptom records in the cleaned clinical data into a standardized medical entity sequence. The medical entity feature vector acquisition module uses a multilayer perceptron to mine the implicit associations between medical entities such as drugs, diagnoses, surgeries, and symptoms from preprocessed clinical data in order to obtain initialized medical entity feature vectors. The patient preference feature vector generation module is used to generate a unified patient preference feature vector, including: analyzing the patient's historical medication frequency to obtain their preference feature vector; using a recurrent neural network to encode the diagnosis, surgery, and symptoms in the clinical data to convert them into a clinical data feature vector; introducing a dynamic demand selection mechanism to filter the preference features most relevant to the current clinical data; and fusing the filtered preference features with the clinical data feature vector. The multi-source information fusion module is used to fuse multi-source information, including: constructing three types of graphs: a comprehensive preference relationship graph, a drug relationship graph, and a drug molecule structure graph; extracting multi-source information feature vectors from the three types of graphs using a graph neural network model; using a unified patient preference feature vector to guide the fusion of multi-source information feature vectors; and implementing differentiated fusion strategies for patients with single visits and multiple visits. The drug recommendation list generation module generates a drug recommendation list based on the fused multi-source information; The multi-source information fusion module performs the following operations: S41: Constructing a multi-graph network, including: First, quantifying the correlation between entities based on normalized co-occurrence frequencies, and drug-diagnosis correlation. ,in, Indicates drug and diagnosis The correlation between them Indicates drug and diagnosis The frequency of co-occurrence, Represents the division symbol. Indicates all things related to drugs The sum of the frequencies of related diagnoses The summation symbol is used to represent the summation symbol. Indexed variables representing summation; drug-surgery correlation ,in, Indicates drug and surgery The correlation between them Indicates drug and surgery The frequency of co-occurrence, Indicates all things related to drugs The sum of the frequencies of related surgeries; drug-symptom correlation ,in, Indicates drug and symptoms The correlation between them Indicates drug and symptoms The frequency of co-occurrence, Indicates all things related to drugs The sum of the frequencies of related symptoms; drug-drug correlation ,in, Indicates drug and medicine The correlation between them Indicates drug and medicine The frequency of co-occurrence, Indicates all things related to drugs The sum of the frequencies of the related drugs; Constructing a comprehensive preference relationship graph: targeting the current medical visit Drug-diagnosis graphs were constructed respectively. Drug-Surgery Diagram Medication-Symptom Chart The weights of the edges in these three graphs are determined by the previously calculated drug-diagnosis correlation. Drug-surgery correlation Drug-symptom correlation Drug-drug correlation Initialization; a variant of the Graph Convolutional Network (GCN) is used to transfer and update information between the three graphs mentioned above, where the diagnosis, surgery, or symptom nodes are the entities. The embedded updates are as follows: ; In the formula, Indicates the first In-layer entities Embedded vector, Indicates the first In-layer entities Embedded vector, Indicates the number of layers in the GCN. express It is any entity in the diagnosis, surgery, or symptoms. , and They represent the first The datasets of diagnostic data, surgical data, and symptom data were collected. Representing entities The update function, Representing entities Message passing function, Indicates the first All drugs in the layer The set of embedded vectors, Indicates from drugs To the entity The weight of the edge; Finally, the final diagnostic representations are obtained through aggregation functions. Surgical indication and symptoms : ; In the formula, , and These represent specific aggregation functions used for diagnosis, surgery, and symptoms, respectively. This is the last layer of GCN. , and These represent the diagnostic, surgical, and symptom embedding vectors of the last layer of the GCN, respectively. Constructing a drug relationship graph: This involves creating an undirected graph representing the drugs involved in the current medical visit. The weight of its edges Co-occurrence correlation between drugs Drug Interaction DDI Adjacency Matrix The value in Weighted summation yields: ; In the formula, These are learnable parameters; GCN is used to transfer and update information in the drug relationship diagram: ; In the formula, Indicates the first Drugs in layers Embedded vector, Indicates drug The update function, Indicates the first Drugs in layers Embedded vector, Indicates drug Message passing function, Indicates related to drugs The set of all directly connected neighboring nodes. Indicates the first This drug Indicates from drugs To the medicine The weight of the edge; Through aggregate functions Drug indications : ; In the formula, This represents the drug embedding vector of the last layer of the GCN; Global DDI adjacency matrix and the global drug co-occurrence matrix Learn to obtain a global graph representation and And integrate them to obtain global drug knowledge , Represents the set of real numbers. The total number of drugs, Indicates the size of the dimension: ; In the formula, These are learnable parameters; The aforementioned diagnostic, surgical, symptom, and drug representations are concatenated and then processed using a feedforward neural network. Obtain the multi-view electronic medical record (EHR) features of the current patient visit. : ; Through multi-head attention mechanism ,Will As a query, for both key and value Perform a query to obtain a context-sensitive global information representation adjusted for the patient's current state. : ; Constructing drug molecular structure maps: Graph neural networks (GNNs) are applied to encode the global molecular map and key local molecular structures of each drug to obtain global structure embeddings. and local molecular structure embedding ,in, Represents the set of real numbers. The total number of local structures of the drug; and the cross-attention mechanism is employed. The global and local structure embeddings are fused to generate an information-enhanced molecular structure representation. : ; S42: Execution preference-guided differential information fusion, including: a. Integration of global information to differentiate medical treatment: The final patient preference representation obtained by the patient preference feature vector generation module Projected to dimension vector ; through a gating parameter that can be adjusted according to the type of visit, i.e., single or multiple visits. ,Will Global information representation related to the context obtained in step S41 By performing fusion, a drug characterization that incorporates patient preferences is obtained. : ; In the formula, Indicates product; b. Contextual aggregation of differentiated medical visits: Calculate the current relevance context By calculating the final patient preference representation Global drug information after incorporating patient preferences Correlation weights between And based on this, Perform weighted aggregation: ; In the formula, For the Softmax function, It is a diagonal function. Indicates the transpose symbol; Calculate historical relevance context Differentiation is made based on the type of visit: For patients with a single visit, For patients who have visited multiple times, their historical medical needs records will be used as a basis. and historical medication information The calculation is as follows: ; The current relevance context and historical relevance context The data is spliced together and processed through a feedforward neural network. Fusion, resulting in aggregated memory context : ; c. Integration of drug molecule information based on patient differentiation: Calculate the final patient preference representation The molecular structure representation obtained in step S41 Correlation weights between Based on this, a weighted aggregation is performed to obtain drug molecule information relevant to the current preference. : ; Finally, a gating parameter that can be adjusted based on the type of visit is used. The aggregated memory context With the drug molecule information The data is then fused to generate a final comprehensive characterization for drug recommendation. : 。 2. The multi-source fusion drug recommendation system for diagnosis and treatment differences and dynamic preferences according to claim 1, characterized in that, The data acquisition module obtains clinical data from the MIMIC-III and MIMIC-IV datasets, drug-drug interaction data from the TWOSIDES dataset, and drug molecule data from the DrugBank dataset.
3. The multi-source fusion drug recommendation system for diagnosis and treatment differences and dynamic preferences according to claim 1, characterized in that, The medical entity feature vector acquisition module performs the following operations: S21: Generate medical entity embedding vectors, including: for the current medical record Diagnostic data set Surgical Data Set and symptom data set Map it to dimension 1 according to the following formula. Embedded space: ; In the formula, , and These represent the generated diagnostic embedding vector, surgical embedding vector, and symptom embedding vector, respectively. , and These represent the embedding matrices for learnable diagnoses, surgeries, and symptoms, respectively. Represents the set of real numbers. , , These represent the total number of categories for diagnosis, surgery, and symptoms, respectively. Regarding the previous medical visit Drug combination used The coding is performed according to the following formula: ; In the formula, This represents the generated historical medication embedding vector. If the current visit is the first visit, then... Initialize as a zero vector. Represents a learnable drug embedding matrix. Indicates the total number of drugs; S22: Construct a comprehensive medical visit representation, including: weighting and concatenating the diagnostic embedding vector, surgical embedding vector, symptom embedding vector, and historical medication embedding vector according to the following formula to generate a comprehensive medical visit representation vector. : ; In the formula, Indicates a connection operation. This represents element-wise multiplication. , , and These are learnable weight vectors corresponding to the embeddings of diagnosis, surgery, symptoms, and medication, respectively. S23: Optimize medical entity embedding vectors through pre-training tasks, including: integrating the comprehensive medical visit representation vector. The input is fed into a multilayer perceptron; through a series of nonlinear transformations by the multilayer perceptron, the transformation results are fed into a sigmoid activation function to output the current... Predicted probability of each drug during the next visit ; and the medical entity embedding vectors optimized during pre-training, i.e. , , and , which serves as the initial feature vector for the medical entity.
4. The multi-source fusion drug recommendation system for diagnosis and treatment differences and dynamic preferences according to claim 3, characterized in that, The patient preference feature vector generation module performs the following operations: S31: Modeling patient needs and preferences, including: statistically analyzing each drug based on the patient's complete medication history. Normalized frequency of occurrence To construct an original medication preference vector ,in, Represents the set of real numbers. Indicates the first This drug , The total number of drugs; and according to the following formula, the original medication preference vector is... With a learnable drug preference embedding matrix Perform element-wise multiplication to generate a patient needs preference embedding vector. , Indicates the size of the dimension: ; In the formula, This represents element-wise multiplication. S32: Dynamically adjust and select demand preferences, including: First, the obtained diagnostic embedding vector Surgical embedding vector and symptom embedding vector Context encoding is performed using recurrent neural networks (RNNs), and the output of the RNN is added to the input through residual connections to generate enhanced clinical state embedding vectors. , and The calculation formula is as follows: ; In the formula, , and They represent , and The output, , and Represents a recurrent neural network; Secondly, the enhanced clinical state embedding vectors are concatenated and processed through a feedforward neural network. Projection is performed to generate a comprehensive demand representation vector as the query vector. : ; In the formula, For connection operation; Then, a multi-head attention mechanism is adopted. , the query vector Embedded vectors of patient demand preferences as keys and values Interact to calculate attention weights : ; Next, the attention weights are utilized. Through diagonal functions Embedded vector of patient needs and preferences Adjustments are made to obtain the adjusted drug preference vector. : ; Subsequently, through a linear transformation Calculate the adjusted drug preference score The sparse maximum method is used to evaluate the scores. Processing yields sparsity scores : ; And according to the selection ratio Dynamically calculate the number of selections Before choosing The most relevant drug preferences: ; In the formula, This indicates taking the maximum value. Indicates the selection ratio. Indicates the multiplication operation. Represents the total number of features. This represents the floor function; Finally, the sparsification score is calculated. Applied to the adjusted drug preference vector The selection is performed and aggregated by summing along the drug axis to generate a comprehensive drug preference vector. : ; In the formula, This represents the vector representation of the selected drug demand preference. This represents the summation operation; S33: Generate a patient preference feature vector, including: embedding the enhanced clinical state into the vector using an adaptive weighted fusion mechanism. , , and the comprehensive drug preference vector The data is fused to generate the final patient preference representation. This mechanism generates functions that satisfy the following conditions for the four input features: scalar attention weights , , , , Representing the Scalar attention weights are applied, and feature fusion is performed according to the following formula: ; In the formula, This indicates an adaptive weighted fusion mechanism.
5. A multi-source fusion drug recommendation system for diagnosis and treatment differences and dynamic preferences according to claim 1, characterized in that, The drug recommendation list generation module performs the following operations: S51: Calculate the probability of drug recommendation, including: the final comprehensive representation obtained from the multi-source information fusion module. Applied to a sigmoid activation function To generate each drug Predicted probability : ; In the formula, To predict the probability, a value close to 1 indicates that the drug should be recommended. A value close to 0 indicates that it is not recommended; and based on the predicted probability Generate the final list of recommended drugs; S52: Define and optimize the composite loss function, including: constructing the drug recommendation problem as a multi-label binary classification task, and using a composite loss function that incorporates considerations of accuracy and safety. The drug recommendation list generation module is optimized, and the composite loss function is... It consists of a weighted average of the following three loss terms: a. Binary cross-entropy loss Used to measure prediction probability Drugs in the dataset Differences between them: ; In the formula, , The total number of drugs; b. Multi-tab margin loss This is used to increase the difference in predicted probabilities between recommended and non-recommended drugs. ; In the formula, Indicates that the index is This medication is one that should be recommended. Indicates the first This drug Indicates the first This is a drug that should not be recommended. It is a function with maximum value. , The total number of drugs; c. Drug Interaction DDI Loss This is used to improve the safety of recommendations by penalizing the co-occurrence probability of drug pairs that are known to interact with each other. ; In the formula, Indicates drug and medicine The interaction between them A value of 1 indicates a drug and medicine There are interactions between them; a value of 0 indicates that there are no interactions. Final composite loss function The weighted sum of the three loss items mentioned above: ; In the formula, and It is a hyperparameter used to balance the three loss terms.