Traditional Chinese medicine recommendation method based on graph neural network based on syndrome information

By constructing a graph neural network based on syndrome information and combining the multi-layer propagation of the disease-TCM matrix and syndrome classification, the problem of insufficient accuracy in TCM recommendations is solved, and high-accuracy TCM recommendations are achieved.

CN115171842BActive Publication Date: 2025-10-03EAST CHINA NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210870609.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-22
Publication Date
2025-10-03
Estimated Expiration
2042-07-22

AI Technical Summary

Technical Problem

The accuracy of existing Chinese medicine recommendation methods based on graph neural networks is not ideal, and they fail to effectively mine TCM syndrome information, resulting in insufficient accuracy in Chinese medicine recommendations.

Method used

A graph neural network based on syndrome information is constructed, and multi-layer propagation is performed through the disease-traditional Chinese medicine matrix and syndrome classification to obtain the embedded representation vectors of diseases and traditional Chinese medicines. The average pooling module, multi-layer perceptron and score calculation module are combined to train the traditional Chinese medicine recommendation model.

Benefits of technology

It has improved the accuracy of Chinese medicine recommendations and achieved accurate prediction of symptoms, with the recommendation accuracy rate reaching over 90%.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115171842B_ABST
    Figure CN115171842B_ABST
Patent Text Reader

Abstract

The present invention discloses a graph neural network method for recommending traditional Chinese medicines based on syndrome information. The method obtains a plurality of disease-traditional Chinese medicine data and classifies them according to syndromes. The method then divides the data into disease-traditional Chinese medicine data sets for each syndrome classification, constructs a disease-traditional Chinese medicine matrix based on each disease-traditional Chinese medicine data set, and constructs a graph neural network containing all diseases and traditional Chinese medicines. The method propagates the data based on the disease-traditional Chinese medicine matrix for all syndrome classifications to obtain embedded representation vectors of the diseases and traditional Chinese medicines, and then constructs and trains a traditional Chinese medicine recommendation model. When traditional Chinese medicine recommendations are needed for a specific disease, the method first determines the disease set included in the disease, then obtains embedded representation vectors for each disease in the disease set based on the graph neural network, inputs the embedded representation vectors into the trained traditional Chinese medicine recommendation model, and selects traditional Chinese medicines with higher scores as recommended according to the scoring function output by the model. The present invention integrates syndrome information into the graph neural network to improve the accuracy of traditional Chinese medicine recommendations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of intelligent medical technology, and more specifically, relates to a graph neural network method for recommending traditional Chinese medicine based on syndrome information. Background Art

[0002] In recent years, with the rapid development of technologies like machine learning and artificial intelligence, the development of intelligent TCM-assisted diagnosis and treatment systems has become a crucial component of TCM services and innovation. However, most current TCM-assisted diagnosis and treatment systems focus solely on the condition and symptoms, overlooking the dialectical nature and complexity of TCM. In fact, TCM diagnostics emphasizes the fundamental principles of TCM diagnosis: holistic observation, the integration of the four diagnoses, the integration of symptoms, and the integration of movement and stillness. This core dialectical theory of TCM categorizes the patient's syndromes from a dialectical perspective, and uses this classification to comprehensively determine medication. The same condition can have different underlying syndromes and require different medications. Physicians use this understanding of the syndromes to make a clear diagnosis and formulate treatment plans.

[0003] There are three types of methods in the existing technology: 1. Using machine learning algorithms such as association rules, cluster analysis, Bayesian networks, and decision trees to mine TCM text data, but large data sets often limit the accuracy and generalization of machine learning models. 2. Using the LDA topic model to make implicit knowledge explicit. Specifically, the medical records are regarded as documents, and the symptoms and Chinese medicines contained in the medical records are regarded as words. The co-occurrence information of words is used to learn implicit topics. However, the multivariate and heterogeneous relationships between entities in the field of TCM are not fully described, and the data sparsity problem caused by insufficient word co-occurrence information in TCM short texts cannot be solved well. 3. Using a graph model constructed using a graph neural network to reflect entities and the connections between them, the nodes in the graph are represented as low-dimensional dense vectors, and the topological structure information of the graph is well reflected.

[0004] Among the three methods mentioned above, graph neural networks are more efficient in feature extraction and representation, and can more effectively mine relevant information. However, the accuracy of TCM recommendation methods based on graph neural networks is not ideal and needs further improvement. Summary of the Invention

[0005] The purpose of the present invention is to overcome the shortcomings of the existing technology and provide a graph neural network method for recommending traditional Chinese medicine based on syndrome information, which integrates syndrome information into the graph neural network and improves the accuracy of traditional Chinese medicine recommendation.

[0006] To achieve the above-mentioned purpose, the present invention provides a Chinese medicine recommendation method based on a graph neural network based on syndrome information, comprising the following steps:

[0007] S1: Obtain a number of disease-TCM data according to actual needs. Each data contains the disease, the set of TCM required to treat the disease, and the syndrome to which the disease belongs. Classify the syndrome according to actual needs to obtain K syndrome classifications. Divide all disease-TCM data into K disease-TCM data sets according to the syndrome classifications. For each syndrome classification, construct a disease-TCM matrix of size M×N, where M represents the total number of diseases and N represents the total number of TCMs. If a certain disease requires the use of a certain TCM in its treatment, the corresponding element in the disease-TCM matrix is ​​1, otherwise it is 0.

[0008] S2: Construct a graph neural network whose nodes include M diseases and N traditional Chinese medicines. The relationship between the nodes is a syndrome classification. Then, based on the disease-traditional Chinese medicine matrix of K syndrome classifications, L-layer propagation is performed to obtain the embedded representation vectors of the disease and traditional Chinese medicine. The specific method is as follows:

[0009] S2.1: Initialize the embedding representation vectors of each disease and Chinese medicine when the number of propagation layers is 0 according to actual needs. The initial embedding representation vector of the mth disease is The initial embedding representation vector of the nth Chinese medicine is At the same time, the embedding representation vector of each syndrome is initialized, and the initial embedding representation vector of the kth syndrome is recorded as

[0010] S2.2: Let the number of propagation layers i = 1;

[0011] S2.3: Perform the i-th layer propagation based on the disease-TCM matrix of each syndrome classification, where the propagation formula of the disease node is as follows:

[0012]

[0013] in, represents the embedding representation vector of the mth disease according to the disease-TCM matrix of the kth syndrome after propagation in the i-th layer, represents the set of neighbor nodes of the mth disease according to the disease-TCM matrix of the kth syndrome, and n′ represents the set of neighbor nodes belonging to the mth disease The Chinese medicine node, represents the neighbor node set of the TCM node n′ according to the symptom-TCM matrix of the kth syndrome, || represents the number of nodes in the node set, and W (i) is the preset i-th layer model parameter, ⊙ represents the multiplication of the corresponding elements, represents the embedding representation vector of the Chinese medicine node n′ at the i-1 layer, Indicates the syndrome classification k corresponding to the mth disease m The embedding representation vector at the i-1th layer, σ() represents the activation function;

[0014] The propagation formula of traditional Chinese medicine nodes is as follows:

[0015]

[0016] in, represents the embedding representation vector of the nth Chinese medicine after propagation in the i-th layer based on the disease-TCM matrix of the k-th syndrome, represents the neighbor node set of the nth Chinese medicine according to the disease-TCM matrix of the kth syndrome, and m′ represents the neighbor node set of the nth Chinese medicine. The disease node, represents the set of neighbor nodes obtained by the disease node m′ according to the disease-TCM matrix of the kth syndrome, represents the embedding representation vector of the disease node m′ at the i-1 layer, Indicates the syndrome classification k corresponding to the disease node m′ m′ The embedding representation vector at layer i-1;

[0017] For each disease or Chinese medicine, the K embedded representation vectors after propagation at the i-th layer obtained based on the K disease-TCM matrices are weighted fused to obtain the final embedded representation vector after propagation at the i-th layer. The calculation formula is as follows:

[0018]

[0019]

[0020] Among them, λ k represents the preset weight of the kth syndrome, and

[0021] S2.4: The propagation formula of the embedded representation vector of the syndrome is as follows:

[0022]

[0023] in, represents the embedded representation vector of the k-th syndrome after propagation in the i-th layer, represents the syndrome propagation parameter of the preset i-th layer model;

[0024] S2.5: Determine whether i < L. If so, proceed to step S2.6; otherwise, proceed to step S2.7.

[0025] S2.6: Set i = i + 1 and return to step S2.3;

[0026] S2.7: For symptoms, Chinese medicines, and syndromes, average the embedding representation vectors obtained by propagation at each layer to obtain the final embedding representation vector. The calculation formulas are as follows:

[0027]

[0028]

[0029]

[0030] S3: Construct a Chinese medicine recommendation model, including an average pooling module, a multi-layer perceptron, and a score calculation module. The average pooling module is used to perform average pooling on the embedded representation vectors of multiple input diseases, and input the obtained feature vectors into the multi-layer perceptron. The multi-layer perceptron extracts the summarized embedded representation vector of the disease and sends it to the score calculation module. The score calculation module calculates the score vector of the Chinese medicine according to the following formula:

[0031]

[0032] in, Represents an N-dimensional score vector, score vector The nth element in is the score of the nth traditional Chinese medicine, E represents the inductive embedding representation vector of the disease, the superscript T represents transposition, G represents the embedding representation vector of the syndrome category to which the syndrome corresponding to the inductive embedding representation vector E of the disease belongs, the syndrome of the inductive embedding representation vector E is the syndrome corresponding to the input multiple diseases, diag(G) represents the diagonal matrix with the elements of the syndrome embedding representation vector G as the diagonal elements, and F represents the traditional Chinese medicine embedding representation matrix with the embedding representation vectors of N traditional Chinese medicines as row vectors;

[0033] S4: Use the symptom-TCM data in step S1 to train the TCM recommendation model. The specific method is as follows: randomly extract a number of symptoms under the same syndrome classification to form a training symptom set, obtain the embedded representation vector of each symptom in the training symptom set, and then use the following method to obtain the actual score vector of the training symptom set: for each TCM, if it belongs to the TCM set required to treat a symptom in the extracted symptoms, then the score is 1, otherwise the score is 0, and the actual score vector Y is constructed based on the scores of N TCMs;

[0034] Input the embedded representation vectors of D diseases into the traditional Chinese medicine recommendation model, take the actual score vector Y as the expected output, and train the traditional Chinese medicine recommendation model;

[0035] S5: When it is necessary to recommend traditional Chinese medicine for a certain disease, first determine the set of symptoms in the disease that belong to the same symptom classification, obtain the embedded representation vector of each symptom in the symptom set, input the embedded representation vector into the trained traditional Chinese medicine recommendation model, and select the top Q traditional Chinese medicines with the highest scores as the recommended traditional Chinese medicines based on the output score function. The value of Q is set according to specific needs.

[0036] The graph neural network Chinese medicine recommendation method based on syndrome information of the present invention obtains a number of disease-Chinese medicine data according to actual needs, classifies them according to syndromes, and obtains disease-Chinese medicine data sets of each syndrome classification. A disease-Chinese medicine matrix is ​​constructed according to each disease-Chinese medicine data set, and a graph neural network containing all diseases and Chinese medicines is constructed. The disease-Chinese medicine matrix based on all syndrome classifications is propagated to obtain embedded representation vectors of diseases and Chinese medicines, and a Chinese medicine recommendation model is constructed and trained. When Chinese medicine needs to be recommended for a certain disease, the disease set contained in the disease is first determined, and then the embedded representation vector of each disease in the disease set is obtained based on the graph neural network. The embedded representation vector is input into the trained Chinese medicine recommendation model, and the Chinese medicine with a higher score is selected as the recommended Chinese medicine according to the score function output by the model.

[0037] Based on the graph neural network modeling of symptoms and traditional Chinese medicine, the present invention integrates syndrome classification information and the symptom-traditional Chinese medicine graph for embedded propagation. While obtaining the embedded representation of syndrome classification information, it enriches the original embedded representation of symptoms and traditional Chinese medicine, thereby achieving more accurate predictions in the subsequent prediction steps and improving the accuracy of traditional Chinese medicine recommendations. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 This is a flowchart of a specific implementation of the graph neural network Chinese medicine recommendation method based on syndrome information of the present invention;

[0039] Figure 2 This is a flowchart of the present invention for obtaining embedded representation vectors of diseases and traditional Chinese medicines based on graph neural networks. DETAILED DESCRIPTION

[0040] The following describes the specific embodiments of the present invention in conjunction with the accompanying drawings so that those skilled in the art can better understand the present invention. It should be noted that in the following description, when detailed descriptions of known functions and designs may dilute the main content of the present invention, such descriptions will be omitted here.

[0041] Example

[0042] Figure 1 This is a flowchart of a specific implementation of the graph neural network Chinese medicine recommendation method based on syndrome information of the present invention. Figure 1 As shown, the graph neural network Chinese medicine recommendation method based on syndrome information of the present invention includes the following steps:

[0043] S101: Get sample data:

[0044] Based on actual needs, we acquire a number of disease-related Chinese medicine (TCM) data sets. Each data entry contains the disease, the set of TCMs required to treat the disease, and the syndrome to which the disease belongs. We then categorize the syndromes according to actual needs, generating K syndrome classifications. All disease-related TCM data sets are then divided into K sets based on the syndrome classifications. For each syndrome classification, we construct an M×N symptom-TCM matrix, where M represents the total number of diseases and N represents the total number of TCMs. If a TCM is required for the treatment of a disease, the corresponding element in the symptom-TCM matrix is ​​set to 1; otherwise, it is set to 0.

[0045] At the same time, a number of actual medication case data are collected, and each case data includes a set of symptoms of the disease and a set of traditional Chinese medicines required for treatment.

[0046] S102: Obtaining embedded representation vectors based on graph neural networks:

[0047] A graph neural network is constructed, whose nodes include M diseases and N traditional Chinese medicines. The relationship between the nodes is a syndrome classification. Then, L-layer propagation is performed based on the disease-traditional Chinese medicine matrix of K syndrome classifications to obtain the embedded representation vectors of the diseases and traditional Chinese medicines. Figure 2 This is a flowchart of the present invention for obtaining embedded representation vectors of diseases and traditional Chinese medicines based on graph neural networks. Figure 2 The specific steps of obtaining the embedded representation vectors of symptoms and traditional Chinese medicines based on the graph neural network in the present invention include:

[0048] S201: Initialize the embedding representation vector:

[0049] Initialize the embedding representation vectors of each disease and Chinese medicine when the number of propagation layers is 0 according to actual needs. The initial embedding representation vector of the mth disease is The initial embedding representation vector of the nth Chinese medicine is At the same time, the embedding representation vector of each syndrome is initialized, and the initial embedding representation vector of the kth syndrome is recorded as

[0050] S202: Set the number of propagation layers i=1.

[0051] S203: The i-th layer of transmission of disease and Chinese medicine:

[0052] The i-th layer propagation is performed based on the disease-TCM matrix of each syndrome classification, where the propagation formula of the disease node is as follows:

[0053]

[0054] in, represents the embedding representation vector of the mth disease according to the disease-TCM matrix of the kth syndrome after propagation in the i-th layer, represents the set of neighbor nodes of the mth disease according to the disease-TCM matrix of the kth syndrome, and n′ represents the set of neighbor nodes belonging to the mth disease The Chinese medicine node, represents the neighbor node set of the TCM node n′ according to the symptom-TCM matrix of the kth syndrome, | | represents the number of nodes in the node set, A symmetric normalization term used to prevent the embedding size from increasing as the number of graph convolution operations increases. (i) is the preset i-th layer model parameter, ⊙ represents the multiplication of the corresponding elements, represents the embedding representation vector of the Chinese medicine node n′ at the i-1 layer, Indicates the syndrome classification k corresponding to the mth disease m The embedding representation vector at the i-1th layer is The syndrome classification embedding representation is integrated into the message passing of the graph neural network to model the disease-traditional Chinese medicine interaction based on this syndrome classification. σ() represents the activation function, and the LeakyRelu activation function is used in this embodiment.

[0055] The propagation formula of traditional Chinese medicine nodes is as follows:

[0056]

[0057] in, represents the embedding representation vector of the nth Chinese medicine after propagation in the i-th layer based on the disease-TCM matrix of the k-th syndrome, represents the neighbor node set of the nth Chinese medicine according to the disease-TCM matrix of the kth syndrome, and m′ represents the neighbor node set of the nth Chinese medicine. The disease node, represents the set of neighbor nodes obtained by the disease node m′ according to the disease-TCM matrix of the kth syndrome, represents the embedding representation vector of the disease node m′ at the i-1 layer, Indicates the syndrome classification k corresponding to the disease node m′ m′ The embedding representation vector at the i-1th layer.

[0058] For each disease or Chinese medicine, the K embedded representation vectors after propagation at the i-th layer obtained based on the K disease-TCM matrices are weighted fused to obtain the final embedded representation vector after propagation at the i-th layer. The calculation formula is as follows:

[0059]

[0060]

[0061] Among them, λ krepresents the preset weight of the kth syndrome, and In this embodiment, the weight λ k Determine using the following method:

[0062] For the K disease-TCM data sets in step S101, the number of data in the kth disease-TCM data set is b k , then the weight λ k The calculation is done using the following formula:

[0063]

[0064] S204: Syndrome propagation at level i:

[0065] In the present invention, the propagation formula of the embedded representation vector of the syndrome is as follows:

[0066]

[0067] in, represents the embedded representation vector of the k-th syndrome after propagation in the i-th layer, Represents the syndrome propagation parameters of the preset i-th layer model.

[0068] Through the above formula, the embedded representation of the current syndrome classification can be projected to the next layer, and the syndrome information can be further integrated with the embedded representation of the disease and traditional Chinese medicine in the next layer.

[0069] S205: Determine whether i<L, if yes, go to step S206, otherwise go to step S207.

[0070] S206: Let i=i+1, and return to step S203.

[0071] S207: Get the final embedding representation vector:

[0072] For symptoms, Chinese medicines, and syndromes, the embedding representation vectors obtained by propagation at each layer are averaged to obtain the final embedding representation vector. The calculation formulas are as follows:

[0073]

[0074]

[0075]

[0076] S103: Constructing a Chinese medicine recommendation model:

[0077] In order to achieve traditional Chinese medicine recommendation, the present invention needs to construct a traditional Chinese medicine recommendation model, including an average pooling module, a multi-layer perceptron and a score calculation module. The average pooling module is used to average pool the embedded representation vectors of multiple input diseases, input the obtained feature vectors into the multi-layer perceptron, and the multi-layer perceptron extracts the summarized embedded representation vector of the disease and sends it to the score calculation module. The score calculation module calculates the score vector of the traditional Chinese medicine according to the following formula:

[0078]

[0079] in, Represents an N-dimensional score vector, score vector The nth element in is the score of the nth traditional Chinese medicine (i.e., the probability value of being suitable for treating the disease corresponding to the current symptom), the superscript T represents transposition, E represents the inductive embedding representation vector of the symptom, G represents the embedding representation vector of the syndrome classification to which the syndrome corresponding to the inductive embedding representation vector E of the symptom belongs, the syndrome of the inductive embedding representation vector E is the syndrome corresponding to the input multiple diseases, diag(G) represents the diagonal matrix with the elements of the syndrome embedding representation vector G as the diagonal elements, and F represents the traditional Chinese medicine embedding representation matrix with the embedding representation vectors of N traditional Chinese medicines as row vectors.

[0080] S104: Training Chinese medicine recommendation model:

[0081] The symptom-TCM data in step S101 is used to train the TCM recommendation model. The specific method is as follows: a number of symptoms are randomly selected under the same syndrome classification to form a training symptom set, and the embedded representation vector of each symptom in the training symptom set is obtained. Then, the actual score vector of the training symptom set is obtained by the following method: for each TCM, if it belongs to the TCM set required for treating a symptom in the extracted symptoms, the score is 1, otherwise the score is 0, and the actual score vector Y is constructed according to the scores of N TCMs.

[0082] The embedded representation vectors of D diseases are input into the traditional Chinese medicine recommendation model, and the actual score vector Y is used as the expected output to train the traditional Chinese medicine recommendation model.

[0083] The setting of the loss function has a significant impact on the training effect of the traditional Chinese medicine recommendation model. The calculation method of the loss function in this embodiment is as follows:

[0084] The number of training disease sets in a batch is recorded as P. For each training disease set, the training disease set is divided into K categories according to the syndrome classification to which it belongs. Then, the following formula is used to calculate the loss of the corresponding syndrome for each category:

[0085]

[0086] Among them, Y p 、 Representation category The actual score vector of the training disease set p and the estimated score vector of the traditional Chinese medicine recommendation model.

[0087] Then average the losses of K syndromes to get the comprehensive loss of this batch:

[0088]

[0089] By minimizing the comprehensive loss, the parameters of the TCM recommendation model are optimized and trained to minimize the gap between the actual TCM and the recommended TCM for each syndrome. In practical applications, L2 regularization can also be added to the comprehensive loss to further optimize the loss function.

[0090] S105: Chinese medicine recommendation:

[0091] When it is necessary to recommend traditional Chinese medicine for a certain disease, we first determine the set of symptoms in the disease that belong to the same symptom classification, obtain the embedded representation vector of each symptom in the symptom set, input the embedded representation vector into the trained traditional Chinese medicine recommendation model, and select the top Q traditional Chinese medicines with the highest scores as the recommended traditional Chinese medicines based on the output score function. The value of Q is set according to specific needs.

[0092] In order to better illustrate the technical solution of the present invention, a specific example is used to experimentally verify the present invention. In this experimental verification, the syndromes are divided into six categories based on experience: wind-heat, damp-heat, wind-cold, qi and blood, yin and yang, and other categories. Data without symptoms and data that do not belong to the first five categories are classified into other categories. In addition, a pre-trained classification model (such as a syndrome classification model based on a graph neural network) can also be used to classify the syndrome data set. Six syndrome-traditional Chinese medicine matrices are obtained based on the symptom-traditional Chinese medicine data. In this experimental verification, the dimension of the embedded representation vector is 256, and the graph neural network performs 2 propagations to obtain embedded representation vectors of symptoms, traditional Chinese medicine, and symptoms.

[0093] For the TCM recommendation model, the multi-layer perceptron is a single-layer 256-dimensional model. The embedded representation vectors of multiple symptoms are average-pooled through the average pooling module and then processed by the multi-layer perceptron to obtain a 256-dimensional summarized symptom representation vector. This vector is then input into the score calculation module to calculate the score of each TCM, and the top 15 TCMs with the highest scores are selected as recommended TCMs. In this experimental verification, the ratio of the number of identical TCMs in the recommended TCMs and the actual number of TCMs used was used as the recommendation accuracy. Table 1 is a comparison table of some TCM recommendation results and actual medication use in this embodiment.

[0094]

[0095]

[0096] Table 1

[0097] As shown in Table 1, the accuracy of the recommended Chinese medicines for various diseases in this embodiment is above 90%, which shows that the present invention can achieve high-accuracy Chinese medicine recommendations.

[0098] Although the above describes the illustrative specific embodiments of the present invention to facilitate understanding of the present invention by those skilled in the art, it should be clear that the present invention is not limited to the scope of the specific embodiments. For those skilled in the art, as long as various changes are within the spirit and scope of the present invention as defined and determined by the appended claims, these changes are obvious, and all inventions and creations using the concepts of the present invention are protected.

Claims

1. A Chinese medicine recommendation method based on graph neural network of syndrome information, characterized in that: The following steps are involved: S1: Obtain a number of disease-TCM data according to actual needs. Each data contains the disease, the set of TCM required to treat the disease, and the syndrome to which the disease belongs. Classify the syndrome according to actual needs to obtain K syndrome classifications. Divide all disease-TCM data into K disease-TCM data sets according to the syndrome classifications. For each syndrome classification, construct a disease-TCM matrix of size M×N, where M represents the total number of diseases and N represents the total number of TCMs. If a certain disease requires the use of a certain TCM in its treatment, the corresponding element in the disease-TCM matrix is ​​1, otherwise it is 0. S2: Construct a graph neural network whose nodes include M diseases and N traditional Chinese medicines. The relationship between the nodes is a syndrome classification. Then, based on the disease-traditional Chinese medicine matrix of K syndrome classifications, L-layer propagation is performed to obtain the embedded representation vectors of the disease and traditional Chinese medicine. The specific method is as follows: S2.1: Initialize the embedding representation vectors of each disease and Chinese medicine when the number of propagation layers is 0 according to actual needs. The initial embedding representation vector of the mth disease is The initial embedding representation vector of the nth Chinese medicine is At the same time, the embedding representation vector of each syndrome is initialized, and the initial embedding representation vector of the kth syndrome is recorded as S2.2: Let the number of propagation layers i = 1; S2.3: Perform the i-th layer propagation based on the disease-TCM matrix of each syndrome classification, where the propagation formula of the disease node is as follows: in, represents the embedding representation vector of the mth disease according to the disease-TCM matrix of the kth syndrome after propagation in the i-th layer, represents the set of neighbor nodes of the mth disease according to the disease-TCM matrix of the kth syndrome, and n′ represents the set of neighbor nodes belonging to the mth disease The Chinese medicine node, represents the neighbor node set of the TCM node n′ according to the symptom-TCM matrix of the kth syndrome, || represents the number of nodes in the node set, and W (i) is the preset i-th layer model parameter, ⊙ represents the multiplication of the corresponding elements, represents the embedding representation vector of the Chinese medicine node n′ at the i-1 layer, Indicates the syndrome classification k corresponding to the mth disease m The embedding representation vector at the i-1th layer, σ() represents the activation function; The propagation formula of traditional Chinese medicine nodes is as follows: in, represents the embedding representation vector of the nth Chinese medicine after propagation in the i-th layer based on the disease-TCM matrix of the k-th syndrome, represents the neighbor node set of the nth Chinese medicine according to the disease-TCM matrix of the kth syndrome, and m′ represents the neighbor node set of the nth Chinese medicine. The disease node, represents the set of neighbor nodes obtained by the disease node m′ according to the disease-TCM matrix of the kth syndrome, represents the embedding representation vector of the disease node m′ at the i-1 layer, Indicates the syndrome classification k corresponding to the disease node m′ m′ The embedding representation vector at layer i-1; For each disease or Chinese medicine, the K embedded representation vectors after propagation at the i-th layer obtained based on the K disease-TCM matrices are weighted fused to obtain the final embedded representation vector after propagation at the i-th layer. The calculation formula is as follows: Among them, λ k represents the preset weight of the kth syndrome, and S2.4: The propagation formula of the embedded representation vector of the syndrome is as follows: in, represents the embedded representation vector of the k-th syndrome after propagation in the i-th layer, represents the syndrome propagation parameter of the preset i-th layer model; S2.5: Determine whether i < L. If so, proceed to step S2.6; otherwise, proceed to step S2.

7. S2.6: Set i = i + 1 and return to step S2.3; S2.7: For symptoms, Chinese medicines, and syndromes, average the embedding representation vectors obtained by propagation at each layer to obtain the final embedding representation vector. The calculation formulas are as follows: S3: Construct a Chinese medicine recommendation model, including an average pooling module, a multi-layer perceptron, and a score calculation module. The average pooling module is used to perform average pooling on the embedded representation vectors of multiple input diseases, and input the obtained feature vectors into the multi-layer perceptron. The multi-layer perceptron extracts the summarized embedded representation vector of the disease and sends it to the score calculation module. The score calculation module calculates the score vector of the Chinese medicine according to the following formula: in, Represents an N-dimensional score vector, score vector The nth element in is the score of the nth traditional Chinese medicine, E represents the inductive embedding representation vector of the disease, the superscript T represents transposition, G represents the embedding representation vector of the syndrome category to which the syndrome corresponding to the inductive embedding representation vector E of the disease belongs, the syndrome of the inductive embedding representation vector E is the syndrome corresponding to the input multiple diseases, diag(G) represents the diagonal matrix with the elements of the syndrome embedding representation vector G as the diagonal elements, and F represents the traditional Chinese medicine embedding representation matrix with the embedding representation vectors of N traditional Chinese medicines as row vectors; S4: Use the symptom-TCM data in step S1 to train the TCM recommendation model. The specific method is as follows: randomly extract a number of symptoms under the same syndrome classification to form a training symptom set, obtain the embedded representation vector of each symptom in the training symptom set, and then use the following method to obtain the actual score vector of the training symptom set: for each TCM, if it belongs to the TCM set required to treat a symptom in the extracted symptoms, then the score is 1, otherwise the score is 0, and the actual score vector Y is constructed based on the scores of N TCMs; Input the embedded representation vectors of D diseases into the traditional Chinese medicine recommendation model, take the actual score vector Y as the expected output, and train the traditional Chinese medicine recommendation model; S5: When it is necessary to recommend traditional Chinese medicine for a certain disease, first determine the set of symptoms in the disease that belong to the same syndrome classification, obtain the embedded representation vector of each symptom in the symptom set, input the embedded representation vector into the trained traditional Chinese medicine recommendation model, and select the top Q traditional Chinese medicines with the highest scores as the recommended traditional Chinese medicines based on the output score function. The value of Q is set according to specific needs.

2. The method for recommending traditional Chinese medicine according to claim 1, characterized in that: The weight λ in step S2.3 k Determine using the following method: For the K disease-TCM data sets in step S1, the number of data in the kth disease-TCM data set is b k , then the weight λ k The calculation is done using the following formula:

3. The method for recommending traditional Chinese medicine according to claim 1, characterized in that: The calculation method of the loss function during the training of the Chinese medicine recommendation model in step S4 is as follows: The number of training disease sets in a batch is recorded as P. For each training disease set, the training disease set is divided into K categories according to the syndrome classification to which it belongs. Then, the following formula is used to calculate the loss of the corresponding syndrome for each category: Among them, Y p 、 Representation category The actual score vector of the training disease set p and the estimated score vector of the traditional Chinese medicine recommendation model; Then average the losses of K syndromes to get the comprehensive loss of this batch:

Citation Information

Patent Citations

  • Traditional Chinese medicine recommendation method based on multi-graph convolutional neural network

    CN112820375A

  • Chinese herbal medicine prescription recommendation method based on hypergraph neural network

    CN114255851A