A prescription recommendation method and system for chronic obstructive pulmonary disease
Through an end-to-end prescription recommendation model, combining symptom and syndrome characteristics, using a two-way long and short-term memory network and attention mechanism, the problem of low drug recommendation accuracy in the existing technology is solved, and higher drug recommendation accuracy and The reflection of traditional Chinese medicine diagnosis and treatment ideas.
Patent Information
- Application Number
- CN202111271795.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2025-01-17
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing drug recommendation methods for chronic obstructive pulmonary diseases have errors in the determination of syndrome types and drug recommendation links, which cannot effectively reflect the "dialectical treatment" idea of traditional Chinese medicine, resulting in low accuracy of drug recommendation.
Using an end-to-end prescription recommendation model, we can splice the symptom feature vector and symptom feature vector, combine the two-way long and short-term memory network and attention mechanism to generate drug recommendation probability, reduce the impact of symptom prediction error, and improve the accuracy of drug recommendation Spend.
It improves the accuracy of drug recommendations, conforms to the traditional Chinese medicine's "dialectics and treatment" idea, effectively utilizes syndrome information, and enhances the reliability of prescription recommendations.
Smart Images

Figure CN113889220B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of medical data processing, and more specifically, relates to a prescription recommendation method and system for chronic obstructive pulmonary disease. Background Art
[0002] Chronic obstructive pulmonary disease is a common disease that can be prevented and treated. As the disease worsens, the complications during the acute attack and later stages seriously affect the patient's quality of life. In recent years, the treatment principles of traditional Chinese medicine, "treatment based on syndrome differentiation" and "holistic concept", have the advantages of less side effects and definite efficacy in the prevention and treatment of chronic obstructive pulmonary disease.
[0003] The patent application document with application publication number CN 113241173 A discloses a TCM-assisted diagnosis and treatment method and system for chronic obstructive pulmonary disease, which decomposes the TCM-assisted diagnosis and treatment process of chronic obstructive pulmonary disease into two links: syndrome determination and drug recommendation: in the syndrome determination link, the syndrome corresponding to the patient is determined mainly based on the patient's symptom information; in the drug recommendation link, a corresponding conventional drug usage model is established for 9 syndromes. When making drug recommendations, the drug model corresponding to the syndrome is first determined based on the syndrome determination result, and on this basis, the specific recommended drug is further determined based on the patient's symptom information. In this method, the construction process of the syndrome determination model and the drug recommendation model fully utilizes the correlation between symptoms, syndromes and drugs in the TCM diagnosis and treatment data set of chronic obstructive pulmonary disease to obtain auxiliary diagnosis and treatment information with better auxiliary effect.
[0004] However, in the drug recommendation method disclosed in the above patent application document, drug recommendation is strictly divided into the stages of syndrome determination and drug recommendation, and the results of syndrome determination dominate the final drug recommendation results. On the one hand, it cannot well reflect the TCM diagnosis and treatment ideas of "differentiation of syndromes and treatment" and "holistic concept". On the other hand, once a large error occurs in syndrome determination, it will seriously affect the accuracy of drug recommendation results. In general, the accuracy of existing drug recommendation methods for chronic obstructive pulmonary disease needs to be further improved. Summary of the invention
[0005] In view of the defects of the prior art and the need for improvement, the present invention provides a prescription recommendation method and system for chronic obstructive pulmonary disease, which aims to improve the accuracy of prescription recommendations for chronic obstructive pulmonary disease and provide a more reliable basis for traditional Chinese medicine diagnosis.
[0006] To achieve the above object, according to one aspect of the present invention, a prescription recommendation method for chronic obstructive pulmonary disease is provided, comprising:
[0007] Convert each symptom information extracted from the patient information into a vector to obtain a symptom vector set;
[0008] The symptom vector set is input into the trained prescription recommendation model, so that the prescription recommendation model outputs the recommendation probability of each drug; the prescription recommendation model includes a syndrome prediction sub-model, a feature splicing layer and a prescription recommendation sub-model; the syndrome prediction sub-model is used to extract features from the symptom vector set to obtain a symptom feature vector, and predict a syndrome feature vector carrying syndrome information based on the symptom feature vector; the feature splicing layer is used to splice the symptom feature vector and the syndrome feature vector to obtain a vector to be decoded; the prescription recommendation sub-model is used to map the vector to be decoded into a prescription vector containing the recommendation probability of each drug;
[0009] According to the prescription vector, some drugs with the highest recommendation probability are screened out as recommended prescriptions.
[0010] When the present invention makes prescription recommendations for chronic obstructive pulmonary disease, the prescription recommendation model used is an end-to-end model, which can obtain a prescription vector containing the probability of drug recommendation according to the input symptom vector set; inside the prescription recommendation model, the symptom feature vector is first extracted, the corresponding syndrome feature vector is predicted based on the feature vector, and then the symptom feature vector and the syndrome feature vector are spliced into an overall feature vector, and the overall feature vector is used as the input of the prescription recommendation sub-model, so that on the basis of the symptom information, the syndrome information can be used as auxiliary information to screen from all drugs and complete the recommendation. This process is consistent with the TCM treatment principles of "differentiation of syndromes and treatment" and "holistic concept", and while utilizing the correlation between symptoms, syndromes and drugs, it can effectively reduce the impact of syndrome prediction errors on prescription recommendations, thereby improving the accuracy of prescription recommendations.
[0011] Furthermore, the syndrome type prediction sub-model includes an encoder, a first fully connected layer, and a second fully connected layer connected in sequence;
[0012] The encoder is TextCNN, which is used to extract features from the input symptom vector set and obtain the first feature vector containing symptom features and relationship features between different symptoms;
[0013] The first fully connected layer is used to transform the dimension of the first feature vector to obtain a second feature vector with a higher dimension;
[0014] The second fully connected layer is used to transform the dimension of the second feature vector to obtain a syndrome type feature vector carrying syndrome type information; the dimension of the syndrome type feature vector is the same as the total number of syndrome types.
[0015] The present invention uses TextCNN as the encoder in the syndrome prediction sub-model. The features extracted by the CNN network include not only the features of the symptom vector itself, but also the relationship features between different symptoms, further ensuring the accuracy of subsequent syndrome prediction and prescription recommendation.
[0016] Furthermore, TextCNN contains three different sizes of convolution kernels, and the sizes of the three convolution kernels are: 3×S, 4×S, and 5×S;
[0017] Among them, S represents the dimension of each symptom vector in the symptom vector set.
[0018] The present invention uses TextCNN as the encoder in the syndrome prediction sub-model, and the TextCNN specifically uses three convolution kernels of sizes 3×S, 4×S, and 5×S (S represents the dimension of each symptom vector in the symptom vector set) for feature extraction, which can further optimize the accuracy of syndrome prediction and prescription recommendation.
[0019] Furthermore, the prescription recommendation sub-model includes a decoder, a third fully connected layer, and an activation function layer;
[0020] The decoder is a bidirectional long short-term memory network, which is used to treat the element sequence in the input vector to be decoded as a time series, and decode the label vector containing the dependency relationship between symptoms and between symptoms and syndrome types;
[0021] The third fully connected layer is used to transform the dimension of the label vector to map it into a vector containing the recommendation score of each drug;
[0022] The activation function layer is used to activate the vector containing the recommendation scores of each drug, so as to map each drug recommendation score to [0, 1] as the recommendation probability of the corresponding drug, and obtain a prescription vector containing the recommendation probability of each drug.
[0023] When decoding each label, the bidirectional long short-term memory network (Bi-LSTM) will consider not only the current label features but also the label features of the previous moment. The present invention uses Bi-LSTM as a decoder in the prescription recommendation sub-model, and decodes the vector to be decoded, which is composed of the symptom feature vector and the syndrome feature vector, as a time series. This can effectively utilize the relationship between symptoms and between symptoms and syndromes, and further improve the accuracy of prescription recommendations.
[0024] Furthermore, the prescription recommendation sub-model also includes an attention mechanism unit, which is used to multiply each symptom vector in the symptom vector set by a corresponding weight coefficient and concatenate them into a weighted feature vector;
[0025] The attention mechanism unit is also used to concatenate the label vector output by the decoder with the weighted feature vector into a new label vector as the input of the third fully connected layer.
[0026] In the present invention, an attention mechanism is also introduced into the prescription recommendation sub-model, so that the different importance of different symptoms can be considered in the prescription recommendation process, further improving the accuracy of prescription recommendation, and can also visualize the influence of related symptoms on decoding the current label.
[0027] Furthermore, the syndrome type prediction sub-model also includes: a classification unit, which is used to perform a softmax operation on the syndrome type feature vector, and set the maximum element in the vector to 1 and the remaining elements to 0 through an argmax operation to obtain a syndrome type vector;
[0028] And, the loss function of the prescription recommendation model is:
[0029] loss=loss syndroms +loss prescription
[0030]
[0031] Among them, loss, loss syndroms and loss prescription are the overall loss function, syndrome loss and prescription loss function respectively; N represents the total number of patients in the training set, k represents the patient serial number; N1 represents the number of syndrome labels, is the syndrome vector of the predicted kth patient, is the true syndrome vector of the kth patient; N2 represents the number of prescription labels, is the predicted prescription vector for the kth patient, is the true prescription vector of the kth patient.
[0032] Although the prescription recommendation model proposed in the present invention is an end-to-end model, the loss function designed by the present invention during the model training process not only considers the error of prescription recommendation, but also the error of syndrome type prediction, ensuring that the trained model has both high prescription recommendation accuracy and syndrome type prediction accuracy, thereby making good use of the auxiliary role of syndrome type information to complete prescription recommendation.
[0033] Furthermore, the prescription recommendation method for chronic obstructive pulmonary disease provided by the present invention further includes:
[0034] According to the TCM diagnosis results, the syndrome vector and / or prescription vector are modified.
[0035] Based on the results output by the model, the present invention further corrects the syndrome vector and the prescription vector according to the actual diagnosis results, thereby ensuring the accuracy of the final results.
[0036] Furthermore, the prescription recommendation method for chronic obstructive pulmonary disease provided by the present invention further includes:
[0037] After correction, the symptom vector set, syndrome vector and prescription vector are added to the training data set as a new training sample.
[0038] After the recommendation is completed, the present invention adds the symptom vector set together with the corrected syndrome vector and prescription vector as a new training sample to the training data set, which can expand the data set and facilitate subsequent updating and iteration of the model.
[0039] Furthermore, the symptom information is converted into a vector by:
[0040] Convert the description content of symptom information into standard description text;
[0041] Use the pre-established symptom dictionary to map the standard description text into the corresponding vector;
[0042] The symptom dictionary records the mapping relationship between text and vector.
[0043] According to another aspect of the present invention, there is provided a prescription recommendation system for chronic obstructive pulmonary disease, comprising:
[0044] A symptom information processing module, used for converting each symptom information extracted from the patient information into a vector to obtain a symptom vector set;
[0045] The prediction module inputs the symptom vector set into the trained prescription recommendation model so that the prescription recommendation model outputs the recommendation probability of each drug; the prescription recommendation model includes a syndrome prediction sub-model, a feature splicing layer and a prescription recommendation sub-model; the syndrome prediction sub-model is used to extract features from the symptom vector set to obtain a symptom feature vector, and predict a syndrome feature vector carrying syndrome information based on the symptom feature vector; the feature splicing layer is used to splice the symptom feature vector and the syndrome feature vector to obtain a vector to be decoded; the prescription recommendation sub-model is used to map the vector to be decoded into a prescription vector containing the recommendation probability of each drug;
[0046] The recommendation module selects some drugs with the highest recommendation probability according to the prescription vector as the recommended prescription.
[0047] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:
[0048] (1) The present invention uses an end-to-end prescription recommendation model to make prescription recommendations based on symptom information. Within the model, the symptom feature vector is first extracted, and the corresponding syndrome feature vector is predicted based on the feature vector. The symptom feature vector and the syndrome feature vector are then spliced into an overall feature vector, and the overall feature vector is used as the input of the prescription recommendation sub-model, so that on the basis of symptom information, the syndrome information can be used as auxiliary information to screen from all drugs and complete the recommendation. This process is consistent with the TCM diagnosis and treatment ideas of "differentiation of syndromes and treatment" and "holistic concept", and while utilizing the correlation between symptoms, syndromes and drugs, it can effectively reduce the impact of syndrome prediction errors on prescription recommendations, thereby improving the accuracy of prescription recommendations.
[0049] (2) The present invention uses TextCNN as the encoder in the syndrome prediction sub-model. The features extracted by the CNN network include not only the features of the symptom vector itself, but also the relationship features between different symptoms, which further ensures the accuracy of subsequent syndrome prediction and prescription recommendation.
[0050] (3) The present invention uses Bi-LSTM as the decoder in the prescription recommendation sub-model, and decodes the vector to be decoded which is composed of the symptom feature vector and the syndrome feature vector as a time series, which can effectively utilize the relationship between symptoms and between symptoms and syndromes, and further improve the accuracy of prescription recommendations.
[0051] (4) The present invention also introduces an attention mechanism into the prescription recommendation sub-model, so that the different importance of different symptoms can be considered in the prescription recommendation process, further improving the accuracy of prescription recommendations, and can also visualize the influence of related symptoms on decoding the current label. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 A flow chart of a prescription recommendation method for chronic obstructive pulmonary disease provided by an embodiment of the present invention;
[0053] Figure 2 A schematic diagram of a prescription recommendation model provided by an embodiment of the present invention;
[0054] Figure 3 A diagram of a network structure of an encoder provided in an embodiment of the present invention;
[0055] Figure 4 A schematic diagram of a decoder network structure provided by an embodiment of the present invention;
[0056] Figure 5 This is a schematic diagram of the structure of a single cell in the existing LSTM;
[0057] Figure 6A schematic diagram of a prescription recommendation system for chronic obstructive pulmonary disease provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
[0059] In the present invention, the terms "first", "second", etc. (if any) in the present invention and the accompanying drawings are used to distinguish similar objects but not necessarily to describe a specific order or sequence.
[0060] In order to solve the technical problem that the existing drug recommendation methods for chronic obstructive pulmonary disease have low recommendation accuracy, the present invention provides a prescription recommendation method and system for chronic obstructive pulmonary disease, the overall idea of which is to follow the TCM diagnosis and treatment ideas of "differentiation of syndromes and treatment" and "holistic concept" and adopt an end-to-end model for prescription prediction; within the model, syndrome type prediction is first performed, and the syndrome type prediction results are used as auxiliary information, together with symptom characteristic information as input information of the prescription recommendation model, to obtain the recommendation probability of all drugs, thereby completing the final prescription recommendation.
[0061] The following are examples.
[0062] Embodiment 1:
[0063] A method for prescribing recommendations for chronic obstructive pulmonary disease, e.g. Figure 1 As shown, including:
[0064] (S1) converting each symptom information extracted from the patient information into a vector to obtain a symptom vector set;
[0065] (S2) inputting the symptom vector set into the trained prescription recommendation model so that the prescription recommendation model outputs the recommendation probability of each drug; the prescription recommendation model includes a syndrome prediction sub-model, a feature splicing layer and a prescription recommendation sub-model; the syndrome prediction sub-model is used to extract features from the symptom vector set to obtain a symptom feature vector, and predict a syndrome feature vector carrying syndrome information based on the symptom feature vector; the feature splicing layer is used to splice the symptom feature vector and the syndrome feature vector to obtain a vector to be decoded; the prescription recommendation sub-model is used to map the vector to be decoded into a prescription vector containing the recommendation probability of each drug;
[0066] (S3) Screening out some drugs with the highest recommendation probability according to the prescription vector as recommended prescriptions.
[0067] Before making a prescription recommendation, it is necessary to collect patient information, which usually includes basic information, main symptoms, secondary symptoms, four traditional Chinese medicine examinations and auxiliary examination results, including:
[0068] The patient's basic information includes name, gender, age, etc.
[0069] The main symptoms include cough, sputum, and dyspnea;
[0070] Secondary symptoms include chest symptoms, nasal symptoms, pharyngeal symptoms, oral symptoms, bowel and urination conditions, etc.
[0071] The four diagnostic methods of traditional Chinese medicine include inspection, auscultation, and palpation;
[0072] Auxiliary examination results include auscultation results, chest CT results, X-ray results, etc.
[0073] For example, for a certain patient, the collected patient information is as follows:
[0074] Male, 66 years old. Main symptoms: cough, expectoration, dyspnea; intermittent cough; loud cough; yellow sputum; foamy sputum; expectoration of more than 50ml day and night; dyspnea grade 3; frequent chest tightness; occasional nasal congestion; occasional clear runny nose; occasional throat itching; obvious dry throat; dry mouth and need to drink water; slight aversion to wind and cold; constipation; lack of energy; cyanosis of lips and nails; pale red tongue; thin tongue; thick tongue coating; yellow tongue coating; rapid pulse; stringy pulse; low breath sounds in both lungs; symptoms not listed in this patient are assumed to be normal;
[0075] Different information in the patient information has different degrees of influence on the prescription recommendation results. In order to ensure the accuracy of the recommendation, referring to the expert prior knowledge, in step (S1) of this embodiment, 50 kinds of symptom information with the greatest influence on the prescription recommendation results are specifically extracted from the patient information, involving four types of information: primary symptoms, secondary symptoms, four traditional Chinese medical examinations, and auxiliary examinations, specifically including cough, sputum, dyspnea, chest tightness, nasal congestion, itchy throat, fatigue, sallow complexion, high-pitched voice, clear breath sounds in both lungs, dry and wet rales, etc.;
[0076] In step (S1) of this embodiment, after extracting effective symptom information, the symptom information is converted into a vector, and the method includes:
[0077] Convert the description content of symptom information into standard description text;
[0078] Use the pre-established symptom dictionary to map the standard description text into the corresponding vector;
[0079] Among them, the mapping relationship between text and vector is recorded in the symptom dictionary; as an optional implementation, in this embodiment, for the existing symptom data, a symptom dictionary is constructed through the lightweight network Word2Vec, and the symptoms are mapped to vectors through the dictionary, specifically:
[0080] Each symptom corresponds to a vector of dimension S = 128. Thus, the 50 symptoms of each patient can be converted into a 50 × 128 matrix, i.e., a symptom vector set, which is convenient for subsequent processing by the computer;
[0081] Considering that the original patient information collected often has the problem of non-standard format, in order to facilitate the establishment of a reliable symptom dictionary, this embodiment will convert the symptom information into a standard description text before mapping it into a vector using the symptom dictionary; one of the optional standardization methods is to grade and quantify the symptom information. For example, for the classification basis of cough, sputum, and dyspnea in the main symptoms, the seven symptoms of "cough frequency", "cough sound", "sputum color", "sputum quality", "sputum volume", "sputum with blood", and "degree of dyspnea" of the patient can be graded and quantified, as shown in Table 1. In Table 1, for cough frequency, it is divided into cough frequency level 1, cough frequency level 2, and cough frequency level 3 according to different frequencies; for the situation of blood in sputum, it is divided into sputum with blood level 1, sputum with blood level 2, sputum with blood level 3, no sputum with blood, and so on. The same is true for the graded quantification of the remaining 43 symptoms, and finally a multi-dimensional symptom feature vector can be obtained. For some symptoms, if the patient does not have them, it is defaulted to none, so the number of patient symptom types is fixed to 50.
[0082] Table 1 Example of standardized symptom information
[0083]
[0084]
[0085] It should be noted that the Word2Vec model and the above-mentioned standardization method of symptom information are only an exemplary description and should not be understood as the only limitation of the present invention.
[0086] After step (S1), this embodiment can obtain a symptom vector set converted from patient information, which includes 50 symptom vectors.
[0087] In order to follow the TCM treatment philosophy of "differentiation and treatment" and "holistic concept", an end-to-end model is used for prescription prediction. In step (S2) of this embodiment, the prescription recommendation mode for recommending prescriptions based on the symptom vector set is an end-to-end model, such as Figure 1 and Figure 2 As shown. Figure 2As shown, in this embodiment, the prescription recommendation model is based on the Seq2seq model architecture;
[0088] In this embodiment, the TCM syndrome results are divided into 9 categories, namely: (0) external cold and internal fluid syndrome; (1) phlegm-heat blocking the lungs syndrome; (2) phlegm-stasis blocking the lungs syndrome; (3) lung qi deficiency syndrome; (4) lung and spleen qi deficiency syndrome; (5) lung and kidney qi deficiency syndrome; (6) lung and kidney qi and yin deficiency syndrome; (7) phlegm-turbidity blocking the lungs syndrome; (8) lung yang deficiency syndrome;
[0089] like Figure 2 As shown, in this embodiment, the syndrome prediction sub-model includes an encoder, a first fully connected layer, and a second fully connected layer connected in sequence;
[0090] The encoder is TextCNN, which is used to extract features from the input symptom vector set to obtain a first feature vector containing symptom features and relationship features between different symptoms. TextCNN is used as the encoder in the syndrome prediction sub-model, where the features extracted by the CNN network include not only the features of the symptom vector itself, but also the relationship features between different symptoms, further ensuring the accuracy of subsequent syndrome prediction and prescription recommendation. In this embodiment, the structure of TextCNN is as follows: Figure 3 As shown, there are three convolution kernels of different sizes: 3×128, 4×128, and 5×128, where 128 corresponds to the length of the symptom information vector after quantization; the number of convolution kernels of each size is 64, and the dimension of the output vectors after maximum pooling is 1*192 after concatenation;
[0091] The first fully connected layer, whose dimension is 192×256, is used to transform the dimension of the first feature vector to obtain a higher-dimensional second feature vector;
[0092] The second fully connected layer has a dimension of 256×9 and is used to transform the dimension of the second feature vector to obtain a syndrome type feature vector carrying syndrome type information;
[0093] like Figure 2 As shown, in this embodiment, the syndrome type prediction sub-model also includes: a classification unit, which is used to perform a softmax operation on the syndrome type feature vector, and set the maximum element in the vector to 1 and the remaining elements to 0 through the argmax operation to obtain a syndrome type vector; in the syndrome type vector, the syndrome type corresponding to the element with a value of 1 is the predicted syndrome type.
[0094] like Figure 2 As shown, in this embodiment, the prescription recommendation sub-model includes a decoder, a third fully connected layer and an activation function layer;
[0095] Considering that the symptoms in the symptom vector set are interdependent, and there is also a certain dependence between symptoms and syndrome types, in order to fully consider this information in the decoding process, such as Figure 2 As shown, in this embodiment, the decoder is a bidirectional long short-term memory network, which is used to treat the element sequence in the input vector to be decoded as a time series, and decode the label vector containing the dependency relationship between symptoms and between symptoms and syndrome types; the bidirectional long short-term memory network (Bi-LSTM) is equivalent to the forward LSTM combined with the backward LSTM, in which two types of cells are defined, namely forward propagation cells and backward propagation cells, and the number of cells is 256, as shown in FIG. Figure 4 As shown in the figure, the symbols without superscript primes are the parameters in the forward propagation cells, and the symbols with superscript primes are the parameters in the backward propagation cells; specifically, an LSTM cell is as follows Figure 5 As shown, for each cell, first calculate the forget gate, select the information to be forgotten, and input the hidden state h at the previous moment. t-1 , the input word x at the current moment t (i.e., the tth element in the vector to be decoded), and the output is the value f of the forget gate t
[0096] f t =σ(W f [h t-1 ,x t ]+b f )
[0097] Among them, σ represents the activation function, w f represents the weight matrix, b f represents the bias matrix;
[0098] Then calculate the memory gate, select the information to be memorized, and input the hidden state h at the previous moment t-1 , the current input word x t , the output is the value of the memory gate i t , temporary cell state
[0099] i t =σ(w i [h t-1 ,x t ]+b i )
[0100]
[0101] Among them, w i and W C represents the weight matrix, b i and b C represents the bias matrix;
[0102] Then calculate the current cell state, and input the value i of the memory gate t , the value of the forget gate f t , temporary cell state The cell state at the last moment is C t-1 , the output is the current cell state C t :
[0103]
[0104] Finally, the output gate and the current hidden layer state are calculated, and the input is the hidden layer state h at the previous moment t-1 , the input word x at the current moment t , the current cell state C t , the value of the output gate is O t , hidden layer state h t :
[0105] O t =σ(W o [h t-1 , x t ]+b o )
[0106] h t =O t *tanh(C t )
[0107] Among them, W O represents the weight matrix, B O represents the bias matrix;
[0108] The forward LSTM and backward LSTM are calculated in the same way, so the final h t for:
[0109] h t =[h t1 :h t2 ]
[0110] where h t1 is the forward LSTM hidden layer state, h t2 is the backward LSTM hidden layer state;
[0111] like Figure 4 As shown, the prescription recommendation sub-model also includes an attention mechanism unit, which is used to multiply each symptom vector in the symptom vector set by the corresponding weight coefficient and concatenate them into a weighted feature vector;
[0112] The attention mechanism unit is also used to concatenate the label vector output by the decoder with the weighted feature vector into a new label vector as the input of the third fully connected layer;
[0113] This embodiment adds an attention mechanism to consider the attention features in addition to the symptom features and the features of the previous moment when decoding each drug;
[0114] a t represents the attention vector at the current moment, s j represents the jth symptom word vector, W a is the weight matrix;
[0115]
[0116] e tj =h t W a s j
[0117] Among them, at j represents the attention allocation coefficient of the jth symptom vector in the original symptom vector set when decoding the tth moment, et j represents the similarity between the hidden state at the t-th moment and the j-th symptom vector, T represents the number of vectors in the symptom vector set, in this embodiment, T=50;
[0118] Final hidden state for:
[0119]
[0120] Where W c is the transformation matrix, the purpose is to restore the shape of the original hidden layer state;
[0121] The third fully connected layer uses the hidden state of the final output of Bi-LSTM As input, it is used to transform the dimension of the label vector to map it into a vector containing the recommendation scores of each drug, and the dimension of the vector is the same as the total number of drugs. In this embodiment, 233 drugs are selected as the drugs to be recommended in combination with the expert prior knowledge, including white mustard seeds, Xanthium sibiricum seeds, Saposhnikovia divaricata, Trichosanthes peel, Scutellaria baicalensis, Coltsfoot flower, etc.;
[0122] The activation function layer is used to perform sigmoid activation on the vector containing the recommendation scores of each drug, so as to map each drug recommendation score to [0, 1] as the recommendation probability of the corresponding drug, and obtain a prescription vector containing the recommendation probability of each drug.
[0123] This embodiment Figure 2 The loss function used when the prescription recommendation model shown is trained end-to-end is:
[0124] loss=loss syndroms +loss prescription
[0125]
[0126] Among them, loss, loss syndroms and loss prescription are the overall loss function, syndrome loss and prescription loss function respectively; N represents the total number of patients in the training set, k represents the patient serial number; N1 represents the number of syndrome labels, is the syndrome vector of the predicted kth patient, is the true syndrome vector of the kth patient; N2 represents the number of prescription labels, is the predicted prescription vector for the kth patient, is the true prescription vector of the kth patient;
[0127] Figure 2 Although the prescription recommendation model shown is an end-to-end model, the loss function designed in this embodiment during the model training process not only considers the error of prescription recommendation, but also considers the error of syndrome type prediction, ensuring that the trained model has both high accuracy of prescription recommendation and syndrome type prediction, so that the auxiliary role of syndrome type information can be well utilized to complete prescription recommendation;
[0128] Accordingly, when the model is trained in this embodiment, each training sample in the training data set used contains a known symptom vector set, syndrome vector and prescription vector; during training, the existing training data set is first divided into a training set and a test set with a division ratio of 8:2, and the symptom vector set is used as the model input, and the syndrome vector and prescription vector are used as the model output, which are used to fit the real syndrome and the real prescription respectively; Adam is used as the optimizer.
[0129] After obtaining the prescription vector containing the recommendation probability of each drug in step (S2), in step (S3) of this embodiment, two methods can be used to screen the drugs to be recommended: one is to set a threshold value and take all drugs with a recommendation probability greater than the threshold value as the final recommended drugs; the other is to determine the final recommended drugs through topK by setting different K values; after a large amount of data experiments and combined with prior knowledge, the threshold is finally determined to be 0.25 and the K value is 22. Optionally, in this embodiment, topK specifically refers to the K drugs with the highest recommendation probability, and for the original patient information collected in step (S1), the corresponding recommended prescriptions are: white mustard seeds, Xanthium sibiricum, Saposhnikovia divaricata, Trichosanthes root, Scutellaria baicalensis, Coltsfoot flower, Ephedra, Adenophora radix, Gypsum, Morus alba bark, Radix Trichosanthis, Apricot kernel, Aster tataricus, and Radix Glycyrrhizae Preparata.
[0130] To further ensure the accuracy of prescription recommendations, Figure 1 As shown, this embodiment also includes:
[0131] According to the TCM diagnosis results, the syndrome vector and / or prescription vector are modified; the specific modification methods include: adding, deleting or modifying patient information; modifying the syndrome prediction results; adding, deleting or modifying the recommended prescriptions;
[0132] In order to further expand the data set and facilitate subsequent updating and iteration of the model, this embodiment also includes:
[0133] After the correction, the symptom vector set, syndrome vector and prescription vector are added to the training data set as a new training sample;
[0134] By expanding the data set, as the model is used, the prescription recommendation model can be regularly retrained with the latest training data, thereby achieving the effect of iteratively updating the prescription recommendation model.
[0135] Embodiment 2:
[0136] A prescription recommendation system for chronic obstructive pulmonary disease, e.g. Figure 6 As shown, including:
[0137] A symptom information processing module, used for converting each symptom information extracted from the patient information into a vector to obtain a symptom vector set;
[0138] The prediction module inputs the symptom vector set into the trained prescription recommendation model so that the prescription recommendation model outputs the recommendation probability of each drug; the prescription recommendation model includes a syndrome prediction sub-model, a feature splicing layer and a prescription recommendation sub-model; the syndrome prediction sub-model is used to extract features from the symptom vector set to obtain a symptom feature vector, and predict a syndrome feature vector carrying syndrome information based on the symptom feature vector; the feature splicing layer is used to splice the symptom feature vector and the syndrome feature vector to obtain a vector to be decoded; the prescription recommendation sub-model is used to map the vector to be decoded into a prescription vector containing the recommendation probability of each drug;
[0139] The recommendation module selects the drugs with the highest recommendation probability according to the prescription vector as the recommended prescription;
[0140] In addition, it may also include: an information collection module for collecting patient information, an interactive module for correcting the syndrome vector and / or prescription vector according to the TCM diagnosis results, a data management module for adding the symptom vector set, syndrome vector and prescription vector as a new training sample to the training data set, etc.;
[0141] In this embodiment, the specific implementation of each module can refer to the description in the above method embodiment, which will not be repeated here.
[0142] It will be easily understood by those skilled in the art that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A prescription recommendation method for chronic obstructive pulmonary disease, characterized in that: include: Convert each symptom information extracted from the patient information into a vector to obtain a symptom vector set; The symptom vector set is input into a trained prescription recommendation model, so that the prescription recommendation model outputs the recommendation probability of each drug; the prescription recommendation model includes a syndrome prediction sub-model, a feature concatenation layer and a prescription recommendation sub-model; the syndrome prediction sub-model is used to extract features from the symptom vector set to obtain a symptom feature vector, and predict a syndrome feature vector carrying syndrome information based on the symptom feature vector; The feature concatenation layer is used to concatenate the symptom feature vector and the syndrome feature vector to obtain a vector to be decoded; the prescription recommendation submodel is used to map the vector to be decoded into a prescription vector containing the recommendation probability of each drug; Screening out some drugs with the highest recommendation probability according to the prescription vector as recommended prescriptions; The syndrome type prediction sub-model includes an encoder, a first fully connected layer, a second fully connected layer and a classification unit connected in sequence; The encoder is a TextCNN, which is used to extract features from the input symptom vector set to obtain a first feature vector including symptom features and relationship features between different symptoms; The first fully connected layer is used to perform dimensionality transformation on the first feature vector to obtain a second feature vector with a higher dimension; The second fully connected layer is used to perform dimension transformation on the second feature vector to obtain a syndrome type feature vector carrying syndrome type information; the dimension of the syndrome type feature vector is the same as the total number of syndrome types; A classification unit, used for performing a softmax operation on the syndrome type feature vector, and setting the maximum element in the vector to 1 and the remaining elements to 0 through an argmax operation, to obtain a syndrome type vector; The prescription recommendation sub-model includes a decoder, a third fully connected layer, an activation function layer, and an attention mechanism unit; The decoder is a bidirectional long short-term memory network, which is used to treat the element sequence in the input vector to be decoded as a time series, and decode the label vector containing the dependency relationship between symptoms and between symptoms and syndrome types; The third fully connected layer is used to transform the dimension of the label vector to map it into a vector containing the recommendation score of each drug; The activation function layer is used to activate the vector containing the recommendation scores of each drug, so as to map each drug recommendation score to a range between [0, 1] as the recommendation probability of the corresponding drug, and obtain a prescription vector containing the recommendation probability of each drug; An attention mechanism unit, used for multiplying each symptom vector in the symptom vector set by a corresponding weight coefficient and concatenating the resultant symptom vector into a weighted feature vector; The attention mechanism unit is also used to concatenate the label vector output by the decoder and the weighted feature vector into a new label vector as the input of the third fully connected layer.
2. The method for recommending prescriptions for chronic obstructive pulmonary disease according to claim 1, characterized in that: The TextCNN contains three convolution kernels of different sizes, and the sizes of the three convolution kernels are: 3×S, 4×S, and 5×S; Among them, S represents the dimension of each symptom vector in the symptom vector set.
3. The method for recommending prescriptions for chronic obstructive pulmonary disease according to claim 1 or 2, characterized in that: The loss function of the prescription recommendation model is: loss=loss syndroms +loss prescription Among them, loss, loss syndroms and loss prescription are the overall loss function, syndrome loss and prescription loss function respectively; N represents the total number of patients in the training set, k represents the patient serial number; N1 represents the number of syndrome labels, is the syndrome vector of the predicted kth patient, is the true syndrome vector of the kth patient; N2 represents the number of prescription labels, is the predicted prescription vector for the kth patient, is the true prescription vector of the kth patient.
4. The method for recommending prescriptions for chronic obstructive pulmonary disease according to claim 3, wherein: Also includes: According to the TCM diagnosis result, the syndrome type vector and / or the prescription vector are modified.
5. The method for recommending prescriptions for chronic obstructive pulmonary disease according to claim 4, characterized in that: Also includes: After correction, the symptom vector set, syndrome vector and prescription vector are added to the training data set as a new training sample.
6. The method for recommending prescriptions for chronic obstructive pulmonary disease according to claim 1, wherein: Convert symptom information into a vector by: Convert the description content of symptom information into standard description text; Use the pre-established symptom dictionary to map the standard description text into the corresponding vector; The symptom dictionary records the mapping relationship between text and vector.
7. A prescription recommendation system for chronic obstructive pulmonary disease, characterized in that: include: A symptom information processing module, used for converting each symptom information extracted from the patient information into a vector to obtain a symptom vector set; A prediction module, inputting the symptom vector set into a trained prescription recommendation model so that the prescription recommendation model outputs the recommendation probability of each drug; the prescription recommendation model includes a syndrome prediction sub-model, a feature concatenation layer and a prescription recommendation sub-model; the syndrome prediction sub-model is used to extract features from the symptom vector set to obtain a symptom feature vector, and predict a syndrome feature vector carrying syndrome information based on the symptom feature vector; The feature concatenation layer is used to concatenate the symptom feature vector and the syndrome feature vector to obtain a vector to be decoded; the prescription recommendation submodel is used to map the vector to be decoded into a prescription vector containing the recommendation probability of each drug; A recommendation module, which selects some drugs with the highest recommendation probability according to the prescription vector as recommended prescriptions; The syndrome type prediction sub-model includes an encoder, a first fully connected layer, a second fully connected layer and a classification unit connected in sequence; The encoder is a TextCNN, which is used to extract features from the input symptom vector set to obtain a first feature vector including symptom features and relationship features between different symptoms; The first fully connected layer is used to perform dimensionality transformation on the first feature vector to obtain a second feature vector with a higher dimension; The second fully connected layer is used to perform dimension transformation on the second feature vector to obtain a syndrome type feature vector carrying syndrome type information; the dimension of the syndrome type feature vector is the same as the total number of syndrome types; A classification unit, used for performing a softmax operation on the syndrome type feature vector, and setting the maximum element in the vector to 1 and the remaining elements to 0 through an argmax operation, to obtain a syndrome type vector; The prescription recommendation sub-model includes a decoder, a third fully connected layer, an activation function layer, and an attention mechanism unit; The decoder is a bidirectional long short-term memory network, which is used to treat the element sequence in the input vector to be decoded as a time series, and decode the label vector containing the dependency relationship between symptoms and between symptoms and syndrome types; The third fully connected layer is used to transform the dimension of the label vector to map it into a vector containing the recommendation score of each drug; The activation function layer is used to activate the vector containing the recommendation scores of each drug, so as to map each drug recommendation score to a range between [0, 1] as the recommendation probability of the corresponding drug, and obtain a prescription vector containing the recommendation probability of each drug; An attention mechanism unit, used for multiplying each symptom vector in the symptom vector set by a corresponding weight coefficient and concatenating the resultant symptom vector into a weighted feature vector; The attention mechanism unit is also used to concatenate the label vector output by the decoder and the weighted feature vector into a new label vector as the input of the third fully connected layer.
Citation Information
Patent Citations
Traditional Chinese medicine auxiliary diagnosis and treatment method and system for chronic obstructive pulmonary disease
CN113241173A
Traditional Chinese medicine dialectical treatment system
CN109102882A
Dysmenorrhea traditional Chinese medicine syndrome differentiation system based on DAELA-LSTM neural network
CN112168142A