A traditional Chinese medicine formula recommendation method and system
By constructing a multi-layer heterogeneous graph network and introducing fractal theory and gated recurrent self-attention mechanism, the algorithm model is improved, which solves the problem that multiple relationships are not fully utilized in existing Chinese medicine recommendation methods, and realizes more efficient and accurate herbal medicine recommendation, which is suitable for Chinese medicine prescription recommendation systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUZHOU UNIVERSITY
- Filing Date
- 2023-10-26
- Publication Date
- 2026-07-03
AI Technical Summary
Existing methods for recommending traditional Chinese medicine (TCM) are too simplistic in their use of symptom-drug association information, failing to fully explore the multi-faceted relationships in the TCM prescription process. Furthermore, graph representation learning modeling fails to distinguish the relationships between different nodes, resulting in low prediction accuracy and efficiency.
A traditional Chinese medicine prescription recommendation method based on fractal nonlinear multi-feature fusion and gated cyclic self-attention mechanism is adopted. By constructing a multi-layer heterogeneous graph network, the weighted K-nearest neighbor algorithm, linear neighborhood similarity algorithm and Gaussian kernel similarity algorithm are improved. Combined with bipartite graph diffusion algorithm and gated cyclic self-attention mechanism, the association information between herbs and syndromes is enhanced.
It improves the accuracy and efficiency of herbal recommendations, enabling more precise selection of herbs based on symptoms, assisting doctors in developing clinical prescriptions, verifying the model's superiority through multiple evaluation indicators, and combining traditional Chinese medicine theory and network pharmacology for analysis.
Smart Images

Figure CN122337459A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traditional Chinese medicine, and more specifically, to a method and system for recommending traditional Chinese medicine prescriptions. Background Technology
[0002] In recent years, machine learning technology has been gradually applied to the field of traditional Chinese medicine (TCM), and related artificial intelligence technologies have become important means to improve diagnostic techniques and treatment outcomes, as well as a powerful driving force for alleviating medical strain. These technologies provide methods for the development of TCM towards informatization, technological advancement, and intelligentization. TCM prescriptions are products of the TCM diagnostic and treatment process, reflecting the principles of TCM diagnosis and treatment, and also possess high research value.
[0003] In the field of artificial intelligence, traditional Chinese medicine (TCM) prescriptions are core data for deep learning modeling. Computational methods for recombining TCM prescriptions can be mainly divided into three approaches: topic modeling, sequence generation modeling, and graph representation learning.
[0004] The three existing learning methods have the following shortcomings: 1. The topic model-based TCM recommendation method is insufficient because its application and modeling of the multiple relationships in the TCM prescription process are too simplistic. Specifically, the above studies do not fully utilize the association information between "symptoms" and "medicines," and relying solely on word co-occurrence is insufficient to fully express the complex relationships between medical entities. From a model perspective, the expressive power of topic models is significantly weaker than that of deep learning models. 2. The sequence generation model method is insufficient in its modeling of the various nonlinear high-order relationships between entities in the TCM domain. 3. In the process of graph representation learning modeling based on the association graph constructed from medical records, the relationships between different nodes are not distinguished, resulting in all edges having the same transmission parameters, which does not meet the actual needs of TCM compatibility. Summary of the Invention
[0005] To address the shortcomings of existing technologies, the present invention aims to provide a method and system for recommending traditional Chinese medicine prescriptions based on fractal nonlinear multi-feature fusion and gated cyclic self-attention mechanism. This method and system have the advantages of stable operation, excellent results, and fast operation, and solve the problems of low prediction accuracy and efficiency of current methods.
[0006] To achieve the above objectives, the present invention provides the following technical solution: a method for recommending traditional Chinese medicine prescriptions, comprising the following steps:
[0007] S1, based on multiple TCM databases, construct a multi-layer heterogeneous graph network of prescription documents consisting of prescription-syndrome-herb, including herb-herb, syndrome-syndrome, syndrome-herb, prescription-herb and prescription-syndrome relationship matrix space;
[0008] S2 utilizes fractal theory and methods to improve the weighted K-nearest neighbor algorithm and complete the herbal medicine-syndrome correlation matrix, thus achieving the completeness of the herbal medicine-syndrome correlation matrix;
[0009] S3 utilizes fractal theory and methods to improve the linear neighborhood similarity algorithm and establishes a quadratic optimization model to reconstruct the similarity matrix between herbs and between syndromes.
[0010] S4 utilizes fractal theory and methods to improve the Gaussian kernel similarity algorithm, and deeply mines the nonlinear correlation information between herbs and between syndromes;
[0011] S5, merge the herb-herb and syndrome-syndrome similarity matrices obtained from S3 and S4 respectively;
[0012] S6, improve the bipartite graph diffusion algorithm and input the result obtained in S5 into the improved bipartite graph diffusion algorithm;
[0013] S7 utilizes a gated recurrent self-attention mechanism to establish a loss function and enhance the herbal medicine-syndrome association information;
[0014] S8 utilizes the confidence scoring formulas for herbs and syndromes, along with the softmax function, to perform two element-level enhancements on the herb-syndrome association matrix, outputting the final herb-syndrome prediction score matrix.
[0015] In summary, this invention offers the following advantages: it suggests that doctors select herbal remedies based on symptoms and assists them in developing clinical prescriptions. It proposes a novel herbal recommendation model (NFFGRAM) consisting of six modules: FWKNKN, fractal linear neighborhood similarity, fractal-based Gaussian kernel similarity, modified bipartite graph diffusion, gated recursive self-attention mechanism, and binary-level enhancement.
[0016] (1) Introducing fractal dimension and using LNS similarity measure to calculate nonlinear features between herbs and symptoms; using fractal FGSK and multi-feature mining and fusion, and an improved bipartite graph diffusion algorithm to complete the matrix; can fully explore the potential correlation between herbs and syndromes.
[0017] (2) The introduction of a gated recurrent self-attention mechanism makes herbal recommendations more accurate. The loss function is constructed using matrix norm and sparsity, and the gating coefficient is set. Confidence scores for herbs and symptoms are introduced and softmax transformation is performed to enhance the herbal-symptom association at the element-level.
[0018] (3) Regarding evaluation metrics, we adopted a dual evaluation method, using both AUC and AUPR metrics from 10-fold cross-validation and precision@K, recall@K, and F1-score metrics for prescription recommendations. The two methods mutually validate each other; furthermore, we evaluated the superiority of the model from a mathematical perspective, namely by calculating the completion rate of different module matrices.
[0019] (4) Case analysis includes both dialectical analysis from the perspective of traditional Chinese medicine theory and analysis of the symptoms, targets, pathways, etc. of traditional Chinese medicine prescriptions through modern medicine and network pharmacology knowledge. Attached Figure Description
[0020] Figure 1 Flowchart of methods for recommending traditional Chinese medicine prescriptions;
[0021] Figure 2 Reconstruct the herb-herb similarity matrix using the FLNS algorithm;
[0022] Figure 3 Comparison of LNS algorithm results with three different distance measures on the TCM1 dataset;
[0023] Figure 4 Comparison of LNS algorithm results with three different distance measures on the TCM2 dataset;
[0024] Figure 5 A schematic diagram of PPI protein-protein interactions in the symptom set;
[0025] Figure 6 GO (biological processes) enrichment analysis bar chart;
[0026] Figure 7 KEGG pathway enrichment analysis;
[0027] Figure 8 KEGG cancer pathway map. Detailed Implementation
[0028] 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 embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0029] Reference Figures 1 to 8 As shown in Example 1: To achieve the above objective, the present invention provides the following technical solution: A method for recommending traditional Chinese medicine prescriptions, comprising the following steps:
[0030] S1, based on multiple TCM databases, construct a multi-layer heterogeneous graph network of prescription documents consisting of prescription-syndrome-herb, including herb-herb, syndrome-syndrome, syndrome-herb, prescription-herb and prescription-syndrome relationship matrix space;
[0031] S2 utilizes fractal theory and methods to improve the weighted K-nearest neighbor algorithm and complete the herbal medicine-syndrome correlation matrix, thus achieving the completeness of the herbal medicine-syndrome correlation matrix;
[0032] S3 utilizes fractal theory and methods to improve the linear neighborhood similarity algorithm and establishes a quadratic optimization model to reconstruct the similarity matrix between herbs and between syndromes.
[0033] S4 utilizes fractal theory and methods to improve the Gaussian kernel similarity algorithm, and deeply mines the nonlinear correlation information between herbs and between syndromes;
[0034] S5, merge the herb-herb and syndrome-syndrome similarity matrices obtained from S3 and S4 respectively;
[0035] S6, improve the bipartite graph diffusion algorithm and input the result obtained in S5 into the improved bipartite graph diffusion algorithm;
[0036] S7 utilizes a gated recurrent self-attention mechanism to establish a loss function and enhance the herbal medicine-syndrome association information;
[0037] S8 utilizes the confidence scoring formulas for herbs and syndromes, along with the softmax function, to perform two element-level enhancements on the herb-syndrome association matrix, outputting the final herb-syndrome prediction score matrix.
[0038] The construction of the prescription-syndrome-herbal multilayer heterogeneous graph network in step S1 specifically includes: S11, constructing a heterogeneous graph network composed of information such as Chinese herbal medicines, compounds, syndromes, and meridians from Chinese medicine medical records and traditional prescriptions, with reference to Chinese medicine databases SymMap, ETCM2.0, ETCM, HERB, and TCMSP.
[0039] S12, construct a complete molecular regulatory network, develop an optimized model to identify the molecular network modules affected by drugs and diseases, and use them as features to describe traditional Chinese medicine and diseases;
[0040] S13 utilizes the structural, pharmacological, and molecular characteristics of compounds contained in herbs, combined with drug compatibility mechanisms, to calculate the importance and interaction network of herbs (A h );
[0041] S14. Using the characteristic description of syndromes and genetic factors, calculate the importance and correlation of diseases and construct a syndrome association network (As).
[0042] S15, based on drug and disease information, obtain drug-syndrome correlation and construct an initial correlation network (Y), and then A... h A drug-disease heterogeneous graph network was constructed using As and Y.
[0043] The prescription document is constructed into a three-layer heterogeneous graph network consisting of prescription, syndrome and herbal medicine. It is then projected into five embedding subspaces, namely herbal medicine-herbal medicine, syndrome-syndrome, syndrome-herbal medicine, prescription-herbal medicine and prescription-syndrome association matrix space.
[0044] Step S2, the completion of the herbal-syndrome association matrix, involves a small proportion of known herbal-syndrome associations in the total matrix information; most of the associations are unknown, resulting in a sparse initial association matrix. To further describe the associations between herbs and syndromes, this paper uses an improved weighted K-nearest neighbor algorithm as data preprocessing to mine potential interactions. In this way, the interaction probability of each association pair is reweighted between 0 and 1.
[0045] Specifically, it includes:
[0046] S21. Based on known drug chemical similarity, disease semantic similarity and existing drug-disease association matrix, and based on fractal theory, we propose to improve the weighted K-nearest neighbor WKNKN algorithm to obtain the FWKNKN algorithm, and reconstruct the herbal medicine-syndrome association matrix.
[0047] S22, derived from the herbal association matrix A h For each herb *hi*, the similarity distance between herbs is calculated. Then, the nonlinear similarity between herbs is measured by the correlation dimension. The K herbs most similar to *hi* are found, and the correlation scores between these herbs and the syndrome are used to deduce the relationship between *hi* and *hi*. i The interaction likelihood distribution is calculated using the following formula:
[0048]
[0049] in These are weighting coefficients. It is the attenuation coefficient; It is a regularization term;
[0050] S23, Syndrome Correlation Matrix A s For each syndrome i Similar calculations are performed to obtain the likelihood distribution of the interaction:
[0051] ,
[0052] in These are weighting coefficients. It is the attenuation coefficient; It is a regularization term;
[0053] S24, using and The average value is used to complete the elements at the corresponding positions in the herbal medicine-syndrome correlation matrix, resulting in the updated herbal medicine-syndrome correlation matrix Y. m : ,in These are Boolean coefficients.
[0054] The specific steps in step S3, which involves mining the correlation information between herbs and between syndromes, include:
[0055] S31, Project the drug-disease association network onto the drug space H, and for any vector in H... ,in It is the number of herbs. dimensional column vector h i Reconstructed The matrix, and , If they are nearly equal, then all the matrices are constructed into tensors, and the fractal dimension is used to represent each layer of the tensor as a characteristic of the herb.
[0056] S32, calculate the fractal dimension distance between herbs to reflect the nonlinear correlation between them. The fractal dimension formula is as follows:
[0057]
[0058] Where r is the radius of the bounding box. For the set of covered points The number of boxes;
[0059] S33, according to the distance matrix, obtain the feature vector h of the i-th herb. i Given a set of K nearest neighbors of herbs, an optimization model is built within this set to reconstruct the feature vector h of herb i. i,
[0060] To reconstruct each feature vector Establish the following optimization model and solve it:
[0061]
[0062]
[0063] in express arrive The nearest neighbor, yes The j-th nearest neighbor; yes and The similarity between them represents the reconstruction contribution weight between them. and , and if ,but ,otherwise ;
[0064] S34. To avoid overlearning of the model, a Tikhonov regularization term is added to minimize the standard weights of the reconstruction.
[0065] ,
[0066] in For regularization parameters, It is the identity matrix, from which the weight matrix can be obtained. As the FLNS matrix between drugs, denoted as The same process is applied to the disease data, and a quadratic optimization problem is solved to obtain the weight matrix. As a matrix of FLNS between diseases, denoted as .
[0067] The step S4, which involves in-depth mining of nonlinear correlation information between herbs and between syndromes, specifically includes:
[0068] S41, using fractal theory, the Gaussian similarity kernel algorithm is improved to obtain the FGSK algorithm, and the herbal medicine-syndrome correlation matrix Y is then applied. m Perform calculations in Y m In the text, the i-th row represents the herb h. i The interaction probability with each syndrome, where the j-th column represents the syndrome s. j The probability of interaction with each herb, vector Q(h) i ) and Q(s j ) represent the eigenvectors of the i-th row vector and the j-th column vector, respectively, as eigenvectors of the Gaussian similarity kernel;
[0069] S42, the herb h i and h j The Gaussian kernel similarity matrix between them is represented as G h , will symptoms i and s j The Gaussian kernel similarity matrix between them is represented as G s The calculation formulas are as follows: Among them, kernel bandwidth , It is the fractal correlation dimension norm.
[0070] The multi-feature fusion of the herbal-herbal and syndrome-syndrome similarity matrices in step S5 specifically includes:
[0071] According to herbal medicine ( and G h ) and symptoms ( and G s The two similarity matrices are integrated based on the principle of complementarity to provide more comprehensive similarity information for NFFGRAM. The similarity information of the herbs and symptoms included are as follows:
[0072]
[0073] .
[0074] The transmission and diffusion of information related to the herbal medicine and syndrome in step S6 involves bipartite graphs, which have been successfully applied in recommendation systems. The graph-based two-step diffusion algorithm mainly consists of two parts: establishing a diffusion weighting matrix and establishing two-step diffusion rules. Taking a disease node as an example:
[0075] S61, each syndrome s j Similarity features A s Mapping to the correlation probability matrix Y m The initial feature diffusion probability matrix A of the disease is obtained from the above. v ;
[0076] S62, the comprehensive similarity matrix A of drugs h Mapping to the correlation probability matrix Y m The initial characteristic diffusion probability matrix A of the drug is obtained above. d;
[0077] S63, the two initial matrices connecting similarity information and probabilistic association information are used as the initial diffusion weighting matrices for nodes during graph diffusion, i.e., the initial diffusion weighting matrices are respectively ,in It is Y m Transpose of;
[0078] We propose to improve the bipartite graph diffusion algorithm to better address the cold start problem. The specific method is as follows:
[0079] S64, each syndrome node will be determined based on the correlation degree of its related herbs and two new matrices A. v and A d To assign weights, that is, the drug nodes will place them in A v and A d The degree of correlation recorded in the data propagates to their related diseases, as shown in the following formula:
[0080]
[0081] in,
[0082]
[0083]
[0084]
[0085]
[0086] in, Indicates symptom nodes The herb nodes connected through it are assigned A weight vector of dimension; and They represent A respectively v and A d The elements in the i-th row and j-th column of the matrix; express The j-th column vector; and These represent the syndrome-syndrome correlation matrices obtained from the diffusion of herbal medicine to syndrome and syndrome to syndrome, respectively. and These are respectively derived from the initial diffusion probability matrix and The resulting diffusion weights; It is used to balance A v and A d Damping factor between the contribution values;
[0087] Compared to the traditional bipartite graph diffusion algorithm, in formulas (8) and (10), we added a factor to the denominator. and The advantage of this is that it can partially avoid the denominator being 0 in the original method, which means it can avoid the cold start problem in the recommendation system.
[0088] S65, the SS matrix obtained from S64, shows the backpropagation of the correlation between disease nodes to associated drug nodes, using the following formula:
[0089]
[0090] in,
[0091]
[0092]
[0093]
[0094]
[0095] in, It is used to balance A v and A d Damping factor between the contribution values; and These represent the syndrome-herb correlation matrices obtained from the diffusion of herbs from herbs to herbs and syndromes to herbs, respectively. and These are respectively derived from the initial diffusion probability matrix and The resulting diffusion weights; It was constructed A weighted vector of dimensions, recording the herbs The probability of association for each symptom; when j=1,2,..., ,Right now The final prediction matrix of the syndrome-herbal association of dimensionality; for The final prediction matrix of the association between herbs and syndromes in viscera.
[0096] The overall enhancement of the herbal medicine-syndrome association information in step S7 specifically includes:
[0097] A loss function is established based on the drug-syndrome correlation and the sparsity and norm of the matrix:
[0098]
[0099] in, It is the sparsity of the matrix. It is a matrix The correlation matrix obtained by the self-attention mechanism in the t-th iteration It is the absolute value of the difference in sparsity of the matrix after two consecutive cycles of self-attention mechanism. Refers to matrix The Frobenius norm of the correlation matrix obtained by the t-th iteration of the self-attention mechanism, i.e. ;
[0100] Set a threshold When the loss is less than the threshold, the self-attention mechanism loop ends, and the association prediction matrix after the loop self-attention mechanism is applied is output. ;
[0101] The formula for the self-attention mechanism is as follows:
[0102]
[0103] Softmax(X) is a softMax transformation applied to each row vector of X; for the attention mechanism, where For a scaled dot product model, where Q is the query matrix (quary), K is the key, and V is the value, when At that time, it refers to the self-attention mechanism for predicting the association between herbal medicine and syndrome; divided by a feature dimension. In order to alleviate the gradient vanishing problem, this solution... .
[0104] Step S8, element-level enhancement of the herbal medicine-syndrome association information, includes the confidence score of association rule mining for symptom-herbal medicine associations.
[0105]
[0106] Where s t Representative symptoms t, h i Representing herb i, Rx (h) i Rx(s) represents a prescription containing drug i. t () represents a prescription containing syndrome t, and N is the total number of prescriptions;
[0107] By modifying the above formula, we obtain the following formula:
[0108]
[0109] Syndrome-Herbal Relationship Matrix The formula for performing quadratic element-level enhancement operations is:
[0110]
[0111] in The operation is an element-wise multiplication operation between matrices. For matrices The matrix obtained by performing a softmax transformation on each row vector.
[0112] Example 2:
[0113] A traditional Chinese medicine prescription recommendation system is provided. The system is based on nonlinear multi-feature fusion and gated recurrent self-attention mechanism. The system includes a computer-readable medium storing a computer program. When the computer program is executed by a processor, it implements the steps of the above-mentioned traditional Chinese medicine prescription recommendation method.
[0114] Example 3: This example uses a traditional Chinese medicine prescription recommendation method based on nonlinear multi-feature fusion and gated recurrent self-attention mechanism from Example 1. Experiments were conducted on two datasets:
[0115] The TCM1 Dataset contains 26,360 prescriptions. The 26,360 cases are divided into 22,917 for training and 3,443 for testing. Statistics for the experimental dataset are shown in Table 1. The initial sparsity of the symptom-herb matrix in the training set is 0.8709.
[0116] The TCM2 Dataset contains 98,334 original medical cases and 33,765 processed medical cases (including only symptoms and herbs). Of the 33,765 processed cases, 390 are symptoms and 805 are herbs. The total number of medical cases is divided into 20,259 for training and 6,753 for testing. Statistics for the experimental dataset are shown in Table 1. The initial sparsity of the symptom-herb matrix in the training set is 0.8728.
[0117]
[0118] Sparsity is defined as the ratio of the number of unassociated elements to the total number of all possible associated elements, or the ratio of the number of zero elements in a matrix to the total number of elements in the matrix.
[0119] Evaluation indicators
[0120] To evaluate the predictive performance of the NFFGRAM model, which predicts potential herbal-symptom associations, we used the AUC (Area Under the Receiver Operating Characteristic curve, AUROC) and AUPR (Area Under Precision-Recall curve, AUPR) metrics of the ten-fold cross-validation method in the earlier FWKNKN, FLNS, FGSK, and Bipartile modules to assess the stability of the method. In the final prescription recommendation stage (recurrent gated self-attention mechanism and two-time enhancement at the element level), we used Precision@K, Recall@K, and F1-score@K to assess the predictive effectiveness. A value closer to 1 indicates better performance, while an AUC value closer to 0.5 indicates performance closer to randomness. We calculate the true positive rate (TPR) and false positive rate (FPR) by changing the preset ranking threshold, as shown in formulas (21) and (22), and plot the Receiver Operating Characteristic curve (ROC) to calculate the corresponding AUC value. AUPR refers to the area under the precision-recall (PR) curve, which is often used to measure model performance. Even when there are false positives in the erroneous information, AUPR can still accurately reflect the performance of the prediction model. If the AUPR value is high, it proves that the model is good. Statistically, recall is equivalent to true positive rate (TPR). Therefore, we plot the PR curve by calculating the true positive rate (TPR) and precision (PRE) for different classification result thresholds, and calculate the corresponding AUPR value, as shown in formulas (1) and (3).
[0121] (twenty one)
[0122] (twenty two)
[0123] (twenty three)
[0124] Where TP is the number of true positive samples, FP is the number of false positive samples, TN is the number of true negative samples, and FN is the number of false negative samples.
[0125] Given a set of symptoms, the herbal recommendation task is to generate a set of herbs to alleviate the symptoms. To evaluate the performance of our method, we use accuracy@K, recall@K, and F1-score@K, as shown in equations (24), (25), and (26), respectively. K is the number of herbs to be recommended.
[0126] (twenty four) (25) (26)
[0127] It is the K highest-scoring herbal recommendations for a given symptom. Precision@K represents the exact amount of a herbal remedy given the symptoms. Recall@K is the recall in top-K recommendations. F1-score@K is a combined evaluation of precision and recall.
[0128] The effectiveness and superiority of the FLNS algorithm
[0129] To demonstrate the effectiveness and superiority of the FLNS algorithm, ten 10-fold cross-validation tests were performed on the TCM1,2 dataset, and compared with the initial LNS algorithm based on Euclid distance and correlation coefficient metric. The average AUC values of the three methods (Euclid distance, correlation coefficient metric, and Fractal dimension metric) were 0.9069, 0.9077, and 0.9091, respectively; the average AUPR values were 0.6166, 0.6302, and 0.6487, respectively. Figure 3 It can be seen that for the TCM1 dataset, the AUC and AUPR values of the Fractal dimension metric are higher than those of the Euclidean distance and Correlation coefficient metric. The AUC value is 0.22% higher than that of the Euclidean distance and 1.5% higher than that of the Correlation coefficient; the AUPR value is 3.2% higher than that of the Euclidean distance and 1.9% higher than that of the Correlation coefficient.
[0130] The average AUC values of the Euclid distance, correlation coefficient metric, and Fractal dimension metric were 0.9122, 0.9127, and 0.9131, respectively; the average AUPR values were 0.6513, 0.6596, and 0.6622, respectively. Figure 4 It can be seen that for the TCM2 dataset, the AUC and AUPR values of the Fractal dimension metric are higher than those of the Euclidean distance and Correlation coefficient metric. The AUC value is 0.09% higher than that of the Euclidean distance and 0.04% higher than that of the Correlation coefficient; the AUPR value is 1.1% higher than that of the Euclidean distance and 2.6% higher than that of the Correlation coefficient.
[0131] As can be seen from the figure, using the fractal dimension to calculate neighborhood distances in LNS performs better than the other two distance measures.
[0132] from Figure 3-4 We can draw the same conclusion: both the AUC and AUPR values show that the Fractal dimension distance measure is superior to the other two distance measures. Therefore, we use the Fractal dimension to calculate the distance measure.
[0133] Comparison with other methods
[0134] The NFFGRAM model embedded using this method was compared with other existing models on two datasets.
[0135]
[0136] For the TCM1 dataset, we compared the experimental results with the Top 10 results, as shown in Table 7. It can be seen that our proposed method outperforms other methods in terms of precision, recall, and F1-score. Compared to the suboptimal SMGCN method, our proposed method surpasses it by 0.13%, 0.03%, and 0.07% in precision, recall, and F1-score, respectively.
[0137] The comparative experimental results for TCM2 data are shown in Table 8.
[0138]
[0139] Note: The first 6 lines are data from the KDHR paper, lines 7-12 are data from the SMRGAT paper, and the last line is the result of the method in this paper.
[0140] As can be seen from the table, the method presented in this paper is significantly superior to the other methods. Table 8 shows the experimental results of all the comparison methods. The second best result is the SMRGAT method (underlined). P@K, R@K and F1-score are the abbreviations of precision@K, recall@K and F1-score@K.
[0141] In summary, our proposed method outperforms other comparative methods. Compared to the best-performing SMRGAT, our method achieves improvements of 12.8% and 19.3% in scores of 10, F1-score@10, and F1-score@20, respectively. Although the F1-score@5 is only 1.0% higher than SMRGAT, the P@5 and R@5 are 7.8% and 15.8% higher, respectively. This suggests that our method is better suited to the characteristics of symptoms and herbs, as well as the potentially complex correlations between symptoms and herbs.
[0142] Network pharmacology analysis of the efficacy of traditional Chinese medicine prescriptions
[0143] We conducted a case study to validate the validity of our proposed herbal recommendation method. Table 9 shows a real-world example of a herbal recommendation scenario. Given a set of symptoms, our proposed NFFGRAM generates a set of herbs to treat the listed symptoms. In the herbal set column, red text indicates herbs shared by the herbal set recommended by NFFGRAM and the actual prescription. One actual prescription contains eight herbs (from the *Dictionary of Traditional Chinese Medicine Prescriptions*). Of the first eight herbs recommended by our method, six are completely identical, achieving an accuracy of 75% and a recall of 75%.
[0144] Furthermore, we analyzed the inhibitory effects of each herbal ingredient in the recommended prescription on symptom targets using the theory of syndrome differentiation and treatment in traditional Chinese medicine and network pharmacology.
[0145] Table 9. Preliminary Research Results of Recommended Traditional Chinese Medicines
[0146]
[0147] In the TCM syndrome differentiation and treatment system, syndrome is a summary of the pathophysiological reaction state at a certain stage in the development of a disease, such as Yin deficiency and internal heat syndrome, liver and kidney Yin deficiency syndrome, etc. Each syndrome includes a series of symptoms from the inside to the outside, forming a symptom set. The symptom set analyzed in this group is night sweats, scrofula, emaciation, and spontaneous sweating. First, from the perspective of modern medicine, we obtained all the target points of the symptom set from the Symmap
[30] database. At the same time, we collected the target points of real Chinese medicine formulas (Atractylodes macrocephala, Glycyrrhiza uralensis, Angelica sinensis, Paeonia lactiflora, Lonicera japonica, Ginseng, Pinellia ternata and Bupleurum chinense) and the recommended Chinese medicine formulas obtained by this model (Glycyrrhiza uralensis, Angelica sinensis, Ginseng, Poria cocos, Atractylodes macrocephala, Bupleurum chinense, Paeonia lactiflora and Paeonia suffruticosa, where Paeonia lactiflora is divided into Paeonia lactiflora and Paeonia veitchii, so Paeonia lactiflora here refers to Paeonia veitchii). To explore the therapeutic mechanisms of the real and recommended formulas for this syndrome, and to clarify the effectiveness of the formula recommended by our model, we obtained the common targets of the real formula and the syndrome, as well as the recommended formula and the syndrome, and plotted PPI networks for each. Figure 5 This indicates the relationship between the targets that can be interfered with by herbal formulas and the disease targets in the PPI network. Green nodes represent cross-targets shared by real Chinese medicine formulas, recommended Chinese medicine formulas, and syndromes (such as BCL2, PPARG, MAP2K1, SDHC, JAK2, GDNF, SDHB, etc.); red nodes represent cross-targets shared by real Chinese medicine formulas and syndromes (such as FGFR3, HNF4A, RET, HNF1A, and BMX); and yellow nodes represent cross-targets shared by recommended Chinese medicine formulas and syndromes (SCN9A, HMBS, NLRP3, and DKC1). The yellow and red nodes also indicate the therapeutic differences among different Chinese medicines, but all can achieve therapeutic effects on this group of symptoms by intervening in these targets. The GO enrichment analysis results of targets affected by components in recommended herbal formulas are plotted as a bar chart of the top 15 GO items, see [link to bar chart]. Figure 6The targets are relatively concentrated in biological processes such as response to cold, negative regulation of neuron apoptotic process, response to toxic substances, female pregnancy, calcium ion import across plasma membrane, cytokine-mediated signaling pathway, response to heat, snRNA pseudouridine synthesis, rRNA pseudouridine synthesis, positive regulation of tyrosine phosphorylation of STAT protein, circadian rhythm, activation of cysteine-type endopeptidase activity involved in apoptotic process, mitochondrial electron transport, succinate to ubiquinone, behavioral response to formalin-induced pain, and response to xenobiotic stimulus. This indicates that the recommended traditional Chinese medicine formula exerts a therapeutic effect on syndromes by regulating multiple biological pathways. Figure 7 The top 15 signaling pathways identified by KEGG pathway enrichment showed that these targets were enriched in pathways in cancer, lipo-associated atherosclerosis, toxoplasmosis, apoptosis, Salmonella infection, and Hepatitis B. Ten of these targets were enriched in the lung cancer pathway. Patients with advanced cancer also experienced spontaneous sweating and night sweats, and were becoming increasingly emaciated due to the disease. Therefore, we analyzed the cancer pathways associated with these symptoms, indicating that this traditional Chinese medicine formula can exert a therapeutic effect by influencing targets in this pathway (Zhu Jingwei. Clinical efficacy analysis of traditional Chinese medicine for spontaneous sweating and night sweats in patients with advanced lung cancer of Qi and Yin deficiency type [J]. Medical Forum Magazine, 2022, 43(10):91-94.). Figure 8As shown. On the other hand, according to the basic syndrome differentiation and treatment of TCM, the cause of night sweats and spontaneous sweating is that the patient has both Qi and Yin deficiency. Therefore, TCM treatment of tonifying Qi and nourishing Yin, clearing heat and resolving phlegm is proposed. Among the TCM herbs involved in the treatment are ginseng, atractylodes macrocephala, poria cocos and licorice (Zhu Jingwei. Clinical TCM efficacy analysis of spontaneous sweating and night sweats in patients with Qi and Yin deficiency in late-stage lung cancer [J]. Medical Forum Magazine, 2022, 43(10): 91-94.). Angelica sinensis ranks 11th among external medications used to treat scrofula in ancient Chinese medical literature, with 12 applications and a frequency of 11.21% (Wang Zhiqiao, Jin Ruhui, Gao Jinhui. Analysis of the usage patterns of external medications for scrofula [J]. Journal of Traditional Chinese Medicine, 2020, 26(11): 164-168.). In the distribution table of the four natures and five flavors of external medications for scrofula, pungent, bitter, and sweet rank in the top three, accounting for 84.52% of the total, which is consistent with the five flavors of the Chinese medicine we recommend. In the distribution table of the meridians of external medications for scrofula, liver, spleen, and heart rank in the top three, accounting for 52.94% of the total, which is consistent with the meridians of the Chinese medicine formula we recommend. In summary, this shows that the Chinese medicine formula we recommend is effective.
[0148] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and variations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
[0149] In summary, the present invention can achieve the following effects:
[0150] To help doctors select herbs based on symptoms and assist them in developing clinical prescriptions, a novel herbal recommendation model (NFFGRAM) is proposed, consisting of six modules: FWKNKN, fractal linear neighborhood similarity, fractal-based Gaussian kernel similarity, modified bipartite graph diffusion, gated recurrent self-attention mechanism, and binary level enhancement.
[0151] (1) Introducing fractal dimension and using LNS similarity measure to calculate nonlinear features between herbs and symptoms; using fractal FGSK and multi-feature mining and fusion, and an improved bipartite graph diffusion algorithm to complete the matrix; can fully explore the potential correlation between herbs and syndromes.
[0152] (2) The introduction of a gated recurrent self-attention mechanism makes herbal recommendations more accurate. The loss function is constructed using matrix norm and sparsity, and the gating coefficient is set. Confidence scores for herbs and symptoms are introduced and softmax transformation is performed to enhance the herbal-symptom association at the element-level.
[0153] (3) Regarding evaluation metrics, we adopted a dual evaluation method, using both AUC and AUPR metrics from 10-fold cross-validation and precision@K, recall@K, and F1-score metrics for prescription recommendations. The two methods mutually validate each other; furthermore, we evaluated the superiority of the model from a mathematical perspective, namely by calculating the completion rate of different module matrices.
[0154] (4) Case analysis includes both dialectical analysis from the perspective of traditional Chinese medicine theory and analysis of the symptoms, targets, pathways, etc. of traditional Chinese medicine prescriptions through modern medicine and network pharmacology knowledge.
[0155] The above description is merely a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be noted that for those skilled in the art, any improvements and modifications made without departing from the principle of the present invention should also be considered within the scope of protection of the present invention.
Claims
1. A method for recommending traditional Chinese medicine prescriptions, characterized by: The steps include the following: S1, based on multiple TCM databases, construct a multi-layer heterogeneous graph network of prescription documents consisting of prescription-syndrome-herb, including herb-herb, syndrome-syndrome, syndrome-herb, prescription-herb and prescription-syndrome relationship matrix space; S2 utilizes fractal theory and methods to improve the weighted K-nearest neighbor algorithm and complete the herbal medicine-syndrome correlation matrix, thus achieving the completeness of the herbal medicine-syndrome correlation matrix; S3 utilizes fractal theory and methods to improve the linear neighborhood similarity algorithm and establishes a quadratic optimization model to reconstruct the similarity matrix between herbs and between syndromes. S4 utilizes fractal theory and methods to improve the Gaussian kernel similarity algorithm, and deeply mines the nonlinear correlation information between herbs and between syndromes; S5, merge the herb-herb and syndrome-syndrome similarity matrices obtained from S3 and S4 respectively; S6, improve the bipartite graph diffusion algorithm and input the result obtained in S5 into the improved bipartite graph diffusion algorithm; S7 utilizes a gated recurrent self-attention mechanism to establish a loss function and enhance the herbal medicine-syndrome association information; S8 utilizes the confidence scoring formulas for herbs and syndromes, along with the softmax function, to perform two element-level enhancements on the herb-syndrome association matrix, outputting the final herb-syndrome prediction score matrix.
2. The method for recommending traditional Chinese medicine prescriptions according to claim 1, characterized in that: Step S1 specifically includes: S11, referring to the traditional Chinese medicine databases SymMap, ETCM2.0, ETCM, HERB, and TCMSP; S12, construct a complete molecular regulatory network, develop an optimized model to identify the molecular network modules affected by drugs and diseases, and use them as features to describe traditional Chinese medicine and diseases; S13 utilizes the structural, pharmacological, and molecular characteristics of compounds contained in herbs, combined with drug compatibility mechanisms, to calculate the importance and interaction network of herbs (A h ); S14. Using the characteristic description of syndromes and genetic factors, calculate the importance and correlation of diseases and construct a syndrome association network (As). S15, based on drug and disease information, obtain drug-syndrome correlation and construct an initial correlation network (Y), and then A... h A drug-disease heterogeneous graph network was constructed using As and Y.
3. The method for recommending traditional Chinese medicine prescriptions according to claim 2, characterized in that: Step S2 specifically includes: S21. Based on known drug chemical similarity, disease semantic similarity and existing drug-disease association matrix, and based on fractal theory, we propose to improve the weighted K-nearest neighbor WKNKN algorithm to obtain the FWKNKN algorithm, and reconstruct the herbal medicine-syndrome association matrix. S22, derived from the herbal association matrix A h For each herb *hi*, the similarity distance between herbs is calculated. Then, the nonlinear similarity between herbs is measured by the correlation dimension. The K herbs most similar to *hi* are found, and the correlation scores between these herbs and the syndrome are used to deduce the relationship between *hi* and *hi*. i The interaction likelihood distribution is calculated using the following formula: in These are weighting coefficients. It is the attenuation coefficient; It is a regularization term; S23, Syndrome Correlation Matrix A s For each syndrome i Similar calculations are performed to obtain the likelihood distribution of the interaction: , in These are weighting coefficients. It is the attenuation coefficient; It is a regularization term; S24, using and The average value is used to complete the elements at the corresponding positions in the herbal medicine-syndrome correlation matrix, resulting in the updated herbal medicine-syndrome correlation matrix Y. m : ,in These are Boolean coefficients.
4. The method for recommending traditional Chinese medicine prescriptions according to claim 3, characterized in that: The specific steps of step S3 include: S31, Project the drug-disease association network onto the drug space H, and for any vector in H... ,in It is the number of herbs. dimensional column vector h i Reconstructed The matrix, and , If they are nearly equal, then all the matrices are constructed into tensors, and the fractal dimension is used to represent each layer of the tensor as a characteristic of the herb. S32, calculate the fractal dimension distance between herbs to reflect the nonlinear correlation between them. The fractal dimension formula is as follows: Where r is the radius of the bounding box. For the set of covered points The number of boxes; S33, according to the distance matrix, obtain the feature vector h of the i-th herb. i Given a set of K nearest neighbors of herbs, an optimization model is built within this set to reconstruct the feature vector h of herb i. i, To reconstruct each feature vector Establish the following optimization model and solve it: in express arrive The nearest neighbor, yes The j-th nearest neighbor; yes and The similarity between them represents the reconstruction contribution weight between them. and , and if ,but ,otherwise ; S34. To avoid overlearning of the model, a Tikhonov regularization term is added to minimize the standard weights of the reconstruction. , in For regularization parameters, It is the identity matrix, from which the weight matrix can be obtained. As the FLNS matrix between drugs, denoted as The same process is applied to the disease data, and a quadratic optimization problem is solved to obtain the weight matrix. As a matrix of FLNS between diseases, denoted as .
5. The method for recommending traditional Chinese medicine prescriptions according to claim 4, characterized in that: Step S4 specifically includes: S41, using fractal theory, the Gaussian similarity kernel algorithm is improved to obtain the FGSK algorithm, and the herbal medicine-syndrome correlation matrix Y is then applied. m Perform calculations in Y m In the text, the i-th row represents the herb h. i The interaction probability with each syndrome, where the j-th column represents the syndrome s. j The probability of interaction with each herb, vector Q(h) i ) and Q(s j ) represent the eigenvectors of the i-th row vector and the j-th column vector, respectively, as eigenvectors of the Gaussian similarity kernel; S42, the herb h i and h j The Gaussian kernel similarity matrix between them is represented as G h , will symptoms i and s j The Gaussian kernel similarity matrix between them is represented as G s The calculation formulas are as follows: Among them, kernel bandwidth , It is the fractal correlation dimension norm.
6. The method for recommending a traditional Chinese medicine prescription according to claim 5, characterized in that: Step S5 specifically includes: According to herbal medicine ( and G h ) and symptoms ( and G s The two similarity matrices are integrated based on the principle of complementarity to provide more comprehensive similarity information for NFFGRAM. The similarity information of the herbs and symptoms included are as follows: 。 7. The method for recommending a traditional Chinese medicine prescription according to claim 6, characterized in that: Step S6 specifically includes: S61, each syndrome s j Similarity features A s Mapping to the correlation probability matrix Y m The initial feature diffusion probability matrix A of the disease is obtained from the above. v ; S62, the comprehensive similarity matrix A of drugs h Mapping to the correlation probability matrix Y m The initial characteristic diffusion probability matrix A of the drug is obtained above. d; S63, the two initial matrices connecting similarity information and probabilistic association information are used as the initial diffusion weighting matrices for nodes during graph diffusion, i.e., the initial diffusion weighting matrices are respectively ,in It is Y m Transpose of; S64, each syndrome node will be determined based on the correlation degree of its related herbs and two new matrices A. v and A d To assign weights, that is, the drug nodes will place them in A v and A d The degree of correlation recorded in the data propagates to their related diseases, as shown in the following formula: in, in, Indicates symptom nodes The herb nodes connected through it are assigned A weight vector of dimension; and They represent A respectively v and A d The elements in the i-th row and j-th column of the matrix; express The j-th column vector; and These represent the syndrome-syndrome correlation matrices obtained from the diffusion of herbal medicine to syndrome and syndrome to syndrome, respectively. and These are respectively derived from the initial diffusion probability matrix and The resulting diffusion weights; It is used to balance A v and A d Damping factor between the contribution values; S65, the SS matrix obtained from S64, shows the backpropagation of the correlation between disease nodes to associated drug nodes, using the following formula: in, in, It is used to balance A v and A d Damping factor between the contribution values; and These represent the syndrome-herb correlation matrices obtained from the diffusion of herbs from herbs to herbs and syndromes to herbs, respectively. and These are respectively derived from the initial diffusion probability matrix and The resulting diffusion weights; It was constructed A weighted vector of dimensions, recording the herbs The probability of association for each symptom; when j=1,2,..., ,Right now The final prediction matrix of the syndrome-herbal association of dimensionality; for The final prediction matrix of the association between herbs and syndromes in viscera.
8. The method for recommending traditional Chinese medicine prescriptions according to claim 7, characterized in that: Step S7 specifically includes: A loss function is established based on the drug-syndrome correlation and the sparsity and norm of the matrix: in, It is the sparsity of the matrix. It is a matrix The correlation matrix obtained by the self-attention mechanism in the t-th iteration It is the absolute value of the difference in sparsity of the matrix after two consecutive cycles of self-attention mechanism. Refers to matrix The Frobenius norm of the correlation matrix obtained by the t-th iteration of the self-attention mechanism, i.e. ; Set a threshold When the loss is less than the threshold, the self-attention mechanism loop ends, and the association prediction matrix after the loop self-attention mechanism is applied is output. ; The formula for the self-attention mechanism is as follows: Softmax(X) is a softMax transformation applied to each row vector of X; for the attention mechanism, where For a scaled dot product model, where Q is the query matrix (quary), K is the key, and V is the value, when At that time, it refers to the self-attention mechanism for predicting the association between herbal medicine and syndrome; divided by a feature dimension. This is to alleviate the problem of vanishing gradients. .
9. The method for recommending traditional Chinese medicine prescriptions according to claim 8, characterized in that: Step S8 includes the confidence score of association rule mining for symptom-herbal association. Where s t Representative symptoms t, h i Representing herb i, Rx (h) i Rx(s) represents a prescription containing drug i. t () represents a prescription containing syndrome t, and N is the total number of prescriptions; By modifying the above formula, we obtain the following formula: Syndrome-Herbal Relationship Matrix The formula for performing quadratic element-level enhancement operations is: in The operation is an element-wise multiplication operation between matrices. For matrices The matrix obtained by performing a softmax transformation on each row vector.
10. A traditional Chinese medicine prescription recommendation system, characterized in that: The system includes a computer-readable medium storing a computer program that, when executed by a processor, implements the steps of the method as described in any one of claims 1-9.