Traditional Chinese medicine syndrome type discriminating and analyzing method and device and sleep disorder early intervention method and device
By combining feature engineering and ensemble learning models with traditional Chinese medicine theory, a high-discrimination feature set is generated, which solves the problem of insufficient accuracy in TCM syndrome differentiation and achieves high-precision differentiation and individualized early intervention.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-03-13
- Publication Date
- 2026-04-10
AI Technical Summary
Existing TCM syndrome differentiation methods rely on isolated tongue features, failing to effectively depict the overall state of the tongue and the complex interactions between features, resulting in insufficient differentiation accuracy and failing to meet the clinical needs for high-precision auxiliary diagnosis.
By combining feature engineering with prior knowledge of traditional Chinese medicine theory, we can generate the overall state of tongue appearance, interaction effects between features, and nonlinear transformation features through feature expansion. We can then construct an integrated learning model for TCM syndrome differentiation and generate personalized intervention suggestions through SHAP analysis.
It significantly improved the accuracy of TCM syndrome differentiation to over 80%, achieved quantitative verification of the causal path of tongue appearance-pathogenesis-sleep quality, and provided individualized early intervention programs.
Smart Images

Figure CN121839152A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of medical information processing technology, and in particular to a method and device for differentiating TCM syndrome types, and a method and device for early intervention of sleep disorders. Background Technology
[0002] Tongue appearance is considered an objective indicator reflecting the state of Qi, blood, and body fluids in the body, as well as the nature and severity of pathogenic factors. In recent years, with the development of artificial intelligence technology, using machine learning models to analyze tongue appearance data to achieve the objectivity and standardization of TCM syndrome differentiation has become an important research direction for the modernization of TCM.
[0003] However, existing methods for TCM syndrome differentiation based on tongue image data have significant limitations. These methods typically employ one of three approaches: 1. Directly using tongue image feature data collected by a tongue diagnostic instrument and basic demographic information as model input, resulting in an accuracy rate of only 51.11% for TCM syndrome differentiation; 2. Introducing modern medical indices and scale scores into the tongue image feature data as model input, achieving an accuracy rate of 55.84% for TCM syndrome differentiation; 3. Using a feature fusion method combining tongue image feature data and modern medical scales as model input, achieving an accuracy rate of 60.28% for TCM syndrome differentiation.
[0004] Despite the continuous incorporation of more information into these methods, the accuracy of differentiation still falls short of the clinical demands for high-precision assisted diagnosis. The fundamental reason lies in the fact that the original tongue features relied upon by existing methods are often isolated and static indicators, failing to effectively depict the overall state of the tongue, the correlation of tongue coating, and the complex interactions between features emphasized in Traditional Chinese Medicine (TCM) theory. For example, the holistic concepts and prior knowledge emphasized in TCM clinical practice, such as "comprehensive judgment of tongue body and tongue coating" and "coordination of tongue color and coating color," cannot be effectively represented through the original feature set. Furthermore, existing methods often rely on introducing external scale information to improve model performance, without fundamentally and deeply mining the inherent discriminative information within the tongue image data.
[0005] This indicates that existing technologies have failed to systematically encode and integrate the deep knowledge of Traditional Chinese Medicine (TCM) theory into feature representations, resulting in models being unable to fully learn the deep patterns related to the essence of syndromes, thus encountering a bottleneck in accuracy. Therefore, how to overcome the limitations of raw features and combine TCM a priori knowledge with the inherent laws of data to construct highly discriminative features that can more accurately and comprehensively reflect the essence of syndromes has become a key technical problem urgently needing to be solved in this field. Therefore, a method to improve the accuracy of TCM syndrome differentiation is urgently required. Summary of the Invention
[0006] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a method and device for TCM syndrome differentiation, which greatly improves the accuracy of TCM syndrome differentiation; the present invention also provides a method and device for early intervention of sleep disorders, which can realize early intervention of sleep disorders.
[0007] To achieve the above objectives, the main technical solutions adopted by the present invention include:
[0008] In a first aspect, the present invention provides a method for differentiating syndrome types in Traditional Chinese Medicine, comprising the following steps:
[0009] Obtain the raw feature dataset containing the subject's tongue appearance features and demographic information;
[0010] A pre-constructed feature engineering scheme was used to extend the original feature dataset, resulting in an extended feature dataset. The feature engineering scheme was determined based on prior knowledge of traditional Chinese medicine theory and the relationships between variables revealed by exploratory analysis of multi-source datasets. It includes a set of predefined feature construction rules to generate extended features that enhance the model's discriminative ability. The extended features include features for quantifying the overall state of the tongue appearance, features for characterizing the interaction effects between features, features for performing nonlinear transformations, and features for integrating abnormal signs. The multi-source dataset contains tongue appearance features, demographic information, health status, and sleep and psychological scale scores of multiple subjects.
[0011] The original feature dataset and the extended feature dataset are input into a pre-trained syndrome differentiation model to obtain TCM syndrome differentiation results.
[0012] Optionally, the predefined feature construction rules include:
[0013] The course of the disease is divided into boxes;
[0014] Separate boxes by age;
[0015] The interaction characteristics of disease duration and age are determined by multiplying the disease duration by age.
[0016] Frequency coding was performed on tongue color, redness of the edges and tip, color of the coating, thickness of the coating, and slenderness of the tongue.
[0017] The four tongue appearance features—tongue color, red edges and tip, ecchymosis and petechiae, and tongue swollenness and thinness—are assigned preset weights and weighted sums are performed to determine the comprehensive tongue appearance score features.
[0018] Assign preset weights to four moss characteristics: moss color, moss thickness, moss greasiness, and moss decay, and perform weighted summation to determine the comprehensive moss scoring characteristics.
[0019] The tongue coating coordination characteristics are determined based on the difference between the tongue appearance comprehensive score item and the tongue coating comprehensive score item.
[0020] The consistency characteristics of the tongue coating are determined based on whether the tongue color equals the coating color according to the Boolean value.
[0021] The age-to-disease-time ratio characteristic is determined by the ratio of age to the sum of disease duration plus 1.
[0022] The interaction characteristics of tongue color and disease course are determined by the product of disease course and tongue color.
[0023] Determine the characteristics of the square of age based on the square of age;
[0024] Determine the characteristics of the square of the disease course based on the square of the disease course;
[0025] The abnormal physical signs are counted by summing the redness at the edges, ecchymosis, petechiae, teeth marks, prickles, and cracks.
[0026] The abnormal characteristics of the tongue can be determined by the sum of its size and the number of teeth marks.
[0027] The age density characteristics of disease duration are determined based on the ratio of disease duration to age.
[0028] Optionally, the pattern differentiation model is an ensemble learning model obtained by fusing an XGBoost sub-model, a deep learning sub-model, and a random forest sub-model through Boosting or Stacking.
[0029] Optionally, the training process of the evidence identification model includes:
[0030] Obtain multi-source datasets and determine the corresponding TCM syndrome label for each subject based on the health status and sleep and psychological scale scores in the multi-source datasets;
[0031] Preprocess the multi-source dataset;
[0032] A pre-built feature engineering scheme is used to extend the features of the original feature dataset in the preprocessed multi-source dataset to obtain the feature-extended multi-source dataset.
[0033] The SMOTE oversampling, random undersampling, or SMOTEENN fusion method is used to perform class balancing on the multi-source dataset after feature expansion.
[0034] The class-balanced dataset is divided into a training set, a validation set, and a test set.
[0035] Using the data with expanded features as input and the defined TCM syndrome labels as output targets, the ensemble learning model is trained and its parameters are optimized using the training and validation sets. The generalization ability of the model is evaluated using the test set, resulting in a well-trained syndrome differentiation model.
[0036] Optionally, the multi-source dataset may be preprocessed, including:
[0037] Identify missing values, outliers, and format errors in the data; fill missing values with the median; correct or remove outliers; and convert character data to numerical data. Then, standardize the data.
[0038] Optionally, the deep learning sub-model includes a first fully connected layer, a first activation function layer, a first batch data normalization layer, a first dropout layer, a second fully connected layer, a second activation function layer, a second batch data normalization layer, a second dropout layer, a third fully connected layer, and a Softmax output layer for multi-class classification, connected in sequence.
[0039] Secondly, the present invention provides an early intervention method for sleep disorders, comprising the following steps:
[0040] Based on any sub-model of the syndrome differentiation model in the above TCM syndrome differentiation method, SHAP analysis is performed on the original feature dataset to evaluate the contribution of different original features to the syndrome prediction results of a single sample and generate an explanatory report of the model decision; wherein, the syndrome differentiation model is an ensemble learning model obtained by fusing the XGBoost sub-model, the deep learning sub-model and the random forest sub-model through Boosting or Stacking.
[0041] Intervention recommendations for individual subjects, generated based on interpretive reports and causal relationships between features in multi-source datasets, will be sent to the user's terminal.
[0042] Optionally, the process of determining the causal relationships among features in a multi-source dataset includes:
[0043] The FCI algorithm and / or PC algorithm are used to perform causal analysis on multi-source datasets that satisfy the directed acyclic graph hypothesis, the causal sufficiency hypothesis, the causal Markov hypothesis, and the causal fidelity hypothesis, and to identify the causal relationships between features in the multi-source datasets.
[0044] Thirdly, the present invention provides a TCM syndrome differentiation device, comprising:
[0045] The acquisition module is used to acquire the raw feature dataset containing the subject's tongue features and demographic information;
[0046] The feature extension module is used to extend the original feature dataset according to a pre-constructed feature engineering scheme to obtain an extended feature dataset. The feature engineering scheme is determined based on prior knowledge of traditional Chinese medicine theory and the relationships between variables revealed by exploratory analysis of multi-source datasets. It includes a set of predefined feature construction rules to generate extended features that can enhance the model's discriminative ability. The extended features include features for quantifying the overall state of the tongue appearance, features for characterizing the interaction effect between features, features for performing nonlinear transformations, and features for integrating abnormal signs. The multi-source dataset contains tongue appearance features, demographic information, health status, and sleep and psychological scale scores of multiple subjects.
[0047] The syndrome differentiation module is used to input the original feature dataset and the extended feature dataset into the pre-trained syndrome differentiation model to obtain the TCM syndrome differentiation results.
[0048] Fourthly, the present invention provides an early intervention device for sleep disorders, comprising:
[0049] The model interpretation module is used to perform SHAP analysis on the original feature dataset based on any sub-model of the syndrome differentiation model in the above-mentioned TCM syndrome differentiation method, evaluate the contribution of different original features to the syndrome prediction results of a single sample, and generate an explanatory report of the model decision; wherein, the syndrome differentiation model is an ensemble learning model obtained by fusing the XGBoost sub-model, the deep learning sub-model and the random forest sub-model through Boosting or Stacking.
[0050] The intervention module sends intervention recommendations for individual subjects, generated based on interpretive reports and causal relationships between features in multi-source datasets, to the user terminal.
[0051] The beneficial effects of this invention are:
[0052] The TCM syndrome differentiation method and apparatus proposed in this invention combine prior knowledge of TCM theory with data exploration and analysis to construct a highly discriminative extended feature set that includes the overall state of the tongue appearance, interaction effects between features, nonlinear transformation features, and abnormal signs. This enables the model to capture the essential characteristics of syndromes more comprehensively and accurately. Experimental results show that the method achieves a differentiation accuracy of over 80% on the test set, demonstrating a significant performance improvement.
[0053] The early intervention method and device for sleep disorders proposed in this invention, through the deep integration of causal discovery and SHAP analysis, achieves for the first time the quantitative verification and individualized application of the causal path of "tongue appearance-pathogenesis-sleep quality". Based on the causal relationship between features in a pre-determined multi-source dataset, combined with the quantitative assessment of the contribution of tongue appearance features of an individual patient by SHAP analysis, it is possible to transform causal evidence at the group level into interpretable early risk warnings for individuals, providing a foundation for early intervention. Attached Figure Description
[0054] Figure 1 This is a flowchart illustrating the TCM syndrome differentiation method according to a specific implementation method.
[0055] Figure 2A This is a distribution chart of TCM syndrome types on the continuous variable of age according to the specific implementation method;
[0056] Figure 2B This is a distribution chart of TCM syndrome types on a continuous variable disease course according to a specific implementation method, with legend and... Figure 2A same;
[0057] Figure 3 A heatmap showing the correlation of tongue features according to a specific implementation method;
[0058] Figure 4 This is a schematic diagram of the structure of a deep learning sub-model according to a specific implementation method;
[0059] Figure 5 This is a graph showing the feature importance analysis results based on the XGBoost model according to a specific implementation method;
[0060] Figure 6A This is a diagram showing the causal relationship identification results based on the FCL algorithm with 95% significance according to a specific implementation method;
[0061] Figure 6B This is a diagram showing the causal relationship identification results based on the PC algorithm with 95% significance according to a specific implementation method;
[0062] Figure 7A The following is a distribution map of the importance of tongue features as measured by SHAP value in the model according to the specific implementation method; where 0 indicates disharmony between the heart and kidneys, 1 indicates deficiency of heart and gallbladder qi, 2 indicates deficiency of both heart and spleen, 3 indicates phlegm-heat disturbing the heart, 4 indicates blood stasis obstruction, 5 indicates liver fire disturbing the heart, and 6 indicates disharmony of stomach qi.
[0063] Figure 7B This is a distribution map of SHAP values for tongue features according to a specific implementation; red dots represent higher values for the feature, blue dots represent lower values for the feature, and the width represents the impact density. Detailed Implementation
[0064] To better explain and facilitate understanding of the present invention, it is described in detail below with reference to the accompanying drawings and specific embodiments. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a clearer and more thorough understanding of the invention and to fully convey the scope of the invention to those skilled in the art.
[0065] Figure 1 This is a flowchart illustrating the TCM syndrome differentiation method provided by the present invention. Figure 1 As shown, the method for differentiating syndromes in Traditional Chinese Medicine includes the following steps:
[0066] Step S1: Obtain the original feature dataset containing the subject's tongue features and demographic information.
[0067] Among them, tongue features can be obtained by acquiring tongue images using a tongue diagnostic instrument.
[0068] Specifically, the original feature dataset includes "disease course", "age", "tongue color", "coating color", "coating thickness", "coating greasiness", "teeth marks", "non-peeled coating", "cracks", "petechiae", "coating rot", "red edges and tips", "ecchymosis and petechiae" and "tongue swell and thinness".
[0069] Step S2: Use a pre-built feature engineering scheme to extend the features of the original feature dataset to obtain an extended feature dataset.
[0070] The feature engineering scheme is based on prior knowledge of traditional Chinese medicine theory and the relationships between variables revealed by exploratory data analysis (EDA) of multi-source datasets. It includes a set of predefined feature construction rules to generate extended features that enhance the model's discriminative ability. These extended features include features for quantifying the overall state of the tongue appearance, features representing the interaction effects between features, features for performing nonlinear transformations, and features integrating abnormal signs. The multi-source dataset contains tongue appearance features, demographic information, health status, and sleep and psychological scale scores from multiple subjects.
[0071] Specifically, EDA analysis of multi-source datasets is a systematic process of data review and understanding, aiming to ensure data quality, discover potential patterns, and provide direct evidence for subsequent feature engineering. This process includes the following steps: preprocessing the multi-source datasets; using visualization techniques to deeply analyze variable characteristics based on the preprocessed datasets and outputting visualization results; and directly inspiring feature construction based on the visualization results.
[0072] As an example, the output visualizations include age distribution charts and disease course distribution charts for each TCM syndrome type, such as... Figure 2A and Figure 2B As shown; Figure 2A and Figure 2B This visually demonstrates the distribution differences, central tendency, and dispersion of different TCM syndrome types across key continuous variables such as age and disease duration. The output visualization also includes a heatmap showing the correlation between tongue features, such as... Figure 3 As shown; Figure 3 The Spearman correlation matrix shown quantifies the correlation strength between various tongue features and demographic features, revealing potential collinear or synergistic variation patterns among the features.
[0073] EDA analysis of multi-source datasets and the resulting visualizations reveal complex relationships between original features and target TCM syndrome types, as well as between the original features themselves. These data insights, combined with prior knowledge of TCM theory, jointly determine predefined feature construction rules.
[0074] Feature construction rules include:
[0075] Binning of disease course: Continuous disease course values are divided into several discrete intervals according to their distribution quantiles (e.g., 25%, 50%, 75%) or clinical experience intervals (e.g., 0-1 years, 1-5 years, 5 years and above). The disease course value of each sample is mapped to the corresponding interval label in order to capture the non-linear relationship between disease course and syndrome type.
[0076] Age binning: Continuous age values are divided into several discrete intervals according to their distribution or preset physiological stages (such as youth, middle age, and old age), and the age value of each sample is mapped to the corresponding interval label in order to capture the non-linear relationship between age and syndrome type.
[0077] The interaction characteristics of disease duration and age are determined by multiplying the disease duration by age.
[0078] Frequency coding was performed on tongue color, redness of the edges and tip, color of the coating, thickness of the coating, and slenderness of the tongue.
[0079] Four tongue appearance features—tongue color, red edges and tip, ecchymosis and petechiae, and tongue swell / thinness—were assigned preset weights and summed to determine the comprehensive tongue appearance score; specifically: 0.3 × tongue color + 0.2 × red edges and tip + 0.2 × ecchymosis and petechiae + 0.3 × tongue swell / thinness.
[0080] Assign preset weights to four moss characteristics: moss color, moss thickness, moss greasiness, and moss decay, and then perform a weighted summation to determine the comprehensive moss score characteristics; specifically: 0.25 × moss color + 0.25 × moss thickness + 0.25 × moss greasiness + 0.25 × moss decay;
[0081] The tongue coating coordination characteristics are determined based on the difference between the tongue appearance comprehensive score item and the tongue coating comprehensive score item.
[0082] The consistency characteristics of the tongue coating are determined based on whether the tongue color equals the coating color according to the Boolean value.
[0083] The age-to-disease-time ratio characteristic is determined by the ratio of age to the sum of disease duration plus 1.
[0084] The interaction characteristics of tongue color and disease course are determined by the product of disease course and tongue color.
[0085] Determine the characteristics of the square of age based on the square of age;
[0086] Determine the characteristics of the square of the disease course based on the square of the disease course;
[0087] The abnormal physical signs are counted by summing the redness at the edges, ecchymosis, petechiae, teeth marks, prickles, and cracks.
[0088] The abnormal characteristics of the tongue can be determined by the sum of its size and the number of teeth marks.
[0089] The age density characteristics of disease duration are determined based on the ratio of disease duration to age.
[0090] Through the above sixteen specific feature construction rules, the original tongue features and demographic information are systematically transformed into a series of extended features that contain rich a priori knowledge of traditional Chinese medicine and the inherent laws of data, which together constitute an extended feature dataset.
[0091] Specifically, the sleep and mental health scales include the Pittsburgh Sleep Quality Index (PSQI), the Insomnia Severity Index (ISI), the Self-Assessment Scale for Depression (PHQ-9), and the Generalized Anxiety Disorder Scale (GAD-7).
[0092] Step S3: Input the original feature dataset and the extended feature dataset into the pre-trained syndrome differentiation model to obtain the TCM syndrome differentiation results.
[0093] To improve the accuracy of TCM syndrome differentiation, the syndrome differentiation model is an ensemble learning model obtained by fusing XGBoost sub-models, deep learning sub-models, and random forest sub-models through Boosting or Stacking. By comprehensively utilizing the different models' ability to capture data features, the overall accuracy and generalization ability of TCM syndrome differentiation are significantly improved.
[0094] Preferably, such as Figure 4As shown, the deep learning sub-model consists of a first fully connected layer, a first activation function layer, a first batch data normalization layer, a first dropout layer, a second fully connected layer, a second activation function layer, a second batch data normalization layer, a second dropout layer, a third fully connected layer, and a Softmax output layer for multi-class classification. This model has a simple structure and improves the overall accuracy and generalization ability of TCM syndrome differentiation.
[0095] Furthermore, the specific parameter configurations for each sub-model in the ensemble learning model are as follows:
[0096] The parameters of the XGBoost sub-model are set as follows: learning rate is 0.1, maximum tree depth is 3, minimum leaf node sample weight sum is 1, sample sampling ratio is 0.8, feature sampling ratio is 0.8, gamma parameter is 0, L1 regularization coefficient alpha is 0, L2 regularization coefficient lambda is 1, random seed is 42 to ensure reproducibility, evaluation metric is multi-class log loss (mlogloss), model training iterations are 200 epochs, and early termination rule is set to automatically terminate training if there is no improvement in performance on the validation set for 10 consecutive epochs.
[0097] Deep learning sub-models employ, for example Figure 4 The network structure shown includes, in sequence: a first fully connected layer, a first ReLU activation function layer, a batch normalization layer, a first dropout layer (dropout rate set to 0.5), a second fully connected layer, a second ReLU activation function layer, a second batch normalization layer, a second dropout layer (dropout rate set to 0.5), a third fully connected layer, and finally, a softmax activation function output layer to achieve probability prediction of multiple TCM syndrome types. This hierarchical structure accelerates training convergence and improves stability through the batch normalization layer, and effectively suppresses overfitting through the dropout layer.
[0098] The parameters of the random forest sub-model are set as follows: the K-fold cross-validation parameter is set to 3, the number of base estimators is set to 100, the maximum depth of a single decision tree is limited to 3 to effectively prevent overfitting, the random seed is set to 42, and the class weight parameter (class_weight) is set to "balanced" to handle the class imbalance problem in the data, so that the model can automatically adjust the weights of each class.
[0099] With the above parameter configuration, the three heteroproton models can effectively capture the complex mapping relationship between tongue features and TCM syndromes from different perspectives of gradient boosting, deep neural networks and ensemble decision trees, respectively. This provides a high-quality base learner for subsequent Boosting or Stacking fusion, enabling the ensemble learning model to have high discrimination accuracy.
[0100] Specifically, the training process of the evidence identification model includes:
[0101] Step A1: Obtain multi-source datasets and determine the TCM syndrome label for each subject based on the health status and sleep and psychological scale scores in the multi-source datasets.
[0102] The definition of multi-source dataset is the same as that in step S2 above, and will not be repeated here.
[0103] Step A2: Preprocess the multi-source dataset.
[0104] Specifically, preprocessing of the multi-source dataset includes: identifying missing values, outliers, and format errors in the data; imputing missing values using the median; correcting or removing outliers; and converting character-based data to numerical data. Then, the data is standardized. It should be noted that the multi-source dataset preprocessing process described above for EDA analysis is the same as that described here.
[0105] Step A3: Use a pre-built feature engineering scheme to extend the original feature dataset in the preprocessed multi-source dataset to obtain the feature-extended multi-source dataset.
[0106] Step A4: Perform class balancing on the multi-source dataset after feature expansion using SMOTE oversampling, random undersampling, or SMOTEENN fusion methods; divide the class-balanced dataset into training set, validation set, and test set.
[0107] In this way, the model training bias caused by the uneven number of samples for different TCM syndromes (e.g., only 25 cases of heart and gallbladder qi deficiency syndrome, while 125 cases of heart and spleen deficiency syndrome) is effectively solved. These methods, by synthesizing minority class samples or adjusting the distribution of majority class samples, make the amount of data for each syndrome type more balanced, thereby significantly improving the model's ability to identify minority syndromes and avoiding the problem of the model overfitting to the majority class samples and ignoring the minority class samples.
[0108] Step A5: Using the data with expanded features as input and the determined TCM syndrome labels as output targets, train and optimize the ensemble learning model using the training and validation sets, and evaluate the model's generalization ability using the test set to obtain the trained syndrome differentiation model.
[0109] Furthermore, the training process of the syndrome differentiation model also includes: analyzing the importance weights of the input features based on the trained XGBoost sub-model or random forest sub-model, and ranking the input features from highest to lowest importance. This allows for the quantitative identification of the key features most discriminative for TCM syndrome differentiation, thus validating the effectiveness of feature engineering.
[0110] The TCM syndrome differentiation method proposed in this invention combines prior knowledge of TCM theory with data exploration and analysis to construct a highly discriminative extended feature set that includes the overall state of the tongue appearance, interaction effects between features, nonlinear transformation features, and abnormal signs. This enables the model to capture the essential characteristics of syndromes more comprehensively and accurately. Experimental results show that the method achieves a differentiation accuracy of over 80% on the test set, demonstrating a significant performance improvement. Furthermore, by integrating three heterogeneous models—XGBoost, deep learning, and random forest—and employing Boosting or Stacking fusion strategies, the model possesses powerful processing capabilities for structured data, deep perception of complex nonlinear relationships, and good generalization performance. Combined with class balancing techniques such as SMOTE, the model bias problem caused by uneven sample sizes is effectively alleviated, further improving the recognition accuracy for a minority of syndromes.
[0111] Based on the TCM syndrome differentiation method proposed above, this invention also proposes an early intervention method for sleep disorders, including the following steps:
[0112] Based on any sub-model in the syndrome differentiation model, SHAP analysis is performed on the original feature dataset to evaluate the contribution of different original features to the syndrome prediction results of a single sample and generate an explanatory report of the model decision. Intervention suggestions for individual subjects generated based on the explanatory report and the causal relationships between features in the multi-source dataset are sent to the user terminal.
[0113] The process of determining the causal relationships among features in a multi-source dataset includes: using the FCI algorithm and / or PC algorithm to perform causal analysis on the multi-source dataset that satisfies the assumptions of directed acyclic graph, causal sufficiency, causal Markov and causal fidelity, and to identify the causal relationships among features in the multi-source dataset.
[0114] Specifically, the following assumptions are made regarding causal relationships: Directed Acyclic Graph (DAB): This assumption presupposes that the causal relationships between the studied feature variables can be represented by a DAB, meaning the causal relationships are unidirectional and do not form circular loops. Causal Sufficiency Assumption: This assumption presupposes that the selected set of feature variables is causally sufficient, meaning the dataset contains all common causal variables affecting the analysis results, and there are no unobserved confounding factors. Causal Markov Assumption: Given all direct causes of a variable, that variable is conditionally independent of its non-descendant variables. This assumption forms the basis for constructing causal graphs. Causal Loyalty Assumption: This assumption presupposes that all conditional independence between variables stems from their causal structure, rather than from accidental coincidences of parameter values. This assumption ensures that the conditional independence relationships inferred from the data accurately reflect the underlying causal structure.
[0115] Under the assumptions above, causal analysis of multi-source datasets is performed using the FCI and / or PC algorithms. Specifically, either the FCI or PC algorithm, or both algorithms simultaneously for cross-validation, are used. Both the FCI and PC algorithms infer the causal framework and direction between variables based on conditional independence tests. During the execution of both the FCI and PC algorithms, Fisher's Z-test is used to determine conditional independence, and the significance level is uniformly set to α=0.05 (i.e., 95% significance). In the PC algorithm, to perform stable graph skeleton discovery, the parameters uc_rule=0 and uc_priority=1 are set.
[0116] This invention proposes an early intervention method for sleep disorders that deeply integrates causal discovery with SHAP analysis, achieving for the first time quantitative verification and individualized application of the causal path of "tongue appearance-pathogenesis-sleep quality." Specifically, causal discovery analysis based on the FCI / PC algorithm reveals the potential causal relationship between tongue appearance characteristics and sleep quality indicators, confirming the scientific law that changes in tongue appearance may precede the deterioration of subjective sleep quality, providing data support for tongue appearance as an early objective biomarker for sleep disorders. Combined with the quantitative assessment of the contribution of tongue appearance characteristics to individual patients using SHAP analysis, it can transform population-level causal evidence into interpretable early risk warnings for individuals, and generate personalized intervention plans containing specific abnormal tongue appearance indicators. This truly realizes a complete technical closed loop from "discovery of population causal laws" to "precise individual intervention," providing a modern solution that is both scientific and practical for the traditional Chinese medicine theory of "prevention of disease."
[0117] Accordingly, the present invention also provides a TCM syndrome differentiation device, comprising: an acquisition module for acquiring an original feature dataset containing the subject's tongue appearance features and demographic information; a feature extension module for extending the original feature dataset according to a pre-constructed feature engineering scheme to obtain an extended feature dataset; and a syndrome differentiation module for inputting the original feature dataset and the extended feature dataset into a pre-trained syndrome differentiation model to obtain TCM syndrome differentiation results.
[0118] The TCM syndrome differentiation device also includes a model training module, which acquires multi-source datasets and determines the TCM syndrome label for each subject based on health status and sleep and psychological scale scores in the multi-source datasets. The multi-source datasets are preprocessed. A pre-built feature engineering scheme is used to expand the original feature dataset in the preprocessed multi-source datasets, resulting in a feature-expanded multi-source dataset. SMOTE oversampling, random undersampling, or SMOTEENN fusion methods are used to perform class balancing on the feature-expanded multi-source dataset. The class-balanced dataset is divided into training, validation, and test sets. Using the feature-expanded data as input and the determined TCM syndrome labels as output targets, the ensemble learning model is trained and its parameters optimized using the training and validation sets. The test set is used to evaluate the model's generalization ability, resulting in a trained syndrome differentiation model.
[0119] The functions of each module are described in the above description of the TCM syndrome differentiation method, and will not be repeated here.
[0120] Accordingly, the present invention also provides an early intervention device for sleep disorders, comprising: a model interpretation module, used to perform SHAP analysis on the original feature dataset based on any sub-model in the syndrome differentiation model, evaluate the contribution of different original features to the syndrome prediction results of a single sample, and generate an interpretive report of the model decision; and an intervention module, used to send intervention suggestions for individual subjects generated based on the interpretive report and the causal relationships between features in the multi-source dataset to a user terminal.
[0121] The functions of each module are described in the above description of early intervention methods for sleep disorders, and will not be repeated here.
[0122] Simulation verification:
[0123] To verify the effectiveness of the method of this invention, an empirical study was conducted. This experiment included 789 participants, comprising 250 healthy subjects and 539 patients with chronic insomnia. The insomnia patients were categorized into seven syndrome types according to Traditional Chinese Medicine (TCM) differentiation: Heart-Kidney Disharmony (62 patients), Heart-Gallbladder Qi Deficiency (25 patients), Heart-Spleen Deficiency (125 patients), Phlegm-Heat Disturbing the Heart (110 patients), Blood Stasis Internal Obstruction (59 patients), Liver Fire Disturbing the Heart (97 patients), and Stomach Qi Disharmony (61 patients). All statistical analyses were two-tailed tests, with a p-value <0.05 considered statistically significant. A multi-source dataset was constructed.
[0124] Based on the aforementioned multi-source datasets, and following the model training process in the TCM syndrome differentiation method, the model was trained. The trained ensemble learning model was tested on the test set, and the accuracy reached 86.21%. The specific performance results of the model are shown in Table 1, where 0 indicates disharmony between the heart and kidneys, 1 indicates deficiency of heart and gallbladder qi, 2 indicates deficiency of both heart and spleen, 3 indicates phlegm-heat disturbing the heart, 4 indicates blood stasis, 5 indicates liver fire disturbing the heart, and 6 indicates disharmony of stomach qi. Table 1 shows that the ensemble learning model performed as follows in classifying the seven syndrome types: 91% accuracy and 77% recall for detecting heart-kidney disharmony; 64% accuracy and 88% recall for detecting heart-gallbladder qi deficiency; 86% accuracy and 75% recall for detecting heart-spleen deficiency; 100% accuracy and 94% recall for detecting phlegm-heat disturbing the heart; 81% accuracy and 100% recall for detecting blood stasis; 92% accuracy and 85% recall for detecting liver fire disturbing the heart; and 88% accuracy and 88% recall for detecting stomach qi disharmony. This demonstrates that the extended features constructed by combining traditional Chinese medicine theory with EDA insights can significantly extract and enhance the syndrome-related discriminative information contained in tongue image data.
[0125] Table 1 - Test Report Form for Ensemble Learning Models
[0126]
[0127] Feature importance was analyzed based on the trained XGBoost sub-model, and the results are as follows: Figure 5 As shown, the top ten most important features are, in order: age-to-disease-duration ratio, tongue color-age interaction, disease-duration-age interaction, age, tongue coating coordination, disease-duration-age density, disease-duration-tongue-color interaction, cracks, tongue coating comprehensive score, and tongue appearance comprehensive score. Of these, only age and cracks are original features; the remaining eight are new features constructed through feature engineering in this invention. This result directly confirms from a global model perspective that the feature construction rules designed in this invention successfully generate information with greater discriminative power than the original features, which is key to the breakthrough improvement in model performance.
[0128] To further explore the intrinsic link between tongue appearance and sleep disorders, causal discovery analysis was performed on a multi-source dataset based on the FCI and PC algorithms. The results were visualized. Figure 6A and Figure 6B The table shows that X1 represents the course of the disease, X2 represents age, X3 represents tongue color, X4 represents redness at the tip and edges, X5 represents the color of the tongue coating, X6 represents the thickness of the tongue coating, X7 represents a greasy tongue coating, X8 represents a rotten tongue coating, X9 represents a swollen or thin tongue, X10 represents teeth marks, X11 represents pinpoints, X12 represents fissures, X13 represents the Pittsburgh Sleep Quality Index (PSQI), X14 represents the Insomnia Severity Index (ISI), X15 represents the Self-Assessment Scale for Depression (PHQ-9), X16 represents the Generalized Anxiety Disorder Scale (GAD-7), and X17 represents the TCM syndrome type. Analysis shows that pinpoints and tongue coating thickness are potential causes of the PSQI, and there is a strong correlation between the two. Furthermore, age, teeth marks, greasy tongue coating, fissures, and pinpoints are the top five most influential features in syndrome differentiation. This finding is significant: it is the first data-driven indication that abnormal changes in the tongue appearance may precede the deterioration of the patient's subjective sleep experience. Therefore, tongue appearance characteristics can serve as an early, objective biomarker for insomnia. This provides a solid modern scientific basis for the preventive medicine concept of "treating disease before it occurs" in traditional Chinese medicine, and preliminarily quantifies the causal path between "tongue appearance - pathogenesis - sleep quality".
[0129] SHAP analysis is used to interpret the model's decisions. SHAP analysis can: Figure 7A As shown, the contribution (i.e., SHAP value) of different tongue features to the prediction of each syndrome type is displayed globally; for example... Figure 7B As shown, a violin plot illustrates the distribution relationship between feature values (such as the color of the tongue coating) and SHAP values (the direction and magnitude of their influence on prediction). For a single subject sample, it clearly demonstrates how each feature pushes its predicted probability from the baseline value to the final value. For example, the analysis shows that a yellow or greasy tongue coating has a high positive contribution to identifying a patient as having a heart-kidney disharmony syndrome, which is completely consistent with traditional Chinese medicine theory, enabling doctors to understand and verify the model's decision-making logic.
[0130] Through systematic experimental verification, this invention not only significantly improves the accuracy of TCM syndrome differentiation to 86.21%, but also provides a theoretical basis for early intervention through causal discovery. Furthermore, through SHAP analysis, it transforms the "black box" model into an auxiliary tool that doctors can understand and trust, forming a complete, effective, and interpretable intelligent TCM tongue diagnosis solution.
[0131] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0132] In the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0133] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make modifications, alterations, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for differentiating syndrome types in Traditional Chinese Medicine, characterized in that, Includes the following steps: Obtain the raw feature dataset containing the subject's tongue appearance features and demographic information; A pre-constructed feature engineering scheme was used to extend the original feature dataset, resulting in an extended feature dataset. The feature engineering scheme was determined based on prior knowledge of traditional Chinese medicine theory and the relationships between variables revealed by exploratory analysis of multi-source datasets. It includes a set of predefined feature construction rules to generate extended features that enhance the model's discriminative ability. The extended features include features for quantifying the overall state of the tongue appearance, features for characterizing the interaction effects between features, features for performing nonlinear transformations, and features for integrating abnormal signs. The multi-source dataset contains tongue appearance features, demographic information, health status, and sleep and psychological scale scores of multiple subjects. The original feature dataset and the extended feature dataset are input into a pre-trained syndrome differentiation model to obtain TCM syndrome differentiation results.
2. The method for differentiating TCM syndrome types according to claim 1, characterized in that, Predefined feature construction rules include: The course of the disease is divided into boxes; Separate boxes by age; The interaction characteristics of disease duration and age are determined by multiplying the disease duration by age. Frequency coding was performed on tongue color, redness of the edges and tip, color of the coating, thickness of the coating, and slenderness of the tongue. The four tongue appearance features—tongue color, red edges and tip, ecchymosis and petechiae, and tongue swollenness and thinness—are assigned preset weights and weighted sums are performed to determine the comprehensive tongue appearance score features. Assign preset weights to four moss characteristics: moss color, moss thickness, moss greasiness, and moss decay, and perform weighted summation to determine the comprehensive moss scoring characteristics. The tongue coating coordination characteristics are determined based on the difference between the tongue appearance comprehensive score item and the tongue coating comprehensive score item. The consistency characteristics of the tongue coating are determined based on whether the tongue color equals the coating color according to the Boolean value. The age-to-disease-time ratio characteristic is determined by the ratio of age to the sum of disease duration plus 1. The interaction characteristics of tongue color and disease course are determined by the product of disease course and tongue color. Determine the characteristics of the square of age based on the square of age; Determine the characteristics of the square of the disease course based on the square of the disease course; The abnormal physical signs are counted by summing the redness at the edges, ecchymosis, petechiae, teeth marks, prickles, and cracks. The abnormal characteristics of the tongue can be determined by the sum of its size and the number of teeth marks. The age density characteristics of disease duration are determined based on the ratio of disease duration to age.
3. The method for differentiating TCM syndrome types according to claim 1, characterized in that, The pattern differentiation model is an ensemble learning model obtained by fusing the XGBoost sub-model, the deep learning sub-model, and the random forest sub-model through Boosting or Stacking.
4. The method for differentiating TCM syndrome types according to claim 3, characterized in that, The training process of the evidence identification model includes: Obtain multi-source datasets and determine the corresponding TCM syndrome label for each subject based on the health status and sleep and psychological scale scores in the multi-source datasets; Preprocess the multi-source dataset; A pre-built feature engineering scheme is used to extend the features of the original feature dataset in the preprocessed multi-source dataset to obtain the feature-extended multi-source dataset. The SMOTE oversampling, random undersampling, or SMOTEENN fusion method is used to perform class balancing on the multi-source dataset after feature expansion. The class-balanced dataset is divided into a training set, a validation set, and a test set. Using the data with expanded features as input and the defined TCM syndrome labels as output targets, the ensemble learning model is trained and its parameters are optimized using the training and validation sets. The generalization ability of the model is evaluated using the test set, resulting in a well-trained syndrome differentiation model.
5. The method for differentiating TCM syndrome types according to claim 4, characterized in that, Preprocessing of multi-source datasets includes: Identify missing values, outliers, and format errors in the data; fill missing values with the median; correct or remove outliers; and convert character data to numerical data. Then, standardize the data.
6. The method for differentiating TCM syndrome types according to claim 3, characterized in that, The deep learning sub-model consists of a first fully connected layer, a first activation function layer, a first batch of data normalization layer, a first dropout layer, a second fully connected layer, a second activation function layer, a second batch of data normalization layer, a second dropout layer, a third fully connected layer, and a Softmax output layer for multi-class classification, connected in sequence.
7. An early intervention method for sleep disorders, characterized in that, Includes the following steps: Based on any sub-model of the syndrome differentiation model in the TCM syndrome differentiation method, SHAP analysis is performed on the original feature dataset to evaluate the contribution of different original features to the syndrome prediction results of a single sample and generate an explanatory report of the model decision; wherein, the syndrome differentiation model is an ensemble learning model obtained by fusing the XGBoost sub-model, the deep learning sub-model and the random forest sub-model through Boosting or Stacking. Intervention recommendations for individual subjects, generated based on interpretive reports and causal relationships between features in multi-source datasets, will be sent to the user's terminal.
8. The method for early intervention of sleep disorders according to claim 7, characterized in that, The process of determining the causal relationships between features in a multi-source dataset includes: The FCI algorithm and / or PC algorithm are used to perform causal analysis on multi-source datasets that satisfy the directed acyclic graph hypothesis, the causal sufficiency hypothesis, the causal Markov hypothesis, and the causal fidelity hypothesis, and to identify the causal relationships between features in the multi-source datasets.
9. A TCM syndrome differentiation device, characterized in that, include: The acquisition module is used to acquire the raw feature dataset containing the subject's tongue features and demographic information; The feature extension module is used to extend the original feature dataset according to a pre-constructed feature engineering scheme to obtain an extended feature dataset. The feature engineering scheme is determined based on prior knowledge of traditional Chinese medicine theory and the relationships between variables revealed by exploratory analysis of multi-source datasets. It includes a set of predefined feature construction rules to generate extended features that can enhance the model's discriminative ability. The extended features include features for quantifying the overall state of the tongue appearance, features for characterizing the interaction effect between features, features for performing nonlinear transformations, and features for integrating abnormal signs. The multi-source dataset contains tongue appearance features, demographic information, health status, and sleep and psychological scale scores of multiple subjects. The syndrome differentiation module is used to input the original feature dataset and the extended feature dataset into the pre-trained syndrome differentiation model to obtain the TCM syndrome differentiation results.
10. An early intervention device for sleep disorders, characterized in that, include: The model interpretation module is used to perform SHAP analysis on the original feature dataset based on any sub-model of the syndrome differentiation model in the TCM syndrome differentiation method according to any one of claims 1-6, evaluate the contribution of different original features to the syndrome prediction results of a single sample, and generate an interpretive report of the model decision; wherein, the syndrome differentiation model is an ensemble learning model obtained by fusing the XGBoost sub-model, the deep learning sub-model and the random forest sub-model through Boosting or Stacking. The intervention module sends intervention recommendations for individual subjects, generated based on interpretive reports and causal relationships between features in multi-source datasets, to the user terminal.
Citation Information
Patent Citations
Artificial intelligence based tongue image detection and recognition method
CN110251084A
Traditional Chinese medicine tongue color and fur color collaborative classification method based on convolutional neural network
CN113011436A
Artificial intelligence-based tongue diagnosis image recognition method
CN113130066A
Face partition feature associated traditional Chinese medicine function state discrimination method based on graph structure
CN117935331A
Multi-mode traditional Chinese medicine insomnia differentiation method based on multi-task deep learning
CN121215232A