Multi-source confidence perception insomnia intelligent prescription recommendation method, medium and equipment
By employing a multi-source confidence perception method and utilizing graph convolutional neural networks to extract the symptom-medicine-syndrome relationship from the TCM knowledge graph, quantifying uncertainty scores and weighted fusion, the data fusion and feature representation problems of the TCM intelligent prescription recommendation system are solved, thereby improving the accuracy and interpretability of the recommendations.
Patent Information
- Application Number
- CN202511151481.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-11-28
AI Technical Summary
Existing intelligent prescription recommendation systems suffer from insufficient data fusion capabilities, simplistic feature representations, and a lack of uncertainty assessment when dealing with the multi-source heterogeneity and structural complexity of TCM clinical data, which affects the accuracy and reliability of recommendations.
A multi-source confidence perception method is adopted, which extracts the symptom-Chinese medicine prescription and symptom-syndrome relationship matrix from the TCM knowledge graph through graph convolutional neural network, generates symptom-guided Chinese medicine prescription and syndrome features, calculates the prediction distribution probability and quantifies the uncertainty score, and dynamically weights and fuses the multi-source probabilities to improve the recommendation accuracy.
It significantly improves the accuracy and interpretability of prescription recommendations for insomnia, and provides more reliable and comprehensive AI-assisted diagnosis and treatment support through heterogeneous spectrum modeling and multi-source confidence fusion.
Smart Images

Figure CN121034560A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence, specifically to a method, medium, and device for recommending intelligent prescriptions for insomnia based on multi-source confidence perception. Background Technology
[0002] With the application of deep learning in traditional Chinese medicine, intelligent prescription recommendation systems have become an important tool for assisting in the diagnosis and treatment of insomnia. However, existing methods still have significant shortcomings in handling the multi-source heterogeneity and structural complexity of TCM clinical data, specifically manifested in the following technical problems:
[0003] (1) Insufficient data fusion capability: TCM clinical data contains multi-source information such as structured symptoms (e.g., symptom-patient matrix) and knowledge of the association between TCM prescriptions and syndrome types (e.g., symptom-TCM matrix). Existing methods are difficult to effectively unify the modeling of these heterogeneous data, resulting in the deep association between symptoms, TCM, and syndrome types not being fully explored, thus affecting the accuracy of recommendations.
[0004] (2) Feature representation is simplistic: Traditional methods usually extract features from only a single perspective (such as symptoms or Chinese medicine), ignoring the synergistic guiding role of symptoms on Chinese medicine and syndrome types. For example, the failure to use graph structures to explicitly model the complex relationship between symptoms, Chinese medicine, and syndrome types leads to a disconnect between local features and global semantics.
[0005] (3) Lack of uncertainty assessment: Existing recommendation systems lack a confidence quantification mechanism for the prediction results of Chinese medicine prescriptions and syndrome types, and cannot dynamically weigh the reliability of multi-source prediction results, which may introduce low-confidence recommendations and affect clinical applicability. Summary of the Invention
[0006] In view of the above problems, this application provides a technical solution for intelligent prescription recommendation for insomnia based on multi-source confidence perception, in order to solve the existing technical problems of insufficient data fusion capabilities, singular feature representation, and lack of uncertainty assessment.
[0007] To achieve the above objectives, in a first aspect, this application provides a method for recommending intelligent prescriptions for insomnia based on multi-source confidence sensing, the method comprising:
[0008] S1: Obtain the original symptom information of multiple patients, and convert the obtained original symptom information into an n×d dimensional sparse binary coding matrix G. s Among them, G s ∈{0,1} n×d n represents the number of patients, d represents the number of symptom items, and G s {ij} = 1 indicates that the j-th symptom exists in the original symptom information of the i-th patient, where the value of i ranges from [1, n] and the value of j ranges from [1, d].
[0009] S2: Extract the symptom-prescription relationship matrix G related to insomnia from the Traditional Chinese Medicine knowledge graph database. M Symptom-syndrome relationship matrix G T Among them, G M ∈{0,1} d×m m represents the quantity of traditional Chinese medicine prescriptions, G T ∈{0,1} d×t t represents the number of certificate types, G M {ab} = 1 indicates that symptom a is related to the traditional Chinese medicine prescription in item b. G T {ab} = 1 indicates that symptom a is related to syndrome type b;
[0010] S3: Symptom-Traditional Chinese Medicine Prescription Relationship Matrix G M Symptom-syndrome relationship matrix G T As the adjacency matrix of a heterogeneous knowledge graph, symptom-guided traditional Chinese medicine prescription features Z are generated through a two-layer graph convolutional neural network with ReLU activation function. M Symptom-guided syndrome characteristics Z T ;
[0011] S4: Symptom-guided characteristics of traditional Chinese medicine prescriptions Z M Calculate the predicted distribution probability y of traditional Chinese medicine prescriptions M and symptom-guided syndrome characteristics Z T Calculate the probability distribution y of the certificate type prediction T ;
[0012] S5: Predict the distribution probability y of traditional Chinese medicine prescriptions using the energy function. M The probability distribution of the sum of the two types of predictions y T The calculation yields the uncertainty score E for traditional Chinese medicine prescriptions. M Equity type uncertainty score E T ;
[0013] S6: The first weight is obtained based on the uncertainty score of the Chinese medicine prescription, and the second weight is obtained based on the uncertainty score of the syndrome type. The value range of the first weight and the second weight is [0,1].
[0014] S7: Predicting the distribution probability y of traditional Chinese medicine prescriptions based on the first and second weights M The probability distribution of the sum of the two types of predictions y T Perform weighted calculations to obtain the probability distribution y after multi-source fusion. F ;
[0015] S8: Output the distribution probability y after multi-source fusion. F Sort the prescriptions in descending order and output the top-ranked Chinese medicine prescriptions and their corresponding syndrome types.
[0016] Furthermore, the calculation formula for step S3 is as follows:
[0017] Z M =GCN(G S G M );
[0018] Z T =GCN(G S G T );
[0019] Wherein, GCN stands for Graph Convolutional Neural Network;
[0020] The calculation formula for step S4 is as follows:
[0021] y M =sigmoid(FC(Z) M ));
[0022] y T =sigmoid(FC(Z) T ));
[0023] Here, sigmoid is a mapping function used to convert the prediction result into a probability with a value in the range [0,1], and FC represents a fully connected neural network layer.
[0024] Furthermore, the calculation formula for step S5 is as follows:
[0025]
[0026] Where θ represents an adjustable hyperparameter, and K represents the total number of predicted traditional Chinese medicine prescription categories. This represents the predicted distribution probability of the traditional Chinese medicine prescription corresponding to the current k-th category, and Q represents the total number of predicted syndrome types. Let e represent the probability distribution of the type prediction corresponding to the current q-th category, where e is the natural exponential function.
[0027] Furthermore, the calculation formula for step S6 is as follows:
[0028] w M =E M ;
[0029] w T =E T ;
[0030] Among them, w M w represents the first weight. T Indicates the second weight;
[0031] The calculation formula for step S7 is as follows:
[0032] y F=-w M ·y M -w T ·y T .
[0033] Furthermore, the method also includes:
[0034] S21: Predicting the distribution probability y based on traditional Chinese medicine prescriptions M The probability distribution of the sum of the two types of predictions y T Calculate the cross-entropy loss;
[0035] S22: Calculate the regularization function loss based on cross-entropy loss, the first weight, and the second weight;
[0036] S23: Calculate the total objective loss based on the cross-entropy loss and the regularization function loss, and optimize the model parameters by minimizing the total objective loss.
[0037] Furthermore, the calculation formula for step S21 is as follows:
[0038] L cls =-y(logy M +logy T );
[0039] Among them, L cls denoted by cross-entropy loss, and y represents the true label information of the training samples, corresponding to the correct prescription information;
[0040] The calculation formula for step S22 is as follows:
[0041] L reg =max(0,g(w) M ,w T )·L cls +|w M -w T |);
[0042]
[0043] Among them, L reg represents the loss function of regularization, max() represents the maximum value function, and |·| represents the absolute value function;
[0044] The calculation formula for step S23 is as follows:
[0045] L = L cls +λ1L reg ;
[0046] Where λ1 represents the hyperparameters of the balanced objective function optimization, and L represents the total objective loss.
[0047] Furthermore, the method also includes:
[0048] Based on the distribution probability y after multi-source fusion F The loss is calculated using the following formula based on the decision probability distribution.
[0049] Lcls -a = -y log yF;
[0050] Among them, Lcls -a This represents the loss due to the probability distribution of the decision;
[0051] Step S23 includes:
[0052] The total objective loss is calculated based on the cross-entropy loss, the regularization function loss, and the decision probability distribution loss. The model parameters are then optimized by minimizing the total objective loss. The formula for calculating the total loss function is as follows:
[0053] L=Lcls+λ1Lreg+λ2Lcls -a ;
[0054] Where λ2 represents the hyperparameters for optimizing the equilibrium objective function.
[0055] Furthermore, the method also includes:
[0056] Obtain the patient's tongue image I, where I∈R H×W×3 H and W represent the height and width of the tongue image, respectively, and 3 represents the RGB channel;
[0057] The global feature vector V of tongue image is extracted by a pre-trained ResNet-50 network, and then reduced to the same dimension as the number of symptom items d through a fully connected layer to obtain the dimensionality-reduced global feature vector V' of tongue image. The calculation formula is as follows:
[0058] V' = ReLU(W v ·V+b v );
[0059] Where ReLU represents the activation function, V∈R 2048 , representing the global feature vector output by the last layer of the ResNet-50 network, with dimensions of 2048, W v ∈R d×2048 , represents the trainable weight matrix, b v ∈R d Represents the bias vector;
[0060] The reduced global feature vector V' of the tongue image and the sparse binary encoding matrix G are calculated based on the attention mechanism. s The association weight α, α∈R d The calculation formula is as follows:
[0061]
[0062] Where μ represents the loop index variable, W α Let W represent the trainable attention weight matrix. a ∈R d×d ,α j Let V' represent the correlation between the global feature vector of the tongue image and the j-th symptom, exp(·) represent the natural exponential function, and G s [:,j]∈R d×1 G represents the occurrence of the j-th symptom in the original symptom information of all patients. s [:,μ] represents the occurrence of the μ-th symptom in the original symptom information of all patients, and the value of μ ranges from [1,d].
[0063] The uncertainty score E of the traditional Chinese medicine prescription is corrected based on the association weight α. M The calculation formula is as follows:
[0064] E M '=E M ·(1+γ·mean(α));
[0065] Among them, E M ' represents the corrected uncertainty score of the traditional Chinese medicine prescription, mean(α) represents the mean of the association weights, γ represents the influence factor, γ∈[0.1,0.5].
[0066] In a second aspect, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the multi-source confidence sensing method for recommending intelligent prescriptions for insomnia as described in the first aspect of this application.
[0067] In a third aspect, this application provides an electronic device having a computer program stored thereon, including a processor and a storage medium, wherein the computer program is stored on the storage medium, and when executed by the processor, the computer program implements the multi-source confidence sensing intelligent prescription recommendation method for insomnia as described in the first aspect of this application.
[0068] Unlike existing technologies, the above-mentioned technical solution involves a multi-source confidence perception-based intelligent prescription recommendation method, medium, and device for insomnia, aiming to solve the problems of low recommendation accuracy caused by insufficient fusion of multi-source heterogeneous data, single feature representation, and lack of prediction confidence in existing technologies. The method includes: encoding patient symptoms into a sparse binary matrix; extracting symptom-prescription matrix and symptom-syndrome matrix from a traditional Chinese medicine knowledge graph; generating symptom-guided traditional Chinese medicine features and syndrome features through a two-layer graph convolutional neural network; calculating the predicted distribution probability of traditional Chinese medicine prescriptions and syndromes; quantifying the uncertainty score of both based on an energy function; dynamically weighting and fusing multi-source probabilities to increase the weight of high-confidence results; and finally outputting recommended prescriptions and syndrome rankings. This invention significantly improves the accuracy and interpretability of insomnia prescription recommendations through heterogeneous graph modeling and multi-source confidence fusion, and is applicable to traditional Chinese medicine clinical auxiliary decision-making systems.
[0069] The above description of the invention is merely an overview of the technical solution of this application. In order to enable those skilled in the art to better understand the technical solution of this application and to implement it based on the description and drawings, and to make the above-mentioned objectives and other objectives, features and advantages of this application easier to understand, the following description is provided in conjunction with the specific embodiments and drawings of this application. Attached Figure Description
[0070] The accompanying drawings are only used to illustrate the principles, implementation methods, applications, features, and effects of specific embodiments of this application and other related content, and should not be considered as limitations on this application.
[0071] In the accompanying drawings of the instruction manual:
[0072] Figure 1 This is a flowchart of the intelligent prescription recommendation method for insomnia based on multi-source confidence sensing, as described in the first exemplary embodiment of this application.
[0073] Figure 2 This is a flowchart of the intelligent prescription recommendation method for insomnia based on multi-source confidence sensing, as described in the second exemplary embodiment of this application.
[0074] Figure 3 This is a flowchart of the intelligent prescription recommendation method for insomnia based on multi-source confidence sensing, as described in the third exemplary embodiment of this application.
[0075] Figure 4 This is a flowchart of the intelligent prescription recommendation method for insomnia based on multi-source confidence sensing, as described in the fourth exemplary embodiment of this application.
[0076] Figure 5 This is a schematic diagram of an electronic device according to an exemplary embodiment of this application;
[0077] The reference numerals used in the above figures are explained as follows:
[0078] 10. Electronic devices;
[0079] 101. Processor;
[0080] 102. Storage medium. Detailed Implementation
[0081] To illustrate the possible application scenarios, technical principles, implementable specific solutions, and achievable objectives and effects of this application in detail, the following description, in conjunction with the listed specific embodiments and accompanying drawings, provides a detailed explanation. The embodiments described herein are merely illustrative of the technical solutions of this application and are therefore intended to limit the scope of protection of this application.
[0082] In this document, the term "embodiment" means that a specific feature, structure, or characteristic described in connection with an embodiment may be included in at least one embodiment of this application. The term "embodiment" appearing in various places throughout the specification does not necessarily refer to the same embodiment, nor does it specifically limit its independence or connection with other embodiments. In principle, in this application, as long as there are no technical contradictions or conflicts, the technical features mentioned in each embodiment can be combined in any way to form corresponding implementable technical solutions.
[0083] Unless otherwise defined, the technical terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains; the use of related terms herein is merely for the purpose of describing particular embodiments and is not intended to limit this application.
[0084] In the description of this application, the term "and / or" is used to describe the logical relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A exists, B exists, and A and B exist simultaneously. Additionally, the character " / " in this document generally indicates that the preceding and following objects have an "or" logical relationship.
[0085] In this application, terms such as “first” and “second” are used only to distinguish one entity or operation from another, and do not necessarily require or imply any actual quantity, hierarchy or order relationship between these entities or operations.
[0086] Without further limitations, the use of terms such as “comprising,” “including,” “having,” or other similar open-ended expressions in this application is intended to cover non-exclusive inclusion, which does not exclude the presence of additional elements in a process, method, or product that includes the stated elements, such that a process, method, or product that includes a list of elements may include not only those defined elements but also other elements not expressly listed, or elements inherent to such a process, method, or product.
[0087] Similar to the understanding in the Examination Guidelines, in this application, expressions such as "greater than," "less than," and "exceeding" are understood to exclude the stated number; expressions such as "above," "below," and "within" are understood to include the stated number. Furthermore, in the description of the embodiments in this application, "multiple" means two or more (including two), and similar expressions related to "multiple" are also understood in this way, such as "multiple groups" and "multiple times," unless otherwise explicitly specified.
[0088] In the description of the embodiments of this application, the space-related expressions used, such as "center," "longitudinal," "lateral," "length," "width," "thickness," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "vertical," "top," "bottom," "inner," "outer," "clockwise," "counterclockwise," "axial," "radial," and "circumferential," indicate the orientation or positional relationship based on the orientation or positional relationship shown in the specific embodiments or drawings. They are only for the purpose of describing the specific embodiments of this application or for the reader's understanding, and do not indicate or imply that the device or component referred to must have a specific position, a specific orientation, or be constructed or operated in a specific orientation. Therefore, they should not be construed as limitations on the embodiments of this application.
[0089] Unless otherwise expressly specified or limited, the terms "installation," "connection," "linking," "fixing," and "setting," as used in the description of the embodiments of this application, should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral setting; it can be a mechanical connection, an electrical connection, or a communication connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be the internal connection of two components or the interaction between two components. For those skilled in the art to which this application pertains, the specific meaning of the above terms in the embodiments of this application can be understood according to the specific circumstances.
[0090] In the first aspect, such as Figure 1 and Figure 4 As shown, this application provides a multi-source confidence sensing-based intelligent prescription recommendation method for insomnia, the method comprising:
[0091] S1: Obtain the original symptom information of multiple patients, and convert the obtained original symptom information into an n×d dimensional sparse binary coding matrix G. s .
[0092] In step S1, the sparse binary encoding matrix G s It is a matrix representation that digitizes raw symptom information, using 0 / 1 values to mark the presence or absence of symptoms, thus achieving a structured transformation of unstructured symptom information. s ∈{0,1} n×d n represents the number of patients, d represents the number of symptom items, and G s {ij} = 1 indicates that the j-th symptom exists in the original symptom information of the i-th patient, where the value of i ranges from [1, n] and the value of j ranges from [1, d].
[0093] For example, a certain G s The matrix representation is as follows:
[0094]
[0095] The above matrix G s Each row in the matrix corresponds to the original symptom information of a patient, and the columns represent symptom items. The value 1 in the matrix indicates that the current patient's original symptom information contains this symptom, and 0 indicates that the patient does not have this symptom.
[0096] S2: Extract the symptom-prescription relationship matrix G related to insomnia from the Traditional Chinese Medicine knowledge graph database. M Symptom-syndrome relationship matrix G T .
[0097] In step S2, the symptom-traditional Chinese medicine prescription relationship matrix G M This is a binary matrix describing the association between symptoms and traditional Chinese medicine prescriptions, used to quantify the correspondence between symptoms and formulas. Symptom-Syndrome Relationship Matrix G T It is a binary matrix that describes the relationship between symptoms and syndrome types, and is used to quantify the correspondence between symptoms and TCM syndrome types.
[0098] G M ∈{0,1} d×m m represents the quantity of traditional Chinese medicine prescriptions, G T ∈{0,1} d×t t represents the number of certificate types, G M {ab} = 1 indicates that symptom a is related to the traditional Chinese medicine prescription in item b (e.g., "irritability" is related to "Bupleurum Decoction"). G T {ab} = 1 indicates that symptom a is related to syndrome type b (e.g., "red tongue with yellow coating" is related to "liver fire disturbing the heart syndrome").
[0099] For example, a certain G M The matrix representation is as follows:
[0100]
[0101] A certain G T The matrix representation is as follows:
[0102]
[0103] S3: Symptom-Traditional Chinese Medicine Prescription Relationship Matrix G M Symptom-syndrome relationship matrix G T As the adjacency matrix of a heterogeneous knowledge graph, symptom-guided traditional Chinese medicine prescription features Z are generated through a two-layer graph convolutional neural network with ReLU activation function. M Symptom-guided syndrome characteristics Z T .
[0104] In step S3, Graph Convolutional Neural Network (GCN) is a deep learning model suitable for graph-structured data, capable of uncovering potential correlation features between nodes (such as symptoms, prescriptions, and syndrome types). GCN can aggregate information from neighboring nodes to uncover deep correlations (such as potential matching patterns between symptom combinations and prescriptions), and the ReLU activation function introduces nonlinearity to enhance feature representation capabilities.
[0105] S4: Symptom-guided characteristics of traditional Chinese medicine prescriptions Z M Calculate the predicted distribution probability y of traditional Chinese medicine prescriptions M and symptom-guided syndrome characteristics Z T Calculate the probability distribution y of the certificate type prediction T .
[0106] Preferably, the output features of the traditional Chinese medicine prescription or syndrome can be mapped to the [0,1] interval using the sigmoid function to achieve a probabilistic representation, such as y M The higher the probability value of a certain prescription, the greater the likelihood that it is suitable for the current symptoms.
[0107] S5: Predict the distribution probability y of traditional Chinese medicine prescriptions using the energy function. M The probability distribution of the sum of the two types of predictions y T The calculation yields the uncertainty score E for traditional Chinese medicine prescriptions. M Equity type uncertainty score E T .
[0108] In step S5, the energy function quantifies uncertainty based on the distribution of predicted probabilities. When the predicted probabilities are concentrated in a few options, the uncertainty score is low; when the probability distribution is dispersed and there are no obviously advantageous options, the uncertainty score is high, reflecting the reliability of the prediction results. The uncertainty score increases when there is a lot of data noise or atypical features.
[0109] S6: The first weight is obtained based on the uncertainty score of the traditional Chinese medicine prescription, and the second weight is obtained based on the uncertainty score of the syndrome type.
[0110] In step S6, the values of the first weight and the second weight range from [0,1]. By dynamically assigning weights based on uncertainty, the accuracy of model decision-making can be improved. For example, predictions with high uncertainty account for a higher proportion in the fusion, thereby reducing decision bias.
[0111] S7: Predicting the distribution probability y of traditional Chinese medicine prescriptions based on the first and second weights M The probability distribution of the sum of the two types of predictions y T Perform weighted calculations to obtain the probability distribution y after multi-source fusion. F ;
[0112] In step S7, the probability distribution y after multi-source fusion F It is a probability distribution that integrates the prediction results of traditional Chinese medicine prescriptions and syndrome types, and is used for the final prescription recommendation ranking. The fusion process of the probability distribution combines the prediction information from both the traditional Chinese medicine prescription and syndrome type perspectives, making the results more comprehensive and reliable.
[0113] S8: Output the distribution probability y after multi-source fusion. F Sort the prescriptions in descending order and output the top-ranked Chinese medicine prescriptions and their corresponding syndrome types. For example, the top-ranked prescription might be "Chaihu Tang" (Bupleurum Decoction), corresponding to the syndrome type "Liver Fire Disturbing the Heart Syndrome." The output results can provide clinicians with intuitive diagnostic and treatment references.
[0114] The above approach effectively integrates multi-source, heterogeneous TCM clinical data. By using structured coding and graph neural networks to mine the relationships between symptoms, prescriptions, and syndrome types, it solves the problem of data fusion difficulties in existing technologies. Simultaneously, an uncertainty quantification mechanism is introduced, dynamically allocating weights based on uncertainty to improve the credibility of prescription recommendations and avoid the limitations of single-perspective prediction. The comprehensive generation of recommendation results from multi-dimensional predictive information improves the accuracy and clinical applicability of prescription recommendations for insomnia, providing strong support for TCM clinical diagnosis and treatment.
[0115] In some embodiments, the calculation formula for step S3 is as follows:
[0116] Z M =GCN(G S G M );
[0117] Z T =GCN(G S G T );
[0118] GCN stands for Graph Convolutional Neural Network. Graph Convolutional Neural Networks update the features of a node by aggregating the feature information of its neighbors. It can effectively capture the dependencies and structural features between nodes in a graph and is suitable for processing data with related structures such as symptom-prescription and symptom-syndrome.
[0119] With G M For example, the first layer of GCN generates preliminary association features by calculating the local neighbor information of nodes (symptoms and traditional Chinese medicine prescriptions); the second layer, based on the features of the first layer, further aggregates higher-order neighbor information to explore deeper association patterns between symptoms and traditional Chinese medicine prescriptions, ultimately obtaining Z-factors that can effectively characterize the features of traditional Chinese medicine prescriptions. M Similarly, Z T This is through GCN to G T The processed syndrome characteristics. This feature extraction method can make full use of the correlation information in the TCM knowledge graph and retain the holistic view of "syndrome differentiation and treatment".
[0120] The calculation formula for step S4 is as follows:
[0121] y M =sigmoid(FC(Z) M ));
[0122] y T =sigmoid(FC(Z) T ));
[0123] Here, sigmoid is a mapping function used to convert the prediction result into a probability with a value in the range [0,1], and FC represents a fully connected neural network layer.
[0124] A fully connected neural network layer is a network layer composed of multiple neurons. Each neuron is connected to all neurons in the previous layer. It performs linear transformation on the input features through a weight matrix and combines bias terms to achieve non-linear mapping and dimensionality transformation of the features.
[0125] The fully connected neural network (FC) layer first processes the features Z extracted by the GCN. M and Z T The high-dimensional features are processed by mapping them to dimensions corresponding to the number of TCM prescription categories and syndrome types. Subsequently, the sigmoid function transforms the output of the FC layer, compressing the values to the [0,1] interval to obtain the probability distribution y. M and y T For example, if the FC layer outputs a feature value of 2.3 for a certain prescription, after calculation using the sigmoid function, a probability value of 0.9 is obtained, indicating that the prescription is 90% likely to be suitable for the current symptoms, thus giving the model output a clear probabilistic interpretation.
[0126] This study effectively mines the relational features in graph-structured data using Graph Convolutional Neural Networks (GCNs), fully utilizing the symptom-prescription and symptom-syndrome associations in Traditional Chinese Medicine (TCM) knowledge graphs. The prediction results are probabilistically transformed using a sigmoid function and fully connected layers, making the output intuitive and easy to understand, facilitating clinical application and enhancing the model's practicality. The combination of two GCN layers and the ReLU activation function strengthens the model's ability to express complex features, capturing more subtle correlations and improving the accuracy of feature extraction.
[0127] In some embodiments, the calculation formula for step S5 is as follows:
[0128]
[0129] Where θ represents an adjustable hyperparameter, and K represents the total number of predicted traditional Chinese medicine prescription categories. This represents the predicted distribution probability of the traditional Chinese medicine prescription corresponding to the current k-th category, and Q represents the total number of predicted syndrome types. Let e represent the probability distribution of the type prediction corresponding to the current q-th category, where e is the natural exponential function.
[0130] In this application, the energy function is a mathematical function used to quantify the uncertainty of a predicted probability distribution. Its core idea is to judge the reliability of the prediction result by measuring the degree of dispersion of the probability distribution. The more concentrated the distribution, the lower the uncertainty; the more dispersed the distribution, the higher the uncertainty. The function value changes accordingly to reflect this uncertainty.
[0131] The hyperparameter θ is a parameter manually set before model training to adjust the sensitivity of the energy function to the probability distribution. Different values of θ result in different levels of discrimination of probability differences by the energy function. Adjusting θ can make the uncertainty score more closely reflect the characteristics of actual clinical data.
[0132] The above scheme can effectively capture the dispersion characteristics of the probability distribution through the energy function, providing a quantitative indicator for evaluating the reliability of the prediction results and improving the interpretability of the model decision.
[0133] In some embodiments, the calculation formula for step S6 is as follows:
[0134] w M =E M ;
[0135] w T =E T ;
[0136] Among them, w M w represents the first weight. T Indicates the second weight;
[0137] The calculation formula for step S7 is as follows:
[0138] y F =-w M ·y M -w T ·y T .
[0139] The negative sign serves to unify the optimization direction, ensuring that high-probability values retain their advantage after fusion (because predictions with high uncertainty have higher weights, the negative sign prevents the weights from suppressing high-probability values). This formula is used to calculate y... M and y T A linear combination is performed, integrating information from two prediction perspectives, to generate the multi-source fused probability distribution y. F This allows the results to more comprehensively reflect the possibility of formula compatibility.
[0140] The above scheme enables dynamic fusion of multi-source prediction results. Weights are adjusted in real time based on prediction uncertainty, highlighting the contribution of high-information (high-uncertainty) predictions and improving the reliability of the fusion results. The weighting formula uses a negative sign to adjust the optimization direction, ensuring that the fusion results effectively retain high-probability prediction information, making the final recommended prescription more closely match the patient's actual symptom needs.
[0141] like Figure 2 As shown, in some embodiments, the method further includes:
[0142] S21: Predicting the distribution probability y based on traditional Chinese medicine prescriptions M The probability distribution of the sum of the two types of predictions y T Calculate the cross-entropy loss;
[0143] S22: Calculate the regularization function loss based on cross-entropy loss, the first weight, and the second weight;
[0144] S23: Calculate the total objective loss based on the cross-entropy loss and the regularization function loss, and optimize the model parameters by minimizing the total objective loss.
[0145] Furthermore, the calculation formula for step S21 is as follows:
[0146] L cls =-y(logy M +logy T );
[0147] Among them, L cls denoted by cross-entropy loss, and y represents the true label information of the training samples, corresponding to the correct prescription information;
[0148] The calculation formula for step S22 is as follows:
[0149] L reg =max(0,g(w) M ,w T )·L cls +|w M -w T |);
[0150]
[0151] Among them, L reg represents the loss function of regularization, max() represents the maximum value function, and |·| represents the absolute value function;
[0152] The calculation formula for step S23 is as follows:
[0153] L = L cls +λ1L reg ;
[0154] Where λ1 represents the hyperparameters of the balanced objective function optimization, and L represents the total objective loss.
[0155] In this embodiment, the cross-entropy loss L cls Used to measure the probability distribution of model predictions (probability of traditional Chinese medicine prescription prediction distribution). M , Probability of the distribution of the certificate type y T The loss function is the difference between the prediction result and the true label y (corresponding to the correct prescription information) of the training sample. The smaller the value, the closer the prediction result is to the actual situation.
[0156] Regularization function loss L reg Based on cross-entropy loss and first weight w M Second weight w T The constructed loss term is used to constrain the uncertainty of the model's predictions, reduce the risk of overfitting, and improve the model's generalization ability.
[0157] The total objective loss L is an optimization objective that combines the cross-entropy loss and the regularization function loss. By minimizing the total objective loss, the model parameter updates are guided, achieving a balance between prediction accuracy and stability.
[0158] Symbolic function g(w) M ,w T The calculation logic for regularization loss can be dynamically adjusted by outputting 1, 0, or -1. For example, when w M >w T When g(·) = 1, then L reg The size depends on L cls +∣w M -w T |, If the prediction error is large or the uncertainty varies greatly, L regIncreasing w forces the model to reduce error and narrow discrepancies; M <w T When, g(·)=-1, L reg Depends on -L cls +∣w M -w T Even if the prediction error is small, if the uncertainty varies greatly, L reg It may still increase, so we must ensure that the model prioritizes balancing uncertainty.
[0159] When calculating the total loss, λ1 controls the weight of the regularization loss. When the model shows signs of overfitting (e.g., good performance on the training set but poor performance on the validation set), increasing λ1 can strengthen the regularization loss. reg The constraint effect of w M with w T To achieve consistency, the model reduces overfitting to the details of the training data, thus improving generalization ability. Conversely, if the model is underfitting, λ1 can be reduced, and L can be optimized more preferentially. cls To improve the accuracy of predictions.
[0160] The piecewise logic of the sign function makes the regularization loss more targeted, dynamically adapting to different uncertainty score relationships and improving the optimization efficiency of the loss function. The introduction of the hyperparameter λ1 increases the flexibility of model tuning, allowing the regularization strength to be adjusted according to the characteristics of clinical data, balancing prediction accuracy and generalization ability. The regularization function constrains the consistency of uncertainty scores, avoiding the influence of single data source bias on model decisions, and improving the credibility and stability of prescription recommendations.
[0161] Furthermore, the method also includes:
[0162] Based on the distribution probability y after multi-source fusion F The loss is calculated using the following formula based on the decision probability distribution.
[0163] L cls-a =-y log y F ;
[0164] Among them, L cls-a This represents the loss due to the probability distribution of the decision;
[0165] Step S23 includes:
[0166] The total objective loss is calculated based on the cross-entropy loss, the regularization function loss, and the decision probability distribution loss. The model parameters are then optimized by minimizing the total objective loss. The formula for calculating the total loss function is as follows:
[0167] L = L cls +λ1L reg +λ2L cls-a ;
[0168] Where λ2 represents the hyperparameters for optimizing the equilibrium objective function.
[0169] The newly added L cls-a This approach allows the model to simultaneously focus on single-source prediction accuracy, uncertainty consistency, and the reliability of the fusion result, by adjusting the optimization weights of the fusion result using λ². For example, when there are biases in multi-source fusion, increasing λ² can strengthen the optimization of y. F The optimization ensures that the probability distribution after fusion is closer to the actual clinical prescription recommendation needs.
[0170] The above scheme directly optimizes the fusion results through decision probability distribution loss, ensuring the synergistic effect of multi-source information fusion, avoiding the accumulation of single-source prediction errors during fusion, and improving the accuracy of the final recommendation. Fine-tuning is achieved through the total loss function using λ1 and λ2, taking into account single-source prediction, uncertainty constraints, and fusion logic, making the model more adaptable to the complexity of multi-source heterogeneous data in traditional Chinese medicine. Targeted optimization of the fusion results enhances the model's clinical applicability, ensuring that the recommended prescriptions not only conform to single-source prediction patterns but also align with the multi-dimensional comprehensive diagnostic logic of traditional Chinese medicine.
[0171] In some embodiments, such as Figure 3 As shown, the method further includes:
[0172] S301: Obtain the patient's tongue image I, where I∈R H×W×3 H and W represent the height and width of the tongue image, respectively, and 3 represents the RGB channel;
[0173] S302: Extract the global feature vector V of tongue image using a pre-trained ResNet-50 network, reduce its dimensionality to the same dimension as the number of symptom items d through a fully connected layer, and obtain the dimensionality-reduced global feature vector V' of tongue image. The calculation formula is as follows:
[0174] V' = ReLU(W v ·V+b v );
[0175] Where ReLU represents the activation function, V∈R 2048 , representing the global feature vector output by the last layer of the ResNet-50 network, with dimensions of 2048, W v ∈R d×2048 , represents the trainable weight matrix, b v ∈R d Represents the bias vector;
[0176] S303: Calculating the dimensionality-reduced global feature vector V' of the tongue image and the sparse binary coding matrix G based on the attention mechanism. s The association weight α, α∈R d The calculation formula is as follows:
[0177]
[0178] Where μ represents the loop index variable, W α Let W represent the trainable attention weight matrix. a ∈R d×d ,α j Let V' represent the correlation between the global feature vector of the tongue image and the j-th symptom, exp(·) represent the natural exponential function, and G s [:,j]∈R d×1 G represents the occurrence of the j-th symptom in the original symptom information of all patients. s [:,μ] represents the occurrence of the μ-th symptom in the original symptom information of all patients, and the value of μ ranges from [1,d].
[0179] S304: Correct the uncertainty score E of the traditional Chinese medicine prescription based on the association weight α. M The calculation formula is as follows:
[0180] E M '=E M ·(1+γ·mean(α));
[0181] Among them, E M ' represents the corrected uncertainty score of the traditional Chinese medicine prescription, mean(α) represents the mean of the association weights, γ represents the influence factor, γ∈[0.1,0.5].
[0182] When tongue appearance is closely related to symptoms (i.e., mean(α) is high), tongue appearance information enhances the correction of uncertainty. For example, when tongue appearance supports the suitability of a certain prescription, E M The uncertainty score is reduced, making it more consistent with the TCM diagnostic logic of "tongue appearance-symptoms-prescription".
[0183] The above-mentioned approach enriches the multi-source information dimensions by introducing tongue image data, aligning with the TCM theory of "combining the four diagnostic methods," and addresses the shortcomings of existing technologies that neglect unstructured visual data, thereby improving the comprehensiveness of data utilization. By dynamically calculating the association weight between tongue image and symptoms through an attention mechanism, the use of tongue image information becomes more targeted, avoiding interference from irrelevant features and enhancing the accuracy of uncertainty scoring. The uncertainty score after tongue image correction is more in line with the logic of TCM diagnosis and treatment, further narrowing the gap between model prediction and clinical diagnosis, and improving the accuracy of prescription recommendations and consistency with TCM theory.
[0184] In a second aspect, this application also provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the multi-source confidence sensing intelligent prescription recommendation method for insomnia as described in the first aspect of this application.
[0185] The computer-readable storage medium may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
[0186] The non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD ROM); the magnetic surface memory may be a disk storage device or a magnetic tape storage device.
[0187] The volatile memory may be random access memory (RAM), which serves as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synclink dynamic random access memory (SLDRAM), and direct memory bus random access memory (DRRAM). The computer-readable storage media described in the embodiments of this application are intended to include these and any other suitable types of memory.
[0188] like Figure 5 As shown, in a third aspect, this application provides an electronic device 10, including a processor 101 and a storage medium 102, wherein a computer program is stored on the storage medium, and the computer program, when executed by the processor, implements the insomnia intelligent prescription recommendation method with multi-source confidence sensing as described in the first aspect of this application.
[0189] In some embodiments, the processor may be implemented by software, hardware, firmware, or a combination thereof, and may use at least one of the following: circuit, single or multiple application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), central processing units (CPUs), controllers, microcontrollers, and microprocessors, thereby enabling the processor to execute some or all of the steps or any combination of the steps in the multi-source confidence sensing intelligent prescription recommendation method for insomnia described in the various embodiments of this application.
[0190] Finally, it should be noted that although the above embodiments have been described in the text and drawings of this application, this should not limit the scope of patent protection of this application. Any technical solutions that are based on the essential concept of this application and utilize the content described in the text and drawings of this application, resulting in equivalent structural or procedural substitutions or modifications, as well as the direct or indirect application of the technical solutions of the above embodiments to other related technical fields, are all included within the scope of patent protection of this application.
Claims
1. A method for recommending intelligent prescriptions for insomnia based on multi-source confidence sensing, characterized in that, The method includes: S1: Obtain the original symptom information of multiple patients, and convert the obtained original symptom information into an n×d dimensional sparse binary coding matrix G. s Among them, G s ∈{0,1} n×d n represents the number of patients, d represents the number of symptom items, and G s {ij} = 1 indicates that the j-th symptom exists in the original symptom information of the i-th patient, where the value of i ranges from [1, n] and the value of j ranges from [1, d]. S2: Extract the symptom-prescription relationship matrix G related to insomnia from the Traditional Chinese Medicine knowledge graph database. M Symptom-syndrome relationship matrix G T Among them, G M ∈{0,1} d×m m represents the quantity of traditional Chinese medicine prescriptions, G T ∈{0,1} d×t t represents the number of certificate types, G M {ab} = 1 indicates that symptom a is related to the traditional Chinese medicine prescription in item b. G T {ab} = 1 indicates that symptom a is related to syndrome type b; S3: Symptom-Traditional Chinese Medicine Prescription Relationship Matrix G M Symptom-syndrome relationship matrix G T As the adjacency matrix of a heterogeneous knowledge graph, symptom-guided traditional Chinese medicine prescription features Z are generated through a two-layer graph convolutional neural network with ReLU activation function. M Symptom-guided syndrome characteristics Z T ; S4: Symptom-guided characteristics of traditional Chinese medicine prescriptions Z M Calculate the predicted distribution probability y of traditional Chinese medicine prescriptions M and symptom-guided syndrome characteristics Z T Calculate the probability distribution y of the type prediction T ; S5: Predict the distribution probability y of traditional Chinese medicine prescriptions using the energy function. M The probability distribution of the sum of the two types of predictions y T The calculation yields the uncertainty score E for traditional Chinese medicine prescriptions. M Equity type uncertainty score E T ; S6: The first weight is obtained based on the uncertainty score of the Chinese medicine prescription, and the second weight is obtained based on the uncertainty score of the syndrome type. The value range of the first weight and the second weight is [0,1]. S7: Predicting the distribution probability y of traditional Chinese medicine prescriptions based on the first and second weights M The probability distribution of the sum of the two types of predictions y T Perform weighted calculations to obtain the probability distribution y after multi-source fusion. F ; S8: Output the distribution probability y after multi-source fusion. F Sort the prescriptions in descending order and output the top-ranked Chinese medicine prescriptions and their corresponding syndrome types.
2. The method for recommending intelligent prescriptions for insomnia based on multi-source confidence sensing as described in claim 1, characterized in that, The calculation formula for step S3 is as follows: Z M =GCN(G S ,G M ); Z T =GCN(G S ,G T ); Wherein, GCN stands for Graph Convolutional Neural Network; The calculation formula for step S4 is as follows: y M =sigmoid(FC(Z M )); y T =sigmoid(FC(Z T )); Here, sigmoid is a mapping function used to convert the prediction result into a probability with a value in the range [0,1], and FC represents a fully connected neural network layer.
3. The method for recommending intelligent prescriptions for insomnia based on multi-source confidence sensing as described in claim 2, characterized in that, The calculation formula for step S5 is as follows: Where θ represents an adjustable hyperparameter, and K represents the total number of predicted traditional Chinese medicine prescription categories. This represents the predicted distribution probability of the traditional Chinese medicine prescription corresponding to the current k-th category, and Q represents the total number of predicted syndrome types. Let e represent the probability distribution of the type prediction corresponding to the current q-th category, where e is the natural exponential function.
4. The method for recommending intelligent prescriptions for insomnia based on multi-source confidence sensing as described in claim 3, characterized in that, The calculation formula for step S6 is as follows: w M =E M ; w T =E T ; Among them, w M w represents the first weight. T Indicates the second weight; The calculation formula for step S7 is as follows: y F =-w M ·y M -w T ·y T 。 5. The method for recommending intelligent prescriptions for insomnia based on multi-source confidence sensing as described in claim 4, characterized in that, The method further includes: S21: Predicting the distribution probability y based on traditional Chinese medicine prescriptions M The probability distribution of the sum of the two types of predictions y T Calculate the cross-entropy loss; S22: Calculate the regularization function loss based on cross-entropy loss, the first weight, and the second weight; S23: Calculate the total objective loss based on the cross-entropy loss and the regularization function loss, and optimize the model parameters by minimizing the total objective loss.
6. The method for recommending intelligent prescriptions for insomnia based on multi-source confidence sensing as described in claim 5, characterized in that, The calculation formula for step S21 is as follows: L cls =-y(logy M +logy T ); Among them, L cls denoted by cross-entropy loss, and y represents the true label information of the training samples, corresponding to the correct prescription information; The calculation formula for step S22 is as follows: L reg =max(0,g(w M ,w T )·L cls +|w M -w T |); Among them, L reg represents the loss function of regularization, max() represents the maximum value function, and |·| represents the absolute value function; The calculation formula for step S23 is as follows: L=L cls +λ1L reg ; Where λ1 represents the hyperparameters of the balanced objective function optimization, and L represents the total objective loss.
7. The method for recommending intelligent prescriptions for insomnia based on multi-source confidence sensing as described in claim 6, characterized in that, The method further includes: Based on the distribution probability y after multi-source fusion F The loss is calculated using the following formula: L cls-a =-y logy F ; Among them, L cls-a This represents the loss due to the probability distribution of the decision; Step S23 includes: The total objective loss is calculated based on the cross-entropy loss, the regularization function loss, and the decision probability distribution loss. The model parameters are then optimized by minimizing the total objective loss. The formula for calculating the total loss function is as follows: L=L cls +λ1L reg +λ2L cls-a ; Where λ2 represents the hyperparameters for optimizing the equilibrium objective function.
8. The method for recommending intelligent prescriptions for insomnia based on multi-source confidence sensing as described in claim 1, characterized in that, The method further includes: Obtain the patient's tongue image I, where I∈R H×W×3 H and W represent the height and width of the tongue image, respectively, and 3 represents the RGB channel; The global feature vector V of tongue image is extracted by a pre-trained ResNet-50 network, and then reduced to the same dimension as the number of symptom items d through a fully connected layer to obtain the dimensionality-reduced global feature vector V' of tongue image. The calculation formula is as follows: V'=ReLU(W v ·V+b v ); Where ReLU represents the activation function, V∈R 2048 , representing the global feature vector output by the last layer of the ResNet-50 network, with dimensions of 2048, W v ∈R d×2048 , represents the trainable weight matrix, b v ∈R d Represents the bias vector; The reduced global feature vector V' of the tongue image and the sparse binary encoding matrix G are calculated based on the attention mechanism. s The association weight α, α∈R d The calculation formula is as follows: Where μ represents the loop index variable, W α W represents the trainable attention weight matrix. a ∈R d×d ,α j Let V' represent the correlation between the global feature vector of the tongue image and the j-th symptom, exp(·) represent the natural exponential function, and G s [:,j]∈R d×1 G represents the occurrence of the j-th symptom in the original symptom information of all patients. s [:,μ] represents the occurrence of the μ-th symptom in the original symptom information of all patients, and the value of μ ranges from [1,d]. The uncertainty score E of the traditional Chinese medicine prescription is corrected based on the association weight α. M The calculation formula is as follows: E M '=E M ·(1+γ·mean(α)); Among them, E M ' represents the corrected uncertainty score of the traditional Chinese medicine prescription, mean(α) represents the mean of the association weights, γ represents the influence factor, γ∈[0.1,0.5].
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the insomnia intelligent prescription recommendation method based on multi-source confidence perception as described in any one of claims 1 to 8.
10. An electronic device having a computer program stored thereon, characterized in that, The device includes a processor and a storage medium, wherein a computer program is stored on the storage medium, and when executed by the processor, the computer program implements the multi-source confidence sensing intelligent prescription recommendation method for insomnia as described in any one of claims 1 to 8.
Citation Information
Cited By
Ranking information recommendation method based on distribution entropy
CN122285959A
A ranking information recommendation method based on distribution entropy
CN122285959B