A mongolian medicine prescription recommendation method based on multi-graph convolution fusion

By employing a multi-graph convolutional fusion method for recommending Mongolian medicine prescriptions, a relationship graph of drug-drug, symptom-drug, symptom-symptom, and symptom-syndrome is constructed. Combining the principles of Mongolian medicine regarding the properties and flavors of prescriptions and the timing of medication, this method solves the problem of inaccurate drug combination recommendations in existing technologies and achieves more personalized drug combination recommendations that are consistent with Mongolian medicine theory.

CN119274739BActive Publication Date: 2026-02-06UNIV OF ELECTRONICS SCI & TECH OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411456595.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2026-02-06
Estimated Expiration
2044-10-18

AI Technical Summary

Technical Problem

Existing technologies fail to fully consider the principles of "property and flavor combination" and "medication according to time" in Mongolian medicine when recommending traditional Chinese medicine, resulting in inaccurate drug combination recommendations and a lack of in-depth modeling of syndrome information, which affects the recommendation effect.

Method used

A multi-graph convolutional fusion method is used to construct drug-drug, symptom-drug, symptom-symptom, and symptom-syndrome relationship graphs. Features are captured by GCN and Transformer encoders, and drug recommendations are made in combination with syndrome information. Feature encoding is designed to incorporate drug properties and medication time, and a comprehensive representation of drugs and symptoms is integrated.

Benefits of technology

It improves the accuracy of Mongolian medicine prescription recommendations, conforms to the Mongolian medicine theoretical system, and can make personalized drug combination recommendations based on syndrome characteristics and time characteristics, thus enhancing the scientific nature and clinical applicability of the recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119274739B_ABST
    Figure CN119274739B_ABST
Patent Text Reader

Abstract

The application discloses a Mongolian medicine prescription recommendation method based on multi-graph convolution fusion, and relates to the technical field of medicine, in particular to a Mongolian medicine prescription recommendation method based on multi-graph convolution fusion. The method comprises the following steps: constructing a Mongolian medicine prescription recommendation model based on multi-graph convolution fusion Transformer, designing feature coding to introduce drug properties and medication time, combining syndrome information, constructing multiple relationship graphs, using graph convolution to capture features, fusing comprehensive representations of drugs and symptoms, and then performing drug recommendation. The method is characterized in that the unique drug 'taste, nature and effect' characteristics, 'nature and taste formula' prescription principles and'medication at different times' medication methods of Mongolian medicine are analyzed, coding and processing are performed accordingly, a special loss function is designed for the prescription process to simulate the Mongolian prescription process, the drug recommendation problem is converted into a drug recommendation and combination problem, and special regularization is designed to simulate the prescription process based on in-depth research on the Mongolian prescription principles, so that the whole scheme is changed from simple drug recommendation to drug recommendation and drug combination, and the method is more in line with the Mongolian theoretical system and clinical practice.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of Mongolian medicine prescription recommendation, specifically relating to a Mongolian medicine prescription recommendation method based on multi-graph convolutional fusion. Background Technology

[0002] Mongolian medicine, as an important component of traditional Chinese medicine, is typically formulated and used clinically under the guidance of Mongolian medical theory, through appropriate combinations to treat diseases, regulate the body, and restore health. The properties of Mongolian medicine are summarized into four categories: six flavors, eight natures, two strengths, and seventeen effects. These constitute the main basis for Mongolian medicine's disease prevention and treatment, and also the theoretical foundation for its formulation. The medicinal taste refers to six flavors: sweet, sour, salty, bitter, pungent, and astringent. The taste of a medicine is related to its effects. For example, sweetness can be used to invigorate the body, detoxify, and treat diseases such as khayi and shila. The medicinal properties refer to eight characteristics: heavy, greasy, cold, dull, light, astringent, hot, and sharp. These are the most important components among the seventeen effects. Mongolian medicine believes that medicinal properties can coordinate and regulate the imbalance of the five elements. For example, heavy and greasy properties can suppress khayi symptoms. The medicinal power refers to cold and hot medicinal power, which highly summarizes the properties of Mongolian medicinal materials. The medicinal efficacy refers to seventeen effects: gentle, heavy, warm, greasy, solid, cold, dull, cool, harmonious, thin, dry, bland, hot, light, sharp, astringent, and dynamic.

[0003] Mongolian medicine prescriptions refer to prescriptions containing two or more Mongolian medicinal materials, formulated according to the principles of "property and flavor combination" and "functional combination." "Property and flavor combination" refers to a method of combining herbs based on their main flavor, properties, and efficacy, targeting the excess, weakness, or conflicting characteristics of the ailments *Hei*, *Shiri*, and *Badagan*, with the aim of restoring their health. When formulating a prescription, attention should be paid to the synergistic effect of the herbs' flavors, properties, and efficacy; if the flavors are the same but the properties and efficacy differ, the effects of the herbs will cancel each other out. For example, pomegranate has a sour flavor and seven efficacies: hot, sharp, rough, floating, greasy, dry, and light; therefore, it belongs to the fire element and has the functions of warming the stomach, treating stomach ailments, and calming *Hei* and *Badagan*. "Functional combination" refers to a method of selecting and combining herbs based on their essential functions and the nature of the lesion. "Functional combination" is currently the most commonly used basic combination method in Mongolian medicine clinical practice. When formulating a prescription, targeted herbs are selected based on the nature and location of the lesion. For example, nutmeg and asafoetida are often used for heart disease. Furthermore, Mongolian medicine emphasizes "medication according to the time of day," focusing on the combination of prescriptions at four times: morning, noon, evening, and bedtime. In the morning, warm-natured prescriptions such as Zhenheyi and Qubadagan are generally used; at noon, cold-natured prescriptions such as Qingxila and Liangxue are used; and in the evening, prescriptions with moderate temperature and heat, such as those for drying yellow fluids and clearing the white veins, are used. Objectively modeling the unique "taste, nature, potency, and efficacy" principles of Mongolian medicine and its "medication according to the time of day" method plays a crucial role in the inheritance and objectification of Mongolian medicine as a whole.

[0004] CN115588478A discloses a traditional Chinese medicine prescription recommendation method based on group collaborative filtering, which helps doctors to associate traditional Chinese medicine with complex symptoms, provides assistance for clinical traditional Chinese medicine prescription, and further broadens the research ideas of traditional Chinese medicine recommendation, but this method only considers the relationship between symptoms and symptoms, and the relationship between symptoms and drugs, and simulates the representation of syndrome by generating symptom group embedding representation, but using symptom group embedding may have a greater impact on the final drug recommendation due to inaccurate syndrome judgment.

[0005] CN115171842A discloses a graph neural network traditional Chinese medicine recommendation method based on syndrome information, which considers the influence of syndrome information on the final traditional Chinese medicine recommendation, integrates syndrome information into the graph neural network, and improves the accuracy of traditional Chinese medicine recommendation, but this method does not consider the "nature, taste and meridian" characteristics of traditional Chinese medicine in modeling traditional Chinese medicine, and has poor interpretability.

[0006] In summary, the above-mentioned scheme only performs simple drug recommendation, and selects traditional Chinese medicine with higher scores as recommended traditional Chinese medicine according to the score function output by the model, without specific and in-depth research on the influence of traditional Chinese medicine prescription principles on drug combination. SUMMARY

[0007] To solve the above technical problems, the present application provides a Mongolian medicine prescription recommendation method based on multi-graph convolution fusion, which introduces drug nature and medication time by designing feature coding, combines syndrome information, constructs multiple relationship graphs and uses graph convolution to capture features, and fuses to obtain comprehensive representation of drugs and symptoms, and then performs drug recommendation.

[0008] The technical scheme adopted by the present application is as follows:

[0009] S1, a node feature construction module is constructed, which is used for initializing coding of drug nodes, symptom nodes and syndrome nodes, and using a Transformer encoder to strengthen the features, and finally using an autoencoder to keep the dimensions of various nodes consistent;

[0010] S2, a drug representation module is constructed, 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 representation of drugs;

[0011] S3, a symptom representation module is constructed, 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 representation of symptoms;

[0012] S4, based on steps S1-S3, a Mongolian medicine prescription recommendation model based on multi-graph convolution fusion Transformer is constructed, and training set data is input for model training;

[0013] The Mongolian medicine prescription recommendation model comprises a node feature construction module, a drug representation module, and a symptom representation module; the training set data comprises patient symptoms and severity, and patient data collected in the past;

[0014] S5, for a patient to be treated, input the symptoms and their severity into the Mongolian medicine prescription recommendation model trained in step S4 to perform prescription prediction and complete prescription recommendation.

[0015] Further, the step S1 is specifically as follows:

[0016] S11, drug node initial encoding construction;

[0017] Define the drug node h i Each Mongolian medicine drug node comprises nature and taste characteristics, syndrome characteristics, and time characteristics, i.e.

[0018] Among them, denotes the nature and taste characteristic encoding of the drug node h i , denotes the syndrome characteristic encoding of the drug node h i , denotes the time characteristic encoding of the drug node h i ; the three kinds of characteristic encodings are specifically as follows:

[0019] (1) Nature and taste characteristic encoding;

[0020] The classical concept of "taste nature power effect" in Mongolian medicine includes six tastes, eight natures, two powers, and seventeen effects. According to the experience obtained in Mongolian medicine clinical practice, the description of drugs basically involves six tastes and seventeen effects. The nature and taste characteristics of the drug node are standardized as "sweet, sour, salty, bitter, pungent, astringent, soft, heavy, warm, greasy, solid, cold, blunt, cool, harmonious, thin, dry, light, hot, light, sharp, astringent, and dynamic", a total of 23 properties. Mongolian medicine drugs are coded according to these 23 properties.

[0021] Among them, the descriptions of "slightly bitter", "bitter", and "extremely bitter" are represented by 2 -1 , 2 0 , and 2 1 , and "yes" and "no" are represented by 1 and 0.

[0022] (2) Syndrome characteristic encoding;

[0023] For the syndrome characteristics of Mongolian medicine, the function and indication of the medicine are found, the syndromes treated by the medicine are obtained, each syndrome has its own independent one-hot encoding, and then the initial encoding of each Mongolian medicine syndrome characteristics is obtained.

[0024] (3) Time feature encoding;

[0025] For the time characteristics of Mongolian medicine, the time feature encoding is initialized as {0, 0, 0, 0}, representing four time points of morning, noon, evening and bedtime respectively. According to the existing Mongolian medical case data, the number of times each medicine is used in the morning, noon, evening and bedtime is counted, and then the statistical value is normalized to obtain the encoding of each Mongolian medicine time feature.

[0026] S12, initial encoding construction of symptom node;

[0027] Define the symptom node s i , one-hot encoding is performed for each symptom, and a symptom-drug relationship matrix HS is constructed, each row of the matrix represents a symptom, and each column represents a drug. According to external medical knowledge, the treatment relationship between drugs and symptoms is obtained. If a symptom i can be treated by a drug j, then HS ij = 1.

[0028] S13, initial encoding construction of syndrome node;

[0029] Define the syndrome node c i , one-hot encoding is performed for each syndrome, and a syndrome-symptom relationship matrix SC is constructed, each row of the matrix represents a syndrome, and each column represents a symptom. According to external medical knowledge, the inclusion relationship between syndromes and symptoms is obtained. If a syndrome i contains a symptom j, then SC ij = 1.

[0030] S14, node feature enhancement;

[0031] Based on steps S11-S13, the initial encoding of the three nodes is obtained and fed into the encoder of the Transformer. Through the multi-head self-attention mechanism, the initial encoding is enhanced in features, and the expression is as follows:

[0032] X (L) = Encoder(X) (1)

[0033] Where X represents the input feature vector sequence, i.e. the initial encoding sequence of the three node features, X (L) represents the output after L-layer encoder, and Encoder(·) represents the Transformer encoder process, in which the most critical step is to calculate the attention weight A, and the expression is as follows:

[0034]

[0035] Where Q, K, and V represent the three parameter matrices Query, Key, and Value for calculating attention, respectively; d k The dimension of the parameter matrix is ​​represented by T, and the transpose of the matrix is ​​represented by T.

[0036] Since different types of nodes have different dimensions, and the symptom feature encoding and syndrome feature encoding are highly sparse, an autoencoder is used to reduce the dimensionality of all nodes to the same dimension, and this same dimension is set to 30.

[0037] Let the input node be represented as X. The encoder maps the input data to the hidden layer representation H and transforms it using an activation function, as shown in the following expression:

[0038] H=σ(W e X+b e (3)

[0039] Among them, W e The weights of the encoder, b e σ represents the bias, and σ represents the ReLU activation function.

[0040] The hidden layer representation H is mapped back to the same space as the input data by the decoder to reconstruct the original data, as shown in the following expression:

[0041] X′=σ(W d H+b d (4)

[0042] Among them, W d b represents the weights of the decoder. d X represents the bias, and X′ represents the reconstructed data.

[0043] The goal of an autoencoder is to minimize the difference between the input and output, and the corresponding loss function is expressed as follows:

[0044]

[0045] Where, N t X represents the number of training samples in the loss function. n1 Let X' represent the n1th input data. n1 This represents the n1th reconstructed data.

[0046] Finally, the output H of the intermediate hidden layer is used as the final encoding of each type of node after dimensionality reduction, and the encoding of each type of node is updated.

[0047] Furthermore, step S2 is specifically as follows:

[0048] S21. Relationship diagram construction;

[0049] Define the drug-drug diagram G1 = {V1, E1};

[0050] Where, V1={h1,h2,…,h nh} represents the set of nodes in graph G1, and E1 represents the set of edges between nodes in graph G1; h i The node represents a Mongolian medicine, and nh represents the quantity of Mongolian medicines, i.e., the total number of all types of Mongolian medicines.

[0051] Cosine similarity (CosSim(i,j)) 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 drugs is the drug node encoding h. i with h j The cosine value between them is calculated using the following expression:

[0052]

[0053] Where k represents the k-th dimension.

[0054] Encoding the opposing flavor and odor characteristics of drug nodes The eight pairs of opposing flavors are represented as "soft / astringent, heavy / light, warm / cool, solid / moving, greasy / bland, dull / sharp, cold / hot, and harmonious / light." The descriptions of "extremely soft," "soft," "slightly soft," "slightly astringent," "astringent," and "extremely astringent" use -2. 1 -2 0 -2 -1 2 -1 2 0 2 1 The value is represented by 0 for "nothing".

[0055] For two drugs i and j, their flavor and odor characteristics are encoded using the opposing properties of their drug nodes. and Cosine similarity between This is used to indicate adverse reactions between drugs.

[0056] The weights of the edges are calculated according to equation (7), and thresholds θ1 and θ2 are defined. The edge weight E is determined based on these thresholds. ij The expression is as follows:

[0057]

[0058] Wherein, θ1 and θ2 represent the thresholds for the similarity of drug node encoding and the encoding of mutually opposing flavor and odor features, respectively.

[0059] Define the symptom-drug diagram G2 = {V2, E2}.

[0060] Where, V2={V h V s} represents the set of nodes in graph G2, and E2 represents the set of edges between nodes in graph G2; V h =V1={h1,h2,…,h nh} represents the set of Mongolian medicine drug nodes, V s ={s1,s2,…,s ns} represents the set of symptom nodes, and ns represents the number of symptom nodes, i.e., the total number of symptom types.

[0061] Finally, based on the symptom-drug relationship matrix HS constructed in step S12, edge connections are established between symptom nodes and drug nodes; that is, if HS ij If the value is 1, then an edge connection is established between the corresponding drug node and symptom node.

[0062] S22, Learning about Relationship Diagrams;

[0063] For the drug-drug graph G1, it first passes through an embedding layer, and then performs graph convolution learning using GCN to obtain drug relationship features; the process expression of GCN is as follows:

[0064]

[0065] in, Let σ represent the feature matrix of the drug nodes in the l-th layer, and let σ represent the activation function ReLU. Let A represent the adjacency matrix of G1 with added self-loops. h Let G1 be the adjacency matrix, and I be the identity matrix. The degree matrix represents the drug-drug graph G1. This represents the weight matrix of the l-th 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 an embedding layer, and then H-GCN is used to perform graph convolution to obtain drug-symptom relationship features.

[0067] H-GCN obtains the embeddings of symptoms s associated with drug h, and then uses neighborhood aggregation embeddings of symptom s to obtain the embedding of the current drug h; the expression for the neighborhood aggregation process is as follows:

[0068]

[0069] wherein, denotes the drug embedding output by the l-th layer H-GCN, denotes the symptom embedding output by the l-th layer H-GCN, and i.e., the drug embedding and the symptom embedding obtained after the embedding layer, denotes the set of symptoms in the drug-symptom graph G2 that interact with the drug h, denotes the set of drugs in the drug-symptom graph G2 that interact with the symptom s, denotes the weight matrix of the l-th layer H-GCN.

[0070] Then, the multi-layer information is fused, and the node itself information is added, and the expression is as follows:

[0071]

[0072] wherein, y h denotes the drug-symptom relationship feature obtained after the l-th layer H-GCN, w1 denotes the weight matrix; the output y h of the H-GCN is taken as the drug-symptom relationship feature of the drug-symptom graph G2.

[0073] Finally, the drug relationship feature y and the drug-symptom relationship feature y h are fused to obtain the comprehensive drug representation y The expression is as follows:

[0074]

[0075] wherein, denotes the set of real numbers, and SUM(·) denotes the addition of corresponding elements of a matrix.

[0076] Further, the step S3 is specifically as follows:

[0077] S31, relationship graph construction;

[0078] The symptom-symptom graph G3 = {V3, E3} is defined.

[0079] wherein, V3 = V s = {s1, s2, …, s ns} denotes the node set of the graph G3, and E3 denotes the edge set between nodes in the graph G3.

[0080] The similarity between symptoms is represented using the cosine similarity CosSim(a, b); the symptom similarity CosSim(a, b) is taken as the weight between nodes a and b, and a threshold value θ3 is defined; if CosSim(a, b) > θ3, an edge is established between the two symptom nodes.

[0081] A symptom-syndrome graph G4 is defined as G4 = {V4, E4}.

[0082] wherein V4 = {V c ,V s} represents the node set of the graph G4, and E4 represents the edge set between nodes in the graph G4; V c ={c1,c2,…,c nc} represents the syndrome node set, and V s ={s1,s2,…,s ns} represents the symptom node set, and nc represents the number of syndrome nodes.

[0083] Then, based on the symptom-syndrome relationship matrix SC constructed in step S13, the edge connection between the symptom nodes and the syndrome nodes is established; that is, if SC ij = 1, an edge connection is established between the corresponding syndrome node and symptom node.

[0084] S32, relationship graph learning;

[0085] For the symptom-symptom graph G3, first pass through the embedding layer, and then use GCN for graph convolution learning to obtain the symptom relationship features; wherein the process expression of GCN is as follows:

[0086]

[0087] wherein, represents the lth layer symptom node feature matrix, represents the adjacency matrix of G3 with a self-loop, A s represents the adjacency matrix of G3, and I represents the unit 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 3rd layer GCN is taken as the symptom relationship features of the symptom-symptom graph G3

[0088] For the symptom-syndrome graph G4, first pass through the embedding layer, and then use S-GCN for graph convolution to obtain the symptom-syndrome relationship features.

[0089] wherein S-GCN obtains the embedding of the syndrome c connected to the symptom s, and then obtains the embedding of the current symptom s by aggregating the embedding of the neighborhood of the syndrome c; similar to the drug-symptom graph G2, the process expression of the neighborhood aggregation is as follows:

[0090]

[0091]

[0092] wherein, denotes the symptom embedding output by the lth layer S-GCN, denotes the syndrome embedding output by the lth layer S-GCN, and i.e. the symptom embedding and the syndrome embedding obtained after the embedding layer, denotes the syndrome set interacting with the symptom s in the symptom-syndrome graph G4, denotes the symptom set interacting with the syndrome c in the symptom-syndrome graph G4, denotes the weight matrix of the lth layer S-GCN.

[0093] Then the output information of the multi-layer S-GCN is fused, and the node itself information is added, and the process expression is as follows:

[0094]

[0095] wherein, z s denotes the symptom-syndrome relationship feature obtained after fusing the u layer S-GCN, w2 denotes the weight matrix; the output z s of the S-GCN is taken as the symptom-syndrome relationship feature of the symptom-syndrome graph G4.

[0096] Similarly, the symptom relationship feature z and the symptom-syndrome relationship feature z s are fused to obtain the symptom comprehensive representation z The expression is as follows:

[0097]

[0098] Further, the step S4 is specifically as follows:

[0099] The Mongolian medicine prescription recommendation model inputs the symptom set S = {η1ss1,η2ss2,…,η M ss M} of the patient in the training data set, and outputs the corresponding prescription R = {r1,r2,r3,r4},r j = {hh1,hh2,…,hh n}, j = {1,2,3,4}.

[0100] wherein, η m denotes the severity of the mth symptom of the recorded patient, which has three degrees of mild, moderate and severe, m ∈ [1, M]; ss mLet r represent the m-th symptom of the patient, where M represents the number of symptoms contained in the patient's symptom set, i.e., the number of symptoms the patient currently has; j This represents the recommended prescription at the j-th time point, where j = {1, 2, 3, 4} corresponds to the time points of morning, noon, evening, and bedtime, respectively. t Let t represent a drug in the prescription at a certain point in time, where t∈[1,n].

[0101] First, a comprehensive representation f of all symptoms is obtained through the symptom representation module. s , with S and f s Perform matrix multiplication to obtain the final symptom representation f based on patient symptoms. s The expression is as follows:

[0102]

[0103] Then, the comprehensive representation f of all drugs is obtained through the drug representation module. h The final representation of symptoms based on patient symptoms f s ′ and the comprehensive representation of all drugs f h Perform matrix multiplication to obtain the final representation f of the patient's medication. h The expression is as follows:

[0104]

[0105] Then, based on the patient's final response to the medication... h The expression for predicting patient medication is as follows:

[0106] P = sigmoid(f h ′) (20)

[0107] Where, P = {P(h1), ..., P(h...} nh P(h) represents the predicted probability of each drug. i ) indicates drug h i The predicted probability.

[0108] Then, adjust the predicted probability of the medication based on the symptoms, as follows:

[0109] A1. Based on the syndrome-symptom relationship matrix SC, the correspondence between symptoms and syndromes is obtained;

[0110] A2. Based on the symptoms {ss1, ..., ss} contained in the patient's symptom set S. M} Identify the patient's possible symptoms {B1,…,B NP};

[0111] Here, NP represents the number of syndromes that a patient may have.

[0112] A3, calculate the severity score of each syndrome of the patient;

[0113] For syndrome B np , np∈[1, NP], the symptom set it contains is {s1, …, s tt}, and the corresponding severity set is {η1, …, η tt}, then the severity score D np of syndrome B np is calculated as follows:

[0114]

[0115] Where η kk represents the severity of symptom s kk .

[0116] A4, adjustment of drug prediction probability;

[0117] Sort all the severity scores of the syndromes {D1, …, D NP} from large to small; the syndrome with the highest severity score is the main syndrome, and the rest are secondary syndromes 1, 2, …, NP-1 in order from large to small; for the syndromes with high severity scores, the corresponding drug prediction probability of the symptoms is increased; adjust the prediction probability of drug h np according to the severity score D np of syndrome B i , the expression is as follows:

[0118] P'(h i ) = P(h i ) · f(D np ) = P(h i ) · (α · D np + β) (22)

[0119] Where P'(h i ) represents the adjusted prediction probability of drug h i , f(D np ) represents the drug prediction probability adjustment function, which is a linear function that maps the severity score D np to the adjustment coefficient of the drug prediction probability; α represents the proportion coefficient, and β represents the offset coefficient.

[0120] Finally, the TOP-K drugs with adjusted prediction probability are used as the final predicted drugs, and the time of drug use is obtained according to the time characteristics in the initial encoding, and the drugs with the same use time are combined to form the prescription at the corresponding time point, and the patient's prescription R = {r1, r2, r3, r4} is obtained.

[0121] Furthermore, in step S4, the Mongolian medicine prescription recommendation model undergoes model training. When recommending prescriptions, it must follow the rules of Mongolian medicine prescription problems, as follows:

[0122] The rules governing Mongolian medicine prescriptions include:

[0123] 1) The properties and flavors of the medicine should match the characteristics of the syndrome;

[0124] 2) Combinations of drugs with high similarity in properties and tastes are more effective;

[0125] 3) There should be no combination of drugs that are incompatible in terms of their properties and flavors;

[0126] Based on the aforementioned rules, a combination loss function is designed as follows:

[0127] For rule 1), the cosine similarity between the drug node's flavor and the input patient syndrome characteristic code is used for simulation. The syndrome B with the highest severity score is encoded as the corresponding flavor of the drug that treats it, and its encoding method is consistent with the drug's flavor encoding method. Then the loss function expression for rule 1) is as follows:

[0128]

[0129] in, Represents drug node h i The odor and flavor characteristics are encoded.

[0130] For rule 2), using the cosine similarity between drug nodes for simulation, the loss function expression for rule 2) is as follows:

[0131] L2=-CosSim(h i ,h j ) (twenty four)

[0132] For rule 3), the cosine similarity between the mutually exclusive flavor and odor feature codes of the drug nodes is used for simulation. The mutually exclusive flavor and odor feature codes of the two drug nodes are respectively and The loss function expression for rule 3) is as follows:

[0133]

[0134] The total loss function of the Mongolian medicine prescription recommendation model includes: the prescription loss function and the BCE loss function.

[0135] The BCE loss function is used in combination with the sigmoid function, as shown in the following expression:

[0136]

[0137] wherein, y n2 represents the true label of the n2th sample, represents the predicted label of the n2th sample, and σ'(·) represents a sigmoid function, represents the predicted probability of the n2th sample, n train represents the number of training samples of the BCE loss function.

[0138] The total loss function is defined as follows:

[0139]

[0140] wherein, λ1, λ2, and λ3 represent regularization term coefficients, respectively.

[0141] The model parameters are updated using the Adam gradient descent, and the model is iteratively trained until the model loss reaches a threshold condition, and the model training is completed.

[0142] The method of the present application builds a Mongolian medicine prescription recommendation model based on multi-graph convolution fusion Transformer, designs feature coding to introduce drug properties and medication time, combines syndrome information, builds multiple relationship graphs, and uses graph convolution to capture features, fuses the comprehensive representation of drugs and symptoms, and then performs drug recommendation. The method of the present application analyzes the unique drug "taste nature power effect" characteristics of Mongolian medicine, "nature and taste formula" prescription principles and "medication at a certain time" medication methods, and specifically codes and processes the prescription process. A special loss function is designed to simulate the Mongolian prescription process, and the drug recommendation problem is converted into a drug recommendation and combination problem. In addition, the Mongolian prescription principle is studied in depth, and a special regularization is designed to simulate the prescription process. The entire scheme is changed from a simple drug recommendation to a drug recommendation and drug combination, making it more consistent with the Mongolian theoretical system and clinical practice. BRIEF DESCRIPTION OF DRAWINGS

[0143] Figure 1 The flowchart of the Mongolian medicine prescription recommendation method based on multi-graph convolution fusion of the present application.

[0144] Figure 2 The initial coding schematic diagram of the Mongolian medicine "clove" in the embodiment of the present application.

[0145] Figure 3 The mutually opposite nature and taste feature coding schematic diagram of the Mongolian medicine "clove" in the embodiment of the present application. DETAILED DESCRIPTION

[0146] The method of the present application will be further described below in conjunction with the drawings and examples.

[0147] As Figure 1As shown, a Mongolian medicine prescription recommendation method based on multi-graph convolution fusion of the present application is shown in the flow chart, and the specific steps are as follows:

[0148] S1, a node feature construction module is constructed, which is used for initializing coding of drug nodes, symptom nodes and syndrome nodes, using a Transformer encoder to strengthen the features, and finally using an autoencoder to keep the dimensions of various nodes consistent;

[0149] S2, a drug representation module is constructed, which is used for constructing drug-drug graphs and symptom-drug graphs, extracting drug-drug relationships and symptom-drug relationships through GCN, and fusing the obtained features to obtain the final comprehensive representation of drugs;

[0150] S3, a symptom representation module is constructed, which is used for constructing symptom-symptom graphs and symptom-syndrome graphs, extracting symptom-symptom relationships and symptom-syndrome relationships through GCN, and fusing the obtained features to obtain the final comprehensive representation of symptoms;

[0151] S4, based on steps S1-S3, a Mongolian medicine prescription recommendation model based on multi-graph convolution fusion Transformer is constructed, and training set data is input for model training;

[0152] Figure 1 The Mongolian medicine prescription recommendation model framework is also shown, which specifically includes a node feature construction module, a drug representation module, and a symptom representation module; the training set data includes patient symptoms and severity, and is collected from past patient data;

[0153] S5, for a patient to be treated, input the symptoms and their severity into the Mongolian medicine prescription recommendation model trained in step S4 to perform prescription prediction and complete prescription recommendation.

[0154] In this embodiment, step S1 is specifically as follows:

[0155] S11, drug node initial coding construction;

[0156] Define the drug node h i Each Mongolian medicine drug node includes nature and taste characteristics, syndrome characteristics and time characteristics, i.e.

[0157] Wherein, represents the nature and taste feature coding of the drug node h i , represents the syndrome feature coding of the drug node h i , represents the time feature coding of the drug node h i ; the three kinds of feature coding are specifically as follows:

[0158] (1) Encoding of flavor and odor characteristics;

[0159] The classic concept of "taste, nature, power, and efficacy" in Mongolian medicine includes six tastes, eight properties, two powers, and seventeen effects. Based on clinical experience in Mongolian medicine, the descriptions of drugs basically involve the six tastes and seventeen effects. The taste and nature characteristics of drug nodes are standardized as "sweet, sour, salty, bitter, pungent, astringent, soft, heavy, warm, greasy, solid, cold, dull, cool, harmonious, thin, dry, bland, hot, light, sharp, astringent, and dynamic", totaling 23 properties. Mongolian medicine drugs are coded according to these 23 properties.

[0160] Among them, the descriptions of "slightly bitter," "bitter," and "extremely bitter" use 2. -1 2 0 2 1 The presence and absence are represented using 1 and 0, respectively.

[0161] Unlike existing TCM drug coding methods, this embodiment introduces syndrome features and time features for Mongolian medicine drug coding. By introducing syndrome features, the model can better learn the therapeutic relationship between syndromes and drugs, thereby predicting appropriate therapeutic drugs for a given syndrome. By introducing time features, the Mongolian medicine method of "administering medicine according to the time of day" can be directly reflected without needing to establish new graph relationships, reducing the model's complexity.

[0162] (2) Syndrome feature coding;

[0163] To identify the syndrome characteristics of Mongolian medicines, we can find the functions and indications of the drugs, obtain the syndromes that the drugs treat, and each syndrome has its own independent one-hot code, thus obtaining the initial code for the syndrome characteristics of each Mongolian medicine.

[0164] (3) Time feature coding;

[0165] For the time characteristics of Mongolian medicines, the time characteristic code is initialized to {0,0,0,0}, representing four time points: morning, noon, evening, and bedtime. Then, based on the existing Mongolian medicine case data, the number of times each medicine is used in the four time points is counted. After that, the statistical values ​​are normalized to obtain the code for the time characteristic of each Mongolian medicine.

[0166] like Figure 2As shown, the initial coding schematic of the Mongolian medicine "clove". For the medicine "clove", the nature and taste is "acrid, slightly bitter, heavy, greasy, warm, solid", so the coding according to the above method can obtain the nature and taste characteristic coding of the medicine "clove" as {0, 0, 0, 0.5, 1, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; The syndrome treated by the medicine "clove" is "hei", so the coding according to the above method can obtain the syndrome characteristic coding of the medicine "clove" as {0,…,1,…,0}; The medicine "clove" only appears in the morning in the existing Mongolian medical case data, so the coding according to the above method can obtain the time characteristic coding of the medicine "clove" as {1, 0, 0, 0}. The nature and taste characteristic coding, syndrome characteristic coding and time characteristic coding of the medicine "clove" are combined together, that is, the initial coding of the medicine "clove" is {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}.

[0167] S12, symptom node initial coding construction;

[0168] Definition of symptom node s i , one-hot coding is performed for each symptom, and a symptom-drug relationship matrix HS is constructed, each row of the matrix represents a symptom, and each column represents a drug. According to external medical knowledge, the treatment relationship between drugs and symptoms is obtained. If a symptom i can be treated by a drug j, then HS ij = 1.

[0169] S13, syndrome node initial coding construction;

[0170] Definition of syndrome node c i , one-hot coding is performed for each syndrome, and a syndrome-symptom relationship matrix SC is constructed, each row of the matrix represents a syndrome, and each column represents a symptom. According to external medical knowledge, the inclusion relationship between syndromes and symptoms is obtained. If a syndrome i contains a symptom j, then SC ij = 1.

[0171] S14, node feature enhancement;

[0172] Based on steps S11-S13, the initial coding of the three kinds of nodes is obtained and is fed into the encoder of the Transformer. Through the multi-head self-attention mechanism, the initial coding is enhanced in features, and the expression is as follows:

[0173] X (L) = Encoder(X) (1)

[0174] Where X represents the input feature vector sequence, i.e., the initial encoding sequence of the three node features, X (L) This represents the output after passing through L layers of encoders. Encoder(·) represents the Transformer encoder process, where the most crucial step is calculating the attention weights A, expressed as follows:

[0175]

[0176] Where Q, K, and V represent the three parameter matrices Query, Key, and Value for calculating attention, respectively; d k The dimension of the parameter matrix is ​​represented by T, and the transpose of the matrix is ​​represented by T.

[0177] Since different types of nodes have different dimensions, and the symptom feature encoding and syndrome feature encoding are highly sparse, an autoencoder is used to reduce the dimensionality of all nodes to the same dimension, and this same dimension is set to 30.

[0178] Let the input node be represented as X. The encoder maps the input data to the hidden layer representation H and transforms it using an activation function, as shown in the following expression:

[0179] h=σ(W e X+b e (3)

[0180] Among them, W e b represents the encoder weights. e σ represents the bias, and σ represents the ReLU activation function.

[0181] The hidden layer representation H is mapped back to the same space as the input data by the decoder to reconstruct the original data, as shown in the following expression:

[0182] X′=σ(W d H+b d (4)

[0183] Among them, W d b represents the weights of the decoder. d X represents the bias, and X′ represents the reconstructed data.

[0184] The goal of an autoencoder is to minimize the difference between the input and output, and the corresponding loss function is expressed as follows:

[0185]

[0186] Where, N t X represents the number of training samples in the loss function. n1 Let X' represent the n1th input data. n1 This represents the n1th reconstructed data;

[0187] Finally, the H output by the intermediate hidden layer is taken as the final encoding of each class node after dimension reduction, and the encoding of each class node is updated.

[0188] In the present embodiment, the step S2 is specifically as follows:

[0189] S21, relationship graph construction;

[0190] Define drug-drug graph G1 = {V1, E1};

[0191] Wherein, 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 medicine, i.e. the number of all Mongolian medicine categories.

[0192] The cosine similarity CosSim(i, j) is used to represent the similarity between drug i and drug j. For two drugs i and j, the drug node encoding is h i = [h i1 , …, h i30 ] and h j = [h j1 , …, h j30 ], the similarity of the drug is the cosine value between the drug node encoding h i and h j , and the calculation expression is as follows:

[0193]

[0194] Wherein, k represents the kth dimension.

[0195] For the mutually opposite nature and taste feature encoding of the drug node Wherein, the 8 pairs of nature and taste with opposite relationship are represented as “soft / astringent, heavy / light, warm / cool, solid / dynamic, greasy / light, blunt / sharp, cold / hot, and / light”. Among them, the description of “extremely soft”, “soft”, “slightly soft”, “slightly astringent”, “astringent”, and “extremely astringent” are represented using -2 1 , -2 0 , -2 -1 , 2 -1 , 2 0 , 2 1 , and 0 is used to represent “none”.

[0196] As Figure 3As shown, the drug "clove" mutual opposite nature and taste characteristic code schematic diagram. For the drug "clove", its nature and taste is "Xin, slightly bitter, heavy, greasy, warm, solid", according to the summary of the 8 pairs of nature and taste screening, can get its nature and taste "heavy, greasy, warm, solid" have opposite relationship, so according to the above way to encode can get the drug "clove" mutual opposite nature and taste characteristic code for {0,1,1,1,1,0,0,0}.

[0197] For two drugs i and j, the cosine similarity between the mutual opposite nature and taste characteristic codes of their drug nodes is used to represent the adverse reactions between the drugs. and

[0198] For the weight of the edge, according to formula (7) to calculate, define threshold θ1 and θ2, according to the threshold to judge the edge weight E ij , the expression is as follows:

[0199]

[0200] Among them, θ1 and θ2 respectively represent the threshold for the similarity of drug node coding and mutual opposite nature and taste characteristic coding.

[0201] Define symptom-drug graph G2 = {V2, E2}.

[0202] Among them, 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 drug 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 categories.

[0203] Finally, based on the symptom-drug relationship matrix HS constructed in step S12, the edge connection between the symptom nodes and the drug nodes is established; that is, if HS ij = 1, the edge connection between the corresponding drug node and the symptom node is established.

[0204] S22, relationship graph learning;

[0205] For drug-drug graph G1, first pass through the embedding layer, and then use GCN for graph convolution learning to get the drug relationship features; the process expression of GCN is as follows:

[0206]

[0207] ​​wherein, denotes the drug node feature matrix of the lth layer, and σ denotes the activation function ReLU, denotes the adjacency matrix of the G1 with the added self-loop, and A h denotes the adjacency matrix of the G1, and I denotes the unit matrix, denotes the degree matrix of the drug-drug graph G1, denotes the weight matrix of the lth layer; the output of the third layer GCN is taken as the drug relationship feature of the drug-drug graph G1

[0208] For the drug-symptom graph G2, first pass through the embedding layer, and then use H-GCN for graph convolution to obtain the drug-symptom relationship feature.

[0209] wherein, H-GCN obtains the embedding of the symptom s connected with the drug h, and then obtains the embedding of the current drug h by aggregating the embedding of the neighborhood of the symptom s, and H-GCN pays more attention to the information aggregation of the drug; the process expression of the neighborhood aggregation is as follows:

[0210]

[0211]

[0212] wherein, denotes the drug embedding output by the lth layer H-GCN, denotes the symptom embedding output by the lth layer H-GCN, and namely, the drug embedding and the symptom embedding obtained after passing through the embedding layer, denotes the set of symptoms interacting with the drug h in the drug-symptom graph G2, denotes the set of drugs interacting with the symptom s in the drug-symptom graph G2, denotes the weight matrix of the lth layer H-GCN.

[0213] The GCN of the first layer of H-GCN can obtain the information of the adjacent nodes (one hop) of the node. For the GCN of the second layer, since all nodes have obtained the information of the adjacent nodes in the first layer, the GCN of the second layer can also obtain the information of the two-hop nodes of the node while aggregating the information of the adjacent nodes. The more the number of layers is, the more information the node can aggregate, but at the same time, the more noise is introduced. And formula (9), (10) does not add its own information in the neighborhood aggregation, and the learning features of each H-GCN layer are different levels. Therefore, formula (11) is used to fuse the multi-layer information and add the node's own information, and the expression is as follows:

[0214]

[0215] wherein, yh denotes the drug-symptom relationship feature after fusing the l-th layer H-GCN, w1 denotes a weight matrix; the output y of the H-GCN is h as the drug-symptom graph G2.

[0216] The drug-symptom relationship feature y can be obtained by fusing the outputs of the multi-layer H-GCN h , where the feature is more focused on the drug node feature compared with using the GCN, and better fits the features of specific types of nodes. The multi-layer information fusion combines the features learned by each layer of the H-GCN with the features of the nodes themselves, obtaining a feature representation that is rich in information and small in noise.

[0217] Finally, the drug relationship feature y and the drug-symptom relationship feature y h are fused to obtain a comprehensive drug representation y The expression is as follows:

[0218]

[0219] , where denotes the set of real numbers, and SUM(·) denotes the addition of corresponding elements of a matrix.

[0220] In this embodiment, the step S3 is specifically as follows:

[0221] S31, relationship graph construction;

[0222] Define the symptom-symptom graph G3 = {V3, E3}.

[0223] , where V3 = V s = {s1, s2,..., s ns} denotes the node set of the graph G3, and E3 denotes the edge set between nodes in the graph G3.

[0224] Use the 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 a threshold θ3; if CosSim(a, b) > θ3, a edge is established between the two symptom nodes.

[0225] Define the symptom-syndrome graph G4 = {V4, E4}.

[0226] , where V4 = {V c , V s} denotes the node set of the graph G4, and E4 denotes the edge set between nodes in the graph G4; V c = {c1, c2,..., c nc} denotes the syndrome node set, and V s = {s1, s2,..., sns} represents a symptom node set, nc represents the number of syndrome nodes.

[0227] Then, based on the syndrome-symptom relationship matrix SC constructed in step S13, the edge connection between the symptom nodes and the syndrome nodes is established; that is, if SC ij = 1, the edge connection between the corresponding syndrome node and the symptom node is established.

[0228] S32, relationship graph learning;

[0229] For the symptom-symptom graph G3, first pass through the embedding layer, and then use GCN for graph convolution learning to obtain the symptom relationship feature; wherein the process expression of GCN is as follows:

[0230]

[0231] wherein, represents the symptom node feature matrix of the lth layer, represents the adjacency matrix of G3 with self-loop, A s represents the adjacency matrix of G3, and I represents the unit 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 3rd layer GCN is taken as the symptom relationship feature of the symptom-symptom graph G3

[0232] For the symptom-syndrome graph G4, first pass through the embedding layer, and then use S-GCN for graph convolution to obtain the symptom-syndrome relationship feature.

[0233] Wherein, S-GCN obtains the embedding of the syndrome c connected with the symptom s, and then obtains the embedding of the current symptom s by using the neighborhood aggregation embedding of the syndrome c, S-GCN pays more attention to the information aggregation of the symptom; similar to the drug-symptom graph G2, the process expression of neighborhood aggregation is as follows:

[0234]

[0235] wherein, represents the symptom embedding output by the lth layer S-GCN, represents the syndrome embedding output by the lth layer S-GCN, and that is, the symptom embedding and the syndrome embedding obtained after the embedding layer, represents the set of syndromes interacting with the symptom s in the symptom-syndrome graph G4, represents the set of symptoms interacting with the syndrome c in the symptom-syndrome graph G4, represents the weight matrix of the lth layer S-GCN.

[0236] Then, the multi-layer S-GCN output information is fused and the node's own information is added. The process expression is as follows:

[0237]

[0238] Among them, z s The symptom-symptom relationship features obtained after fusing u layers of S-GCN are represented by w2, which represents the weight matrix; the output z of S-GCN is... s This serves as a characteristic of the symptom-syndrome relationship in the G4 symptom-syndrome diagram.

[0239] Similar to the drug representation module, the symptom relationship features will be finalized. Characteristics of the relationship between symptoms and syndromes z s By integrating the results, a comprehensive symptom representation can be obtained. The expression is as follows:

[0240]

[0241] In this embodiment, step S4 is specifically as follows:

[0242] The Mongolian medicine prescription recommendation model is input into the training dataset containing the patient symptom set S = {η1ss1, η2ss2, ..., η}. M ss M}, output the corresponding prescription R={r1,r2,r3,r4},r j ={hh1,hh2,…,hh n},j={1,2,3,4}.

[0243] Where, η m This represents the severity of the m-th symptom recorded for the patient, with three levels: mild, moderate, and severe, where m ∈ [1, M]; ss m Let r represent the m-th symptom of the patient, where M represents the number of symptoms contained in the patient's symptom set, i.e., the number of symptoms the patient currently has; j This represents the recommended prescription at the j-th time point, where j = {1, 2, 3, 4} corresponds to the time points of morning, noon, evening, and bedtime, respectively. t Let t represent a drug in the prescription at a certain point in time, where t∈[1,n].

[0244] First, a comprehensive representation f of all symptoms is obtained through the symptom representation module. s , with S and f s Perform matrix multiplication to obtain the final symptom representation f′ based on patient symptoms. s The expression is as follows:

[0245]

[0246] Then the comprehensive representation f of all drugs is obtained by the drug representation module h The final representation f' of the patient's symptoms based on the patient's symptoms is obtained s The comprehensive representation f of all drugs h The final representation f' of the patient's drugs is obtained by matrix multiplication h The expression is as follows:

[0247]

[0248] The final representation f' of the patient's drugs is obtained again h The patient's drugs are predicted, and the expression is as follows:

[0249] P = sigmoid(f' h ) (20)

[0250] Where P = {P(h1), …, P(h nh )} represents the prediction probability of each drug, and P(h i ) represents the prediction probability of drug h i .

[0251] The prediction probability of the drug is adjusted according to the syndrome, and the specific process is as follows:

[0252] A1, according to the relationship matrix SC between syndrome and symptoms, the corresponding relationship between symptoms and syndromes is obtained;

[0253] A2, according to the symptoms {ss1,…,ss M} contained in the patient's symptom set S, the possible syndromes {B1,…,B NP} of the patient are determined;

[0254] Where NP represents the number of syndromes that the patient may have.

[0255] A3, calculate the severity score of each syndrome of the patient;

[0256] For syndrome B np , np ∈ [1, NP], containing the symptom set {s1,…,s tt}, the corresponding severity set is {η1,…,η tt}, and the severity score D np of syndrome B np is calculated as follows:

[0257]

[0258] Where η kk represents the severity of symptom s kk .

[0259] A4, adjustment of drug prediction probability;

[0260] Sort all the severity scores of syndromes {D1,…,D NP} in descending order; the syndrome with the highest severity score is the main syndrome, and the rest are secondary syndromes 1, 2, …, NP-1 in descending order; the drug prediction probability of the symptoms corresponding to the syndrome with a high severity score is increased; the prediction probability of the drug h np is adjusted according to the severity score D np of the syndrome B i , and the expression is as follows:

[0261] P'(h i ) = P(h i ) f(D np ) = P(h i ) (αD np + β) (22)

[0262] where P'(h i ) represents the adjusted prediction probability of the drug h i , f(D np ) represents the drug prediction probability adjustment function, which is a linear function that maps the severity score D np 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 proportion coefficient, controlling the degree of influence of the severity score on the prediction probability, and β represents the offset coefficient, ensuring that when the severity score is zero, the prediction probability also has a certain basic value.

[0263] Finally, the drugs with the 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 the initial encoding, and the drugs with the same use time are combined to form the prescriptions at the corresponding time points, obtaining the patient's prescription R = {r1, r2, r3, r4}.

[0264] In this embodiment, in step S4, the Mongolian medicine prescription recommendation model is trained, and when recommending the prescription, the rules in the Mongolian medicine prescription problem need to be followed, which are as follows:

[0265] The rules in the Mongolian medicine prescription problem include:

[0266] 1) The nature and taste of the drug should meet the characteristics of the syndrome;

[0267] 2) The combination of drugs with high similarity in nature and taste has better effect;

[0268] 3) There should be no combination of drugs with nature and taste incompatibility;

[0269] Based on the rules, a prescription loss function is designed, which is as follows:

[0270] For rule 1), the cosine similarity between the nature and taste encoding of the drug node and the input patient syndrome characteristic encoding is used to simulate, in this way, the model is encouraged to find drugs with high similarity of corresponding nature and taste to the syndrome characteristics. For example, the characteristics of the syndrome "Hei" are astringent, light, cool, mild, firm, and dynamic, and the corresponding nature and taste possessed by the drugs for treating it are soft, heavy, warm, greasy, and solid. The syndrome B with the highest severity score is encoded as the corresponding nature and taste possessed by the drug for treating it, and the encoding method is consistent with the nature and taste encoding method of the drug. The loss function expression of rule 1) is as follows:

[0271]

[0272] Wherein, represents the nature and taste feature encoding of the drug node h i .

[0273] For rule 2), the cosine similarity between drug nodes is used to simulate, in this way, the model is encouraged to find drugs with high similarity between drugs. The loss function expression of rule 2) is as follows:

[0274] L2=-CosSim(h i ,h j ) (24)

[0275] For rule 3), the cosine similarity between the mutually opposite nature and taste feature encodings of the drug nodes is used to simulate, in this way, the model is encouraged to find drugs without adverse reactions. The mutually opposite nature and taste feature encodings of the two drug nodes are and The loss function expression of rule 3) is as follows:

[0276]

[0277] The total loss function of the Mongolian medicine prescription recommendation model includes: combination loss function, BCE (Binary Cross Entropy) loss function.

[0278] Wherein, the BCE loss function is a common loss function widely used in binary classification problems, which is commonly used to evaluate the degree of correct and incorrect prediction of the model in different samples, and 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 the multi-label classification task after simple modification. The BCE loss function is combined with the sigmoid function, and the expression is as follows:

[0279]

[0280] Wherein, y n2y n2 represents the true label of the nth2 sample, y n2 represents the predicted label of the nth2 sample, and y n2 represents the predicted probability of the nth2 sample, and n train y n2 represents the number of training samples of the BCE loss function.

[0281] The total loss function is defined as follows:

[0282]

[0283] wherein, λ1, λ2, λ3 represent the regularization term coefficients respectively.

[0284] The model parameters are updated using the Adam gradient descent, and the model is iteratively trained until the model loss reaches the threshold condition, and the model training is completed.

[0285] In summary, the method of the present application is designed and coded for Mongolian medicine, which is coded according to the characteristics of nature and taste, syndrome characteristics and time characteristics. Thereby, the drug "taste and nature" characteristics and "medication according to time" medication method in Mongolian medicine are introduced, and the syndrome information is introduced. The relationships among drugs, symptoms and syndromes are established by constructing drug-drug relationship graph, symptom-drug relationship graph, symptom-symptom relationship graph and symptom-syndrome relationship graph. The designed weight value is used to represent the relationship between drugs and drugs. The GCN network is designed to focus on aggregating drug feature information and symptom feature information for heterogeneous symptom-drug relationship graph and heterogeneous symptom-syndrome relationship graph. The method of the present application analyzes the unique drug "taste and nature" characteristics, "nature and taste" prescription principles and "medication according to time" medication method of Mongolian medicine, and is specifically coded and processed for prescription process. A special loss function is designed to simulate the Mongolian prescription process, and the drug recommendation problem is converted into a drug recommendation and combination problem. In addition, the Mongolian prescription principle is studied in depth, and a special regularization is designed to simulate the prescription process. The whole scheme is changed from simple drug recommendation to drug recommendation and drug combination, which is more in line with the Mongolian theoretical system and clinical practice.

[0286] Those skilled in the art will realize that the embodiments described herein are for the purpose of helping the reader understand the principles of the present application and should be understood as not limiting the scope of protection of the present application to such specific statements and embodiments. The present application can have various modifications and changes for those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present application should be included in the scope of protection of the claims of the present application.

Claims

1. A Mongolian medicine prescription recommendation method based on multi-graph convolutional fusion, the specific steps of which are as follows: S1. Construct a node feature construction module to initialize the encoding of drug nodes, symptom nodes and syndrome nodes, and use a Transformer encoder to enhance their features. Finally, use an autoencoder to keep the dimensions of various nodes consistent. S2. Construct a drug representation module to build 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. Construct a symptom representation module to build symptom-symptom maps and symptom-syndrome maps. 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, construct a Mongolian medicine prescription recommendation model based on multi-graph convolutional fusion Transformer, and input the training set data 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 past patient data; S5. For patients awaiting treatment, input their symptoms and severity into the Mongolian medicine prescription recommendation model trained in step S4 to predict prescriptions and complete prescription recommendations. The specific steps of S1 are as follows: S11. Initial encoding construction of drug nodes; Define drug node h i Each Mongolian medicine drug node includes: its properties and flavors, its symptoms, and its time characteristics, namely... in, Represents drug node h i The encoding of odor characteristics, Represents drug node h i Syndrome feature coding, Represents drug node h i Time feature encoding; the three feature encoding methods are as follows: (1) Encoding of flavor and odor characteristics; The properties and flavors of medicinal nodes are standardized as "sweet, sour, salty, bitter, pungent, astringent, soft, heavy, warm, greasy, solid, cold, dull, cool, harmonious, thin, dry, bland, hot, light, sharp, astringent, and dynamic", totaling 23 properties. Mongolian medicines are coded according to these 23 properties. Among them, the descriptions of "slightly bitter", "bitter", and "extremely bitter" use 2. -1 2 0 2 1 The presence and absence are represented using 1 and 0, respectively. (2) Syndrome feature coding; For the syndrome characteristics of Mongolian medicine, the functions and indications of the medicine are found, and the syndromes treated by the medicine are obtained. Each syndrome has its own independent one-hot code, so the initial code of each syndrome characteristic of Mongolian medicine is obtained. (3) Time feature coding; For the time characteristics of Mongolian medicines, the time characteristic code is initialized to {0,0,0,0}, which represent four time points: morning, noon, evening and bedtime, respectively. Then, based on the existing Mongolian medicine medical records, the number of times each medicine is used in the four time points of morning, noon, evening and bedtime is counted. After that, the statistical values ​​are normalized to obtain the code of the time characteristic of each Mongolian medicine. S12, Initial encoding construction of symptom nodes; Define symptom nodes s i Each symptom is one-hot encoded, and a symptom-drug relationship matrix HS is constructed. Each row in the matrix 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 encoding construction of syndrome nodes; Define the symptom node c i One-hot encoding is performed on each syndrome, and a syndrome-symptom relationship matrix SC is constructed. Each row of 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 includes symptom j, then SC... ij =1; S14, Node Feature Enhancement; Based on steps S11-S13, after obtaining the initial encodings of the three types of nodes, these encodings are fed into the Transformer encoder. The initial encodings are then enhanced using a multi-head self-attention mechanism, as shown in the following expression: X (L) =Encoder(X) (1) Where X represents the input feature vector sequence, i.e., the initial encoding sequence of the three node features, X (L) This represents the output after passing through L layers of encoders. Encoder(·) represents the Transformer encoder process, where the most crucial step is calculating the attention weights A, expressed as follows: Where Q, K, and V represent the three parameter matrices Query, Key, and Value for calculating attention, respectively; d k The dimension of the parameter matrix is ​​represented by T, and the transpose of the matrix is ​​represented by T. Since different types of nodes have different dimensions, and the symptom feature encoding and syndrome feature encoding are highly sparse, an autoencoder is used to reduce the dimensionality of all nodes to the same dimension, and this same dimension is set to 30. Let the input node be represented as X. The encoder maps the input data to the hidden layer representation H and transforms it using an activation function, as shown in the following expression: H=σ(W e X+b e ) (3) Among them, W e b represents the encoder weights. e σ represents the bias, and σ represents the ReLU activation function. The hidden layer representation H is mapped back to the same space as the input data by the decoder to reconstruct the original data, as shown in the following expression: X′=σ(W d H+b d ) (4) Among them, W d b represents the weights of the decoder. d X' represents the bias, and X′ represents the reconstructed data. The goal of an autoencoder is to minimize the difference between the input and output, and the corresponding loss function is expressed as follows: Where, N t X represents the number of training samples in the loss function. n1 Let X' represent the n1th input data. n1 This represents the n1th reconstructed data; Finally, the H output from the intermediate hidden layer is used as the final encoding of various types of nodes after dimensionality reduction, and the encoding of various types of nodes is updated. Step S2 is as follows: S21. Relationship diagram construction; Define the drug-drug diagram G1 = {V1, E1}; Where, V1={h1,h2,…,h nh } represents the set of nodes in graph G1, and E1 represents the set of edges between nodes in graph G1; h i This represents a node for Mongolian medicine, and nh represents the quantity of Mongolian medicine, i.e., the total number of all types of Mongolian medicine. Cosine similarity (CosSim(i,j)) 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 drugs is the drug node encoding h. i with h j The cosine value between them is calculated using the following expression: Where k represents the k-th dimension; Encoding the opposing flavor and odor characteristics of drug nodes The eight pairs of opposing flavors are represented as "soft / astringent, heavy / light, warm / cool, solid / moving, greasy / bland, dull / sharp, cold / hot, harmonious / light". The descriptions of "extremely soft", "soft", "slightly soft", "slightly astringent", "astringent", and "extremely astringent" use -2. 1 -2 0 -2 -1 2 -1 2 0 2 1 The value is represented by 0 for "none"; For two drugs i and j, their flavor and odor characteristics are encoded using the opposing properties of their drug nodes. and Cosine similarity between To indicate adverse reactions between drugs; The weights of the edges are calculated according to equation (7), and thresholds θ1 and θ2 are defined. The edge weight E is determined based on these thresholds. ij The expression is as follows: Where θ1 and θ2 represent the thresholds for the similarity between the drug node encoding and the encoding of mutually opposing flavor and odor features, respectively; Define the symptom-drug diagram G2 = {V2, E2}; Where, V2={V h V s } represents the set of nodes in graph G2, and E2 represents the set of edges between nodes in graph G2; V h =V1={h1,h2,…,h nh } represents the set of Mongolian medicine drug nodes, V s ={s1,s2,…,s ns } represents the set of symptom nodes, and ns represents the number of symptom nodes, i.e., the total number of symptom types; Finally, based on the symptom-drug relationship matrix HS constructed in step S12, edge connections are established between symptom nodes and drug nodes; that is, if HS ij If the value is 1, then an edge connection is established between the corresponding drug node and symptom node; S22, Learning about Relationship Diagrams; For the drug-drug graph G1, it first passes through an embedding layer, and then performs graph convolution learning using GCN to obtain drug relationship features; the process expression of GCN is as follows: in, Let σ represent the feature matrix of the drug nodes in the l-th layer, and let σ represent the activation function ReLU. Let A represent the adjacency matrix of G1 with added self-loops. h Let G1 be the adjacency matrix, and I be the identity matrix. The degree matrix represents the drug-drug graph G1. This represents the weight matrix of the l-th 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 an embedding layer, and then H-GCN is used to perform graph convolution to obtain drug-symptom relationship features; H-GCN obtains the embeddings of symptoms s associated with drug h, and then uses neighborhood aggregation embeddings of symptom s to obtain the embedding of the current drug h; the expression for the neighborhood aggregation process is as follows: in, This represents the drug embedding output from the l-th layer H-GCN. This represents the symptom embedding output of the l-th layer H-GCN. and That is, drug embedding and symptom embedding obtained after the embedding layer. This represents the set of symptoms in drug-symptom diagram G2 that interact with drug h. This represents the set of drugs that interact with symptom s in the drug-symptom diagram G2. This represents the weight matrix of the l-th layer H-GCN; Then, the information from multiple layers is merged, and the node's own information is added, as shown in the following expression: Among them, y h The expression represents the drug-symptom relationship features obtained after fusing l layers of H-GCN, where w1 represents the weight matrix; the output y of H-GCN is... h As a characteristic of the drug-symptom relationship in the drug-symptom diagram G2; Finally, the characteristics of drug relationships will be analyzed. Characteristics of the relationship between drugs and symptoms y h By fusing the components, a comprehensive drug representation can be obtained. The expression is as follows: in, This represents the set of real numbers, and SUM(·) represents the sum of corresponding elements of a matrix.

2. The Mongolian medicine prescription recommendation method based on multi-graph convolutional fusion according to claim 1, characterized in that, Step S3 is as follows: S31. Relationship diagram construction; Define symptoms - Symptom diagram G3 = {V3, E3}; Where, V3 = V s ={s1,s2,…,s ns } represents the set of nodes in graph G3, and E3 represents the set of edges between nodes in graph G3; Cosine similarity (CosSim(a,b)) is used to represent the similarity between symptoms; CosSim(a,b) is taken as the weight between nodes a and b, and a threshold θ3 is defined; if CosSim(a,b)>θ3, then an edge is established between the two symptom nodes. Define the symptom-syndrome diagram G4 = {V4, E4}; Where, V4={V c V s } represents the set of nodes in graph G4, and E4 represents the set of edges between nodes in graph G4; V c ={c1,c2,…,c nc } represents the set of syndrome nodes, V s ={s1,s2,…,s ns } represents the set of symptom nodes, and nc represents the number of syndrome nodes; Then, based on the syndrome-symptom relationship matrix SC constructed in step S13, edge connections are established between symptom nodes and syndrome nodes; that is, if SC ij =1, then an edge connection is established between the corresponding syndrome node and symptom node; S32, Learning about Relationship Diagrams; For the symptom-symptom map G3, it first passes through an embedding layer, and then uses GCN for graph convolutional learning to obtain symptom relationship features; the process expression of GCN is as follows: in, This represents the feature matrix of the symptom nodes in the l-th layer. Let A represent the adjacency matrix of G3 with added self-loops. s Let I denote the adjacency matrix of G3, and let I denote the identity matrix. W represents the degree matrix of the symptom-symptom graph G3. s (l) This represents the weight matrix of the l-th layer; similar to the drug-drug graph G1, the output of the 3rd 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 an embedding layer, and then performs graph convolution on it using S-GCN to obtain the symptom-syndrome relationship features; In this process, S-GCN obtains the embeddings of syndromes c connected to symptom s, and then uses the neighborhood aggregation embeddings of syndrome c to obtain the embedding of the current symptom s; similar to the drug-symptom graph G2, its neighborhood aggregation process is expressed as follows: in, This represents the symptom embedding of the output of the l-th layer S-GCN. This represents the symptom embedding of the output of the l-th layer S-GCN. and That is, the symptom embedding and syndrome embedding obtained after the embedding layer. This represents the set of syndromes in symptom-syndrome diagram G4 that interact with symptom s. This represents the set of symptoms in symptom-syndrome diagram G4 that interact with syndrome c. This 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 The symptom-symptom relationship features obtained after fusing u layers of S-GCN are represented by w2, which represents the weight matrix; the output z of S-GCN is... s As a characteristic of the symptom-syndrome relationship in the G4 symptom-syndrome diagram; Similar to the drug representation module, the symptom relationship features will be finalized. Characteristics of the relationship between symptoms and syndromes z s By integrating the results, a comprehensive symptom representation can be obtained. The expression is as follows:

3. The Mongolian medicine prescription recommendation method based on multi-graph convolutional fusion according to claim 1, characterized in that, Step S4 is as follows: The Mongolian medicine prescription recommendation model is input into the training dataset containing the patient symptom set S = {η1ss1, η2ss2, ..., η}. M ss M }, output the corresponding prescription R={r1,r2,r3,r4},r j ={hh1,hh2,…,hh n },j={1,2,3,4}; Where, η m This represents the severity of the m-th symptom recorded for the patient, with three levels: mild, moderate, and severe, where m ∈ [1, M]; ss m Let r represent the m-th symptom of the patient, where M represents the number of symptoms contained in the patient's symptom set, i.e., the number of symptoms the patient currently has; j This represents the recommended prescription at the j-th time point, where j = {1, 2, 3, 4} corresponds to the time points of morning, noon, evening, and bedtime, respectively. t Let t represent a drug in the prescription at a certain point in time, where t∈[1,n]; First, a comprehensive representation f of all symptoms is obtained through the symptom representation module. s , with S and f s Perform matrix multiplication to obtain the final symptom representation f based on patient symptoms. s The expression is as follows: Then, the comprehensive representation f of all drugs is obtained through the drug representation module. h The final representation of symptoms based on patient symptoms f s ′ and the comprehensive representation of all drugs f h Perform matrix multiplication to obtain the final representation f′ of the patient's medication. h The expression is as follows: Then, based on the patient's final drug response f′ h Predict the patient's medication using the following expression: P=sigmoid(f′ h ) (20) Where, P={P(h1),…,P(h nh P(h) represents the predicted probability of each drug. i ) indicates drug h i The predicted probability; Then, adjust the predicted probability of the medication based on the symptoms, as follows: A1. Based on the syndrome-symptom relationship matrix SC, the correspondence between symptoms and syndromes is obtained; A2. Based on the symptoms {ss1, ..., ss} contained in the patient's symptom set S. M } Identify the patient's possible symptoms {B1,…,B NP }; Wherein, NP represents the number of syndromes that the patient may have; A3. Calculate the severity score for each syndrome of the patient; For syndrome B np np∈[1,NP], and its set of symptoms is {s1,…,s}. tt The corresponding severity set is {η1,…,η}. tt Then syndrome B np Severity score D np The calculation expression is as follows: Where, η kk Indicates symptoms s kk The corresponding severity level; A4. Adjustment of drug prediction probability; Score the severity of all symptoms {D1,…,D} NP Sort the syndromes from highest to lowest severity; the syndrome with the highest severity score is designated as the primary syndrome, and the rest are listed in descending order as secondary syndrome 1, secondary syndrome 2, ..., secondary syndrome NP-1; for syndromes with high severity scores, the probability of predicting medication for their corresponding symptoms is increased; based on syndrome B... np Severity score D np Adjusting medication h i The predicted probability is expressed as follows: P′(h i )=P(h i )·f(D np )=P(h i )·(α·D np +β) (22) Wherein, P′(h i ) indicates drug h i Adjusted prediction probability, f(D) np ) represents the drug prediction probability adjustment function, which is a linear function that adjusts the severity score D. np The adjustment coefficient is mapped to the drug prediction probability; α represents the proportionality coefficient, and β represents the offset coefficient. Finally, the drugs with the adjusted predicted probabilities TOP-K are used as the final predicted drugs. Based on the time characteristics in their initial codes, the time of drug use is obtained. Drugs with the same use time are combined into prescriptions corresponding to the time points to obtain the patient's prescription R = {r1, r2, r3, r4}.

4. The Mongolian medicine prescription recommendation method based on multi-graph convolutional fusion according to claim 1, characterized in that, In step S4, the Mongolian medicine prescription recommendation model undergoes model training. When recommending prescriptions, it must follow the rules of Mongolian medicine prescription problems, as follows: The rules governing Mongolian medicine prescriptions include: 1) The properties and flavors of the medicine should match the characteristics of the syndrome; 2) Combinations of drugs with high similarity in properties and tastes are more effective; 3) There should be no combination of drugs that are incompatible in terms of their properties and flavors; Based on the aforementioned rules, a combination loss function is designed as follows: For rule 1), the cosine similarity between the drug node's flavor and the input patient syndrome characteristic code is used for simulation. The syndrome B with the highest severity score is encoded as the corresponding flavor of the drug that treats it, and its encoding method is consistent with the drug's flavor encoding method. Then the loss function expression for rule 1) is as follows: in, Represents drug node h i Encoding of odor and flavor characteristics; For rule 2), using the cosine similarity between drug nodes for simulation, the loss function expression for rule 2) is as follows: L2=-CosSim(h i ,h j ) (24) For rule 3), the cosine similarity between the mutually exclusive flavor and odor feature codes of the drug nodes is used for simulation. The mutually exclusive flavor and odor feature codes of the two drug nodes are respectively and The loss function expression for rule 3) is as follows: The total loss function of the Mongolian medicine prescription recommendation model includes: the prescription loss function and the BCE loss function; The BCE loss function is used in combination with the sigmoid function, as shown in the following expression: Among them, y n2 This represents the true label of the n2th sample. Let σ'(·) represent the predicted label of the n2th sample, and let σ′(·) represent the sigmoid function. Let n represent the predicted probability of the n2th sample. train This indicates the number of training samples for the BCE loss function; The total loss function is defined as follows: Where λ1, λ2, and λ3 represent the regularization coefficients, respectively; The model parameters are updated using Adam gradient descent, and the model is trained iteratively until the model loss reaches a threshold condition, thus completing the model training.

Citation Information

Patent Citations

  • Traditional Chinese medicine formula auxiliary recommendation method based on group collaborative filtering

    CN115588478A