Method and system for recommending advantageous combination of traditional chinese medicine and western medicine based on unsupervised heterogeneous graph neural network

By constructing a combined Chinese and Western medicine treatment plan using an unsupervised heterogeneous graph neural network, and combining association rule mining and graph attention mechanisms, the accuracy and suitability issues of combined Chinese and Western medicine treatment plan recommendations in existing technologies are solved, achieving efficient plan identification and recommendation.

CN120878282BActive Publication Date: 2025-12-16WEST CHINA HOSPITAL SICHUAN UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511403649.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-29
Publication Date
2025-12-16
Estimated Expiration
2045-09-29

AI Technical Summary

Technical Problem

Existing technologies lack deep learning architectures for recommending combined Chinese and Western medicine treatments that address complex heterogeneous characteristics, making accurate identification and recommendation impossible. Furthermore, relying on supervised learning requires a large amount of labeled data, resulting in poor model generalization ability.

Method used

We employ an unsupervised heterogeneous graph neural network approach, using association rule mining and graph attention mechanisms to construct a heterogeneous graph for the combined use of traditional Chinese and Western medicines. We then calculate the efficacy rate and therapeutic weights of drug combinations and perform unsupervised training to recommend superior treatment options.

Benefits of technology

It enables accurate identification and recommendation of combined Chinese and Western medicine treatment plans, adapts to the data characteristics of medical scenarios, improves the generalization ability and clinical application practicality of the model, and reduces hardware deployment costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120878282B_ABST
    Figure CN120878282B_ABST
Patent Text Reader

Abstract

The application discloses a Chinese and western medicine combination advantage scheme recommendation method and system based on an unsupervised heterogeneous graph neural network, and relates to the technical field of medical information.The application mines four types of drug-drug (such as traditional Chinese medicine-western medicine, western medicine-traditional Chinese medicine) and two types of drug-therapeutic effect correlation rules by preprocessing medical electronic medical records, calculates support, lift, drug frequency and drug combination efficiency; constructs a heterogeneous graph containing traditional Chinese medicine, western medicine nodes and four types of heterogeneous edges, calculates therapeutic effect weight; unsupervised training of heterogeneous graph attention network, optimization model; output Chinese and western medicine combination advantage scheme. The system includes a data set construction function module corresponding to the recommendation method. The application solves the problems of existing technology, such as therapeutic effect loss and dependence on labeled data, improves recommendation accuracy, and meets clinical needs.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of medical information technology, and more specifically, to a method and system for recommending advantageous combinations of traditional Chinese and Western medicines based on unsupervised heterogeneous graph neural networks. Background Technology

[0002] The selection of optimal combined Chinese and Western medicine regimens refers to the use of statistical models or machine learning methods to analyze the distribution of data characteristics and scientifically screen the best combined Chinese and Western medicine regimens from the perspective of efficacy. A large amount of real-world data exists in clinical practice regarding the combined use of Chinese and Western medicines, and the efficacy of different combinations varies significantly. Therefore, how to scientifically recommend the best combined Chinese and Western medicine regimens based on real-world data has become an important issue.

[0003] Currently, there are relatively few methods for selecting advantageous combinations of traditional Chinese medicine (TCM) and Western medicine, mainly relying on machine learning methods such as association rule mining and community label propagation algorithms. Association rule mining, in particular, is simple in principle, revealing potential combination patterns by analyzing the co-occurrence frequency of drugs in prescriptions. It is efficient when handling large-scale datasets, but can only discover simple co-occurrence patterns of TCM and Western medicine. Community label propagation is an algorithm used for community discovery, iteratively updating node labels based on a graph structure, aggregating nodes with similar attributes into the same community. In 2024, a domestic team used the community label propagation algorithm to discover TCM and Western medicine combinations, mainly constructing a graph structure based on drug attribute similarity, and then using label propagation to divide communities to identify potential TCM and Western medicine combination clusters. However, these machine learning methods only consider drug co-occurrence frequency and drug attribute similarity, without scientifically evaluating the actual clinical efficacy of drug combinations.

[0004] With the development of deep learning, neural networks can automatically learn and extract complex, high-level drug features from raw data, capturing potential relationships between drug combinations. However, there is relatively little research using deep learning to select advantageous combinations of traditional Chinese medicine and Western medicine. Most studies focus on predicting the synergistic effects of Western medicine combinations. For example, the DeepSynergy model proposed by foreign research teams predicts drug combinations by combining drug features with cell line gene expression information. Recently, the TranSynergy model, based on knowledge-driven learning and self-attention Transformer enhancement, proposed by domestic teams, has improved the performance of predicting synergistic drug combinations and predicted several synergistic drug combinations with high confidence. However, existing neural network models mainly deal with isomorphic graphs (such as protein-protein interaction networks) or simple heteromorphic graphs (such as drug-target networks), lacking dedicated modeling methods for the combination of traditional Chinese medicine and Western medicine. In addition, existing models mostly use supervised learning, requiring a large amount of labeled data, which is scarce in actual medical scenarios, resulting in poor model generalization ability.

[0005] The aforementioned work includes using machine learning and deep learning to discover the advantages of combining traditional Chinese medicine and Western medicine, but it suffers from insufficient integration of key efficacy indicators and a lack of deep learning architecture specifically designed to model the complex heterogeneous characteristics of the traditional Chinese medicine-Western medicine combination system, thus failing to achieve accurate identification and recommendation of the advantages of combining traditional Chinese medicine and Western medicine. Summary of the Invention

[0006] To overcome the shortcomings and deficiencies of existing technologies, this invention provides a method and system for recommending advantageous combinations of traditional Chinese medicine and Western medicine based on unsupervised heterogeneous graph neural networks. The purpose of this invention is to address the problem that existing methods for recommending combinations of traditional Chinese medicine and Western medicine cannot accurately identify and recommend advantageous combinations. This invention provides a method based on unsupervised heterogeneous graph neural networks for selecting advantageous combinations of traditional Chinese medicine and Western medicine from real-world data. This method integrates association rule mining and graph attention mechanisms, and constructs efficacy weights based on drug combination frequency and effectiveness, strengthening the model's learning ability for high-frequency and effective combinations of traditional Chinese medicine and Western medicine, thereby achieving accurate identification and recommendation of advantageous combinations.

[0007] To address the problems existing in the prior art, the present invention is achieved through the following technical solution.

[0008] The first aspect of this invention provides a method for recommending advantageous combinations of traditional Chinese and Western medicines based on unsupervised heterogeneous graph neural networks, comprising the following steps:

[0009] S1. The step of constructing a prescription-efficacy classification dataset involves preprocessing the medication information and efficacy outcome indicators in the electronic medical records to obtain a structured prescription-efficacy classification dataset containing standardized drug names and efficacy classifications.

[0010] S2. The step of constructing a heterogeneous graph of combined use of traditional Chinese and Western medicine based on association rules is to use the Fp-growth algorithm to mine the drug-drug association rules and drug-efficacy association rules in the prescription-efficacy classification dataset. The drug-drug association rules include four categories: traditional Chinese medicine → traditional Chinese medicine, traditional Chinese medicine → Western medicine, Western medicine → traditional Chinese medicine, and Western medicine → Western medicine. The drug-efficacy association rules include two categories: drug → significantly effective and drug → limited efficacy.

[0011] Calculate the support and lift of each association rule, the frequency of various drugs, the efficacy rate of drug combination, and the efficacy weight; construct a heterogeneous graph containing traditional Chinese medicine nodes, Western medicine nodes, and four types of heterogeneous edges; the formula for calculating the efficacy rate of drug combination is: The efficacy weights are used as edge weights, and their calculation formula is as follows:

[0012] ;in and The values ​​should be determined based on clinical experience. The selection of advantageous solutions should consider both the frequency of drug combination and clinical efficacy, aiming to avoid one-sided solutions of "high frequency and low efficiency" and "high efficiency and low frequency", and to ensure that the solutions discovered are both practical and effective. The node features are three-dimensional vectors standardized by Z-score, which include drug frequency, drug → significant efficacy support and drug → limited efficacy support. The edge features are two-dimensional vectors standardized by Z-score, which include drug-drug support and drug combination efficacy.

[0013] S3. The step of constructing a heterogeneous graph attention network model involves vectorizing the node features of the heterogeneous graph, calculating the attention weights between nodes through an attention mechanism with a mask matrix, and outputting node embedding vectors that fuse neighborhood information.

[0014] S4. Unsupervised training step with fused efficacy weights: The cosine similarity of positive samples is weighted by the efficacy weights, and the average cosine similarity of negative samples is calculated to construct the loss function.

[0015] The heterogeneous graph attention network model is optimized through unsupervised contrastive learning.

[0016] S5, Recommendation steps for advantageous combinations of traditional Chinese medicine and Western medicine: Based on the optimized heterogeneous graph attention network model, output the embedding vectors of traditional Chinese medicine and Western medicine nodes, construct the cross-modal similarity matrix of traditional Chinese medicine and Western medicine, and filter and output advantageous combination schemes according to similarity.

[0017] More preferably, step S2, which involves constructing an isomer graph of combined traditional Chinese and Western medicine based on association rules, specifically includes:

[0018] S21. Use the Fp-growth algorithm to mine the association rules in the prescription-effect classification dataset, and calculate the support and lift of each type of association rule as well as the frequency of each drug.

[0019] S22. Filter out drug combinations with a lift greater than 1 and a support greater than a set threshold for drug-drug association rules, and calculate the effectiveness of their combined use in prescriptions based on the selected drug combinations.

[0020] S23. Construct a heterogeneous graph of combined Chinese and Western medicine based on the selected drug combinations. The node types of the heterogeneous graph include Chinese medicine nodes and Western medicine nodes. The node features are three-dimensional vectors standardized by Z-score. The three-dimensional vectors include drug frequency, drug-significantly effective support, and drug-limited efficacy support. The edge types of the heterogeneous graph include four types of heterogeneous edges: Chinese medicine-Chinese medicine edge, Chinese medicine-Western medicine edge, Western medicine-Chinese medicine edge, and Western medicine-Western medicine edge. The edge features are two-dimensional vectors standardized by Z-score. The two-dimensional vectors include drug-drug support and drug combination efficacy. At the same time, efficacy weights are constructed as edge weights.

[0021] Furthermore, the formula for calculating the support of the four types of drug-drug association rules is as follows:

[0022] ;

[0023] The formula for calculating the lifting degree of the four categories of drugs-drug association rules is as follows:

[0024] ;

[0025] In the formula, This represents the probability that drug A and drug B appear simultaneously in all prescriptions; This indicates the strength of the association between drug A and drug B. This indicates that drug A and drug B are positively correlated; This represents the probability of drug A appearing in all prescriptions; This represents the probability of drug B appearing in all prescriptions;

[0026] The formulas for calculating the support and improvement of drug efficacy are as follows:

[0027] ;

[0028] ;

[0029] This represents the probability that all prescriptions using drug A are significantly effective. This indicates the probability that the treatment is significantly effective among all prescriptions.

[0030] The formula for calculating the support and improvement of a drug's limited efficacy is as follows:

[0031] ;

[0032] ;

[0033] This represents the probability that drug A is used in all prescriptions and has limited efficacy. This indicates the probability that a prescription has limited efficacy among all prescriptions.

[0034] More preferably, the step of constructing the heterogeneous graph attention network model in S3 specifically includes:

[0035] S31, Node Feature Vectorization Step: The 3D vector features of each node are vectorized using a randomly initialized shared weight matrix. Perform a linear transformation to project the 3D vector features of each node onto... In the feature space, we obtain the node feature set. ,in, For dimension is The matrix, For dimension is where n is the total number of nodes;

[0036] S32. Steps for calculating attention coefficients with a masked matrix, resulting in normalized attention coefficients. ,

[0037] In the formula, Let i represent the eigenvector after the linear transformation of node i. This represents a vector concatenation operation. This represents a learnable attention parameter vector, optimized through backpropagation and gradient descent. Let T be the activation function, and let T denote the transpose.

[0038] Construct an adjacency matrix and convert it into a mask matrix. In the mask matrix, assign a value of 0 to positions containing edges and a value of 0 to positions without edges. ;

[0039] The mask matrix is ​​combined with the unnormalized attention coefficient matrix, and then processed using the softmax function:

[0040] In the formula, Let k represent the set of neighbors of node i, including node i itself; k represents the k-th neighbor node. This represents the attention weight of node j towards node i;

[0041] S33, Node Embedding Output Step: By fusing node features with attention weights, a new feature representation of the node is generated. Specifically...

[0042] For node i, aggregate its neighboring nodes. The feature weighted sum is then passed through a nonlinear activation function. The output features of node i are obtained after transformation. In the formula, Let be the input feature vector of neighbor node j.

[0043] More preferably, the node features of the heterogeneous graph are vectorized, specifically, the numerical features of node i are represented as a matrix. Through a randomly initialized shared weight matrix Perform a linear transformation and project its 3D features onto... 3D feature space, to obtain ;

[0044] When there are n nodes, the node feature set is represented as a matrix. ,

[0045] ;

[0046] Through a randomly generated shared weight matrix After performing a linear transformation, we obtain the vectorized set of node features. , .

[0047] Further preferably, the unsupervised training step for the S4 fusion efficacy weights specifically includes:

[0048] S41, Node embedding vector similarity calculation steps: Based on the node embedding vectors output by the heterogeneous graph attention network model constructed in S3, calculate the cosine similarity between node embedding vectors.

[0049] S42, Positive Sample Processing Step: Take the drug combinations with edges in the heterogeneous graph as positive samples, and use the efficacy weights constructed in step S2 to weight the cosine similarity of the positive samples to calculate the weighted cosine similarity of the positive samples. ;

[0050] S43. Negative sample processing steps: Randomly generate sample pairs. During the generation process, check whether the sample pair already exists in the positive samples. If it does not exist, add it to the list of negative samples to ensure that the negative samples do not contain real edges and that the number of negative samples is the same as the number of positive samples. Calculate the average cosine similarity of negative samples.

[0051] S44. Construct the loss function Loss. The loss function is constructed using the difference between the mean cosine similarity of negative samples and the weighted cosine similarity of positive samples. The loss function is minimized through unsupervised contrastive learning to complete the training of the heterogeneous graph attention network model.

[0052] More preferably, the cosine similarity calculation formula is:

[0053] ;

[0054] In the formula, Represents the vector dot product. Let f denote the Euclidean norm of vector M, and let f denote the dimension of the vector. , Let M and N represent the values ​​of vector M and N in the t-th dimension, respectively; the cosine similarity result ranges from [-1, 1], and the larger the value, the more similar the directions of the two vectors are.

[0055] A further preferred step in the S5 recommended approach for the combined use of traditional Chinese and Western medicine specifically includes:

[0056] S51, Embedding Vector Generation Step: Input the original feature matrices and topological relationships of the traditional Chinese medicine nodes and Western medicine nodes into the optimized heterogeneous graph attention network model, and output the deep embedding vector E of all nodes. n is the total number of nodes, and D is the embedding dimension;

[0057] S52. Cross-modal similarity calculation steps: Extract the subset of deep embedding vectors of traditional Chinese medicine from the deep embedding vector E. Deep embedding vector subsets of Western medicine The similarity between traditional Chinese medicine nodes and Western medicine nodes is calculated based on cosine similarity. This represents the set of all Chinese medicine nodes. Represent the set of all Western medicine nodes, and construct the cross-modal similarity matrix between traditional Chinese medicine and Western medicine. , ,in, Represents a subset of deep embedding vectors for traditional Chinese medicine. The embedding vector of the i-th node in the array. Represents a subset of deep embedding vectors for Western medicine The embedding vector of the j-th node; the value range is [-1, 1], and the larger the value, the higher the combination potential;

[0058] S53. Sort the cross-modal similarity matrix of traditional Chinese medicine and Western medicine in descending order of similarity value to generate candidate combination sequences. , Using an empirical threshold, the final output includes the name of the traditional Chinese medicine, the name of the Western medicine, the node embedding similarity score, and the recommended sequence number, representing the advantages of using traditional Chinese and Western medicine in combination.

[0059] More preferably, step S1, which involves constructing a prescription-efficacy classification dataset, specifically includes:

[0060] S11. Medical electronic medical record preprocessing step: Natural language processing technology is used to convert medication information and efficacy outcome indicators in unstructured medical electronic medical records into structured data, generating standardized drug prescription forms and efficacy outcome indicator forms.

[0061] S12, Standardization of drug names: Based on the standardization dictionary of drugs, standardize the drug names in the drug prescription form and remove duplicate drugs in the same prescription.

[0062] S13. Standardization steps for efficacy outcome indicators: After screening key indicators, standardizing units of measurement, handling missing values, and standardizing time variables, the efficacy of prescriptions is classified as significantly effective or limited in efficacy based on the changes in indicators before and after medication; a structured prescription-efficacy classification dataset containing standardized drug names and efficacy classifications is obtained.

[0063] A second aspect of this invention provides a system for recommending advantageous combinations of traditional Chinese and Western medicines based on unsupervised heterogeneous graph neural networks, the system comprising:

[0064] The medication prescription-efficacy classification dataset construction module is used to preprocess medication information and efficacy outcome indicators in electronic medical records to obtain a structured medication prescription-efficacy classification dataset containing standardized drug names and efficacy classifications.

[0065] A heterogeneous graph construction module for combined Chinese and Western medicine is used to mine drug-drug association rules and drug-efficacy association rules in the prescription-efficacy classification dataset using the Fp-growth algorithm. The drug-drug association rules include four categories: Chinese medicine → Chinese medicine, Chinese medicine → Western medicine, Western medicine → Chinese medicine, and Western medicine → Western medicine. The drug-efficacy association rules include two categories: drug → significantly effective and drug → limited efficacy. The module calculates the support and lift of each association rule, the frequency of each drug, the effectiveness rate of drug combination, and the efficacy weight. It constructs a heterogeneous graph containing Chinese medicine nodes, Western medicine nodes, and the four types of heterogeneous edges. The formula for calculating the effectiveness rate of drug combination is: The efficacy weights are used as edge weights, and their calculation formula is as follows: ;in and The values ​​should be determined based on clinical experience. The selection of advantageous solutions should consider both the frequency of drug combination and clinical efficacy, aiming to avoid one-sided solutions of "high frequency and low efficiency" and "high efficiency and low frequency", and to ensure that the solutions discovered are both practical and effective. The node features are three-dimensional vectors standardized by Z-score, which include drug frequency, drug → significant efficacy support and drug → limited efficacy support. The edge features are two-dimensional vectors standardized by Z-score, which include drug-drug support and drug combination efficacy.

[0066] The heterogeneous graph attention network model construction module is used to vectorize the node features of the heterogeneous graph, calculate the attention weights between nodes through the attention mechanism with mask matrix, and output the node embedding vector that integrates neighborhood information.

[0067] An unsupervised training module that integrates efficacy weights constructs a loss function by weighting the cosine similarity of positive samples with these efficacy weights and calculating the average cosine similarity of negative samples. The heterogeneous graph attention network model is optimized through unsupervised contrastive learning.

[0068] The module recommends advantageous combinations of traditional Chinese medicine and Western medicine. Based on the optimized heterogeneous graph attention network model, it outputs the node embedding vectors of traditional Chinese medicine and Western medicine, constructs a cross-modal similarity matrix between traditional Chinese medicine and Western medicine, and filters and outputs advantageous combination schemes according to similarity.

[0069] Compared with existing technologies, this invention utilizes a three-pronged technical architecture: constructing a heterogeneous graph of combined Chinese and Western medicine using association rules, unsupervised training through efficacy weight fusion, and scheme recommendation based on cross-modal similarity. This architecture addresses the core pain points of existing methods for selecting Chinese and Western medicine schemes—namely, lack of efficacy indicators, poor heterogeneous adaptability, and reliance on labeled data—and achieves multi-dimensional technical breakthroughs. Specific technical effects are as follows:

[0070] 1. This invention improves the accuracy of recommended combined Chinese and Western medicine regimens, upgrading from a frequency-oriented approach to a dual efficacy-frequency-oriented approach. Existing technologies rely solely on drug contribution frequency selection schemes, easily recommending high-frequency but ineffective combinations, with limited clinical practical value. This invention achieves a breakthrough in accuracy through three major design features:

[0071] —Efficacy indicators are embedded throughout the entire process. In the medication prescription-efficacy classification dataset construction stage, significant effective / limited efficacy labels are obtained through efficacy outcome indicator classification. In the heterogeneous graph construction stage, the efficacy rate of drug combination is calculated and efficacy weights are constructed. The efficacy weights are passed from the data layer to the model layer to avoid the defect of only looking at frequency and not efficacy.

[0072] — Refined mining of directed association rules: The Fp-growth algorithm is used to mine four types of directed drug-drug combination relationships: Chinese medicine → Chinese medicine, Chinese medicine → Western medicine, Western medicine → Chinese medicine, and Western medicine → Western medicine, rather than undirected generalized combinations of Chinese medicine and Western medicine. This accurately captures the association strength of directed drug-drug combinations and avoids recommendation bias caused by confusion of combination direction.

[0073] —The efficacy-weighted model learning, in the unsupervised training stage, uses efficacy weights to weight the cosine similarity of positive samples, enabling the model to optimize and learn high-frequency and effective combinations, rather than treating all high-frequency combinations equally, thereby greatly improving the accuracy of the combined use of Chinese and Western medicine in this invention.

[0074] 2. This invention adapts to the data characteristics of medical scenarios, addressing the industry pain points of scarce labeled data and complex heterogeneous systems. Existing deep learning models rely on supervised learning, requiring a large amount of manually labeled efficacy data, which is scarce in medical scenarios. Furthermore, existing models mostly process homogeneous graphs or simple heterogeneous graphs, failing to adapt to the complex heterogeneous characteristics of cross-category and multi-relationship relationships between traditional Chinese medicine and Western medicine. This invention specifically addresses the above pain points:

[0075] —Unsupervised training with scarce data: Based on a contrastive learning design using positive samples (real drug combination edges) + negative samples (non-real edges), no manual labeling of efficacy is required, and model training can be completed using only real-world prescription data; far superior to traditional supervised models;

[0076] —Heterogeneous graph architecture adapted to the heterogeneous characteristics of traditional Chinese medicine and Western medicine: A dedicated heterogeneous graph is constructed, consisting of two types of nodes (traditional Chinese medicine nodes and Western medicine nodes) and four types of directed edges (traditional Chinese medicine → traditional Chinese medicine, traditional Chinese medicine → Western medicine, Western medicine → traditional Chinese medicine, and Western medicine → Western medicine). Combined with an attention mechanism using a masked matrix, the model accurately distinguishes differences in node type and edge direction. For example, traditional Chinese medicine nodes only aggregate features from Western medicine nodes used as adjuvants, and Western medicine nodes only aggregate features from traditional Chinese medicine nodes used as adjuvants, avoiding confusion of neighborhood information. Compared to traditional models handling isomorphic graphs, this invention significantly improves the feature capture accuracy for cross-category combinations of traditional Chinese and Western medicine, and significantly enhances adaptability.

[0077] 3. This invention enhances the practicality of clinical application, upgrading from generalized recommendations to specific solutions that can be implemented. Existing technologies often output generalized combinations of traditional Chinese medicine categories and Western medicine categories, requiring clinicians to further screen specific drugs, resulting in high implementation costs. This invention achieves the function of assisting clinical recommendations through refined design:

[0078] —The specific drug-level recommendation granularity, support and improvement calculations are all based on the specific drug name, not the drug type. The final output includes the specific Chinese medicine name, the specific Western medicine name, the similarity score, and the recommendation sequence number, which can assist doctors in making medication decisions and provide them with reference.

[0079] —The clinical scenario-based approach is adapted to the following scenarios: Traditional Chinese medicine → Western medicine combination corresponds to chronic conditioning scenarios where traditional Chinese medicine is the mainstay and Western medicine is the auxiliarystay (e.g., astragalus is the mainstay for lowering blood sugar and metformin is the auxiliarystay for controlling blood sugar), while Western medicine → Traditional Chinese medicine combination corresponds to acute treatment scenarios where Western medicine is the mainstay and traditional Chinese medicine is the auxiliarystay for relieving side effects (e.g., aspirin is the mainstay for antithrombosis and Xiangsha Yangwei Pill is the auxiliarystay for relieving gastrointestinal irritation). The recommended treatment plan is highly consistent with the clinical diagnosis and treatment logic.

[0080] — Explainable recommendation basis: The solution output includes a node embedding similarity score (based on a comprehensive calculation of drug features and efficacy features). Doctors can intuitively judge the degree of advantage of the combination through the score. At the same time, the model can backtrack on the quantitative indicators such as the support and effectiveness of the solution, avoiding black box recommendations and enhancing clinical trust.

[0081] 4. This invention improves the generalization ability and efficiency of the model, adapting to multiple departments and disease scenarios while balancing performance and accuracy. The prescription-efficacy classification dataset construction module of this invention supports standardized processing of unstructured EMR text to structured data, adapting to prescription data from multiple departments such as cardiology, endocrinology, and respiratory medicine. The heterogeneous graph construction and model training process does not require adjustments to the core logic for specific diseases. In the recommendation of combined Chinese and Western medicine regimens for different diseases such as diabetes, coronary heart disease, and chronic bronchitis, it achieves a high and significantly effective recommendation rate, with generalization superior to models designed only for a single disease. The FP-growth algorithm is used to mine association rules, improving efficiency by 2-3 times compared to the traditional Apriori algorithm for processing 100,000-level prescription datasets. Unsupervised training reduces invalid computation through dynamic negative sample sampling (excluding real edges), shortening model training time by 40% compared to supervised learning models of the same scale. The entire process of processing 100,000-level data can be completed on a regular server, reducing hardware deployment costs.

[0082] 5. This invention can promote the value transformation of real-world medical data, from data accumulation to clinical decision support. A large amount of real-world data on the combined use of traditional Chinese medicine and Western medicine accumulated in clinical practice is often difficult to transform into effective decision support due to its unstructured nature, lack of efficacy labels, and complex relationships. This invention transforms dormant data into actionable medication recommendations through an end-to-end process of data preprocessing → heterogeneous graph modeling → model training → treatment recommendation. On the one hand, the standardization of drug names and efficacy indicators in the dataset construction stage establishes a standardized processing paradigm for real-world data, solving the data quality problems of multiple names for the same drug and inconsistent efficacy indicators. On the other hand, the superior treatment options output by the model can feed back into clinical practice (such as forming a department-specific recommended list of combined Chinese and Western medicine treatments), while indicators such as the support rate and effectiveness of the treatment options can serve as evidence-based evidence for the safety and effectiveness of drug combinations, promoting a closed loop of real-world data → clinical evidence → treatment optimization, and facilitating the implementation of precision medicine. Attached Figure Description

[0083] Figure 1 This is a flowchart of the method for recommending the advantageous combination of traditional Chinese and Western medicines according to the present invention;

[0084] Figure 2 This is a flowchart illustrating the construction of isomer diagrams for the combined use of traditional Chinese and Western medicines in this invention.

[0085] Figure 3This is a flowchart of the structured modeling process based on graph attention mechanism of the present invention;

[0086] Figure 4 This is a schematic diagram illustrating the calculation of attention coefficients with a masked matrix in this invention;

[0087] Figure 5 This is a schematic diagram of the process for recommending advantageous combinations of traditional Chinese and Western medicines based on a heterogeneous graph attention network model according to the present invention.

[0088] Figure 6 Flowchart for constructing the prescription-efficacy classification dataset of this invention;

[0089] Figure 7 This is a schematic diagram of the structure of the system for recommending advantageous combinations of traditional Chinese and Western medicines according to the present invention. Detailed Implementation

[0090] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0091] Example 1

[0092] As a preferred embodiment of the present invention, please refer to the appendix to the specification. Figure 1 As shown, this embodiment discloses a method for recommending advantageous combinations of traditional Chinese and Western medicines based on unsupervised heterogeneous graph neural networks, including the following steps:

[0093] S1. The step of constructing a prescription-efficacy classification dataset involves preprocessing the medication information and efficacy outcome indicators in the electronic medical records to obtain a structured prescription-efficacy classification dataset (or "prescription-efficacy transaction dataset for combined Chinese and Western medicine") containing standardized drug names and efficacy classifications.

[0094] S2. The step of constructing a heterogeneity graph of combined Chinese and Western medicine based on association rules, and using the Fp-growth algorithm to mine the prescription-efficacy classification dataset (as shown in the attached figure). Figure 2As shown, or referred to as the "Traditional Chinese Medicine and Western Medicine Combined Prescription-Efficacy Transaction Dataset"), the data includes drug-drug association rules and drug-efficacy association rules. The drug-drug association rules include four categories: Traditional Chinese Medicine → Traditional Chinese Medicine, Traditional Chinese Medicine → Western Medicine, Western Medicine → Traditional Chinese Medicine, and Western Medicine → Western Medicine. The drug-efficacy association rules include two categories: Drug → Significantly Effective and Drug → Limited Efficacy. The support and lift of each association rule, the frequency of various drugs, the drug combination efficacy rate, and the efficacy weight are calculated. A heterogeneous graph containing Traditional Chinese Medicine nodes, Western Medicine nodes, and four types of heterogeneous edges is constructed. The formula for calculating the drug combination efficacy rate is: The efficacy weights are used as edge weights, and their calculation formula is as follows: ;in and The values ​​should be determined based on clinical experience. The selection of advantageous solutions should consider both the frequency of drug combination and clinical efficacy, aiming to avoid one-sided solutions of "high frequency and low efficiency" and "high efficiency and low frequency", and to ensure that the solutions discovered are both practical and effective. The node features are three-dimensional vectors standardized by Z-score, which include drug frequency, drug → significant efficacy support and drug → limited efficacy support. The edge features are two-dimensional vectors standardized by Z-score, which include drug-drug support and drug combination efficacy.

[0095] S3. The step of constructing a heterogeneous graph attention network model involves vectorizing the node features of the heterogeneous graph, calculating the attention weights between nodes through an attention mechanism with a mask matrix, and outputting node embedding vectors that fuse neighborhood information.

[0096] S4. Unsupervised training step with fused efficacy weights: The cosine similarity of positive samples is weighted by the efficacy weights, and the average cosine similarity of negative samples is calculated to construct the loss function.

[0097] The heterogeneous graph attention network model is optimized through unsupervised contrastive learning.

[0098] S5, Recommendation steps for advantageous combinations of traditional Chinese medicine and Western medicine: Based on the optimized heterogeneous graph attention network model, output the embedding vectors of traditional Chinese medicine and Western medicine nodes, construct the cross-modal similarity matrix of traditional Chinese medicine and Western medicine, and filter and output advantageous combination schemes according to similarity.

[0099] Example 2

[0100] As another preferred embodiment of the present invention, this embodiment is a further detailed supplement and explanation of the technical solution of the present invention based on the above embodiment 1. This embodiment is a detailed supplement and description of the specific implementation scheme of step S2, as shown in the appendix to the specification. Figure 2As shown, step S2, which involves constructing an isomer graph of combined traditional Chinese and Western medicine based on association rules, specifically includes:

[0101] S21. Use the Fp-growth algorithm to mine the association rules in the prescription-efficacy classification dataset (or the "prescription-efficacy transaction dataset of combined Chinese and Western medicine"). The association rules include four types of drug-drug association rules: Chinese medicine → Chinese medicine, Chinese medicine → Western medicine, Western medicine → Chinese medicine and Western medicine → Western medicine. There are also two types of drug-efficacy association rules: drug → significantly effective and drug → limited efficacy. Calculate the support and lift of each type of association rule and the frequency of each drug.

[0102] S22. Filter out drug combinations with a lift greater than 1 and a support greater than a set threshold for drug-drug association rules, and calculate the effectiveness of their combined use in prescriptions based on the selected drug combinations.

[0103] S23. Construct a heterogeneous graph of combined Chinese and Western medicine based on the selected drug combinations. The node types of the heterogeneous graph include Chinese medicine nodes and Western medicine nodes. The node features are three-dimensional vectors standardized by Z-score. The three-dimensional vectors include drug frequency, drug-significantly effective support, and drug-limited efficacy support. The edge types of the heterogeneous graph include four types of heterogeneous edges: Chinese medicine-Chinese medicine edge, Chinese medicine-Western medicine edge, Western medicine-Chinese medicine edge, and Western medicine-Western medicine edge. The edge features are two-dimensional vectors standardized by Z-score. The two-dimensional vectors include drug-drug support and drug combination efficacy. At the same time, efficacy weights are constructed as edge weights.

[0104] As one implementation method of this embodiment, the formula for calculating the support degree of the four types of drug-drug association rules is as follows:

[0105] ;

[0106] The formula for calculating the lifting degree of the four categories of drugs-drug association rules is as follows:

[0107] ;

[0108] In the formula, This represents the probability that drug A and drug B appear simultaneously in all prescriptions; This indicates the strength of the association between drug A and drug B. This indicates that drug A and drug B are positively correlated; This represents the probability of drug A appearing in all prescriptions; This represents the probability of drug B appearing in all prescriptions;

[0109] The formulas for calculating the support and improvement of drug efficacy are as follows:

[0110] ;

[0111] ;

[0112] This represents the probability that all prescriptions using drug A are significantly effective. This indicates the probability that the treatment is significantly effective among all prescriptions.

[0113] The formula for calculating the support and improvement of a drug's limited efficacy is as follows:

[0114] ;

[0115] ;

[0116] This represents the probability that drug A is used in all prescriptions and has limited efficacy. This indicates the probability that a prescription has limited efficacy among all prescriptions.

[0117] Example 3

[0118] As another preferred embodiment of the present invention, this embodiment is a further detailed supplement and explanation of the technical solution of the present invention based on the above embodiment 1 or embodiment 2. This embodiment is a detailed supplement and description of the specific implementation scheme of step S3, as shown in the appendix to the specification. Figure 3 and attached Figure 4 As shown, the S3 step of constructing a heterogeneous graph attention network model specifically includes:

[0119] S31, Node Feature Vectorization Step: The 3D vector features of each node are vectorized using a randomly initialized shared weight matrix. Perform a linear transformation to project the 3D vector features of each node onto... In the feature space, we obtain the node feature set. ,in, For dimension is The matrix, For dimension is where n is the total number of nodes;

[0120] S32. Steps for calculating attention coefficients with a masked matrix, resulting in normalized attention coefficients. ,

[0121] In the formula, Let i represent the eigenvector after the linear transformation of node i. This represents a vector concatenation operation. This represents a learnable attention parameter vector, optimized through backpropagation and gradient descent. Let T be the activation function, and let T denote the transpose.

[0122] Construct an adjacency matrix and convert it into a mask matrix. In the mask matrix, assign a value of 0 to positions containing edges and a value of 0 to positions without edges. ;

[0123] The mask matrix is ​​combined with the unnormalized attention coefficient matrix, and then processed using the softmax function:

[0124] In the formula, Let k represent the set of neighbors of node i, including node i itself; k represents the k-th neighbor node. This represents the attention weight of node j towards node i;

[0125] S33, Node Embedding Output Step: By fusing node features with attention weights, a new feature representation of the node is generated. Specifically...

[0126] For node i, aggregate its neighboring nodes. The feature weighted sum is then passed through a nonlinear activation function. The output features of node i are obtained after transformation. In the formula, Let be the input feature vector of neighbor node j.

[0127] As one implementation method of this embodiment, the node features of the heterogeneous graph are vectorized, specifically, the numerical features of node i are represented as a matrix. Through a randomly initialized shared weight matrix Perform a linear transformation and project its 3D features onto... 3D feature space, to obtain ;

[0128] When there are n nodes, the node feature set is represented as a matrix. ,

[0129] ;

[0130] Through a randomly generated shared weight matrix After performing a linear transformation, we obtain the vectorized set of node features. , .

[0131] Example 4

[0132] As another preferred embodiment of the present invention, this embodiment is a further detailed supplement and explanation of the technical solution of the present invention based on the above-described embodiments 1, 2, or 3. This embodiment is a detailed supplement and description of the specific implementation scheme of step S4. In this embodiment, the unsupervised training step of fusing therapeutic efficacy weights in step S4 specifically includes:

[0133] S41, Node embedding vector similarity calculation steps: Based on the node embedding vectors output by the heterogeneous graph attention network model constructed in S3, calculate the cosine similarity between node embedding vectors.

[0134] S42, Positive Sample Processing Step: Take the drug combinations with edges in the heterogeneous graph as positive samples, and use the efficacy weights constructed in step S2 to weight the cosine similarity of the positive samples to calculate the weighted cosine similarity of the positive samples. ;

[0135] S43. Negative sample processing steps: Randomly generate sample pairs. During the generation process, check whether the sample pair already exists in the positive samples. If it does not exist, add it to the list of negative samples to ensure that the negative samples do not contain real edges and that the number of negative samples is the same as the number of positive samples. Calculate the average cosine similarity of negative samples.

[0136] S44. Construct the loss function Loss. The loss function is constructed using the difference between the mean cosine similarity of negative samples and the weighted cosine similarity of positive samples. The loss function is minimized through unsupervised contrastive learning to complete the training of the heterogeneous graph attention network model.

[0137] More preferably, the cosine similarity calculation formula is:

[0138] ;

[0139] In the formula, Represents the vector dot product. Let f denote the Euclidean norm of vector M, and let f denote the dimension of the vector. , Let M and N represent the values ​​of vector M and N in the t-th dimension, respectively; the cosine similarity result ranges from [-1, 1], and the larger the value, the more similar the directions of the two vectors are.

[0140] Example 5

[0141] As another preferred embodiment of the present invention, this embodiment is a further detailed supplement and explanation of the technical solution of the present invention based on the above-described embodiments 1, 2, 3, or 4. This embodiment is a detailed supplement and description of the specific implementation scheme of step S5. In this embodiment, please refer to the appendix to the specification. Figure 5As shown, the recommended steps for the S5 combination therapy of traditional Chinese and Western medicine include:

[0142] S51, Embedding Vector Generation Step: Input the original feature matrices and topological relationships of the traditional Chinese medicine nodes and Western medicine nodes into the optimized heterogeneous graph attention network model, and output the deep embedding vector E of all nodes. n is the total number of nodes, and D is the embedding dimension;

[0143] S52. Cross-modal similarity calculation steps: Extract the subset of deep embedding vectors of traditional Chinese medicine from the deep embedding vector E. Deep embedding vector subsets of Western medicine The similarity between traditional Chinese medicine nodes and Western medicine nodes is calculated based on cosine similarity. This represents the set of all Chinese medicine nodes. Represent the set of all Western medicine nodes, and construct the cross-modal similarity matrix between traditional Chinese medicine and Western medicine. , ,in, Represents a subset of deep embedding vectors for traditional Chinese medicine. The embedding vector of the i-th node in the array. Represents a subset of deep embedding vectors for Western medicine The embedding vector of the j-th node; the value range is [-1, 1], and the larger the value, the higher the combination potential;

[0144] S53. Recommendations for combined use of traditional Chinese medicine and Western medicine: Sort the cross-modal similarity matrix of traditional Chinese medicine and Western medicine in descending order of similarity value to generate candidate combination sequences. , Using an empirical threshold, the final output includes the name of the traditional Chinese medicine, the name of the Western medicine, the node embedding similarity score, and the recommended sequence number, representing the advantages of using traditional Chinese and Western medicine in combination.

[0145] Example 6

[0146] As another preferred embodiment of the present invention, this embodiment is a further detailed supplement and explanation of the technical solution of the present invention based on the above-described embodiments 1, 2, 3, 4, or 5. This embodiment is a detailed supplement and description of the specific implementation scheme of step S1. In this embodiment, please refer to the appendix to the specification. Figure 6 As shown, step S1, which involves constructing a prescription-treatment classification dataset, specifically includes:

[0147] S11. Medical electronic medical record preprocessing step: Natural language processing technology is used to convert medication information and efficacy outcome indicators in unstructured medical electronic medical records into structured data, generating standardized drug prescription forms and efficacy outcome indicator forms.

[0148] S12. Drug Name Standardization Steps: Based on a standardized drug dictionary, standardize the drug names in the drug prescription form and remove duplicate drugs from the same prescription; specifically:

[0149] — Obtain the original values ​​of the generic name, brand name, and aliases of the medication from the medication prescription form;

[0150] —A standardized drug name database is established based on the National Drug Procurement Catalog and the Chinese Herbal Medicine Catalog. Machine learning methods are used for name matching. If there is a complete match, it is directly mapped to the standard name. If there is no complete match, special symbols (such as *, #, !, etc.) are removed and a second matching is performed. If there are still unmatched items after the second matching, the unmatched items are manually checked.

[0151] — Construct a medication prescription dataset, perform name mapping based on a standardized drug dictionary, and remove duplicate drugs from the same prescription;

[0152] S13. Standardization steps for efficacy outcome indicators: After screening key indicators, standardizing units of measurement, handling missing values, and standardizing time variables, the efficacy of the prescription is classified as significantly effective or with limited efficacy based on the changes in indicators before and after medication. Specifically...

[0153] — Extract therapeutic effect indicators and screen key indicators that can reflect the effectiveness of drug treatment (such as sex hormone levels, imaging features, disease severity, symptom scores, etc.).

[0154] — Data standardization processing, including standardizing units of measurement (e.g., hormone unit standardization), handling missing values ​​(imputation or deletion), and standardizing time variables;

[0155] —Construct therapeutic effect indicators, match medication prescriptions with corresponding time points, and classify prescription efficacy as "significantly effective" or "limited efficacy" based on the magnitude of indicator changes before and after medication, ultimately obtaining a structured medication prescription-efficacy classification dataset containing standardized drug names and efficacy classifications.

[0156] Example 7

[0157] As another preferred embodiment of the present invention, please refer to the appendix to the specification. Figure 7 As shown in the figure, this embodiment discloses a recommendation system for the superior combination of traditional Chinese and Western medicine based on unsupervised heterogeneous graph neural network. The system includes a prescription-efficacy classification dataset construction module, a heterogeneous graph construction module for the combination of traditional Chinese and Western medicine, a heterogeneous graph attention network model construction module, an unsupervised training module that integrates efficacy weights, and a recommendation module for the superior combination of traditional Chinese and Western medicine. The working principle of each module is as follows.

[0158] The medication prescription-efficacy classification dataset construction module is used to preprocess medication information and efficacy outcome indicators in electronic medical records to obtain a structured medication prescription-efficacy classification dataset containing standardized drug names and efficacy classifications.

[0159] Specifically, the medication prescription-efficacy classification dataset construction module uses natural language processing technology to convert medication information and efficacy outcome indicators from unstructured electronic medical records into structured data, generating standardized medication order tables and efficacy outcome indicator tables. It extracts the original values ​​of generic names, brand names, and aliases of drugs from the medication order tables; establishes a standardized drug name database based on the National Drug Procurement Catalog and the Traditional Chinese Medicine Catalog, and uses machine learning methods for name matching; if a complete match is found, it is directly mapped to the standard name; if not a complete match is found, special symbols (such as *, #, !, etc.) are removed before a second matching; if unmatched items still exist after the second matching, they are manually verified; and a medication prescription classification dataset is constructed. The dataset is structured based on a standardized drug dictionary for name mapping, removing duplicate drugs from the same prescription; extracting therapeutic effect indicators, and screening key indicators that reflect the therapeutic effect of drugs (such as sex hormone levels, imaging features, disease severity, symptom scores, etc.); standardizing the data, unifying the units of measurement (such as standardizing hormone units), handling missing values ​​(imputation or deletion), and standardizing time variables; constructing therapeutic effect indicators, matching drug prescriptions with corresponding time points for examination indicators, and classifying prescription efficacy as "significantly effective" or "limitedly effective" based on the magnitude of indicator changes before and after medication, ultimately resulting in a structured drug prescription-efficacy classification dataset containing standardized drug names and efficacy classifications.

[0160] The module for constructing heterogeneous graphs of combined Chinese and Western medicine is used to mine drug-drug association rules (four categories of drug-drug association rules: Chinese medicine → Chinese medicine, Chinese medicine → Western medicine, Western medicine → Chinese medicine, and Western medicine → Western medicine) and drug-efficacy association rules (two categories of drug-efficacy association rules: drug → significantly effective and drug → limited efficacy) in the prescription-efficacy classification dataset using the Fp-growth algorithm.

[0161] Calculate the support and lift of each association rule, and the frequency of each drug;

[0162] The formula for calculating the support of the four categories of drugs-drug association rules is as follows:

[0163] ;

[0164] The formula for calculating the lifting degree of the four categories of drugs-drug association rules is as follows:

[0165] ;

[0166] In the formula, This represents the probability that drug A and drug B appear simultaneously in all prescriptions; This indicates the strength of the association between drug A and drug B. This indicates that drug A and drug B are positively correlated; This represents the probability of drug A appearing in all prescriptions; This represents the probability of drug B appearing in all prescriptions;

[0167] The formulas for calculating the support and improvement of drug efficacy are as follows:

[0168] ;

[0169] ;

[0170] This represents the probability that all prescriptions using drug A are significantly effective. This indicates the probability that the treatment is significantly effective among all prescriptions.

[0171] The formula for calculating the support and improvement of a drug's limited efficacy is as follows:

[0172] ;

[0173] ;

[0174] This represents the probability that drug A is used in all prescriptions and has limited efficacy. This indicates the probability that a prescription has limited efficacy among all prescriptions.

[0175] Drug combinations with a lift greater than 1 and a support greater than a set threshold are filtered out (drug combinations that appear randomly or have low frequency are filtered out, and the filtered node pairs are used as the basic elements and feature variables of the heterogeneous network graph). The effectiveness of using the selected drug combinations in prescriptions is calculated. .

[0176] Constructing a heterogeneous graph:

[0177] —Node settings: type is Traditional Chinese Medicine node, Western Medicine node; node features are Z-score normalized three-dimensional vectors, including drug frequency, drug → significant efficacy support, and drug → limited efficacy support; Z-score normalization is as follows: This is converted into a distribution with a mean of 0 and a standard deviation of 1, eliminating the influence of units and numerical range. These are the standardized numerical features. , Let x represent the mean and standard deviation of the original numerical feature x, respectively.

[0178] —The edge settings are as follows: Chinese medicine → Chinese medicine edge, Chinese medicine → Western medicine edge, Western medicine → Chinese medicine edge, and Western medicine → Western medicine edge. The edge features are two-dimensional vectors standardized by Z-score. The two-dimensional vectors include drug-drug support and drug combination efficiency.

[0179] —Constructing efficacy weights: The selection of advantageous drug combination regimens needs to consider drug usage frequency and combination efficacy. The weighted sum of the standardized drug combination support and efficacy is used as the efficacy weight to enhance the model's learning ability for advantageous combination combinations during training. The efficacy weight is used as the edge weight, as shown in the following formula:

[0180] ;in and The value of the optimal treatment should be determined based on clinical experience. The selection of the optimal treatment should consider both the frequency of drug combination and clinical efficacy, in order to avoid the one-sided approach of "high frequency and low efficiency" or "high efficiency and low frequency" and ensure that the selected treatment is both practical and effective.

[0181] The heterogeneous graph attention network model building module is used to fuse the feature vectors of neighboring nodes using the graph attention mechanism, update the node representation, and output a new feature vector containing neighborhood information. Specifically,

[0182] — Node feature vectorization: the numerical features of node i are represented as a matrix. Through a randomly initialized shared weight matrix Perform a linear transformation and project its 3D features onto... 3D feature space, to obtain ;

[0183] When there are n nodes, the node feature set is represented as a matrix. ,

[0184] ;

[0185] Through a randomly generated shared weight matrix After performing a linear transformation, we obtain the vectorized set of node features. , ;

[0186] — Calculation of attention coefficients with masked matrix, resulting in normalized attention coefficients. ,

[0187] In the formula, Let i represent the eigenvector after the linear transformation of node i. This represents a vector concatenation operation. This represents a learnable attention parameter vector, optimized through backpropagation and gradient descent. Let T be the activation function, and T denote the transpose; negative value information is preserved by introducing nonlinearity.

[0188] —Constructing a mask matrix: Since the nodes in the heterogeneous graph are not fully connected, it is necessary to retain the attention coefficients corresponding to the existing edges. The attention masking operation is implemented by constructing an adjacency matrix, and initialization is performed. Matrix of size ( N (representing the number of nodes), if any node and nodes If there is an edge between them, then the matrix of the first degree is... row and number An adjacency matrix is ​​created by setting each column to 1 and the rest to 0. To create a mask matrix, construct an adjacency matrix and convert it into a mask matrix. In the mask matrix, positions containing edges are assigned a value of 0, and positions without edges are assigned a value of 0. ;

[0189] —Attention coefficient normalization: Combine the mask matrix with the unnormalized attention coefficient matrix and process it using the softmax function.

[0190] In the formula, Let k represent the set of neighbors of node i, including node i itself; k represents the k-th neighbor node. This represents the attention weight of node j towards node i;

[0191] The node embedding output, by fusing node features with attention weights, generates a new feature representation for the node. Specifically,

[0192] For node i, aggregate its neighboring nodes. The feature weighted sum is then passed through a nonlinear activation function. The output characteristics of node i are obtained after transformation (such as ReLU, LeakyReLU function). In the formula, Let be the input feature vector of neighbor node j.

[0193] The unsupervised training module, which integrates efficacy weights, calculates the cosine similarity between node embedding vectors based on the node embedding vectors output by the constructed heterogeneous graph attention network model. The calculation formula is as follows:

[0194] In the formula, Represents the vector dot product. Let f denote the Euclidean norm of vector M, and let f denote the dimension of the vector. , Let M and N represent the values ​​of vector M and N in the t-th dimension, respectively; the cosine similarity result ranges from [-1, 1], and the larger the value, the more similar the directions of the two vectors are;

[0195] Drug combinations with edges in the heterogeneous graph are taken as positive samples. The cosine similarity of the positive samples is weighted by the efficacy weights constructed in step S2, and the weighted cosine similarity of the positive samples is calculated. ;

[0196] Randomly generate sample pairs. During the generation process, check whether the sample pair already exists in the positive samples. If it does not exist, add it to the list of negative samples. Ensure that the negative samples do not contain real edges and that the number of negative samples is the same as the number of positive samples. Calculate the average cosine similarity of the negative samples.

[0197] Through unsupervised contrastive learning training, the generated node (drug) embeddings maximize the embedding similarity of pairs with actual edges in the graph (positive sample pairs) while minimizing the embedding similarity of pairs with non-existent edges (negative sample pairs). A loss function is constructed using the difference between the average similarity of negative samples and the weighted similarity of positive samples, and this loss function is gradually minimized until it stabilizes. The core idea of ​​this loss function is to maximize the difference between the embedding similarities of positive and negative sample pairs, i.e., to construct the loss function using the difference between the average cosine similarity of negative samples and the weighted cosine similarity of positive samples, and then minimize this loss function through unsupervised contrastive learning. Complete the training of the heterogeneous graph attention network model;

[0198] loss function The heterogeneous graph attention network model is optimized through unsupervised contrastive learning.

[0199] The module recommending advantageous combinations of traditional Chinese medicine and Western medicine is based on an unsupervised heterogeneous graph neural network model. It performs forward propagation on a dataset of combined medication prescriptions and efficacy indicators to recommend the most advantageous combinations. The specific process is as follows:

[0200] Embedded vector generation:

[0201] a. Input: The original feature matrix and topological relationship of the Chinese medicine node and the Western medicine node.

[0202] b. Processing: The node representation is iteratively updated through a multi-layer graph attention mechanism, and the efficacy weights generated by association rule mining (constructed from the frequency of drug combination and the effectiveness rate) are integrated to dynamically modulate the attention coefficient;

[0203] c. Output: Depth embedding vectors of all nodes (Traditional Chinese Medicine, Western Medicine) (N is the total number of nodes, and D is the embedding dimension).

[0204] Cross-modal similarity calculation: Extracting a subset of deep embedding vectors of traditional Chinese medicine from deep embedding vector E Deep embedding vector subsets of Western medicine The similarity between traditional Chinese medicine nodes and Western medicine nodes is calculated based on cosine similarity. This represents the set of all Chinese medicine nodes. Represent the set of all Western medicine nodes, and construct the cross-modal similarity matrix between traditional Chinese medicine and Western medicine. , ,in, Represents a subset of deep embedding vectors for traditional Chinese medicine. The embedding vector of the i-th node in the array. Represents a subset of deep embedding vectors for Western medicine The embedding vector of the j-th node; the value range is [-1, 1], and the larger the value, the higher the combination potential;

[0205] Recommendations for combined Chinese and Western medicine regimens are generated by sorting the cross-modal similarity matrix of Chinese and Western medicines in descending order of similarity value to produce candidate combination sequences. , Using an empirical threshold, the final output includes the name of the traditional Chinese medicine, the name of the Western medicine, the node embedding similarity score, and the recommended sequence number, representing the advantages of using traditional Chinese and Western medicine in combination.

Claims

1. A method for recommending a combination of traditional Chinese medicine and Western medicine based on an unsupervised heterogeneous graph neural network, characterized in that: The method comprises the following steps: S1, constructing a drug prescription-therapeutic classification dataset step, preprocessing the drug information and therapeutic outcome indicators in the medical electronic medical record to obtain a structured drug prescription-therapeutic classification dataset containing standardized drug names and therapeutic classifications; S2, constructing a traditional Chinese medicine and western medicine combination heterogeneous graph based on association rules step, using the Fp-growth algorithm to mine drug-drug association rules and drug-therapeutic association rules in the drug prescription-therapeutic classification dataset, the drug-drug association rules including four types of drug-drug association rules: traditional Chinese medicine→traditional Chinese medicine, traditional Chinese medicine→western medicine, western medicine→traditional Chinese medicine and western medicine→western medicine, the drug-therapeutic association rules including two types of drug-therapeutic association rules: drug→significant effectiveness and drug→limited therapeutic effect; The support and lift of each association rule, the frequency of each drug, the effective rate of drug combination and the therapeutic weight are calculated; a heterogeneous graph containing traditional Chinese medicine nodes, western medicine nodes and four types of heterogeneous edges is constructed; wherein the effective rate of drug combination is calculated by the formula: ; the efficacy weight is taken as the edge weight, and the calculation formula is: ; wherein and are determined based on clinical practice experience; the node features are Z-score standardized three-dimensional vectors including drug frequency, drug → significant effective support, and drug → limited efficacy support; the edge features are Z-score standardized two-dimensional vectors including drug-drug support and drug combination efficiency; S3, constructing a heterogeneous graph attention network model step, vectorizing the node features of the heterogeneous graph, calculating the attention weight between nodes through the attention mechanism with a mask matrix, and outputting the node embedding vector fused with neighborhood information; S4, an unsupervised training step of fusing therapeutic weights, calculating the average cosine similarity of negative samples, and constructing a loss function optimizing the heterogeneous graph attention network model through unsupervised contrastive learning; S5, a traditional Chinese medicine and western medicine combination advantage scheme recommendation step, based on the optimized heterogeneous graph attention network model, outputting the traditional Chinese medicine and western medicine node embedding vectors, constructing a traditional Chinese medicine-western medicine cross-modal similarity matrix, and filtering and outputting the advantage combination scheme according to the similarity.

2. The method of claim 1, wherein the method is based on an unsupervised heterogeneous graph neural network. The S2 step of constructing a traditional Chinese medicine and western medicine combination heterogeneous graph based on association rules specifically comprises: S21, using the Fp-growth algorithm to mine the association rules in the drug prescription-therapeutic classification dataset, and calculating the support and lift of each type of association rule and the frequency of each drug; S22, filtering and screening out drug-drug association rules with a lift greater than 1 and a support greater than a set threshold, and calculating the effective rate of combination in the prescription based on the screened drug combinations; S23, constructing a traditional Chinese medicine and western medicine combination heterogeneous graph based on the screened drug combinations, the node types of the heterogeneous graph including traditional Chinese medicine nodes and western medicine nodes, the node features being three-dimensional vectors standardized by Z-score, the three-dimensional vectors including drug frequency, drug→significant effectiveness support and drug→limited therapeutic effect support; the edge types of the heterogeneous graph including four types of heterogeneous edges: traditional Chinese medicine→traditional Chinese medicine edge, traditional Chinese medicine→western medicine edge, western medicine→traditional Chinese medicine edge and western medicine→western medicine edge, the edge features being two-dimensional vectors standardized by Z-score, the two-dimensional vectors including drug-drug support and drug combination effective rate; and constructing a therapeutic weight as an edge weight.

3. The method of claim 2, wherein the method is based on an unsupervised heterogeneous graph neural network. The calculation formula of the support of the four types of drug-drug association rules is: ; The calculation formula of the lift of the four types of drug-drug association rules is: ; wherein, represents the probability of the co-occurrence of drug A and drug B in all prescriptions; represents the association strength of drug A and drug B, represents that drug A is positively correlated with drug B; represents the probability of the occurrence of drug A in all prescriptions; represents the probability of the occurrence of drug B in all prescriptions; The calculation formula of the drug→significant effectiveness support and lift is: ; ; P(A | E) represents the probability that drug A was used in all prescriptions where the efficacy was significantly effective; P(E) represents the probability that the efficacy was significantly effective in all prescriptions; The calculation formula of the drug→limited therapeutic effect support and lift is: ; ; represents the probability of using drug A and limited efficacy in all prescriptions; represents the probability of limited efficacy in all prescriptions.

4. The method of claim 1-3, wherein the method is based on an unsupervised heterogeneous graph neural network. The S3 step of constructing a heterogeneous graph attention network model specifically comprises: S31, node feature vectorization step, projecting the three-dimensional vector features of each node to a feature space of dimensionality through a linear transformation using a randomly initialized shared weight matrix wherein n is the total number of nodes.​​​​​ S32, attention coefficient calculation step with mask matrix, calculation for normalized attention coefficient , where, denotes the linearly transformed feature vector of node i, denotes the vector concatenation operation, denotes the learnable attention parameter vector, which is optimized through backpropagation and gradient descent, is an activation function, and T denotes the transpose; The adjacency matrix is constructed and converted into a mask matrix, where the position with an edge is assigned a value of 0, and the position without an edge is assigned a value of ; The mask matrix is combined with the non-normalized attention coefficient matrix, and a softmax function is applied for processing: ; where, denotes the neighbor set of node i, including node i itself; k denotes the kth neighbor node of node i, denotes the attention weight of node j to node i; S33, a node embedding output step, by fusing the node features and the attention weights, a new feature representation of the node is generated, specifically, For node i, aggregate the feature-weighted sum of its neighbor nodes and pass through a nonlinear activation function to get the output feature of node i ; where is the input feature vector of neighbor node j.

5. The method of claim 4, wherein the method is based on an unsupervised heterogeneous graph neural network. Vectorizing the node features of the heterogeneous graph, specifically, the numerical features of node i are represented as a matrix , and a linear transformation is performed on the three-dimensional features of the node through a randomly initialized shared weight matrix to project them into a -dimensional feature space, obtaining ; When there are n nodes, the set of node features is represented as a matrix , ; By a randomly generated shared weight matrix After linear transformation, a vectorized node feature set is obtained ​​ 6. The method of claim 1-3, wherein the method is based on an unsupervised heterogeneous graph neural network. The S4 step of unsupervised training with fusion of efficacy weight specifically comprises: S41, a node embedding vector similarity calculation step, based on the node embedding vectors output by the S3 constructed heterogeneous graph attention network model, the cosine similarity between the node embedding vectors is calculated; S42, a positive sample processing step, the drug combinations with existing edges in the heterogeneous graph are taken as positive samples, and the cosine similarity of the positive samples is weighted by the efficacy weight constructed in the S2 step to calculate the weighted cosine similarity of the positive samples; ; S43, a negative sample processing step, a sample pair is randomly generated, and whether the sample pair exists in the positive samples is checked during the generation process. If it does not exist, it is added to the list of negative samples to ensure that the negative samples do not contain real edges, and the number of negative samples is the same as that of positive samples. The average cosine similarity of the negative samples is calculated; S44, a loss function Loss is constructed, the difference between the average cosine similarity of the negative samples and the weighted cosine similarity of the positive samples is used to construct the loss function, and the loss function is minimized through unsupervised contrast learning to complete the training of the heterogeneous graph attention network model.

7. The method of claim 6, wherein the method is based on an unsupervised heterogeneous graph neural network. The cosine similarity calculation formula is: ; wherein, denotes the vector dot product, denotes the Euclidean norm of vector M, f denotes the vector dimension, , denote the value of vector M and vector N in the t-th dimension, respectively; the cosine similarity result ranges from [-1, 1], the greater the value, the more similar the direction of the two vectors.

8. The method of claim 1-3, wherein the method is based on an unsupervised heterogeneous graph neural network. The S5 step of recommending a Chinese and Western medicine combination advantage scheme specifically comprises: S51, an embedding vector generation step, inputting the original feature matrix and topological relationship of the traditional Chinese medicine node and the western medicine node into an optimized heterogeneous graph attention network model, and outputting the deep embedding vector E of all nodes, n is the total number of nodes, and D is the embedding dimension. S52, a cross-modal similarity calculation step, extracting a traditional Chinese medicine depth embedding vector subset from the depth embedding vector E and a western medicine depth embedding vector subset Based on the cosine similarity, the similarity between the traditional Chinese medicine node and the western medicine node is calculated, wherein, denotes the set of all traditional Chinese medicine nodes, denotes the set of all western medicine nodes, and a traditional Chinese medicine-western medicine cross-modal similarity matrix is constructed , wherein, denotes a subset of traditional Chinese medicine depth embedding vectors embedding vector of the i-th node in the traditional Chinese medicine, denotes a subset of western medicine depth embedding vectors embedding vector of the j-th node in the western medicine; the value domain is [-1, 1], and the larger the value is, the higher the combination potential is; S53, sort the traditional Chinese medicine-western medicine cross-modal similarity matrix in descending order of similarity value to generate a candidate combination sequence , is an empirical threshold value, and the final output includes the traditional Chinese medicine name, western medicine name, node embedding similarity score, and recommended sequence number of the traditional Chinese medicine-western medicine combination advantage scheme.

9. The method of claim 1-3, wherein the method is based on an unsupervised heterogeneous graph neural network. The S1 step of constructing a drug prescription-efficacy classification dataset specifically comprises: S11, a medical electronic medical record preprocessing step, natural language processing technology is used to convert the drug information and efficacy outcome indicators in the unstructured medical electronic medical record into structured data, generating a standardized drug medical order table and an efficacy outcome indicator table; S12, a drug name standardization step, based on a drug standardization dictionary, the drug names in the drug medical order table are standardized and the duplicate drugs in the same prescription are removed; S13, a standardization processing step of efficacy outcome indicators, after key indicator screening, unit unification, missing value processing and time variable standardization of the efficacy outcome indicators, the prescription efficacy is classified as significantly effective or limited efficacy according to the amplitude of the indicators before and after drug use; a structured drug prescription-efficacy classification dataset containing standardized drug names and efficacy classifications is obtained.

10. The system for recommending a combination of traditional Chinese medicine and Western medicine advantage program based on an unsupervised heterogeneous graph neural network according to any one of claims 1-9, characterized in that: The system comprises a drug prescription-efficacy classification dataset construction module, a Chinese and Western medicine combination heterogeneous graph construction module, a heterogeneous graph attention network model construction module, an unsupervised training module with fusion of efficacy weight, and a Chinese and Western medicine combination advantage scheme recommendation module, which are sequentially and communicatively connected to cooperatively recommend a Chinese and Western medicine combination advantage scheme; wherein: The drug prescription-efficacy classification dataset construction module is used to preprocess the drug information and efficacy outcome indicators in the medical electronic medical record to obtain a structured drug prescription-efficacy classification dataset containing standardized drug names and efficacy classifications; The Chinese and Western medicine combined isomer graph construction module is configured to mine drug-drug association rules and drug-therapeutic effect association rules in the medication prescription-therapeutic effect classification data set by using an Fp-growth algorithm, the drug-drug association rules include four types of drug-drug association rules, i.e., Chinese medicine→Chinese medicine, Chinese medicine→Western medicine, Western medicine→Chinese medicine and Western medicine→Western medicine, and the drug-therapeutic effect association rules include two types of drug-therapeutic effect association rules, i.e., drug→significant effectiveness and drug→limited therapeutic effect; the support and lift of each association rule, the frequency of each drug, the drug combination effectiveness and the therapeutic effect weight are calculated; an isomer graph including Chinese medicine nodes, Western medicine nodes and four types of isomer edges is constructed; the drug combination effectiveness calculation formula is: ; the efficacy weight is taken as an edge weight, and a calculation formula thereof is: ; wherein and values are determined based on clinical practice experience; the node feature is a three-dimensional vector standardized by Z-score, and the three-dimensional vector includes drug frequency, drug→significant effective support, and drug→limited efficacy support; the edge feature is a two-dimensional vector standardized by Z-score, and the two-dimensional vector includes drug-drug support and drug combination efficiency. The isomer graph attention network model construction module is configured to perform vectorization processing on the node features of the isomer graph, calculate the attention weights between nodes by using an attention mechanism with a mask matrix, and output node embedding vectors that fuse neighborhood information; The unsupervised training module fusing the therapeutic effect weight is configured to calculate the average cosine similarity of negative samples by using the therapeutic effect weight to weight the cosine similarity of positive samples, and construct a loss function optimizing the heterogeneous graph attention network model through unsupervised contrastive learning; The Chinese and Western medicine combined advantage scheme recommendation module is configured to output Chinese medicine and Western medicine node embedding vectors based on the optimized isomer graph attention network model, construct a Chinese medicine-Western medicine cross-modal similarity matrix, and output an advantage combination scheme by screening according to the similarity.

Citation Information

Patent Citations

  • Deep learning-based Chinese and western medicine combined medical scheme recommendation method and system

    CN119446399A