Mongolian medicine prescription recommendation method based on multi-graph convolution fusion
Through the multi-graph convolution fusion method, combined with Transformer and GCN, a relationship diagram of Mongolian medicine, symptoms and syndrome was constructed, which solved the problems of "nature and taste in meridians" and "using medicine according to time" in Mongolian medicine, and improved the problem of "non-consideration of medicine" and "using medicine according to time" in Mongolian medicine. The accuracy and interpretation of drug recommendations have been achieved, and the drug combination recommendation of Mongolian medicine has been achieved.
Patent Information
- Application Number
- CN202411456595.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-10-18
AI Technical Summary
The existing recommended methods for traditional Chinese medicine prescriptions fail to fully consider the characteristics of Mongolian medicine's "nature and taste in meridians" and the principle of "using medicine according to time", resulting in little impact on the drug combination and poor recommendation accuracy and explanation.
Using the recommended method of Mongolian medical prescriptions based on multi-graph convolutional fusion, the various relationship diagrams of drugs, symptoms and syndromes are constructed, and the characteristics are captured using graph convolution, combined with the Transformer encoder and GCN, the comprehensive representation of the fusion drugs and symptoms is integrated. Drug recommendations are carried out, and feature encoding and loss functions are designed to simulate the Mongolian medical prescription composition process.
It improves the accuracy and interpretation of drug recommendations, conforms to the theoretical system and clinical practice of Mongolian medicine, and can conduct targeted drug combination recommendations, enhancing a deep understanding of the principle of Mongolian medicine prescription composition.
Smart Images

Figure BDA0005090639370000021 
Figure BDA0005090639370000031 
Figure BDA0005090639370000041
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of Mongolian medicine prescription recommendation, and particularly relates to a Mongolian medicine prescription recommendation method based on multi-graph convolution fusion. Background Art
[0002] As an important part of traditional Chinese medicine, Mongolian medicine is usually used in clinical practice after being formulated into prescriptions under the guidance of Mongolian medicine basic theories in an appropriate combination to achieve the purpose of treating diseases, conditioning the body and restoring health. The performance of Mongolian medicine can be summarized into four types: six flavors, eight properties, two powers and seventeen effects. This is the main basis for Mongolian medicine to prevent and treat diseases, and is also the theoretical basis for formulating medicine. Among them, the taste of the medicine refers to six tastes, namely sweet, sour, salty, bitter, pungent and astringent. There is a certain connection between the taste of the medicine and its effect. For example, sweet taste can nourish the body, detoxify and treat Hei and Xila; the medicinal properties refer to eight properties, namely heavy, greasy, cold, dull, light, astringent, hot and sharp, which are the most important components among the seventeen effects. Mongolian medicine believes that the medicinal properties can independently coordinate and rectify the phenomenon of excessive or insufficient five elements. For example, heavy and greasy properties can calm Hei syndrome; the medicinal power refers to the cold medicinal power and the hot medicinal power, which highly summarizes the properties of Mongolian medicinal materials; the medicinal efficacy refers to 17 effects, namely soft, heavy, warm, greasy, solid, cold, dull, cool, harmonious, thin, dry, light, hot, light, sharp, astringent and moving.
[0003] Mongolian medicine prescription refers to Mongolian medicinal materials with more than two herbs, which are matched according to the principles of "nature and flavor combination" and "function combination". Among them, "nature and flavor combination" refers to the combination method based on the main taste, medicinal properties and efficacy of the medicine, targeting the characteristics of the increase, weakness and conflict of Heyi, Xiri and Badagan, with the purpose of recovery. When formulating the prescription, attention should be paid to the coordination of the taste of the medicine and its medicinal properties and efficacy. If the taste is the same, the medicinal properties and efficacy are different, the effects of the medicine will cancel each other out. For example, pomegranate tastes sour and has seven efficacy, namely heat, sharp, rough, floating, greasy, dry and light, so it belongs to fire, and has the function of warming the stomach, curing stomach diseases, and calming Heyi and Badagan. "Function combination" refers to the method of selecting the combination of therapeutic drugs according to the essential function of the drug and the nature of the lesion. "Function combination" is the most commonly used basic combination method in Mongolian medicine clinical practice. When formulating the prescription, select highly targeted therapeutic drugs according to the lesion nature and lesion site of a certain disease. For example, meat bean onion and asafoetida are often used for heart Heyi disease. Mongolian medicine also emphasizes "taking medicine according to the time of day", focusing on the combination formula of the four time points of morning, noon, evening and before bedtime. In the morning, the warm and hot prescriptions of Zhenheyi and Qubadagan are generally used, and the cold and cool prescriptions of Qingxila and Liangxue are generally used at noon. In the evening, the prescriptions of moderate cold and heat, dry yellow water and Tongbaimai are used. In view of the unique compatibility principle of "flavor, nature, strength and effect" and the medication method of "taking medicine according to the time of day" in Mongolian medicine, objective modeling is carried out, which plays an important role in the inheritance and objectification of the entire Mongolian medicine.
[0004] CN115588478A discloses a method for auxiliary recommendation of Chinese medicine prescriptions based on group collaborative filtering, which helps doctors to complete the association between Chinese medicine and complex symptoms, provides assistance for clinical Chinese medicine prescriptions, and further broadens the research ideas for Chinese medicine recommendation. However, this method only considers the relationship between symptoms and symptoms and between symptoms and medicines, and simulates the representation of syndromes by generating symptom group embedding representations. The use of symptom group embeddings may have a significant impact on the final drug recommendation due to inaccurate syndrome judgments.
[0005] CN115171842A discloses a graph neural network method for recommending Chinese medicine based on syndrome information. It considers the impact of syndrome information on the final Chinese medicine recommendation, integrates syndrome information into the graph neural network, and improves the accuracy of Chinese medicine recommendation. However, this method does not consider the "nature, taste and meridian" characteristics of Chinese medicine in modeling Chinese medicine, and has poor interpretability.
[0006] In summary, the above scheme only makes a simple drug recommendation, selecting Chinese medicines with higher scores as recommended Chinese medicines based on the scoring function output by the model, without any specific in-depth research on the impact of TCM prescription principles on drug combinations. Summary of the invention
[0007] To solve the above technical problems, the present invention provides a Mongolian medicine prescription recommendation method based on multi-graph convolution fusion, which introduces the nature and taste of the medicine and the time of medication by designing feature coding, combines syndrome information, constructs multiple relationship graphs and uses graph convolution to capture features, and fuses them to obtain a comprehensive representation of drugs and symptoms, thereby making drug recommendations.
[0008] The technical solution adopted by the present invention is: a Mongolian medicine prescription recommendation method based on multi-graph convolution fusion, and the specific steps are as follows:
[0009] S1. Construct a node feature construction module to initialize the encoding of drug nodes, symptom nodes, and syndrome nodes, and use the Transformer encoder to enhance their features, and finally use the autoencoder to keep the dimensions of various nodes consistent;
[0010] S2, building a drug representation module, which is used to construct drug-drug graphs and symptom-drug graphs, extract drug-drug relationships and symptom-drug relationships through GCN, and fuse the obtained features to obtain the final comprehensive drug representation;
[0011] S3, build a symptom representation module, which is used to construct symptom-symptom graphs and symptom-syndrome graphs, extract symptom-symptom relationships and symptom-syndrome relationships through GCN, and fuse the obtained features to obtain the final comprehensive symptom representation;
[0012] S4. Based on steps S1-S3, a Mongolian medicine prescription recommendation model based on multi-graph convolutional fusion Transformer is constructed, and the training set data is input for model training;
[0013] The Mongolian medicine prescription recommendation model includes: a node feature construction module, a drug representation module, and a symptom representation module; the training set data includes: patient symptoms and severity, collected from previous patient data;
[0014] S5. For patients waiting for treatment, their symptoms and their severity are input into the Mongolian medicine prescription recommendation model trained in step S4 to make prescription predictions and complete prescription recommendations.
[0015] Furthermore, the step S1 is specifically as follows:
[0016] S11, initial coding construction of drug nodes;
[0017] Define drug node h i ,Each Mongolian medicine node includes: nature and taste characteristics, symptom characteristics and time characteristics, that is,
[0018] in, Represents drug node h i The flavor characteristics of Represents drug node h i The syndrome characteristic coding, Represents drug node h i The time characteristic coding of the drug characteristic coding is as follows:
[0019] (1) Coding of sexual and flavor characteristics;
[0020] The classic concepts of "taste, nature, force and effect" in Mongolian medicine include six flavors, eight properties, two forces and seventeen effects. According to the clinical experience of Mongolian medicine, the description of six flavors and seventeen effects is basically involved for drugs, and the nature and taste characteristics of drug nodes are standardized as "sweet, sour, salty, bitter, pungent, astringent, soft, heavy, warm, greasy, solid, cold, dull, cool, harmonious, thin, dry, light, hot, light, sharp, astringent, and moving". There are 23 properties in total, and Mongolian medicinal materials are coded according to these 23 properties.
[0021] Among them, for the descriptions of "slightly bitter", "bitter", and "extremely bitter", use 2 -1 , 2 0 , 2 1 Use 1 and 0 to represent "yes" and "no".
[0022] (2) Syndrome characteristic coding;
[0023] For the symptom characteristics of Mongolian medicine, the functions and indications of the medicine are found, and the syndrome treated by the medicine is obtained. Each syndrome has its own independent one-hot code, and the initial code of the symptom characteristics of each Mongolian medicine is obtained.
[0024] (3) Temporal feature coding;
[0025] For the time characteristics of Mongolian medicine, the time feature code is initialized to {0,0,0,0}, which represents the four time points of morning, noon, evening and before bedtime respectively. Then, based on the existing Mongolian medical records, the number of times each medicine is used at the four time points of morning, noon, evening and before bedtime is counted. After that, the statistical values are normalized to obtain the code of the time characteristics of each Mongolian medicine.
[0026] S12, initial coding construction of symptom nodes;
[0027] Defining Symptom Nodes i , one-hot encode each symptom, and construct the symptom-drug relationship matrix HS, where each row represents a symptom and each column represents a drug. Based on external medical knowledge, the therapeutic relationship between drugs and symptoms is obtained. If a symptom i can be treated by drug j, then HS ij =1.
[0028] S13, initial coding construction of syndrome nodes;
[0029] Define syndrome node c i , one-hot encoding is performed for each syndrome, and a syndrome-symptom relationship matrix SC is constructed. Each row in the matrix represents a syndrome, and each column represents a symptom. Based on external medical knowledge, the inclusion relationship between syndromes and symptoms is obtained. If a syndrome i contains symptom j, then SC ij =1.
[0030] S14, node feature enhancement;
[0031] Based on steps S11-S13, after the initial codes of the three nodes are obtained, they are transmitted to the encoder of the Transformer. The features of the initial codes are enhanced through the multi-head self-attention mechanism. The expression is as follows:
[0032] X (L) =Encoder(X)#(1)
[0033] Among them, X represents the input feature vector sequence, that is, the initial encoding sequence of three node features, X (L) represents the output after L layers of encoders, Encoder(·) represents the Transformer encoder process, in which the most critical step is to calculate the attention weight A, which is expressed as follows:
[0034]
[0035] Among them, Q, K, and V represent the three parameter matrices Query, Key, and Value for calculating attention respectively; d k represents the dimension of the parameter matrix and T represents the transpose of the matrix.
[0036] Different types of nodes have different dimensions, and the symptom feature encoding and syndrome feature encoding are highly sparse. In this case, an autoencoder is used to reduce the dimension of all nodes to the same dimension, and the number of dimensions is set to 30.
[0037] Assume that the input node represents X, and the encoder maps the input data to the hidden layer representation H, which is transformed by the activation function. The expression is as follows:
[0038] H=σ(W e X+b e )#(3)
[0039] Among them, W e represents the weight of the encoder, b e represents the bias, and σ represents the activation function ReLU.
[0040] The representation H of the hidden layer is mapped back to the same space as the input data by the decoder to reconstruct the original data, as follows:
[0041] X′=σ(W d H+b d )#(4)
[0042] Among them, W d represents the weight of the decoder, b d represents the bias, and X′ represents the reconstructed data.
[0043] The goal of the autoencoder is to make the gap between input and output as small as possible. The corresponding loss function expression is as follows:
[0044]
[0045] Among them, N t Indicates the number of training samples for the loss function, X n1 represents the n1th input data, X′ n1 Represents the corresponding n1th reconstructed data.
[0046] Finally, the H output by the middle hidden layer is used as the final code of each type of node after dimensionality reduction, and the code of each type of node is updated.
[0047] Furthermore, the step S2 is specifically as follows:
[0048] S21, relationship diagram construction;
[0049] Define drug-drug graph G1 = {V1, E1};
[0050] Where V1={h1,h2,…,h nh} represents the node set of graph G1, E1 represents the edge set between nodes in graph G1; h i Represents the Mongolian medicine node, and nh represents the number of Mongolian medicines, that is, the number of all Mongolian medicine types.
[0051] Cosine similarity is used to represent the similarity between drug i and drug j. For two drugs i and j, their drug node encoding is h i =[h i1 ,…,h i30 ] and h j =[h j1 ,…,h j30 ], the similarity of the drug is the drug node code h i With h j The cosine value between is calculated as follows:
[0052]
[0053] Among them, k represents the kth dimension.
[0054] Encoding of opposing properties and flavors of drug nodes The eight pairs of opposite natures and flavors are represented as "soft / astringent, heavy / light, warm / cool, solid / moving, greasy / light, dull / sharp, cold / hot, and mild / light". The descriptions of "extremely soft", "soft", "slightly soft", "slightly astringent", "astringent", and "extremely astringent" are expressed as -2. 1 , -2 0 , -2 -1 , 2 -1 , 2 0 , 2 1 Use 0 to represent "none".
[0055] For two drugs i and j, the opposite nature and taste characteristics of their drug nodes are used to encode and The cosine similarity between To indicate adverse reactions between drugs.
[0056] The edge weight is calculated according to formula (7), and the thresholds θ1 and θ2 are defined. The edge weight E is determined according to the thresholds. ij , the expression is as follows:
[0057]
[0058] Among them, θ1 and θ2 represent the thresholds for the similarity of drug node encoding and the opposing taste feature encoding, respectively.
[0059] Define symptom-drug graph G2 = {V2, E2}.
[0060] Where V2 = {V h ,V s} represents the node set of graph G2, E2 represents the edge set between nodes in graph G2; V h =V1={h1,h2,…,h nh} represents the Mongolian medicine node set, V s ={s1,s2,…,s ns} represents the symptom node set, and ns represents the number of symptom nodes, that is, the number of all symptom types.
[0061] Finally, based on the symptom-drug relationship matrix HS constructed in step S12, edge connections between symptom nodes and drug nodes are established; that is, if HS ij =1, an edge connection is established between the corresponding drug node and symptom node.
[0062] S22, relationship diagram learning;
[0063] For the drug-drug graph G1, it first passes through the embedding layer, and then uses GCN to perform graph convolution learning to obtain drug relationship features; the process expression of GCN is as follows:
[0064]
[0065] in, represents the feature matrix of the drug node at the lth layer, σ represents the activation function ReLU, represents the adjacency matrix of G1 with self-loops added, A h represents the adjacency matrix of G1, I represents the identity matrix, represents the degree matrix of the drug-drug graph G1, Represents the weight matrix of the lth layer; the output of the 3rd layer GCN is used as the drug relationship feature of the drug-drug graph G1
[0066] For the drug-symptom graph G2, it first passes through the embedding layer and then performs graph convolution on it using H-GCN to obtain the drug-symptom relationship features.
[0067] Among them, H-GCN obtains the embedding of symptom s connected to drug h, and then uses the neighborhood aggregation embedding of symptom s to obtain the embedding of the current drug g; the process expression of its neighborhood aggregation is as follows:
[0068]
[0069] in, represents the drug embedding output by the l-th layer H-GCN, represents the symptom embedding output by the l-th layer H-GCN, and That is, the drug embedding and symptom embedding obtained after the embedding layer, represents the set of symptoms that interact with drug h in the drug-symptom graph G2, represents the set of drugs that interact with symptom s in the drug-symptom graph G2, Represents the weight matrix of the l-th layer H-GCN.
[0070] Then, multiple layers of information are fused and the node's own information is added. The expression is as follows:
[0071]
[0072] Among them, y h represents the drug-disease relationship feature obtained after fusing l layers of H-GCN, w1 represents the weight matrix; the output y of H-GCN is h The drug-symptom relationship characteristics as the drug-symptom graph G2.
[0073] Finally, the drug relationship features Drug-disease relationship characteristics h Fusion to obtain a comprehensive representation of drugs The expression is as follows:
[0074]
[0075] in, represents the set of real numbers, and SUM(·) represents the addition of corresponding elements of the matrix.
[0076] Furthermore, the step S3 is specifically as follows:
[0077] S31, relationship diagram construction;
[0078] Define symptom-symptom graph G3 = {V3, E3}.
[0079] Where, σV3=V s ={s1,s2,…,s ns} represents the node set of graph G3, and E3 represents the edge set between nodes in graph G3.
[0080] Use cosine similarity CosSim(a,b) to represent the similarity between symptoms; take the symptom similarity CosSim(a,b) as the weight between nodes a and b, and define the threshold θ3; if CosSim(a,b)>θ3, then establish an edge between the two symptom nodes.
[0081] Define symptom-syndrome diagram G4 = {V4, E4}.
[0082] Where V4 = {V c ,V s} represents the node set of graph G4, E4 represents the edge set between nodes in graph G4; V c ={c1,c2,…,c n} represents the syndrome node set, V s ={s1,s2,…,s ns} represents the symptom node set, and nc represents the number of syndrome nodes.
[0083] Then, based on the syndrome-symptom relationship matrix SC constructed in step S13, edge connections between symptom nodes and syndrome nodes are established; that is, if SC ij =1, an edge connection is established between the corresponding syndrome node and symptom node.
[0084] S32, relationship diagram learning;
[0085] For the symptom-symptom graph G3, it first passes through the embedding layer, and then uses GCN to perform graph convolution learning to obtain the symptom relationship features; the process expression of GCN is as follows:
[0086]
[0087] in, represents the feature matrix of the symptom node at the lth layer, represents the adjacency matrix of G3 with self-loops added, A s represents the adjacency matrix of G3, I represents the identity matrix, represents the degree matrix of the symptom-symptom graph G3, Represents the weight matrix of the lth layer; similar to the drug-drug graph G1, the output of the third layer GCN is used as the symptom relationship feature of the symptom-symptom graph G3
[0088] For the symptom-syndrome graph G4, it first passes through the embedding layer, and then uses S-GCN to perform graph convolution on it to obtain the symptom-syndrome relationship features.
[0089] Among them, S-GCN obtains the embedding of syndrome c connected to symptom s, and then uses the neighborhood aggregation embedding of syndrome c to obtain the embedding of the current symptom s; similar to the drug-symptom graph G2, the process expression of its neighborhood aggregation is as follows:
[0090]
[0091] in, represents the symptom embedding output by the l-th layer S-GCN, represents the syndrome embedding output by the l-th layer S-GCN, and That is, the symptom embedding and syndrome embedding obtained after the embedding layer, represents the syndrome set that interacts with symptom s in the symptom-syndrome graph G4, Indicates the symptom set that interacts with syndrome c in the symptom-syndrome diagram G4, Represents the weight matrix of the l-th layer S-GCN.
[0092] Then the multi-layer S-GCN output information is fused and the node’s own information is added. The process expression is as follows:
[0093]
[0094] Among them, z s represents the symptom-syndrome relationship feature obtained after fusing the u-layer S-GCN, w2 represents the weight matrix; the output z of S-GCN is s As the symptom-syndrome relationship characteristics of symptom-syndrome diagram G4.
[0095] Similar to the drug representation module, the symptom relationship features are finally Symptom-syndrome relationship characteristics s Fusion to obtain a comprehensive representation of symptoms The expression is as follows:
[0096]
[0097] Furthermore, the step S4 is specifically as follows:
[0098] The Mongolian medicine prescription recommendation model inputs the patient symptom set S in the training data set = {η1ss1,η2ss2,…,η M ss M}, output its corresponding prescription R = {r1, r2, r3, r4}, r j ={hh1,hh2,…,hh n},j={1,2,3,4}.
[0099] Among them, η m Indicates the severity of the mth symptom of the patient, which can be mild, moderate, or severe, m∈[1,M]; ss mrepresents the mth symptom of the patient, M represents the number of symptoms contained in the patient's symptom set, that is, the number of symptoms the current patient has; r j represents the recommended prescription at the jth time point, where j = {1, 2, 3, 4} corresponds to the morning, noon, evening and bedtime time points, respectively. t Represents a drug in the prescription composition at a certain time point, t∈[1,n].
[0100] First, the comprehensive representation of all symptoms is obtained through the symptom representation module s , S and f s Perform matrix multiplication to obtain the final symptom representation f based on the patient's symptoms s ′, the expression is as follows:
[0101]
[0102] Then the comprehensive representation of all drugs is obtained through the drug representation module h , the final expression of the symptoms based on the patient's symptoms is f s ′ and the comprehensive expression of all drugs f h Perform matrix multiplication to obtain the final representation of the patient's medication f h ′, the expression is as follows:
[0103]
[0104] According to the final expression of the patient's medication h 'Predict the patient's medication, the expression is as follows:
[0105] P = si moid (f ' h )#(20)
[0106] Where P = {P(h1),…,P(h nh )} represents the predicted probability of each drug, P(h i ) indicates drug h i The predicted probability of .
[0107] The predicted probability of the drug is then adjusted according to the syndrome, as follows:
[0108] A1. Obtain the correspondence between symptoms and syndromes based on the syndrome-symptom relationship matrix SC;
[0109] A2. According to the symptoms contained in the patient symptom set S {ss1,…,ss M}Determine the possible syndrome of the patient {B1,…,B N};
[0110] Here, N represents the number of possible syndromes that a patient may have.
[0111] A3. Calculate the severity score of each syndrome of the patient;
[0112] For syndrome B n , n∈[1,N], the set of symptoms it contains is {s1,…,s tt}, the corresponding severity set is {η1,…,η tt}, then syndrome B n Severity score D n The calculation expression is as follows:
[0113]
[0114] Among them, η kk Indicates symptoms kk The corresponding severity.
[0115] A4. Adjustment of drug prediction probability;
[0116] The severity scores of all syndromes {D1,…,D N} Sort by severity; the syndrome with the highest severity score is the main syndrome, and the others are ranked from severity to severity as secondary syndrome 1, secondary syndrome 2…, secondary syndrome NP-1; for syndromes with high severity scores, the prediction probability of the corresponding drug increases; according to syndrome B n Severity score D n Adjust medication h i The predicted probability is expressed as follows:
[0117] P′(h i )=P(h i )·f(D n )=P(h i )·(α·D n +β)#(22)
[0118] Among them, P′(h i ) indicates drug h i The adjusted predicted probability, f(D n ) represents the drug prediction probability adjustment function, which is a linear function that converts the severity score D n Mapped to the adjustment coefficient of the drug prediction probability; α represents the proportional coefficient and β represents the offset coefficient.
[0119] Finally, the drugs with adjusted prediction probability TOP-K are used as the final predicted drugs, and the time of drug use is obtained according to the time characteristics in its initial coding. Drugs with the same usage time are combined into prescriptions at corresponding time points to obtain the patient prescription R = {r1, r2, r3, r4}.
[0120] Furthermore, in step S4, the Mongolian medicine prescription recommendation model performs model training, and when recommending prescriptions, the rules in the Mongolian medicine prescription problem must be followed, as follows:
[0121] The rules in the Mongolian medicine prescription problem include:
[0122] 1) The properties and flavors of the medicine should be consistent with the characteristics of the syndrome;
[0123] 2) Combinations of drugs with similar properties and flavors are more effective;
[0124] 3) There should be no combination of drugs with incompatible properties and flavors;
[0125] The formula loss function is designed based on the rules, as follows:
[0126] For rule 1), the cosine similarity between the nature and taste coding of the drug node and the input patient syndrome characteristic coding is used to simulate, and the syndrome B with the highest severity score is encoded as the corresponding nature and taste of the drug that treats it. The encoding method is consistent with the nature and taste encoding method of the drug; then the loss function expression of rule 1) is as follows:
[0127]
[0128] in, Represents drug node h i Coding of flavor characteristics.
[0129] For rule 2), the cosine similarity between drug nodes is used for simulation, and the loss function expression of rule 2) is as follows:
[0130] L2=-CosSim(h i ,h j )#(twenty four)
[0131] For rule 3), the cosine similarity between the mutually opposing flavor feature codes of the drug nodes is used for simulation. The mutually opposing flavor feature codes of the two drug nodes are and Then the loss function expression of rule 3) is as follows:
[0132]
[0133] The total loss function of the Mongolian medicine prescription recommendation model includes: prescription loss function and BCE loss function.
[0134] Among them, the BCE loss function is used in combination with the sigmoid function, and the expression is as follows:
[0135]
[0136] Among them, y n2 Represents the true label of the n2th sample, y n2 represents the predicted label of the n2th sample, σ′(·) represents the sigmoid function, σ′(y n2 ) represents the predicted probability of the n2th sample, n tan Indicates the number of training samples for the BCE loss function.
[0137] The total loss function is defined as follows:
[0138]
[0139] Among them, λ1, λ2, and λ3 represent the regularization term coefficients respectively.
[0140] Use Adam gradient descent to update the model parameters and iteratively train the model until the model loss reaches the threshold condition to complete the model training.
[0141] Beneficial effects of the present invention: The method of the present invention constructs a Mongolian medicine prescription recommendation model based on multi-graph convolution fusion Transformer, designs feature coding to introduce drug properties and medication time, combines symptom information, constructs multiple relationship graphs and uses graph convolution to capture features, and fuses to obtain a comprehensive representation of drugs and symptoms, thereby recommending drugs. The method of the present invention analyzes the unique "taste, property, strength and efficacy" characteristics of Mongolian medicine, the "property and taste prescription" prescription principle and the "medication by time" medication method, and specifically encodes and processes the prescription process. A special loss function is designed to simulate the Mongolian medicine prescription process, and the drug recommendation problem is converted into a drug recommendation and combination problem. In addition, an in-depth study is conducted on the Mongolian medicine prescription principle, and a special regularization is designed to simulate the prescription process, and the entire scheme is changed from a simple drug recommendation to a drug recommendation and drug combination, making it more in line with the Mongolian medicine theoretical system and clinical practice. BRIEF DESCRIPTION OF THE DRAWINGS
[0142] Figure 1 This is a flowchart of a Mongolian medicine prescription recommendation method based on multi-graph convolution fusion of the present invention.
[0143] Figure 2 This is a schematic diagram of the initial coding of the Mongolian medicine "Clove" in an embodiment of the present invention.
[0144] Figure 3 This is a schematic diagram of the coding of the opposing properties and flavor characteristics of the Mongolian medicine "clove" in an embodiment of the present invention. DETAILED DESCRIPTION
[0145] The method of the present invention is further described below in conjunction with the accompanying drawings and embodiments.
[0146] like Figure 1As shown, a flow chart of a Mongolian medicine prescription recommendation method based on multi-graph convolution fusion of the present invention, the specific steps are as follows:
[0147] S1. Construct a node feature construction module to initialize the encoding of drug nodes, symptom nodes, and syndrome nodes, and use the Transformer encoder to enhance their features, and finally use the autoencoder to keep the dimensions of various nodes consistent;
[0148] S2, building a drug representation module, which is used to construct drug-drug graphs and symptom-drug graphs, extract drug-drug relationships and symptom-drug relationships through GCN, and fuse the obtained features to obtain the final comprehensive drug representation;
[0149] S3, build a symptom representation module, which is used to construct symptom-symptom graphs and symptom-syndrome graphs, extract symptom-symptom relationships and symptom-syndrome relationships through GCN, and fuse the obtained features to obtain the final comprehensive symptom representation;
[0150] S4. Based on steps S1-S3, a Mongolian medicine prescription recommendation model based on multi-graph convolutional fusion Transformer is constructed, and the training set data is input for model training;
[0151] Figure 1 The Mongolian medicine prescription recommendation model framework is also shown, which specifically includes: node feature construction module, drug representation module, symptom representation module; the training set data includes: patient symptoms and severity, collected from previous patient data;
[0152] S5. For patients waiting for treatment, their symptoms and their severity are input into the Mongolian medicine prescription recommendation model trained in step S4 to make prescription predictions and complete prescription recommendations.
[0153] In this embodiment, the step S1 is specifically as follows:
[0154] S11, initial coding construction of drug nodes;
[0155] Define drug node h i ,Each Mongolian medicine node includes: nature and taste characteristics, symptom characteristics and time characteristics, that is,
[0156] in, Represents drug node h i The flavor characteristics of Represents drug node h i The syndrome characteristic coding, Represents drug node h i The time characteristic coding of the drug characteristic coding is as follows:
[0157] (1) Coding of sexual and flavor characteristics;
[0158] The classic concepts of "taste, nature, force and effect" in Mongolian medicine include six flavors, eight properties, two forces and seventeen effects. According to the clinical experience of Mongolian medicine, the description of six flavors and seventeen effects is basically involved for drugs, and the nature and taste characteristics of drug nodes are standardized as "sweet, sour, salty, bitter, pungent, astringent, soft, heavy, warm, greasy, solid, cold, dull, cool, harmonious, thin, dry, light, hot, light, sharp, astringent, and moving". There are 23 properties in total, and Mongolian medicinal materials are coded according to these 23 properties.
[0159] Among them, for the descriptions of "slightly bitter", "bitter", and "extremely bitter", use 2 -1 , 2 0 , 2 1 Use 1 and 0 to represent "yes" and "no".
[0160] For Mongolian medicine coding, this embodiment introduces syndrome characteristics and time characteristics, which are different from the existing Chinese medicine coding. By introducing syndrome characteristics, the model can better learn the therapeutic relationship between syndromes and drugs, so as to achieve the effect of predicting appropriate therapeutic drugs for specified syndromes. By introducing time characteristics, the Mongolian medicine method of "taking medicine according to the time" can be directly reflected without the need to establish a new graph relationship, which reduces the complexity of the model.
[0161] (2) Syndrome characteristic coding;
[0162] For the symptom characteristics of Mongolian medicine, the functions and indications of the medicine are found, and the syndrome treated by the medicine is obtained. Each syndrome has its own independent one-hot code, and the initial code of the symptom characteristics of each Mongolian medicine is obtained.
[0163] (3) Temporal feature coding;
[0164] For the time characteristics of Mongolian medicine, the time feature code is initialized to {0,0,0,0}, which represents the four time points of morning, noon, evening and before bedtime respectively. Then, based on the existing Mongolian medical records, the number of times each medicine is used at the four time points of morning, noon, evening and before bedtime is counted. After that, the statistical values are normalized to obtain the code of the time characteristics of each Mongolian medicine.
[0165] like Figure 2As shown in the figure, the initial coding diagram of the Mongolian medicine "Dingxiang". For the drug "Dingxiang", its nature and flavor are "spicy, slightly bitter, heavy, greasy, warm, and solid", so according to the above encoding method, the nature and flavor characteristics of the drug "Dingxiang" can be encoded as {0,0,0,0.5,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0}; the main syndrome treated by the drug "Dingxiang" is "He Yi", so according to the above encoding method, the syndrome characteristics of the drug "Dingxiang" can be encoded as {0,…,1,…,0}; the drug "Dingxiang" only appears in the morning in the existing Mongolian medical records, so according to the above encoding method, the time characteristics of the drug "Dingxiang" can be encoded as {1,0,0,0}. By combining the nature and taste characteristic coding, syndrome characteristic coding and time characteristic coding of the drug “clove”, we can get the initial coding of the drug “clove” {0,0,0,0.5,1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0;0,…,1,…,0;1,0,0,0}.
[0166] S12, initial coding construction of symptom nodes;
[0167] Defining Symptom Nodes i , one-hot encode each symptom, and construct the symptom-drug relationship matrix HS, where each row represents a symptom and each column represents a drug. Based on external medical knowledge, the therapeutic relationship between drugs and symptoms is obtained. If a symptom i can be treated by drug j, then HS ij =1.
[0168] S13, initial coding construction of syndrome nodes;
[0169] Define syndrome node c i , one-hot encoding is performed for each syndrome, and a syndrome-symptom relationship matrix SC is constructed. Each row in the matrix represents a syndrome, and each column represents a symptom. Based on external medical knowledge, the inclusion relationship between syndromes and symptoms is obtained. If a syndrome i contains symptom j, then SC ij =1.
[0170] S14, node feature enhancement;
[0171] Based on steps S11-S13, after the initial codes of the three nodes are obtained, they are transmitted to the encoder of the Transformer. The features of the initial codes are enhanced through the multi-head self-attention mechanism. The expression is as follows:
[0172] X (L) =Encoder(X)#(1)
[0173] Among them, X represents the input feature vector sequence, that is, the initial encoding sequence of three node features, X (L) represents the output after L layers of encoders, Encoder(·) represents the Transformer encoder process, in which the most critical step is to calculate the attention weight A, which is expressed as follows:
[0174]
[0175] Among them, Q, K, and V represent the three parameter matrices Query, Key, and Value for calculating attention respectively; d k represents the dimension of the parameter matrix and T represents the transpose of the matrix.
[0176] Different types of nodes have different dimensions, and the symptom feature encoding and syndrome feature encoding are highly sparse. In this case, an autoencoder is used to reduce the dimension of all nodes to the same dimension, and the number of dimensions is set to 30.
[0177] Assume that the input node represents X, and the encoder maps the input data to the hidden layer representation H, which is transformed by the activation function. The expression is as follows:
[0178] H=σ(W e X+b e )#(3)
[0179] Among them, W e represents the weight of the encoder, b e represents the bias, and σ represents the activation function ReLU.
[0180] The representation H of the hidden layer is mapped back to the same space as the input data by the decoder to reconstruct the original data, as follows:
[0181] X′=σ(W d H+b d )#(4)
[0182] Among them, W d represents the weight of the decoder, b d represents the bias, and X′ represents the reconstructed data.
[0183] The goal of the autoencoder is to make the gap between input and output as small as possible. The corresponding loss function expression is as follows:
[0184]
[0185] Among them, N t Indicates the number of training samples for the loss function, X n1 represents the n1th input data, X′ n1 Indicates the corresponding n1th reconstructed data;
[0186] Finally, the H output by the middle hidden layer is used as the final code of each type of node after dimensionality reduction, and the code of each type of node is updated.
[0187] In this embodiment, step S2 is specifically as follows:
[0188] S21, relationship diagram construction;
[0189] Define drug-drug graph G1 = {V1, E1};
[0190] Where V1={h1,h2,…,h nh} represents the node set of graph G1, E1 represents the edge set between nodes in graph G1; h i Represents the Mongolian medicine node, and nh represents the number of Mongolian medicines, that is, the number of all Mongolian medicine types.
[0191] Cosine similarity is used to represent the similarity between drug i and drug j. For two drugs i and j, their drug node encoding is h i =[h i1 ,…,h i30 ] and h j =[h j1 ,…,h j30 ], the similarity of the drug is the drug node code h i With h j The cosine value between is calculated as follows:
[0192]
[0193] Among them, k represents the kth dimension.
[0194] Encoding of opposing properties and flavors of drug nodes The eight pairs of opposite natures and flavors are represented as "soft / astringent, heavy / light, warm / cool, solid / moving, greasy / light, dull / sharp, cold / hot, and mild / light". The descriptions of "extremely soft", "soft", "slightly soft", "slightly astringent", "astringent", and "extremely astringent" are expressed as -2. 1 , -2 0 , -2 -1 , 2 -1 , 2 0 , 2 1 Use 0 to represent "none".
[0195] like Figure 3As shown in the figure, the coding diagram of the mutually opposing properties and flavors of the drug "clove". For the drug "clove", its properties and flavors are "spicy, slightly bitter, heavy, greasy, warm, and solid". After screening according to the summarized 8 pairs of properties and flavors with opposing relationships, it can be obtained that "heavy, greasy, warm, and solid" have an opposing relationship in its properties and flavors. Therefore, according to the above method, the coding of the mutually opposing properties and flavors of the drug "clove" can be obtained as {0,1,1,1,1,0,0,0}.
[0196] For two drugs i and j, the opposite nature and taste characteristics of their drug nodes are used to encode and The cosine similarity between To indicate adverse reactions between drugs.
[0197] The edge weight is calculated according to formula (7), and the thresholds θ1 and θ2 are defined. The edge weight E is determined according to the thresholds. ij , the expression is as follows:
[0198]
[0199] Among them, θ1 and θ2 represent the thresholds for the similarity of drug node encoding and the opposing taste feature encoding, respectively.
[0200] Define symptom-drug graph G2 = {V2, E2}.
[0201] Where V2 = {V h ,V s} represents the node set of graph G2, E2 represents the edge set between nodes in graph G2; V h =V1={h1,h2,…,h nh} represents the Mongolian medicine node set, V s ={s1,s2,…,s ns} represents the symptom node set, and ns represents the number of symptom nodes, that is, the number of all symptom types.
[0202] Finally, based on the symptom-drug relationship matrix HS constructed in step S12, edge connections between symptom nodes and drug nodes are established; that is, if HS ij =1, an edge connection is established between the corresponding drug node and symptom node.
[0203] S22, relationship diagram learning;
[0204] For the drug-drug graph G1, it first passes through the embedding layer, and then uses GCN to perform graph convolution learning to obtain drug relationship features; the process expression of GCN is as follows:
[0205]
[0206] in, represents the feature matrix of the drug node at the lth layer, σ represents the activation function ReLU, represents the adjacency matrix of G1 with self-loops added, A h represents the adjacency matrix of G1, I represents the identity matrix, represents the degree matrix of the drug-drug graph G1, Represents the weight matrix of the lth layer; the output of the 3rd layer GCN is used as the drug relationship feature of the drug-drug graph G1
[0207] For the drug-symptom graph G2, it first passes through the embedding layer and then performs graph convolution on it using H-GCN to obtain the drug-symptom relationship features.
[0208] Among them, H-GCN obtains the embedding of symptom s connected to drug h, and then uses the neighborhood aggregation embedding of symptom s to obtain the embedding of the current drug h. H-GCN pays more attention to the information aggregation of drugs; the process expression of its neighborhood aggregation is as follows:
[0209]
[0210] in, represents the drug embedding output by the l-th layer H-GCN, represents the symptom embedding output by the l-th layer H-GCN, and That is, the drug embedding and symptom embedding obtained after the embedding layer, represents the set of symptoms that interact with drug h in the drug-symptom graph G2, represents the set of drugs that interact with symptom s in the drug-symptom graph G2, Represents the weight matrix of the l-th layer H-GCN.
[0211] The GCN in the first layer of H-GCN can obtain the information of the node's neighboring nodes (one hop). For the GCN in the second layer, since all nodes have obtained the information of neighboring nodes in the first layer, the GCN in the second layer can also obtain the information of the node's two-hop nodes while aggregating the information of neighboring nodes. The more layers there are, the more information a node can aggregate, but the more noise is introduced at the same time. Moreover, equations (9) and (10) do not add their own information in the neighborhood aggregation, and the learning features of each H-GCN layer are at different levels. Therefore, equation (11) is used to fuse multiple layers of information and add the node's own information. The expression is as follows:
[0212]
[0213] Among them, y hrepresents the drug-disease relationship feature obtained after fusing l layers of H-GCN, w1 represents the weight matrix; the output y of H-GCN is h The drug-symptom relationship characteristics as the drug-symptom graph G2.
[0214] By fusing the outputs of multiple layers of H-GCN, we can obtain the drug-disease relationship feature y h , where the features pay more attention to drug node features than using GCN, and better fit the features of specific types of nodes. Multi-layer information fusion combines the features learned by each layer of H-GCN with the features of the node itself to obtain a feature representation with rich information and low noise.
[0215] Finally, the drug relationship features Drug-disease relationship characteristics h Fusion to obtain a comprehensive representation of drugs The expression is as follows:
[0216]
[0217] in, represents the set of real numbers, and SUM(·) represents the addition of corresponding elements of the matrix.
[0218] In this embodiment, step S3 is specifically as follows:
[0219] S31, relationship diagram construction;
[0220] Define symptom-symptom graph G3 = {V3, E3}.
[0221] Where V3 = V s ={s1,s2,…,s ns} represents the node set of graph G3, and E3 represents the edge set between nodes in graph G3.
[0222] Use cosine similarity CosSim(a,b) to represent the similarity between symptoms; take the symptom similarity CosSim(a,b) as the weight between nodes a and b, and define the threshold θ3; if CosSim(a,b)>θ3, then establish an edge between the two symptom nodes.
[0223] Define symptom-syndrome diagram G4 = {V4, E4}.
[0224] Where V4 = {V c ,V s} represents the node set of graph G4, E4 represents the edge set between nodes in graph G4; V c ={c1,c2,…,c n} represents the syndrome node set, V s ={s1,s2,…,s ns} represents the symptom node set, and nc represents the number of syndrome nodes.
[0225] Then, based on the syndrome-symptom relationship matrix SC constructed in step S13, edge connections between symptom nodes and syndrome nodes are established; that is, if SC ij =1, an edge connection is established between the corresponding syndrome node and symptom node.
[0226] S32, relationship diagram learning;
[0227] For the symptom-symptom graph G3, it first passes through the embedding layer, and then uses GCN to perform graph convolution learning to obtain the symptom relationship features; the process expression of GCN is as follows:
[0228]
[0229] in, represents the feature matrix of the symptom node at the lth layer, represents the adjacency matrix of G3 with self-loops added, A s represents the adjacency matrix of G3, I represents the identity matrix, represents the degree matrix of the symptom-symptom graph G3, Represents the weight matrix of the lth layer; similar to the drug-drug graph G1, the output of the third layer GCN is used as the symptom relationship feature of the symptom-symptom graph G3
[0230] For the symptom-syndrome graph G4, it first passes through the embedding layer, and then uses S-GCN to perform graph convolution on it to obtain the symptom-syndrome relationship features.
[0231] Among them, S-GCN obtains the embedding of syndrome c connected to symptom s, and then uses the neighborhood aggregation embedding of syndrome c to obtain the embedding of the current symptom s. S-GCN pays more attention to the information aggregation of symptoms; similar to the drug-symptom graph G2, its neighborhood aggregation process expression is as follows:
[0232]
[0233] in, represents the symptom embedding output by the l-th layer S-GCN, represents the syndrome embedding output by the l-th layer S-GCN, and That is, the symptom embedding and syndrome embedding obtained after the embedding layer, represents the syndrome set that interacts with symptom s in the symptom-syndrome graph G4, Indicates the symptom set that interacts with syndrome c in the symptom-syndrome diagram G4, Represents the weight matrix of the l-th layer S-GCN.
[0234] Then the multi-layer S-GCN output information is fused and the node’s own information is added. The process expression is as follows:
[0235]
[0236] Among them, z s represents the symptom-syndrome relationship feature obtained after fusing the u-layer S-GCN, w2 represents the weight matrix; the output z of S-GCN is s As the symptom-syndrome relationship characteristics of symptom-syndrome diagram G4.
[0237] Similar to the drug representation module, the symptom relationship features are finally Symptom-syndrome relationship characteristics s Fusion to obtain a comprehensive representation of symptoms The expression is as follows:
[0238]
[0239] In this embodiment, step S4 is specifically as follows:
[0240] The Mongolian medicine prescription recommendation model inputs the patient symptom set S in the training data set = {η1ss1,η2ss2,…,η M ss M}, output its corresponding prescription R = {r1, r2, r3, r4}, r j ={hh1,hh2,…,hh n},j={1,2,3,4}.
[0241] Among them, η m Indicates the severity of the mth symptom of the patient, which can be mild, moderate, or severe, m∈[1,M]; ss m represents the mth symptom of the patient, M represents the number of symptoms contained in the patient's symptom set, that is, the number of symptoms the current patient has; r j represents the recommended prescription at the jth time point, where j = {1, 2, 3, 4} corresponds to the morning, noon, evening and bedtime time points, respectively. t Represents a drug in the prescription composition at a certain time point, t∈[1,n].
[0242] First, the comprehensive representation of all symptoms is obtained through the symptom representation module s , S and f s Perform matrix multiplication to obtain the final symptom representation f based on the patient's symptoms s ′, the expression is as follows:
[0243]
[0244] Then the comprehensive representation of all drugs is obtained through the drug representation module h , the final expression of the symptoms based on the patient's symptoms is f s ′ and the comprehensive expression of all drugs f h Perform matrix multiplication to obtain the final representation of the patient's medication f h ′, the expression is as follows:
[0245]
[0246] According to the final expression of the patient's medication h 'Predict the patient's medication, the expression is as follows:
[0247] P=si moid(f h ′)#(20)
[0248] Where P = {P(h1),…,P(h nh )} represents the predicted probability of each drug, P(h i ) indicates drug h i The predicted probability of .
[0249] The predicted probability of the drug is then adjusted according to the syndrome, as follows:
[0250] A1. Obtain the correspondence between symptoms and syndromes based on the syndrome-symptom relationship matrix SC;
[0251] A2. According to the symptoms contained in the patient symptom set S {ss1,…,ss M}Determine the possible syndrome of the patient {B1,…,B N};
[0252] Here, N represents the number of possible syndromes that a patient may have.
[0253] A3. Calculate the severity score of each syndrome of the patient;
[0254] For syndrome B n , n∈[1,N], the set of symptoms it contains is {s1,…,s tt}, the corresponding severity set is {η1,…,η tt}, then syndrome B n Severity score D n The calculation expression is as follows:
[0255]
[0256] Among them, η kk Indicates symptoms kk The corresponding severity.
[0257] A4. Adjustment of drug prediction probability;
[0258] The severity scores of all syndromes {D1,…,D N} Sort by severity; the syndrome with the highest severity score is the main syndrome, and the others are ranked from severity to severity as secondary syndrome 1, secondary syndrome 2…, secondary syndrome NP-1; for syndromes with high severity scores, the prediction probability of the corresponding drug increases; according to syndrome B n Severity score D n Adjust medication h i The predicted probability is expressed as follows:
[0259] P′(h i )=P(h i )·f(D n )=P(h i )·(α·D n +β)#(22)
[0260] Among them, P′(h i ) indicates drug h i The adjusted predicted probability, f(D n ) represents the drug prediction probability adjustment function, which is a linear function that converts the severity score D n Mapped to the adjustment coefficient of the drug prediction probability. In this embodiment, the higher the severity score, the higher the corresponding drug prediction probability, where α represents the proportionality coefficient, which controls the degree of influence of the severity score on the prediction probability, and β represents the offset coefficient, which ensures that when the severity score is zero, the prediction probability also has a certain basic value.
[0261] Finally, the drugs with adjusted prediction probability TOP-K are used as the final predicted drugs, and the time of drug use is obtained according to the time characteristics in its initial coding. Drugs with the same usage time are combined into prescriptions at corresponding time points to obtain the patient prescription R = {r1, r2, r3, r4}.
[0262] In this embodiment, in step S4, the Mongolian medicine prescription recommendation model performs model training. When recommending prescriptions, the rules in the Mongolian medicine prescription problem must be followed, as follows:
[0263] The rules in the Mongolian medicine prescription problem include:
[0264] 1) The properties and flavors of the medicine should be consistent with the characteristics of the syndrome;
[0265] 2) Combinations of drugs with similar properties and flavors are more effective;
[0266] 3) There should be no combination of drugs with incompatible properties and flavors;
[0267] The formula loss function is designed based on the rules, as follows:
[0268] For rule 1), the cosine similarity between the nature and taste coding of the drug node and the input patient syndrome characteristic coding is used for simulation, and in this way the model is encouraged to find drugs with high similarity in nature and taste with the syndrome characteristics. For example, the characteristics of syndrome "He Yi" are astringent, light, cool, slight, hard, and moving, and the corresponding nature and taste of the drugs used to treat it are soft, heavy, warm, greasy, and solid; the syndrome B with the highest severity score is encoded as the corresponding nature and taste of the drugs used to treat it, and its encoding method is consistent with the nature and taste encoding method of the drugs; then the loss function expression of rule 1) is as follows:
[0269]
[0270] in, Represents drug node h i Coding of flavor characteristics.
[0271] For rule 2), the cosine similarity between drug nodes is used for simulation, which encourages the model to find drugs with high similarity between drugs. The loss function expression of rule 2) is as follows:
[0272] L2=-CosSim(h i ,h j (#(twenty four)
[0273] For rule 3), the cosine similarity between the mutually opposing property and taste feature codes of the drug nodes is used to simulate, in this way, the model is encouraged to find drugs without adverse reactions. The mutually opposing property and taste feature codes of the two drug nodes are and Then the loss function expression of rule 3) is as follows:
[0274]
[0275] The total loss function of the Mongolian medicine prescription recommendation model includes: prescription loss function and BCE (Binary CrossEntropy) loss function.
[0276] Among them, the BCE loss function is a common loss function widely used in binary classification problems. It is often used to evaluate the degree of correct and incorrect prediction of the model in different samples. The multi-label classification task can be simply understood as the superposition of multiple binary classification tasks, so the BCE loss function can also be applied to multi-label classification tasks after simple modification. The BCE loss function is used in combination with the sigmoid function, and the expression is as follows:
[0277]
[0278] Among them, y n2 Represents the true label of the n2th sample, yn2 represents the predicted label of the n2th sample, σ′(·) represents the sigmoid function, σ′(y n2 ) represents the predicted probability of the n2th sample, n tan Indicates the number of training samples for the BCE loss function.
[0279] The total loss function is defined as follows:
[0280]
[0281] Among them, λ1, λ2, and λ3 represent the regularization term coefficients respectively.
[0282] Use Adam gradient descent to update the model parameters and iteratively train the model until the model loss reaches the threshold condition to complete the model training.
[0283] In summary, the method of the present invention designs and codes Mongolian medicines, and codes them according to the characteristics of nature and taste, syndrome characteristics and time characteristics, thereby introducing the characteristics of "taste, nature, power and effect" and the method of "taking medicine according to the time" in Mongolian medicine, and introducing syndrome information. The relationship between drugs, symptoms and syndromes is established by constructing a drug-drug relationship diagram, a symptom-drug relationship diagram, a symptom-symptom relationship diagram, and a symptom-syndrome relationship diagram. The relationship between drugs and drugs is represented by a designed weight value. A GCN network that focuses on aggregating drug feature information and symptom feature information is designed for heterogeneous symptom-drug relationship diagrams and heterogeneous symptom-syndrome relationship diagrams. The method of the present invention analyzes the unique "flavor, property, strength and effect" characteristics of Mongolian medicine, the "property and taste combination" prescription principle and the "medication according to the time of day" medication method, and performs targeted encoding and processing for the prescription process, designs a special loss function to simulate the Mongolian medicine prescription process, transforms the drug recommendation problem into a drug recommendation and combination problem, conducts in-depth research on the Mongolian medicine prescription principles, designs special regularization to simulate the prescription process, and transforms the entire program from a simple drug recommendation to a drug recommendation and drug combination, making it more in line with the Mongolian medicine theoretical system and clinical practice.
[0284] Those skilled in the art will appreciate that the embodiments described herein are intended to help readers understand the principles of the present invention, and should be understood that the scope of protection of the present invention is not limited to such specific statements and embodiments. For those skilled in the art, the present invention may have various changes and variations. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of the claims of the present invention.
Claims
1. A Mongolian medicine prescription recommendation method based on multi-graph convolution fusion, the specific steps are as follows: S1. Construct a node feature construction module to initialize the encoding of drug nodes, symptom nodes, and syndrome nodes, and use the Transformer encoder to enhance their features, and finally use the autoencoder to keep the dimensions of various nodes consistent; S2, building a drug representation module, which is used to construct drug-drug graphs and symptom-drug graphs, extract drug-drug relationships and symptom-drug relationships through GCN, and fuse the obtained features to obtain the final comprehensive drug representation; S3, build a symptom representation module, which is used to construct symptom-symptom graphs and symptom-syndrome graphs, extract symptom-symptom relationships and symptom-syndrome relationships through GCN, and fuse the obtained features to obtain the final comprehensive symptom representation; S4. Based on steps S1-S3, a Mongolian medicine prescription recommendation model based on multi-graph convolutional fusion Transformer is constructed, and the training set data is input for model training; The Mongolian medicine prescription recommendation model includes: a node feature construction module, a drug representation module, and a symptom representation module; the training set data includes: patient symptoms and severity, collected from previous patient data; S5. For patients waiting for treatment, their symptoms and their severity are input into the Mongolian medicine prescription recommendation model trained in step S4 to make prescription predictions and complete prescription recommendations.
2. According to claim 1, a Mongolian medicine prescription recommendation method based on multi-graph convolution fusion is characterized in that: The step S1 is specifically as follows: S11, initial coding construction of drug nodes; Define drug node h i ,Each Mongolian medicine node includes: nature and taste characteristics, syndrome characteristics and time characteristics, that is, in, Represents drug node h i The flavor characteristics of Represents drug node h i The syndrome characteristic coding, Represents drug node h i The time characteristic coding of the drug characteristic coding is as follows: (1) Coding of sexual and flavor characteristics; The classic concepts of "flavor, nature, force and effect" in Mongolian medicine include six flavors, eight properties, two forces and seventeen effects. Based on the clinical experience of Mongolian medicine, the description of six flavors and seventeen effects is basically involved in the drug, and the nature and flavor characteristics of drug nodes are standardized as "sweet, sour, salty, bitter, pungent, astringent, soft, heavy, warm, greasy, solid, cold, dull, cool, harmonious, rare, dry, light, hot, light, sharp, astringent and moving", with a total of 23 properties, and Mongolian medicines are coded according to these 23 properties. Among them, for the descriptions of "slightly bitter", "bitter", and "extremely bitter", use 2 -1 , 2 0 , 2 1 To indicate, use 1 and 0 to indicate "yes" and "no"; (2) Syndrome characteristic coding; For the syndrome characteristics of Mongolian medicine, the functions and indications of the medicine are found, and the syndrome treated by the medicine is obtained. Each syndrome has its own independent one-hot code, and the initial code of each Mongolian medicine syndrome characteristic is obtained; (3) Temporal feature coding; For the time characteristics of Mongolian medicine, the time characteristic code is initialized to {0,0,0,0}, which represent the four time points of morning, noon, evening and before bedtime respectively. Then, according to the existing Mongolian medical records, the number of times each medicine is used at the four time points of morning, noon, evening and before bedtime is counted. After that, the statistical value is normalized to obtain the code of the time characteristic of each Mongolian medicine. S12, initial coding construction of symptom nodes; Defining Symptom Nodes i , one-hot encode each symptom, and construct the symptom-drug relationship matrix HS, where each row represents a symptom and each column represents a drug. Based on external medical knowledge, the therapeutic relationship between drugs and symptoms is obtained. If a symptom i can be treated by drug j, then HS ij =1; S13, initial coding construction of syndrome nodes; Define syndrome node c i , one-hot encoding is performed for each syndrome, and a syndrome-symptom relationship matrix SC is constructed. Each row in the matrix represents a syndrome, and each column represents a symptom. Based on external medical knowledge, the inclusion relationship between syndromes and symptoms is obtained. If a syndrome i contains symptom j, then SC ij =1; S14, node feature enhancement; Based on steps S11-S13, after the initial codes of the three nodes are obtained, they are transmitted to the encoder of the Transformer. The features of the initial codes are enhanced through the multi-head self-attention mechanism. The expression is as follows: X (L) =Encoder(X)#(1) Among them, X represents the input feature vector sequence, that is, the initial encoding sequence of three node features, X (L) represents the output after L layers of encoders, Encoder(·) represents the Transformer encoder process, in which the most critical step is to calculate the attention weight A, which is expressed as follows: Among them, Q, K, and V represent the three parameter matrices Query, Key, and Value for calculating attention respectively; d k represents the dimension of the parameter matrix, and T represents the transpose of the matrix; Different types of nodes have different dimensions, and the symptom feature encoding and syndrome feature encoding are highly sparse, so the autoencoder method is used to reduce the dimension of all nodes to the same dimension, and the number of this same dimension is set to 30; Assume that the input node represents X, and the encoder maps the input data to the hidden layer representation H, which is transformed by the activation function. The expression is as follows: H=σ(W e X+b e )#(3) Among them, W e represents the weight of the encoder, b e represents bias, σ represents the activation function ReLU; The representation H of the hidden layer is mapped back to the same space as the input data by the decoder to reconstruct the original data, as follows: X ′ =σ(W d H+b d )#(4) Among them, W d represents the weight of the decoder, b d represents the bias, X ′ Represents reconstructed data; The goal of the autoencoder is to make the gap between input and output as small as possible. The corresponding loss function expression is as follows: Among them, N t Indicates the number of training samples for the loss function, X n1 represents the n1th input data, X′ n1 Indicates the corresponding n1th reconstructed data; Finally, the H output by the middle hidden layer is used as the final code of each type of node after dimensionality reduction, and the code of each type of node is updated.
3. According to the method for recommending Mongolian medicine prescriptions based on multi-graph convolution fusion according to claim 1, it is characterized in that: The step S2 is specifically as follows: S21, relationship diagram construction; Define drug-drug graph G1 = {V1, E1}; Where V1={h1,h2,…,h nh } represents the node set of graph G1, E1 represents the edge set between nodes in graph G1; h i represents a Mongolian medicine node, and nh represents the number of Mongolian medicines, that is, the number of all Mongolian medicine types; Cosine similarity is used to represent the similarity between drug i and drug j. For two drugs i and j, their drug node encoding is h i =[h i1 ,…,h i30 ] and h j =[h j1 ,…,h j30 ], the similarity of the drug is the drug node code h i With h j The cosine value between is calculated as follows: Among them, k represents the kth dimension; For drug nodes, the opposite nature and taste feature encoding h i A , among which 8 pairs of opposite nature and flavor are expressed as "soft / astringent, heavy / light, warm / cool, solid / moving, greasy / light, dull / sharp, cold / hot, and mild / light". For the descriptions of "extremely soft", "soft", "slightly soft", "slightly astringent", "astringent", and "extremely astringent", -2 is used. 1 , -2 0 , -2 -1 , 2 -1 , 2 0 , 2 1 Use 0 to represent "none"; For two drugs i and j, the opposite nature and taste characteristics of their drug nodes are used to encode and The cosine similarity between To indicate adverse reactions between drugs; The edge weight is calculated according to formula (7), and the thresholds θ1 and θ2 are defined. The edge weight E is determined according to the thresholds. ij , the expression is as follows: Among them, θ1 and θ2 represent the thresholds for the similarity between drug node encoding and the opposing flavor feature encoding, respectively; define symptom-drug graph G2 = {V2, E2}; Where V2 = {V h ,V s } represents the node set of graph G2, V2 represents the edge set between nodes in graph G2; V h =V1={h1,h2,…,h nh } represents the Mongolian medicine node set, V s ={s1,s2,…,s ns } represents the symptom node set, ns represents the number of symptom nodes, that is, the number of all symptom types; Finally, based on the symptom-drug relationship matrix HS constructed in step S12, edge connections between symptom nodes and drug nodes are established; that is, if HS ij =1, an edge connection is established between the corresponding drug node and symptom node; S22, relationship diagram learning; For the drug-drug graph G1, it first passes through the embedding layer, and then uses GCN to perform graph convolution learning to obtain drug relationship features; the process expression of GCN is as follows: in, represents the feature matrix of the drug node at the lth layer, σ represents the activation function ReLU, represents the adjacency matrix of G1 with self-loops added, A h represents the adjacency matrix of G1, I represents the identity matrix, represents the degree matrix of the drug-drug graph G1, Represents the weight matrix of the lth layer; the output of the 3rd layer GCN is used as the drug relationship feature of the drug-drug graph G1 For the drug-symptom graph G2, it first passes through the embedding layer, and then uses H-GCN to perform graph convolution on it to obtain the drug-symptom relationship features; Among them, H-GCN obtains the embedding of symptom s connected to drug h, and then uses the neighborhood aggregation embedding of symptom s to obtain the embedding of the current drug h; the process expression of its neighborhood aggregation is as follows: in, represents the drug embedding output by the l-th layer H-GCN, represents the symptom embedding output by the l-th layer H-GCN, and That is, the drug embedding and symptom embedding obtained after the embedding layer, represents the set of symptoms that interact with drug h in the drug-symptom graph G2, represents the set of drugs that interact with symptom s in the drug-symptom graph G2, Represents the weight matrix of the l-th layer H-GCN; Then, multiple layers of information are fused and the node information itself is added. The expression is as follows: Among them, y h represents the drug-disease relationship feature obtained after fusing l layers of H-GCN, w1 represents the weight matrix; the output y of H-GCN is h As the drug-symptom relationship characteristics of the drug-symptom graph G2; Finally, the drug relationship features Drug-disease relationship characteristics h Fusion to obtain a comprehensive representation of drugs The expression is as follows: in, represents the set of real numbers, and SUM(·) represents the addition of corresponding elements of the matrix.
4. The Mongolian medicine prescription recommendation method based on multi-graph convolution fusion according to claim 1, characterized in that: The step S3 is specifically as follows: S31, relationship diagram construction; define symptom-symptom graph G3 = {V3, E3}; Where V3 = V s ={s1,s2,…,s ns } represents the node set of graph G3, E3 represents the edge set between nodes in graph G3; Use cosine similarity CosSim(a,b) to represent the similarity between symptoms; take the symptom similarity CosSim(a,b) as the weight between nodes a and b, and define the threshold θ3; if CosSim(a,b)>θ3, then establish an edge between the two symptom nodes; Define symptom-syndrome diagram G4 = {V4, E4}; Where V4 = {V c ,V s } represents the node set of graph G4, E4 represents the edge set between nodes in graph G4; V c ={c1,c2,…,c n } represents the syndrome node set, V s ={s1,s2,…,s ns } represents the symptom node set, nc represents the number of syndrome nodes; Then, based on the syndrome-symptom relationship matrix SC constructed in step S13, edge connections between symptom nodes and syndrome nodes are established; that is, if SC ij =1, an edge connection is established between the corresponding syndrome node and symptom node; S32, relationship diagram learning; For the symptom-symptom graph G3, it first passes through the embedding layer, and then uses GCN to perform graph convolution learning to obtain the symptom relationship features; the process expression of GCN is as follows: in, represents the feature matrix of the symptom node at the lth layer, represents the adjacency matrix of G3 with self-loops added, A s represents the adjacency matrix of G3, I represents the identity matrix, represents the degree matrix of the symptom-symptom graph G3, Represents the weight matrix of the lth layer; similar to the drug-drug graph G1, the output of the third layer GCN is used as the symptom relationship feature of the symptom-symptom graph G3 For the symptom-syndrome graph G4, it first passes through the embedding layer, and then uses S-GCN to perform graph convolution on it to obtain the symptom-syndrome relationship features; Among them, S-GCN obtains the embedding of syndrome c connected to symptom s, and then uses the neighborhood aggregation embedding of syndrome c to obtain the embedding of the current symptom s; similar to the drug-symptom graph G2, the process expression of its neighborhood aggregation is as follows: in, represents the symptom embedding output by the l-th layer S-GCN, represents the syndrome embedding output by the l-th layer S-GCN, and That is, the symptom embedding and syndrome embedding obtained after the embedding layer, represents the syndrome set that interacts with symptom s in the symptom-syndrome graph G4, Indicates the symptom set that interacts with syndrome c in the symptom-syndrome diagram G4, Represents the weight matrix of the l-th layer S-GCN; Then the multi-layer S-GCN output information is fused and the node’s own information is added. The process expression is as follows: Among them, z s represents the symptom-syndrome relationship feature obtained after fusing the u-layer S-GCN, w2 represents the weight matrix; the output z of S-GCN is s As the symptom-syndrome relationship characteristics of symptom-syndrome diagram G4; Similar to the drug representation module, the symptom relationship features are finally Symptom-syndrome relationship characteristics s Fusion to obtain a comprehensive representation of symptoms The expression is as follows:
5. The Mongolian medicine prescription recommendation method based on multi-graph convolution fusion according to claim 1, characterized in that: The step S4 is specifically as follows: The Mongolian medicine prescription recommendation model inputs the patient symptom set S in the training data set = {η1ss1,η2ss2,…,η M ss M }, output its corresponding prescription R = {r1, r2, r3, r4}, r J ={hh1,hh2,…,hh N }, j = {1, 2, 3, 4}; Among them, η M Indicates the severity of the mth symptom of the patient, which can be mild, moderate, or severe, m∈[1,M]; ss m represents the mth symptom of the patient, M represents the number of symptoms contained in the patient's symptom set, that is, the number of symptoms the current patient has; r j represents the recommended prescription at the jth time point, where j = {1, 2, 3, 4} corresponds to the morning, noon, evening and bedtime time points, respectively. t represents a drug in a prescription at a certain time point, t∈[1,n]; First, the comprehensive representation of all symptoms is obtained through the symptom representation module s , S and f s Perform matrix multiplication to obtain the final symptom representation f based on the patient's symptoms s ′ , the expression is as follows: Then the comprehensive representation of all drugs is obtained through the drug representation module h , the final expression of the symptoms based on the patient's symptoms is f s ′ A comprehensive representation of all drugs h Perform matrix multiplication to obtain the final representation of the patient's medication f h ′ , the expression is as follows: According to the final expression of the patient's medication h ′ Predict patient medications, the expression is as follows: P=simoid(f′ h )#(20) Where P = {P(h1),…,P(h nh )} represents the predicted probability of each drug, P(h i ) indicates drug h i The predicted probability of The predicted probability of the drug is then adjusted according to the syndrome, as follows: A1. Obtain the correspondence between symptoms and syndromes based on the syndrome-symptom relationship matrix SC; A2. According to the symptoms contained in the patient symptom set S {ss1,…,ss M }Determine the possible syndrome of the patient {B1,…,B N }; Among them, N represents the number of possible syndromes that the patient may have; A3. Calculate the severity score of each syndrome of the patient; For syndrome B n , n∈[1,N], the set of symptoms it contains is {s1,…,s TT }, the corresponding severity set is {η1,…,η TT }, then syndrome B N Severity score D N The calculation expression is as follows: Among them, η kk Indicates symptoms kk The corresponding severity; A4. Adjustment of drug prediction probability; The severity scores of all syndromes {D1,…,D N } Sort by severity; the syndrome with the highest severity score is the main syndrome, and the others are ranked from severity to severity as secondary syndrome 1, secondary syndrome 2…, secondary syndrome NP-1; for syndromes with high severity scores, the prediction probability of the corresponding drug increases; according to syndrome B n Severity score D n Adjust medication h i The predicted probability is expressed as follows: P ′ (h i )=P(h i )·f(D n )=P(h i )·(α·D n +β)#(22) Among them, P ′ (h i ) indicates drug h i The adjusted predicted probability, f(D n ) represents the drug prediction probability adjustment function, which is a linear function that converts the severity score D n Mapped to the adjustment coefficient of drug prediction probability; α represents the proportional coefficient, and β represents the offset coefficient; Finally, the drugs with adjusted prediction probability TOP-K are used as the final predicted drugs, and the time of drug use is obtained according to the time characteristics in its initial coding. Drugs with the same usage time are combined into prescriptions at corresponding time points to obtain the patient prescription R = {r1, r2, r3, r4}.
6. The Mongolian medicine prescription recommendation method based on multi-graph convolution fusion according to claim 1, characterized in that: In step S4, the Mongolian medicine prescription recommendation model is trained to recommend prescriptions according to the rules of the Mongolian medicine prescription problem, which are as follows: The rules in the Mongolian medicine prescription problem include: 1) The properties and flavors of the medicine should be consistent with the characteristics of the syndrome; 2) Combinations of drugs with similar properties and flavors are more effective; 3) There should be no combination of drugs with incompatible properties and flavors; The formula loss function is designed based on the rules, as follows: For rule 1), the cosine similarity between the nature and taste coding of the drug node and the input patient syndrome characteristic coding is used to simulate, and the syndrome B with the highest severity score is encoded as the corresponding nature and taste of the drug that treats it. The encoding method is consistent with the nature and taste encoding method of the drug; then the loss function expression of rule 1) is as follows: in, Represents drug node h i The encoding of sexual and flavor characteristics; For rule 2), the cosine similarity between drug nodes is used for simulation, and the loss function expression of rule 2) is as follows: L2=-CosSim(h i ,h j )#(24) For rule 3), the cosine similarity between the mutually opposing flavor feature codes of the drug nodes is used for simulation. The mutually opposing flavor feature codes of the two drug nodes are and Then the loss function expression of rule 3) is as follows: The total loss function of the Mongolian medicine prescription recommendation model includes: prescription loss function and BCE loss function; Among them, the BCE loss function is used in combination with the sigmoid function, and the expression is as follows: Among them, y n2 Represents the true label of the n2th sample, y n2 represents the predicted label of the n2th sample, σ ′ (·) represents the sigmoid function, σ ′ (y n2 ) represents the predicted probability of the n2th sample, n tan Indicates the number of training samples for the BCE loss function; The total loss function is defined as follows: Among them, λ1, λ2, and λ3 represent the regularization term coefficients respectively; Use Adam gradient descent to update the model parameters and iteratively train the model until the model loss reaches the threshold condition to complete the model training.
Citation Information
Patent Citations
Traditional Chinese medicine prescription recommendation method and system based on latent semantic model
CN111477295A
Graph neural network traditional Chinese medicine recommendation method based on syndrome information
CN115171842A
Drug recommendation method and system based on historical drugs and dual-granularity fusion network
CN118506965A
Artificial intelligence-based method and apparatus for determining drug feature information
WO2023134061A1
Cited By
Knowledge graph-based drug recommendation information acquisition method and device, and medium
CN121528413A