A traditional chinese medicine prescription drug attribute classification method based on graph convolution network
By constructing a feature matrix and directed graph of traditional Chinese medicine prescriptions using a graph convolutional network-based approach, and combining ChebNet graph convolutional layers and multi-head attention mechanism, the problem of low accuracy in determining the drug attributes of traditional Chinese medicine prescriptions is solved, achieving higher classification accuracy and model stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- INST OF INFORMATION ON TRADITIONAL CHINESE MEDICINE CACMS
- Filing Date
- 2025-10-11
- Publication Date
- 2026-04-14
AI Technical Summary
The accuracy of existing technologies in determining the principal, assistant, adjuvant, and guide drugs in traditional Chinese medicine prescriptions still needs improvement, especially in the identification of assistant drugs.
A graph convolutional network-based approach is adopted to construct a feature matrix of traditional Chinese medicine prescriptions, calculate the weights of drug edges, construct a directed graph, and train and classify it through a graph convolutional neural network with ChebNet graph convolutional layers and multi-head attention mechanism.
It significantly improves the classification accuracy of the properties of principal, assistant, adjuvant, and guide drugs, reduces the risk of overfitting in the model, improves the information dissemination efficiency and numerical stability in large-scale drug networks, and enhances the robustness and generalizability to unknown samples.
Smart Images

Figure CN120951099B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of TCM prescription drug attribute classification technology, and in particular to a TCM prescription drug attribute classification method based on graph convolutional networks. Background Technology
[0002] Traditional Chinese medicine (TCM) prescriptions are not simply a collection of drugs or a mere addition of their effects. Rather, they are formulated based on the needs of the disease, following the principles of syndrome differentiation and treatment, selecting appropriate drugs, and specifying suitable dosages. Through generations of experience, TCM physicians have continuously summarized their findings, gradually forming a relatively complete theory of TCM drug compatibility—the theory of principal, assistant, adjuvant, and guide herbs. This theory not only reveals the primary and secondary roles of drugs in a prescription, providing important guidance for clinical prescription and medication, but also serves as the basis for analyzing and researching effective prescriptions from ancient and modern times, as well as for creating new prescriptions in clinical practice.
[0003] However, how to determine the principal, assistant, adjuvant, and guide properties of drugs in a prescription remains highly controversial. Early studies primarily focused on qualitative analysis, exploring factors influencing these properties. For example, Li Ji and He Taozan argued that potency should be the primary criterion; Zhu Yuyang advocated efficacy; Duan Fujin believed a comprehensive consideration of efficacy, potency, and dosage; Lin Lin et al. argued for a combination of syndrome differentiation and treatment principles, determining the properties based on the drug's nature, flavor, meridian tropism, and function; Tong Xiaolin et al. proposed a model of "principal treatment as principal, secondary treatment as assistant, eight principles as adjuvant, and guiding to the meridian as guide"; Zhou Ming proposed three models of "principal, assistant, adjuvant, and guide" based on subjective assessment, disease expectation, and prescription manifestation; Zhang Fang et al. proposed a comprehensive method to determine the status of each drug by referring to the drug efficacy descriptions in the Pharmacopoeia, dosage, number of ingredients, primary and secondary disease indications, new prescription names, and whether the drug is necessary; and Jin Yuli et al. proposed a model for defining drug concepts based on the "six pathogenic factors" theory in the *Huangdi Neijing*.
[0004] In recent years, with the development of information technology, some scholars have begun to attempt to use information technology to build models to automatically determine the drug attributes in prescriptions. However, the accuracy still needs to be improved. For example, Li Yuanbai et al. proposed the relationship between the "relative dosage of Chinese medicine" and the principal, assistant, adjuvant, and guide herbs. Ma Jialin et al. constructed a pun-based topic model (DCTM) based on Bayesian network theory, using two explicit variables—disease and Chinese medicine—as clues to mine and analyze the implicit structure of the principal, assistant, adjuvant, and guide herbs. The results showed that the model was relatively accurate in identifying the principal herb and could correctly identify the assistant herbs in most classical prescriptions, but the identification results for the assistant herbs were generally poor. Therefore, it is very necessary to design a method for classifying the drug attributes of Chinese medicine prescriptions based on graph convolutional networks. Summary of the Invention
[0005] To overcome the shortcomings of existing technologies, the purpose of this invention is to provide a method for classifying the drug attributes of traditional Chinese medicine prescriptions based on graph convolutional networks.
[0006] To achieve the above objectives, the present invention provides the following solution:
[0007] This invention also provides a method for classifying the drug attributes of traditional Chinese medicine prescriptions based on graph convolutional networks, including:
[0008] Step 1: Construct the feature matrix of traditional Chinese medicine prescriptions;
[0009] Step 2: Calculate the weight of the Chinese medicine prescription-drug edge;
[0010] Step 3: Construct a directed graph with Chinese herbal formulas as subgraphs and herbs as nodes;
[0011] Step 4: Construct a classification model of drug attributes for traditional Chinese medicine prescriptions, and train it based on the feature matrix of traditional Chinese medicine prescriptions and a directed graph;
[0012] Step 5: Classify the drug attributes of traditional Chinese medicine prescriptions based on the trained TCM prescription drug attribute classification model.
[0013] Preferably, in step 1, constructing the feature matrix of traditional Chinese medicine prescriptions specifically involves:
[0014] Obtain the original data of traditional Chinese medicine prescriptions and classify and organize them;
[0015] Perform basic cleaning and format conversion on the classified and organized Chinese herbal medicine prescription data;
[0016] Based on the BERT model, the function description of traditional Chinese medicine prescriptions and the efficacy description of drugs are vectorized, and the cosine similarity is calculated to measure the correlation between the two, and finally the correlation index is obtained.
[0017] By integrating the obtained data, a feature matrix of traditional Chinese medicine prescriptions is constructed, and prescriptions are set. The included herbal collection is ,in Indicates the first There are several herbs, and the feature vector of each herb is: Then the prescription c eigenvectors for:
[0018] ;
[0019] In the formula, This refers to the quantity of herbs in the prescription.
[0020] Preferably, in step 2, the weight of the traditional Chinese medicine formula-drug edge is calculated as follows:
[0021] The calculation constructs basic associations based on the similarity between herbs, and quantifies the structural similarity between pairs of herbs using cosine similarity. For any herb node... d i andd j The edge weights are calculated to form a symmetric matrix reflecting the similarity of medicinal properties. This matrix directly encodes the geometric proximity of herbs in the feature space, given two vectors. and The cosine similarity between them for:
[0022] ;
[0023] In the formula, Let ||v|| denote the dot product of vectors, and ||v|| denote the magnitude of the vector.
[0024] The computation of information-theory-based dependency metrics defines the nodes of traditional Chinese medicine prescriptions. c For drugs d Dependence on traditional Chinese medicine prescriptions Drug nodes Dependence for:
[0025] ;
[0026] In the formula, Indicates Chinese medicine prescriptions The length of the drug, i.e., the number of drugs contained therein; Indicates that it contains drugs The average length of all Chinese herbal prescriptions; This refers to the total number of traditional Chinese medicine prescriptions. For containing drugs The number of traditional Chinese medicine prescriptions;
[0027] The final edge weights are calculated using a combined weighting strategy, as follows:
[0028] ;
[0029] In the formula, It is the edge weight; It is a hyperparameter used to balance the contribution of topological similarity and functional dependency; It is the similarity value in the basic similarity matrix; C ij It contains at the same time and A collection of traditional Chinese medicine prescriptions; and These represent the pairs of traditional Chinese medicine formulas, c and c. and Dependence on.
[0030] Preferably, in step 3, a directed graph is constructed with traditional Chinese medicine prescriptions as subgraphs and drugs as nodes, specifically as follows:
[0031] Using traditional Chinese medicine formulas as subgraphs and drugs as nodes, a separate subgraph is constructed for each traditional Chinese medicine formula, focusing on the drugs in the formula and their interrelationships. All subgraphs are merged into a general graph to form a directed graph that covers the drug relationships of all traditional Chinese medicine formulas.
[0032] Preferably, the TCM prescription drug attribute classification model is a graph convolutional neural network using ChebNet graph convolutional layers and incorporating a multi-head attention mechanism, and its model is optimized using the cross-entropy loss function, as follows:
[0033] ;
[0034] In the formula, For real labels, Predict probabilities for the model.
[0035] According to specific embodiments provided by the present invention, the present invention discloses the following technical effects:
[0036] This invention provides a method for classifying the drug attributes of traditional Chinese medicine (TCM) prescriptions based on graph convolutional networks. The method includes constructing a feature matrix of TCM prescriptions, calculating the weights of TCM prescription-drug edges, constructing a directed graph with TCM prescriptions as subgraphs and drugs as nodes, building a TCM prescription drug attribute classification model, training the model based on the TCM prescription feature matrix and the directed graph, and classifying the drug attributes of TCM prescriptions based on the trained TCM prescription drug attribute classification model. This invention reduces the feature filtering complexity of graph convolution operations by introducing Chebyshev polynomial expansion to approximate the graph Laplacian operator, improving the efficiency and numerical stability of information propagation in large-scale drug networks. Simultaneously, by combining a multi-head graph attention mechanism, it can adaptively learn the heterogeneous relationship weights between different drug nodes in the prescription, significantly enhancing the modeling ability for complex multi-level dependencies of "principal, assistant, adjuvant, and guide" relationships. Furthermore, through a multi-layer graph neural network structure, normalization, and regularization, it effectively improves the model's generalization ability and convergence stability, reduces the risk of overfitting, and ensures better robustness and generalizability for unknown samples. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a schematic diagram of the process for classifying the drug attributes of traditional Chinese medicine prescriptions based on graph convolutional networks, provided in an embodiment of the present invention.
[0039] Figure 2 This is a schematic diagram of the quantitative analysis process of the correlation between prescriptions and herbs based on the BERT model.
[0040] Figure 3 A schematic diagram of the framework for a classification model of drug properties in traditional Chinese medicine prescriptions. Detailed Implementation
[0041] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0042] The purpose of this invention is to provide a method for classifying the drug attributes of traditional Chinese medicine prescriptions based on graph convolutional networks. This method reduces the feature filtering complexity of graph convolution operations, improves the efficiency and numerical stability of information propagation in large-scale drug networks, and effectively enhances the generalization ability and convergence stability of the model through multi-layer graph neural network structure, normalization and regularization processing, reduces the risk of overfitting, and ensures better robustness and generalizability for unknown samples.
[0043] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0044] Figure 1 This is a schematic diagram of the process for classifying the drug attributes of traditional Chinese medicine prescriptions based on graph convolutional networks, as provided in an embodiment of the present invention. Figure 1 As shown, this invention provides a method for classifying the drug attributes of traditional Chinese medicine prescriptions based on graph convolutional networks, including:
[0045] Step 1: Construct the feature matrix of traditional Chinese medicine prescriptions;
[0046] Step 2: Calculate the weight of the Chinese medicine prescription-drug edge;
[0047] Step 3: Construct a directed graph with Chinese herbal formulas as subgraphs and herbs as nodes;
[0048] Step 4: Construct a classification model of drug attributes for traditional Chinese medicine prescriptions, and train it based on the feature matrix of traditional Chinese medicine prescriptions and a directed graph;
[0049] Step 5: Classify the drug attributes of traditional Chinese medicine prescriptions based on the trained TCM prescription drug attribute classification model.
[0050] It should be noted that the data in this invention comes from the prescriptions included in the national higher education textbook for traditional Chinese medicine, "Formulary".
[0051] In step 1, the feature matrix of traditional Chinese medicine prescriptions is constructed, specifically as follows:
[0052] The original data of Chinese herbal medicine prescriptions were obtained and classified. First, the original data were systematically classified and organized to ensure that each record contained key information such as prescription name, constituent drugs, and indications. The efficacy of the prescription and the various attributes of each drug were recorded in detail, such as dosage, nature (cold, hot, warm, cool, etc.) and meridian tropism (lung, liver, spleen, kidney, etc.). These attributes not only reflect the intrinsic characteristics of the drugs, but also directly affect the overall efficacy and compatibility principles of the prescription.
[0053] Basic cleaning and format conversion were performed on the classified and organized Chinese herbal medicine prescription data. In order to ensure the accuracy and reliability of subsequent analysis, basic cleaning and format conversion were performed on the data, including classifying drug attributes, uniformly converting the dosage ratio to a numerical type, handling missing values and outliers, converting text attributes such as nature and taste and meridian tropism to numerical codes, and uniformly converting all data columns to numerical types to eliminate data type differences.
[0054] like Figure 2 As shown, based on the BERT model, the function description of Chinese herbal prescriptions and the efficacy description of drugs are vectorized, and the cosine similarity is calculated to measure the correlation between the two, and finally the correlation index is obtained.
[0055] By integrating the obtained data, a feature matrix of traditional Chinese medicine prescriptions is constructed, and prescriptions are set. The included herbal collection is ,in Indicates the first There are several herbs, and the feature vector of each herb is: Then the prescription c eigenvectors for:
[0056] ;
[0057] In the formula, The quantity of herbs in the prescription;
[0058] This matrix not only includes the basic attributes of prescriptions and drugs, but also integrates the correlation indicators calculated by the BERT model, providing a rich and high-quality data foundation for subsequent model training and analysis. It ensures that the construction process of the feature matrix is both rigorous and comprehensive, laying a solid foundation for in-depth analysis of traditional Chinese medicine prescription data and model application.
[0059] In this invention, an embodiment is provided, and the basic situation of the herbal feature matrix of Fangfeng Tongsheng San formula is shown in Table 1.
[0060] Table 1. Basic Information Matrix of Fangfeng Tongsheng Powder Formula - Herbal Characteristic Matrix
[0061]
[0062]
[0063] In step 2, the weights of the traditional Chinese medicine formula-drug edge are calculated, specifically as follows:
[0064] The calculation constructs basic associations based on the similarity between herbs, and quantifies the structural similarity between pairs of herbs using cosine similarity. For any herb node... d i and d j The edge weights are calculated to form a symmetric matrix reflecting the similarity of medicinal properties. This matrix directly encodes the geometric proximity of herbs in the feature space, given two vectors. and The cosine similarity between them for:
[0065] ;
[0066] In the formula, Let ||v|| denote the dot product of vectors, and ||v|| denote the magnitude of the vector.
[0067] The computation of information-theory-based dependency metrics defines the nodes of traditional Chinese medicine prescriptions. c For drugs d Dependence on traditional Chinese medicine prescriptions Drug nodes Dependence for:
[0068] ;
[0069] In the formula, Indicates Chinese medicine prescriptions The length of the drug, i.e., the number of drugs contained therein; Indicates that it contains drugs The average length of all Chinese herbal prescriptions; This refers to the total number of traditional Chinese medicine prescriptions. For containing drugs The number of traditional Chinese medicine prescriptions;
[0070] The final edge weights employ a fusion weighting strategy, combining basic similarity with functional dependency. This preserves the similarity of local structures while strengthening the global matching pattern. Common components in the formula set modulate the dependency, and hyperparameters balance the contributions of topological similarity and functional dependency, resulting in composite weights:
[0071] ;
[0072] In the formula, It is the edge weight; It is a hyperparameter used to balance the contribution of topological similarity and functional dependency; It is the similarity value in the basic similarity matrix; C ij It contains at the same time and A collection of traditional Chinese medicine prescriptions; and These represent the pairs of traditional Chinese medicine formulas, c and c. and Dependence on.
[0073] In step 3, a directed graph is constructed with traditional Chinese medicine prescriptions as subgraphs and drugs as nodes, specifically as follows:
[0074] This embodiment utilizes Python's `networkx` library to construct a directed graph (DiGraph) to reveal the complex relationship network between Chinese herbal medicines. In the directed graph, each node represents a unique medicine and contains rich feature information, including the medicine's attributes (such as its nature and flavor, and meridian tropism), dosage ratio, and the "principal, assistant, adjuvant, and guide" coding. The latter clarifies the position and role of the medicine in the prescription from the perspective of traditional Chinese medicine theory, providing an important basis for in-depth analysis. Based on this, a subgraph is constructed for each prescription, focusing on the medicines in the prescription and their interrelationships, clearly showing its unique drug compatibility pattern. Subsequently, all subgraphs are merged into a general graph, forming a comprehensive network covering the drug relationships of all prescriptions. To facilitate unified comparison and analysis of different subgraphs, the adjacency matrix of the subgraphs is normalized to ensure that the data of all subgraphs are consistent and comparable in scale and scope. This method provides strong support for mining the commonalities and differences between different prescriptions and further promotes the research on the compatibility rules of Chinese herbal medicines.
[0075] This paper introduces a classification model for the attributes of drugs in traditional Chinese medicine (TCM) prescriptions. This model is primarily based on the theoretical framework of Graph Convolutional Networks (GCNs), focusing on using ChebNet graph convolutional layers to process graph-structured data. First, the normalization of the adjacency matrix is a core step in graph convolution operations, aiming to ensure numerical stability and improve model performance. Specifically, the normalization process calculates the reciprocal of the square root of the degree matrix of the adjacency matrix and applies it to the adjacency matrix, thereby achieving a standardized representation of the graph structure. This process converts the adjacency matrix into a sparse matrix form, calculates the sum of each row and takes its reciprocal square root, generating a diagonal matrix, and finally completes the normalization operation through matrix multiplication.
[0076] In the design of ChebNet's graph convolutional layers, the model utilizes Chebyshev polynomials to locally approximate the graph Laplacian matrix, effectively avoiding the high computational complexity of global spectral decomposition while capturing high-order neighborhood information of nodes. The Chebyshev graph convolutional layer initializes weight parameters and transforms input features using Chebyshev polynomials, propagating node features layer by layer. During model initialization, a sequence of Chebyshev polynomials is generated using the normalized Laplacian matrix, providing the foundation for subsequent graph convolution operations.
[0077] To further enhance the model's ability to represent node features in complex graph structures, this study introduces a multi-head attention mechanism. Multi-head attention, through multiple parallel attention heads, independently learns the association weights between nodes in different subspaces, thereby capturing diverse node interaction patterns. Specifically, each attention head includes an independent linear transformation to map input features to different feature spaces; subsequently, the weighted contributions of neighboring node features are dynamically adjusted by learning attention coefficients between nodes. The outputs of each attention head are integrated through concatenation or averaging, enhancing the model's representational power. This mechanism also combines residual connections and layer normalization (LayerNorm) to stabilize the training process and prevent gradient vanishing. Dropout further enhances the model's generalization ability.
[0078] Multi-layered GCN models achieve multi-level representation learning of graph data by stacking multiple graph convolutional layers, combining Chebyshev multinomial local spectral convolution and multi-head attention mechanisms, as well as different activation functions (such as ELU and ReLU) and regularization techniques (such as Dropout and BatchNorm). Basic graph convolution operations combine input features with the adjacency matrix through matrix multiplication and apply activation functions for nonlinear transformations, thereby progressively extracting higher-order features from the graph structure. Finally, the model outputs the node classification results by propagating node features layer by layer.
[0079] This invention combines the locality of graph convolution, the efficient approximation of Chebyshev polynomials, and the diverse feature aggregation capabilities of multi-head attention mechanisms. This not only reduces computational complexity but also enhances the representational ability of complex graph-structured data. This design provides theoretical support and practical guidance for graph neural networks in processing large-scale and complex herbal formula relationships, and has broad application prospects.
[0080] A schematic diagram of the TCM prescription drug attribute classification model framework is shown below. Figure 3 As shown;
[0081] The ChebNet graph convolutional layer, graph convolutional neural network, and multi-head attention mechanism will be introduced separately:
[0082] 1. ChebNet graph convolution layer.
[0083] ChebNet's graph convolutional layer is a graph convolution operation based on Chebyshev polynomials. It aims to achieve efficient representation learning of graph data through polynomial approximation. Unlike traditional Graph Convolutional Networks (GCNs), ChebNet uses Chebyshev polynomials to locally approximate the graph Laplacian matrix, thus avoiding the computational overhead of global spectral decomposition, while simultaneously capturing high-order neighborhood information of nodes in the graph. The graph convolution operation based on Chebyshev polynomials can be represented as:
[0084] ;
[0085] in, It is a normalized Laplace matrix; It is a Chebyshev polynomial; These are learnable parameters; It is the order of the polynomial;
[0086] Multi-layer GCN model: Combining basic graph convolutional layers and ChebNet graph convolutional layers, a multi-layer GCN model is constructed to capture the complex relationships between drugs.
[0087] 2. Graph Convolutional Network (GCN).
[0088] Graph Convolutional Networks ( GCN This is a graph-based deep learning model that learns representations of graph data by extending convolutional operations to non-Euclidean data domains. Its core training mechanism involves minimizing the loss function of known labeled nodes and optimizing shared weight parameters using backpropagation, given the graph structure. ,in (node set, )and (Edge set) represents the relationship between vertices and edges. The mathematical basis of graph convolution operation can be realized through the spectral decomposition of the graph Laplacian matrix. Specifically, the Laplacian matrix is defined as... The adjacency matrix Encodes the connection relationships between nodes, for the angle matrix satisfy Node feature matrix The Row corresponding node of 3D feature vector In the spectral domain graph convolution framework, the graph signal After Fourier transform, it is characterized as ,in, Given an orthogonal basis consisting of the eigenvectors of the Laplacian matrix, the propagation rule of the graph convolutional layer can be formalized as follows:
[0089] ;
[0090] In the formula, It is an adjacency matrix with self-loops added; yes The degree matrix; These are the node features of the l-th layer; It is the learnable weight matrix of the l-th layer; It is an activation function (such as...) ReLU ).
[0091] 3. Multi-Head Attention.
[0092] Multi-head attention is a graph neural network module that enhances the representational power of node features by using multiple self-attention heads in parallel. This mechanism effectively captures multi-dimensional interaction information of nodes by independently learning the correlations between nodes in different subspaces, thereby enhancing the model's ability to represent complex graph structures. In the multi-head attention layer, the input node feature matrix is first processed... A linear mapping is performed to generate input representations for multiple attention heads. Then, the attention coefficients between neighboring node pairs are calculated, and... The function normalizes the coefficients and then performs a weighted summation of the features of the neighboring nodes to obtain the output features of each attention head. The output features of all heads are concatenated or averaged to obtain the new representation of the node.
[0093] ;
[0094] ;
[0095] ;
[0096] ;
[0097] ;
[0098] ;
[0099] In the formula, The linear transformation matrix for each attention head. and The parameter vector is the attention mechanism. LayerNorm and residual connections are used to improve the training stability and expressive power of the model.
[0100] The TCM formula drug attribute classification model uses the cross-entropy loss function to optimize the model. By minimizing the difference between the predicted value and the true label, the model's classification performance is improved.
[0101] ;
[0102] In the formula, For real labels, Predict probabilities for the model.
[0103] During training, the Adam optimizer is used to accelerate model convergence and avoid getting stuck in local optima through an adaptive learning rate adjustment strategy. To comprehensively evaluate model performance, metrics such as accuracy, precision, recall, and F1-score are introduced to ensure the robustness and reliability of the model in classification tasks.
[0104] This invention reduces the feature filtering complexity of graph convolution operations by introducing Chebyshev polynomial expansion to approximate the graph Laplacian operator, thereby improving the efficiency and numerical stability of information propagation in large-scale drug networks. Simultaneously, by combining a multi-head graph attention mechanism, it can adaptively learn the heterogeneous relationship weights between different drug nodes in a prescription, significantly enhancing the modeling ability for complex multi-level dependencies of "principal, assistant, adjuvant, and guide" relationships. Furthermore, through a multi-layer graph neural network structure, normalization, and regularization, it effectively improves the model's generalization ability and convergence stability, reduces the risk of overfitting, and ensures better robustness and generalizability for unknown samples. Experimental results show that the method described in this invention achieves an overall accuracy of 0.71, a recall of 0.71, and an AUC of 0.83 in the automatic classification task of the principal, assistant, adjuvant, and guide attributes. These results are significantly better than traditional GCN or single-domain convolution methods. The method can better explain the scientific connotation of the "principal, assistant, adjuvant, and guide" compatibility theory in traditional Chinese medicine prescriptions, promote the objectification, datafication, and intelligent application of compatibility theory, better guide clinical prescription and medication, promote the in-depth development and efficient utilization of traditional Chinese medicine prescriptions, and provide strong support for the modernization and internationalization of traditional Chinese medicine.
[0105] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0106] Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this invention. Furthermore, those skilled in the art will recognize that, based on the ideas of this invention, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this invention.
Claims
1. A method for classifying the drug attributes of traditional Chinese medicine prescriptions based on graph convolutional networks, characterized in that, include: Step 1: Construct the feature matrix of traditional Chinese medicine prescriptions; Step 2: Calculate the weight of the Chinese medicine prescription-drug edge; Step 3: Construct a directed graph with Chinese herbal formulas as subgraphs and herbs as nodes; Step 4: Construct a classification model of drug attributes for traditional Chinese medicine prescriptions, and train it based on the feature matrix of traditional Chinese medicine prescriptions and a directed graph; Step 5: Classify the drug attributes of traditional Chinese medicine prescriptions based on the trained TCM prescription drug attribute classification model; In step 2, the weights of the traditional Chinese medicine formula-drug edge are calculated, specifically as follows: Basic associations are constructed based on the similarity between herbs. The structural similarity between any two herbs is quantified by cosine similarity. For any herb node d i With d j The edge weights are calculated to form a basic similarity matrix reflecting the similarity of medicinal properties. This matrix directly encodes the geometric proximity of herbs in the feature space, given two vectors. and The cosine similarity between them for: ; In the formula, Let ||v|| denote the dot product of vectors, and ||v|| denote the magnitude of the vector. Based on information theory, a dependency measure is defined, showing the dependency degree of a traditional Chinese medicine formula c on a drug node d. Drug nodes Dependence for: ; In the formula, Indicates Chinese medicine prescriptions The length of the drug, i.e., the number of drugs contained therein; Indicates the presence of drug nodes The average length of all Chinese herbal prescriptions; This refers to the total number of traditional Chinese medicine prescriptions. For containing drugs The number of traditional Chinese medicine prescriptions; The final edge weights are calculated using a combined weighting strategy, as follows: ; In the formula, It is the edge weight; It is a hyperparameter used to balance the contribution of topological similarity and functional dependency; It is the similarity value in the basic similarity matrix; C ij It contains at the same time and A collection of traditional Chinese medicine prescriptions; and These represent the pairs of traditional Chinese medicine formulas, c and c. and Dependence on.
2. The method according to claim 1, characterized in that, In step 1, the feature matrix of traditional Chinese medicine prescriptions is constructed, specifically as follows: Obtain the original data of traditional Chinese medicine prescriptions and classify and organize them; Perform basic cleaning and format conversion on the classified and organized Chinese herbal medicine prescription data; Based on the BERT model, the function description of traditional Chinese medicine prescriptions and the efficacy description of drugs are vectorized, and the cosine similarity is calculated to measure the correlation between the two, and finally the correlation index is obtained. By integrating the obtained data, a feature matrix of traditional Chinese medicine prescriptions is constructed. Let the set of herbs included in prescription c be denoted as . ,in Indicates the first There are several herbs, and the feature vector of each herb is: Then the feature vector of the traditional Chinese medicine formula c for: ; In the formula, This refers to the quantity of herbs in the prescription.
3. The method according to claim 1, characterized in that, In step 3, a directed graph is constructed with traditional Chinese medicine prescriptions as subgraphs and drugs as nodes, specifically as follows: Using traditional Chinese medicine formulas as subgraphs and drugs as nodes, a separate subgraph is constructed for each traditional Chinese medicine formula, focusing on the drugs in the traditional Chinese medicine formula and their interrelationships. All subgraphs are merged into a general graph to form a directed graph that covers the drug relationships of all traditional Chinese medicine formulas.
4. The method according to claim 3, characterized in that, The TCM prescription drug attribute classification model is a graph convolutional neural network using ChebNet graph convolutional layers and incorporating a multi-head attention mechanism. It employs a cross-entropy loss function to optimize the model, which is as follows: ; In the formula, For real labels, Predict probabilities for the model.