Traditional Chinese medicine syndrome prediction method in presence of sample imbalance
By combining syndromes with sufficient sample size as a major category, subdivided syndromes with small sample size into major categories, building a training sample set and training a neural network model, the problem of inaccurate prediction of Chinese medicine syndromes caused by sample imbalance is solved, and a high accuracy and interpretability syndrome prediction is achieved.
Patent Information
- Application Number
- CN202510293561.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-13
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2045-03-13
AI Technical Summary
The prior art cannot accurately predict Chinese medicine syndromes when there is sample imbalance, resulting in the model focusing on types with large samples, affecting the ability of categories with small samples.
By taking syndromes with sufficient sample size as a separate major category, subdivided syndromes with small sample size are combined into one major category, and each patient marked the major categories of syndromes, subdivided syndromes and syndromes they exist, thereby building a training sample set and training a neural network model for syndrome prediction.
The problem of prediction inaccuracy caused by sample imbalance is solved, overfitting is avoided, the accuracy of syndrome prediction is improved, and the interpretability of the model is increased.
Smart Images

Figure CN119811690A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of syndrome prediction, and in particular to a method for predicting traditional Chinese medicine syndromes when there is sample imbalance. Background Art
[0002] Syndrome differentiation is a thinking and practice process that comprehensively analyzes the data obtained from the four examinations (observation, auscultation, inquiry, palpation) based on the theory of traditional Chinese medicine, clarifies the nature of the lesion and determines what kind of syndrome it is. According to the theory of traditional Chinese medicine, it analyzes the syndrome (symptoms, signs, etc.) and related data, identifies the syndrome elements such as the location and nature of the disease, and makes a syndrome diagnosis. Discussion and treatment, also known as treatment, is the thinking and practice process of establishing corresponding treatment principles, methods and prescriptions based on the results of syndrome differentiation, and selecting appropriate treatment methods and measures to treat the disease. Syndrome differentiation and discussion and treatment are two inseparable aspects of the diagnosis and treatment of diseases. Syndrome differentiation is to understand the disease and determine the syndrome; discussion and treatment is to establish the treatment method and prescription based on the results of syndrome differentiation. Syndrome differentiation is the premise and basis of discussion and treatment, and discussion and treatment is the means and method of treating the disease, and it is also a test of whether the syndrome differentiation is correct. Therefore, syndrome differentiation and discussion and treatment are the embodiment of the combination of theory and practice, the specific application of the theoretical system of theory, method, prescription and medicine in clinical practice, and the basic principle of clinical diagnosis and treatment of traditional Chinese medicine.
[0003] With the development of deep learning, reinforcement learning and other technologies, there are methods to combine deep learning models with TCM dialectics. However, existing methods mainly focus on the syndrome classification of certain diseases and cannot predict syndromes on a large scale. When the scope of syndrome prediction is expanded, some rare syndromes have little training data and there is sample imbalance, which causes the model to focus on types with a large number of samples, affecting the recognition ability of categories with a small number of samples. Summary of the invention
[0004] In view of the above analysis, the embodiment of the present invention aims to provide a method for predicting TCM syndromes when samples are unbalanced, so as to solve the problem that syndrome prediction cannot be accurately performed when samples are unbalanced.
[0005] On the one hand, an embodiment of the present invention provides a method for predicting TCM syndromes when there is sample imbalance, comprising the following steps: Obtain the patient's symptom text description and convert it into initial features, and construct a training sample set based on the patient's initial features, syndromes and syndrome elements; wherein each syndrome with a sample size greater than a first threshold is regarded as a separate major syndrome; syndromes with a sample size less than or equal to the first threshold are subdivided syndromes, and all subdivided syndromes are merged into a major category to form a small sample major syndrome; each sample includes three groups of labels, the first group of labels marks whether the patient has each major syndrome, the second group of labels is used to express whether the patient has each syndrome in the small sample major syndrome, and the third group of labels is used to mark whether the patient has each syndrome element; Constructing a neural network model, the neural network model includes a syndrome prediction task and a syndrome factor prediction task; wherein the syndrome prediction task includes the prediction of the major syndromes and subdivided syndromes of the sample; training the neural network model based on the constructed training sample set to obtain a syndrome prediction model; The text description of the symptoms of the patient to be predicted is converted into initial features; the probability of each major category of syndrome in the patient to be predicted is predicted based on the trained syndrome prediction model; the syndrome of the patient to be predicted is determined based on the probability of each major category of syndrome in the patient to be predicted.
[0006] Based on the further improvement of the above method, the neural network model includes: A first feature extraction module, used for performing deep feature extraction on the sample based on the initial feature to obtain a first feature of the sample; A certificate element classification module, used for predicting the certificate element of the sample based on the first feature or the initial feature; A major syndrome prediction module, used to predict the major syndrome of the sample based on the first feature and the syndrome element prediction result; A subdivided syndrome prediction module is used to predict subdivided syndromes in a small sample of large-category syndromes based on the first feature.
[0007] Based on the further improvement of the above method, the subdivided syndrome prediction module includes: A feature decomposition module, used for decomposing the first feature into an invariant feature and a variable feature; A third classifier is used to predict whether the sample does not have a small sample large category syndrome based on the invariant feature; The fourth classifier is used to predict the probability of the sample containing a subdivided syndrome in a small sample large category syndrome based on the variable feature.
[0008] Based on further improvement of the above method, the syndrome of the patient to be predicted is determined based on the probability of each major syndrome of the patient to be predicted, including: If the predicted probability of the patient to be predicted having a large category of syndromes with a small sample is less than or equal to the second threshold, the large category of syndromes with a predicted probability greater than the second threshold is the syndrome of the patient to be predicted; Otherwise, the subdivided syndrome of the patient to be predicted is determined based on the similarity between the patient to be predicted and the samples in the training sample library, and the subdivided syndrome and the major syndrome whose prediction probability is greater than the second threshold are the syndromes of the patient to be predicted.
[0009] Based on further improvement of the above method, the syndrome of the patient to be predicted is determined based on the probability of each major syndrome of the patient to be predicted, including: Determine the probability that the patient to be predicted has each subdivided syndrome based on the similarity between the patient to be predicted and each subdivided syndrome; The major syndromes and subdivided syndromes with probabilities greater than the second threshold are the syndromes of the patient to be predicted.
[0010] Based on the further improvement of the above method, the similarity between the patient to be predicted and each subdivided syndrome is obtained in the following way: Extracting samples with subdivided syndromes from the training sample set as samples to be compared; extracting variable features and syndrome factor prediction results of each sample to be compared based on the trained syndrome prediction model; splicing the variable features and syndrome factor prediction results to obtain the features to be compared of each sample to be compared; The variable features of the patient to be predicted and the syndrome factor prediction results are spliced to obtain the features to be compared of the patient to be predicted; Calculate the features to be compared of the patient to be predicted and the features to be compared of each sample to be compared to obtain the similarity between the patient to be predicted and each sample to be compared; The similarity between the patient to be predicted and each subdivided syndrome is calculated based on the similarity between the patient to be predicted and each sample to be compared.
[0011] Based on the further improvement of the above method, the similarity between the patient to be predicted and each subdivided syndrome is calculated based on the similarity between the patient to be predicted and each sample to be compared, including: For each subdivided syndrome, the average of the similarities between all samples to be compared and the patient to be predicted that have the subdivided syndrome is taken as the similarity between the patient to be predicted and the subdivided syndrome.
[0012] Based on the further improvement of the above method, the probability of each subdivided syndrome in the patient to be predicted is obtained based on the similarity between the patient to be predicted and each subdivided syndrome in the following way: According to the formula Calculate the initial prediction probability that the patient to be predicted has the jth subdivision syndrome ; According to the formula Calculate the final prediction probability of the jth subdivided syndrome in the patient to be predicted; in, represents the similarity between the patient to be predicted and the jth subdivided syndrome, P represents the probability that the patient to be predicted has a small sample of large-category syndrome, Indicates the number of subdivided syndromes.
[0013] Based on the further improvement of the above method, the following formula is used to calculate the training loss of the neural network model: ; in, It represents the joint loss of syndrome factor prediction and major syndrome prediction. represents the prediction loss of subdivided syndromes, Represents weight.
[0014] Based on the further improvement of the above method, the following formula is used to calculate the prediction loss of the subdivided syndrome: ; ; ; in, represents the invariant feature of the i-th sample, Indicates whether the i-th sample has the j-th subdivision syndrome, Indicates whether the i-th sample predicted by the model has the j-th subdivision syndrome. represents the third classifier, Indicates whether the ith sample has a small sample and a large category syndrome. If yes, it is 1, otherwise it is 0. represents the weight, n represents the number of samples in the current training batch, Indicates the number of subdivided syndromes.
[0015] Compared with the prior art, the method for predicting TCM syndromes when there is sample imbalance provided in this embodiment is to treat syndromes with sufficient sample size as separate major categories, merge subdivided syndromes with small sample size as a major category, and mark the major category syndromes, subdivided syndromes and syndrome elements of each patient, thereby constructing a training sample set, and training a neural network model based on the constructed training sample set. Since the major category syndromes are the syndromes with small sample size merged together, there will be no sample imbalance problem. At the same time, when predicting subdivided syndromes, since the sample size of the subdivided syndromes is the same, there will be no imbalance problem. Therefore, the trained model can accurately predict the major category syndromes, subdivided syndromes and syndrome elements, solve the problem of inaccurate prediction when the sample is balanced, avoid overfitting, and improve the prediction accuracy. In addition, the existing method simply establishes a direct mapping relationship from symptoms to syndromes, while ignoring the analysis process of TCM in diagnosis, so it is impossible to provide good interpretability for its method. In order to increase the interpretability of the model, the present invention collects the patient's syndrome factor information at the same time. By adding the learning of the correspondence between syndrome factors and symptoms and the correspondence between symptom information and syndrome factors, the model can incorporate the syndrome factor information when predicting syndrome classification and give the corresponding syndrome factor prediction results, thereby achieving the purpose of improving the accuracy of syndrome prediction and providing the interpretability of syndrome prediction.
[0016] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The accompanying drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the entire drawings, the same reference symbols represent the same components; Figure 1 The present invention is a flowchart of a method for predicting TCM syndromes when there is sample imbalance according to an embodiment of the present invention. DETAILED DESCRIPTION
[0018] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.
[0019] A specific embodiment of the present invention discloses a method for predicting TCM syndromes when there is sample imbalance, such as Figure 1 As shown, the following steps are included: S1. Obtain the patient's symptom text description and convert it into initial features, and construct a training sample set based on the patient's initial features, syndromes and syndrome elements; wherein each syndrome with a sample size greater than the first threshold is regarded as a separate major syndrome; syndromes with a sample size less than or equal to the first threshold are subdivided syndromes, and all subdivided syndromes are merged into a major category to form a small sample major syndrome; each sample includes three groups of labels, the first group of labels marks whether the patient has each major syndrome, the second group of labels is used to express whether the patient has each subdivided syndrome in the small sample major syndrome, and the third group of labels is used to mark whether the patient has each syndrome element; S2. Constructing a neural network model, wherein the neural network model includes a syndrome prediction task and a syndrome factor prediction task; wherein the syndrome prediction task includes the prediction of the major syndromes and the subdivided syndromes of the sample; training the neural network model based on the constructed training sample set to obtain a syndrome prediction model; S3. Convert the text description of the symptoms of the patient to be predicted into initial features; predict the probability of the patient to be predicted having each major category of syndrome based on the trained syndrome prediction model; determine the syndrome of the patient to be predicted based on the probability of the patient to be predicted having each major category of syndrome.
[0020] During implementation, the patient's text description of symptoms can be converted into initial features, i.e., input recognizable by the model, through existing methods. For example, a pre-trained BERT model can be used to obtain the initial features of each patient.
[0021] If the sample size is less than or equal to the first threshold, it is considered a small sample syndrome. All small sample syndromes are combined as a large category syndrome, expressed as small sample large category syndrome. N is the number of syndrome types, , Indicates the number of subdivided syndromes, Indicates the number of major syndromes, Indicates the number of syndromes for which the sample size exceeds the first prediction.
[0022] The first threshold is determined according to the number of samples of each syndrome actually collected. For example, the first threshold may be 10. Subdivided syndromes are syndromes whose sample size is less than the first threshold.
[0023] It should be noted that each patient may have multiple symptoms and multiple syndromes.
[0024] Compared with the prior art, the method for predicting TCM syndromes when there is sample imbalance provided in this embodiment is to treat syndromes with sufficient sample size as separate major categories, merge subdivided syndromes with small sample size as a major category, and mark the major category syndromes, subdivided syndromes and syndrome elements of each patient, thereby constructing a training sample set, and training a neural network model based on the constructed training sample set. Since the major category syndromes are the syndromes with small sample size merged together, there will be no sample imbalance problem. At the same time, when predicting subdivided syndromes, since the sample size of the subdivided syndromes is the same, there will be no imbalance problem. Therefore, the trained model can accurately predict the major category syndromes, subdivided syndromes and syndrome elements, solve the problem of inaccurate prediction when the sample is balanced, avoid overfitting, and improve the prediction accuracy. In addition, the existing method simply establishes a direct mapping relationship from symptoms to syndromes, while ignoring the analysis process of TCM in diagnosis, so it is impossible to provide good interpretability for its method. In order to increase the interpretability of the model, the present invention collects the patient's syndrome factor information at the same time. By adding the learning of the correspondence between syndrome factors and symptoms and the correspondence between symptom information and syndrome factors, the model can incorporate the syndrome factor information when predicting syndrome classification and give the corresponding syndrome factor prediction results, thereby achieving the purpose of improving the accuracy of syndrome prediction and providing the interpretability of syndrome prediction.
[0025] Specifically, the neural network model includes: A first feature extraction module, used for performing deep feature extraction on the sample based on the initial feature to obtain a first feature of the sample; A certificate element classification module, used for predicting the certificate element of the sample based on the first feature or the initial feature; A major syndrome prediction module, used to predict the major syndrome of the sample based on the first feature and the syndrome element prediction result; A subdivided syndrome prediction module is used to predict subdivided syndromes in a small sample of large-category syndromes based on the first feature.
[0026] During implementation, the first feature extraction module may adopt an existing NLP model structure.
[0027] The syndrome factor classification module, the major syndrome prediction module, and the detailed syndrome prediction module can adopt the existing multi-classifier structure.
[0028] During implementation, the major syndrome prediction module integrates the syndrome element information and predicts the major syndrome based on the first feature and the syndrome element prediction result. Specifically, the major syndrome prediction module predicts the major syndrome of the sample based on the first feature and the syndrome element prediction result, including: The first feature is combined with the syndrome factor prediction structure to predict the major syndromes of the sample.
[0029] During implementation, in order to improve the accuracy of subdivided syndrome prediction, the subdivided syndrome prediction module includes: A feature decomposition module, used for decomposing the first feature into an invariant feature and a variable feature; A third classifier is used to predict whether the sample does not have a small sample large category syndrome based on the invariant feature; The fourth classifier is used to predict the probability of the sample containing a subdivided syndrome in a small sample large category syndrome based on the variable feature.
[0030] First, we hope that the invariant features can better distinguish whether the sample has a small sample of large-category syndromes, that is, to extract the common features of small sample syndromes, and use variable features to assist in distinguishing different sub-syndromes in the small sample of large-category syndromes.
[0031] During implementation, the feature decomposition module decomposes the first feature through the mask matrix. The mask matrix M is introduced, that is, the matrix size is the same as the first feature, and the unchanged feature , variable features The value of the mask matrix M is obtained by model learning, using represents the first feature of the i-th patient.
[0032] When implemented, the third classifier is a binary classifier , whose output It indicates the probability that the sample does not contain large-category syndromes of small samples.
[0033] The fourth classifier is multi-classification, expressed as , whose output is the probability that the sample has the kth subdivided syndrome.
[0034] During implementation, the training loss of the neural network model is calculated using the following formula: ; in, It represents the joint loss of syndrome factor prediction and major syndrome prediction. represents the prediction loss of subdivided syndromes, Represents weight.
[0035] When implemented, the combined loss of syndrome factor prediction and major syndrome prediction is: ; ; ; in, represents the prediction loss of major syndromes, Indicates the predicted loss of the certificate element, Indicates whether the i-th sample has the label of the J-th major syndrome, It indicates the probability of whether the i-th sample predicted by the model has the J-th major syndrome. Indicates whether the i-th sample has the label of the k-th evidence element, It indicates the probability of whether the i-th sample predicted by the model contains the k-th evidence. represents the weight, n represents the number of samples in the current training batch, Indicates the number of major syndromes. The number of types of evidence.
[0036] Specifically, the following formula is used to calculate the prediction loss of the subdivided syndrome: ; ; ; in, represents the invariant feature of the i-th sample, Indicates whether the i-th sample has the label of the j-th subdivision syndrome, It indicates the probability of whether the i-th sample has the j-th subdivision syndrome predicted by the model. represents the third classifier, Indicates whether the i-th sample has a label of a small sample and a large category syndrome. If yes, it is 1, otherwise it is 0. represents the weight, n represents the number of samples in the current training batch, Indicates the number of subdivided syndromes.
[0037] By classifying large-category syndromes in small samples and predicting subdivided syndromes based on invariant and variable features, the prediction losses of classification and subdivided syndromes are added, thereby improving the accuracy of subdivided syndrome prediction.
[0038] During implementation, the gradient of the neural network is back-propagated through the mini-batch stochastic gradient descent algorithm, and the parameters of the model are trained by minimizing the loss function. When the model converges, that is, reaches the preset loss accuracy or number of iterations, the training is stopped and the syndrome prediction model is obtained.
[0039] For the patient to be predicted, the text description of his / her symptoms is converted into initial features; based on the trained syndrome prediction model, the probability of each major syndrome in the patient to be predicted is predicted; Then, the syndrome of the patient to be predicted is determined based on the probability of the patient to be predicted having each major syndrome category.
[0040] In a specific embodiment, the syndrome of the patient to be predicted is determined based on the probability of each major syndrome of the patient to be predicted, including: If the predicted probability of the patient to be predicted having a large category of syndromes with a small sample is less than or equal to the second threshold, the large category of syndromes with a predicted probability greater than the second threshold is the syndrome of the patient to be predicted; Otherwise, the subdivided syndrome of the patient to be predicted is determined based on the similarity between the patient to be predicted and the samples in the training sample library, and the subdivided syndrome and the major syndrome whose prediction probability is greater than the second threshold are the syndromes of the patient to be predicted.
[0041] If the probability of the patient to be predicted having a large-category syndrome with a small sample is less than or equal to the second threshold, it is considered that the patient to be predicted does not have a subdivided syndrome, and the large-category syndrome with a predicted probability greater than the second threshold is directly regarded as the syndrome of the patient to be predicted. If the probability of the patient to be predicted having a large-category syndrome with a small sample is greater than the second threshold, it is considered that the patient to be predicted has a subdivided syndrome, and therefore, the subdivided syndrome of the patient to be predicted is determined according to the similarity between the patient to be predicted and the samples in the training sample library. In implementation, the second threshold can be set to 0.5, for example.
[0042] Specifically, based on the similarity between the patient to be predicted and the samples in the training sample library, the subdivided syndromes of the patient to be predicted are determined, including: S301, extracting samples with subdivided syndromes from the training sample set as samples to be compared; extracting variable features and syndrome factor prediction results of each sample to be compared based on the trained syndrome prediction model; splicing the variable features and syndrome factor prediction results to obtain the features to be compared of each sample to be compared; S302, combining the variable features of the patient to be predicted and the syndrome factor prediction results to obtain the features to be compared of the patient to be predicted; S303, calculating the features to be compared of the patient to be predicted and the features to be compared of each sample to be compared to obtain the similarity between the patient to be predicted and each sample to be compared; S304. Use the subdivided syndromes existing in the samples to be compared whose similarity is greater than the third threshold as the subdivided syndromes of the patient to be predicted.
[0043] During implementation, samples with subdivided syndromes are first extracted as samples to be compared, that is, the patients to be predicted are compared with the samples to be compared.
[0044] Then, the variable features of each sample to be compared are obtained based on the trained syndrome prediction model. Prediction results of syndrome factors , after splicing, we get the features to be compared of the samples to be compared .
[0045] Similarly, the variable features of the patient to be predicted and the syndrome factor prediction results are concatenated to obtain the features to be compared q of the patient to be predicted.
[0046] During implementation, the cosine similarity formula can be used to calculate the similarity between the patient to be predicted and the i-th sample to be compared. .
[0047] The subdivided syndromes existing in the samples to be compared with a similarity greater than the third threshold are used as the subdivided syndromes of the patient to be predicted, so as to accurately match the medical records closest to the patient to be predicted. During implementation, the third threshold can be set according to the prediction accuracy requirements.
[0048] In order to accurately obtain the predicted probability of syndrome, in a specific embodiment, the syndrome of the patient to be predicted is determined based on the probability of each major syndrome of the patient to be predicted, including: S31, determining the probability that the patient to be predicted has each subdivided syndrome based on the similarity between the patient to be predicted and each subdivided syndrome; S32. The major syndromes and subdivided syndromes whose probabilities are greater than the second threshold are the syndromes of the patient to be predicted.
[0049] Specifically, the similarity between the patient to be predicted and each subdivided syndrome is obtained in the following manner: S311, extracting samples with subdivided syndromes from the training sample set as samples to be compared; extracting variable features and syndrome factor prediction results of each sample to be compared based on the trained syndrome prediction model; splicing the variable features and syndrome factor prediction results to obtain the features to be compared of each sample to be compared; S312, combining the variable features of the patient to be predicted and the syndrome factor prediction results to obtain the features to be compared of the patient to be predicted; S313, calculating the features to be compared of the patient to be predicted and the features to be compared of each sample to be compared to obtain the similarity between the patient to be predicted and each sample to be compared; S314. Calculate the similarity between the patient to be predicted and each subdivided syndrome based on the similarity between the patient to be predicted and each sample to be compared.
[0050] Steps S311 to S313 are the same as the processes of S301 to S303 and will not be described again here.
[0051] Specifically, the similarity between the patient to be predicted and each subdivided syndrome is calculated based on the similarity between the patient to be predicted and each sample to be compared, including: For each subdivided syndrome, the average of the similarities between all samples to be compared and the patient to be predicted that have the subdivided syndrome is taken as the similarity between the patient to be predicted and the subdivided syndrome.
[0052] Specifically, based on the similarity between the patient to be predicted and each subdivided syndrome, the probability of the patient to be predicted having each subdivided syndrome is obtained in the following manner: According to the formula Calculate the initial prediction probability that the patient to be predicted has the jth subdivision syndrome ; According to the formula Calculate the final prediction probability of the jth subdivided syndrome in the patient to be predicted; in, represents the similarity between the patient to be predicted and the jth subdivided syndrome, It indicates the probability that the predicted patient has a large category of syndromes in a small sample. Indicates the number of subdivided syndromes.
[0053] By integrating the similarity between the patient to be predicted and each subdivided syndrome, as well as the probability that the patient to be predicted has a small sample of large-category syndromes, the accurate prediction probability of the patient having each subdivided syndrome can be obtained.
[0054] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0055] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.
Claims
1. A method for predicting TCM syndromes when there is sample imbalance, characterized in that: The following steps are involved: Obtain the patient's symptom text description and convert it into initial features, and construct a training sample set based on the patient's initial features, syndromes and syndrome elements; wherein each syndrome with a sample size greater than a first threshold is regarded as a separate major syndrome; syndromes with a sample size less than or equal to the first threshold are subdivided syndromes, and all subdivided syndromes are merged into a major category to form a small sample major syndrome; each sample includes three groups of labels, the first group of labels marks whether the patient has each major syndrome, the second group of labels is used to express whether the patient has each syndrome in the small sample major syndrome, and the third group of labels is used to mark whether the patient has each syndrome element; Constructing a neural network model, the neural network model includes a syndrome prediction task and a syndrome factor prediction task; wherein the syndrome prediction task includes the prediction of the major syndromes and subdivided syndromes of the sample; training the neural network model based on the constructed training sample set to obtain a syndrome prediction model; The text description of the symptoms of the patient to be predicted is converted into initial features; the probability of each major category of syndrome in the patient to be predicted is predicted based on the trained syndrome prediction model; the syndrome of the patient to be predicted is determined based on the probability of each major category of syndrome in the patient to be predicted.
2. The method for predicting TCM syndromes when there is sample imbalance according to claim 1, characterized in that: The neural network model includes: A first feature extraction module, used for performing deep feature extraction on the sample based on the initial feature to obtain a first feature of the sample; A certificate element classification module, used for predicting the certificate element of the sample based on the first feature or the initial feature; A major syndrome prediction module, used to predict the major syndrome of the sample based on the first feature and the syndrome element prediction result; A subdivided syndrome prediction module is used to predict subdivided syndromes in a small sample of large-category syndromes based on the first feature.
3. The method for predicting TCM syndromes when there is sample imbalance according to claim 2, characterized in that: The subdivided syndrome prediction module comprises: A feature decomposition module, used for decomposing the first feature into an invariant feature and a variable feature; A third classifier is used to predict whether the sample does not have a small sample large category syndrome based on the invariant feature; The fourth classifier is used to predict the probability of the sample containing a subdivided syndrome in a small sample large category syndrome based on the variable feature.
4. The method for predicting TCM syndromes when there is sample imbalance according to claim 3, characterized in that: The syndrome of the patient to be predicted is determined based on the probability of each major syndrome of the patient to be predicted, including: If the predicted probability of the patient to be predicted having a large category of syndromes with a small sample is less than or equal to the second threshold, the large category of syndromes with a predicted probability greater than the second threshold is the syndrome of the patient to be predicted; Otherwise, the subdivided syndrome of the patient to be predicted is determined based on the similarity between the patient to be predicted and the samples in the training sample library, and the subdivided syndrome and the major syndrome whose prediction probability is greater than the second threshold are the syndromes of the patient to be predicted.
5. The method for predicting TCM syndromes when there is sample imbalance according to claim 3, characterized in that: The syndrome of the patient to be predicted is determined based on the probability of each major syndrome of the patient to be predicted, including: Determine the probability that the patient to be predicted has each subdivided syndrome based on the similarity between the patient to be predicted and each subdivided syndrome; The major syndromes and subdivided syndromes with probabilities greater than the second threshold are the syndromes of the patient to be predicted.
6. The method for predicting TCM syndromes when there is sample imbalance according to claim 5, characterized in that: The similarity between the patient to be predicted and each subdivided syndrome is obtained in the following way: Extracting samples with subdivided syndromes from the training sample set as samples to be compared; extracting variable features and syndrome factor prediction results of each sample to be compared based on the trained syndrome prediction model; splicing the variable features and syndrome factor prediction results to obtain the features to be compared of each sample to be compared; The variable features of the patient to be predicted and the syndrome factor prediction results are spliced to obtain the features to be compared of the patient to be predicted; Calculate the features to be compared of the patient to be predicted and the features to be compared of each sample to be compared to obtain the similarity between the patient to be predicted and each sample to be compared; The similarity between the patient to be predicted and each subdivided syndrome is calculated based on the similarity between the patient to be predicted and each sample to be compared.
7. The method for predicting TCM syndromes when there is sample imbalance according to claim 6, characterized in that: The similarity between the patient to be predicted and each subdivided syndrome is calculated based on the similarity between the patient to be predicted and each sample to be compared, including: For each subdivided syndrome, the average of the similarities between all samples to be compared and the patient to be predicted that have the subdivided syndrome is taken as the similarity between the patient to be predicted and the subdivided syndrome.
8. The method for predicting TCM syndromes when there is sample imbalance according to claim 6, characterized in that: Based on the similarity between the patient to be predicted and each subdivided syndrome, the probability of the patient to be predicted having each subdivided syndrome is obtained in the following way: According to the formula Calculate the initial prediction probability that the patient to be predicted has the jth subdivision syndrome ; According to the formula Calculate the final prediction probability of the jth subdivided syndrome in the patient to be predicted; in, represents the similarity between the patient to be predicted and the jth subdivided syndrome, P represents the probability that the patient to be predicted has a small sample of large-category syndromes, Indicates the number of subdivided syndromes.
9. The method for predicting TCM syndromes when there is sample imbalance according to claim 3, characterized in that: The training loss of the neural network model is calculated using the following formula: ; in, It represents the joint loss of syndrome factor prediction and major syndrome prediction. represents the prediction loss of subdivided syndromes, Represents weight.
10. The method for predicting TCM syndromes when there is sample imbalance according to claim 9, characterized in that: The following formula was used to calculate the prediction loss of the subdivided syndromes: ; ; ; in, represents the invariant feature of the i-th sample, Indicates whether the i-th sample has the j-th subdivision syndrome, Indicates whether the i-th sample predicted by the model has the j-th subdivision syndrome. represents the third classifier, Indicates whether the ith sample has a small sample and a large category syndrome. If yes, it is 1, otherwise it is 0. represents the weight, n represents the number of samples in the current training batch, Indicates the number of subdivided syndromes.
Citation Information
Patent Citations
Syndrome differentiation method and apparatus for traditional Chinese medicine syndrome elements
CN107122583A
Unbalanced data processing method, device and equipment for medical prediction model
CN116978571A
Character recognition method and device based on deep learning and storage medium
CN119169634A
Essence model construction method and system based on big data
CN119170289A
Traditional Chinese medicine syndrome element prediction method based on collaborative filtering
CN119339917A