Classification method of TCM syndrome types of idiopathic pulmonary fibrosis based on machine learning
Through the clustering algorithm and MIV feature selection combined with genetic algorithm and LM algorithm, the BP neural network is optimized, and the problem of low classification accuracy in traditional Chinese medicine syndrome prediction is solved, and higher syndrome classification accuracy and Diagnostic reliability.
Patent Information
- Application Number
- CN202311272453.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-28
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2043-09-28
AI Technical Summary
The prior art classification accuracy rate in the traditional Chinese medicine syndrome prediction of idiopathic pulmonary fibrosis is not high, and the intrinsic relationships and associations between symptoms are not fully utilized, resulting in a high misdiagnosis rate and limitations in relying on artificial experience.
Clustering algorithm and MIV feature selection algorithm are used to process symptom data, and BP neural network is optimized with genetic algorithm and LM algorithm to conduct proof-type prediction to improve the accuracy of traditional Chinese medicine proof-type classification.
It significantly improves the accuracy of the classification of traditional Chinese medicine syndromes in idiopathic pulmonary fibrosis, reduces the rate of misdiagnosis, realizes individualized and accurate traditional Chinese medicine syndrome diagnosis, and enhances the interpretation of the syndrome data and the prediction ability of the model.
Smart Images

Figure CN117292794B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of information classification and prediction, and in particular to a method for classifying TCM syndrome types of idiopathic pulmonary fibrosis based on machine learning. Background Art
[0002] Idiopathic pulmonary fibrosis (IPF) is a chronic, progressive lung disease with a complex pathogenesis. Its main pathological features are interstitial lung inflammation and fibrosis. The prevalence and mortality of IPF have been on the rise in recent years, seriously affecting the quality of life of patients. Currently, Western medicine mainly relies on HRCT to diagnose IPF, but the treatment effect of the disease is still poor.
[0003] Traditional Chinese medicine believes that IPF belongs to the category of "pulmonary fibrosis". In the process of syndrome differentiation and treatment of IPF, different Chinese medicine doctors will have individual differences in dialectical conclusions based on their own experience, which may lead to the same IPF patient being diagnosed with different syndromes by different doctors, increasing the misdiagnosis rate. However, there are certain limitations in syndrome classification based on artificial experience, and it is impossible to fully utilize the internal connection and correlation between symptoms.
[0004] Some scholars have used machine learning algorithms to explore the prediction of TCM syndrome types in IPF. For example, Bayesian classifiers and support vector machines are used to classify syndrome types. However, these methods have low classification accuracy and fail to fully utilize methods such as feature selection to improve prediction performance, making it difficult to interpret the large amount of implicit knowledge between "symptoms and syndromes". In order to improve the accuracy of TCM syndrome prediction for IPF and fully explore the inherent laws between symptoms and syndrome types, it is necessary to use more intelligent methods to express, convert and analyze symptom information in order to obtain a more scientific syndrome determination model. Summary of the invention
[0005] In order to solve the problems existing in the above-mentioned prior art, the present invention provides a method for processing symptom data using a clustering algorithm and an MIV feature selection algorithm, and then predicting syndrome types based on a BP neural network optimized by a genetic algorithm and an LM algorithm, so as to improve the accuracy of IPF syndrome type classification and achieve scientific and accurate judgment of IPF TCM syndrome types.
[0006] The technical solution of the present invention includes:
[0007] The TCM syndrome classification method for idiopathic pulmonary fibrosis based on machine learning includes the following steps:
[0008] The symptoms, syndrome types and their mutual mapping relationship data of several patients with idiopathic pulmonary fibrosis are collected to construct a first data set; the symptoms include main symptoms, concomitant symptoms and tongue and pulse symptoms; the syndrome types are artificial standardized syndrome types;
[0009] Classify, encode and cluster the symptom data in the first data set, determine the syndrome type results corresponding to the high-frequency symptoms in each category, and compare them with the mapping relationship in the first data set, perform manual syndrome differentiation on the unmatched syndrome type determination results, and obtain a corrected second data set;
[0010] Selecting several symptoms with the highest contribution rate in each syndrome type from the second data set as a training set to complete the training of the improved BP model;
[0011] The trained improved BP model was used to classify the newly collected data of patients with idiopathic pulmonary fibrosis into TCM syndrome types.
[0012] In some preferred embodiments, the classification coding method includes:
[0013] For ordered multi-category, start coding the symptom from 0 until all symptoms in the same category have been coded.
[0014] For unordered multi-category symptoms, they are first broken down into several sub-items, and then 0 and 1 are used to encode the presence or absence of the sub-item symptoms respectively.
[0015] In some preferred embodiments, the classification coding method further comprises: deleting symptoms recorded as normal in the concurrent symptoms;
[0016] Symptoms were ranked by frequency, and low-frequency symptoms were deleted based on clinical experience.
[0017] In some preferred embodiments, the clustering method includes: performing single-item coding on the symptom data in the first data set: for a single-category symptom, using 0 and 1 to code the absence and presence of the symptom respectively, and using 0.5 to code the alleviation or relief of the symptom; for a multi-category symptom, coding the symptom starting from 0 until all symptoms of the same category are coded;
[0018] The symptom data after single-item encoding are clustered using the SOM model, and the output layer matrix of the SOM model is determined through the results of parameter adjustment experiments.
[0019] In some preferred embodiments, the method of selecting the symptoms with the highest contribution rate of each syndrome type from the second data set as the training set is:
[0020] Constructing an influencing factor matrix according to the symptoms and their codes in the second data set, wherein the behavioral symptoms in the influencing factor matrix are listed as symptom codes;
[0021] The influencing factor matrix is used as the input of the conventional BP neural network to complete the training of the conventional BP neural network;
[0022] Increase or decrease the influencing factor matrix by 10% respectively to obtain the second influencing factor matrix and the third influencing factor matrix, and input them into the trained conventional BP neural network respectively to obtain the first output variable Y1 and the second output variable Y2;
[0023] Calculate the change value of each influencing factor on the dialectical result Among them, i is the influencing factor number, and m is the number of input samples;
[0024] Calculate the contribution of each influencing factor separately Where n is the total number of influencing factors.
[0025] In some preferred embodiments, the improved BP model includes:
[0026] Use LM algorithm to optimize the initial BP model;
[0027] The GA algorithm is used to optimize the weight and bias assignment of the BP model, including the following steps:
[0028] Calculate the population fitness after each training: Among them, p is the number of training samples, y α , o α are the true output and predicted output of the αth training sample respectively;
[0029] Individual selection operations are performed according to the fitness size of the population.
[0030] Beneficial Effects
[0031] The present invention standardizes syndrome data by combining neural network algorithm and expert knowledge, and improves the accuracy and reliability of TCM syndrome differentiation of idiopathic pulmonary fibrosis. The symptom classification method is used to classify and cluster symptom characteristics, thereby removing the redundancy in the original data information, screening out more characteristic symptoms, and further screening out features that have important contributions to different syndromes, so that the data after dimensionality reduction is more interpretable, which helps to improve the efficiency of subsequent modeling. The genetic algorithm and LM algorithm are used to optimize the training process of the BP neural network, improve the prediction accuracy of the model, and expand the space for model search optimization. The present invention comprehensively considers multiple links such as symptom expression, syndrome data processing and intelligent modeling of TCM for idiopathic pulmonary fibrosis, realizes deep learning and modeling of TCM disease and syndrome rules, can significantly improve the accuracy of TCM syndrome classification of IPF, can assist clinicians in syndrome differentiation, reduce the misdiagnosis rate, and realize individualized and accurate TCM syndrome diagnosis. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 This is a flow chart of a method for classifying TCM syndrome types of idiopathic pulmonary fibrosis based on machine learning in a preferred embodiment of the present invention;
[0033] Figure 2 This is a schematic diagram of the encoding result of the first data set in a preferred embodiment of the present invention;
[0034] Figure 3 This is a schematic diagram of the encoding result of the second data set in a preferred embodiment of the present invention;
[0035] Figure 4 A schematic diagram of the MIV values and contribution rates of the symptoms corresponding to each syndrome type in a preferred embodiment of the present invention;
[0036] Figure 5 This is a comparison chart of the accuracy of the improved BP model proposed by the present invention and other existing models in the experimental examples of the present invention;
[0037] Figure 6 This is a comparison chart of the accuracy of the classification coding proposed by the present invention and other existing coding methods in the experimental examples of the present invention; DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present invention clearer, the present invention is further described below in conjunction with the accompanying drawings. In the description of the present invention, it should be understood that the terms "upper", "lower", "front", "back", "left", "right", "top", "bottom", "inside", "outside" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention.
[0039] Example 1
[0040] like Figure 1 As shown, this embodiment provides a method for classifying TCM syndrome types of idiopathic pulmonary fibrosis based on machine learning, comprising the following steps:
[0041] S1. Collect the symptoms, syndrome types and their mutual mapping relationship data of several patients with idiopathic pulmonary fibrosis to construct the first data set; the symptoms include main symptoms, concomitant symptoms and tongue and pulse symptoms; the syndrome types are artificial standardized syndrome types, for example, Chinese medicine experts are asked to perform syndrome differentiation and classification based on case data to form syndrome diagnosis results, such as lung and spleen qi deficiency syndrome, lung and kidney yang deficiency syndrome, etc.; the mutual mapping relationship refers to the artificial dialectical results marked in the original data. Among them, the data source can be retrieved by retrieving typical cases of Chinese medicine published in recent years, or directly collecting unpublished case data of Chinese medicine experts with rich clinical experience. It is also possible to extract IPF cases treated by famous old Chinese medicine practitioners from public literature.
[0042] Those skilled in the art should be aware that the selection of medical record data needs to follow the general principles of this field, including: 1. Select representative typical cases that are consistent with the relevant literature reports on the diagnosis and treatment of IPF by traditional Chinese medicine. 2. The diagnosis of the case complies with the standard diagnostic standards, such as the "Diagnostic Criteria for Syndrome of Idiopathic Pulmonary Fibrosis in Traditional Chinese Medicine (2019 Edition)". 3. The four diagnostic information (look, smell, ask, and palpate) and the treatment plan are complete. Treatment is mainly based on empirical or self-prescribed Chinese herbal decoctions. 4. Cases that are not IPF or have other diseases at the time of the first visit are excluded. 5. Cases with unclear case sources or incomplete information are excluded. 6. The main treatment method should be oral Chinese medicine, without or with a small amount of other treatment measures such as acupuncture, acupoint injection, etc. 7. The source of medical record data is reliable and has scientific guiding significance.
[0043] The above data are used as qualitative indicators of traditional Chinese medicine to establish a data set.
[0044] S2. Classify, encode and cluster the symptom data in the first data set, determine the syndrome type results corresponding to the high-frequency symptoms of each category, and compare them with the mapping relationship in the first data set, perform manual syndrome differentiation on the unmatched syndrome type determination results, and obtain a corrected second data set. It should be understood that the classification of data such as Chinese medicine symptoms in the prior art mainly examines the number of categories possessed by the data itself, usually including single classification data and multi-classification data. Among them, the single classification data refers to data that can be distinguished by absence and presence. In the present invention, the main symptom category in the idiopathic pulmonary fibrosis symptoms meets the classification definition. The multi-classification data refers to data with multiple classification sub-items, such as the concomitant symptoms and tongue and pulse symptoms in the present invention. The prior art mostly uses the rule that the presence of the symptom is coded as 1 and the absence of the symptom is coded as 0 to encode the above sub-item data.
[0045] The problem that this easily leads to is: ignoring the sequence problem in multi-classification data. For the symptoms of idiopathic pulmonary fibrosis, the main multi-classification symptoms include two types of sequence information: 1. Ordered multi-classification symptoms, such as cough and dry cough symptoms, which are mainly divided into four categories: none, mild, moderate, and severe. The sub-items of this type of symptoms have a sequence relationship from front to back and from mild to severe; 2. Unordered multi-classification symptoms, such as tongue and pulse symptoms. Taking tongue shape as an example, it includes five categories: none, enlarged tongue, cracked tongue, tongue tooth marks, and thin tongue. The sub-items of this type of symptoms have no sequence relationship and only represent the presence or absence of sub-items.
[0046] If the traditional one-by-one encoding method is used, it is easy to cause the data dimension to be too large and the data volume to be cumbersome, which is not conducive to the subsequent neural network training and actual prediction. Therefore, in some preferred embodiments, it is considered to use classification encoding to deal with the sequence problem in symptom data, which specifically includes the following steps:
[0047] The classification coding method includes:
[0048] S201. For ordered multi-category symptoms, encode the symptom starting from 0 until all symptoms of the same category are encoded.
[0049] S202. For unordered multi-classification symptoms, firstly break them down into several sub-items, and then use 0 and 1 to encode the presence or absence of the sub-item symptoms respectively.
[0050] Furthermore, the classified and coded data set still contains high-dimensional data. On the one hand, the data recorded as normal concomitant symptoms, such as "normal bowel movements", "good sleep", "good appetite" and other normal symptoms, play a small role in the subsequent syndrome differentiation. On the other hand, the symptoms with lower frequency are also less referenceable. Therefore, in other better embodiments, the classification coding method also includes: deleting the symptoms recorded as normal in the concomitant symptoms; sorting the symptoms by frequency, and deleting the low-frequency symptoms based on clinical experience, so as to achieve further dimensionality reduction processing of the high-dimensional data.
[0051] The essence of the clustering operation is to establish an association between symptoms and syndromes belonging to the same category through clustering operation. There are many ways to implement it. In some preferred embodiments, the SOM model is considered for clustering, which specifically includes the following steps: single-item encoding of the symptom data in the first data set: for single-category symptoms, 0 and 1 are used to encode the absence and presence of the symptom respectively, and 0.5 is used to encode the reduction or alleviation of the symptom; for multi-category symptoms, the symptom is encoded starting from 0 until all symptoms of the same category are encoded; the symptom data after single-item encoding are clustered using the SOM model, and the output layer matrix of the SOM model is determined by the results of the parameter adjustment experiment.
[0052] S3. Select several symptoms with the highest contribution rate in each syndrome type from the second data set as training sets to complete the training of the improved BP model. It should be understood that there are many methods for considering the contribution of input parameters to output parameters in the art. In some preferred embodiments, a method for selecting the symptoms with the highest contribution rate in each syndrome type from the second data set as training sets is provided:
[0053] S301, constructing an influencing factor matrix according to the symptoms and their codes in the second data set, wherein the behavioral symptoms in the influencing factor matrix are listed as symptom codes;
[0054] S302, using the influencing factor matrix as the input of the conventional BP neural network to complete the training of the conventional BP neural network; it should be noted that the conventional BP neural network in this step refers to a standard BP neural network without any modification.
[0055] S303, increasing or decreasing the influencing factor matrix by 10% respectively, obtaining a second influencing factor matrix and a third influencing factor matrix, and inputting them into the trained conventional BP neural network respectively, to obtain a first output variable Y1 and a second output variable Y2;
[0056] S304, respectively calculating the influence change value of each influencing factor on the dialectical result Among them, i is the number of influencing factors, m is the number of input samples; the impact change value NIV i The absolute value of reflects the relative importance of each influencing factor to the judgment result. After arranging them in descending order and eliminating the data with smaller absolute value of MIV, the variable screening is completed.
[0057] S305. Calculate the contribution of each influencing factor Where n is the total number of influencing factors.
[0058] Furthermore, in order to further reduce the amount of invalid data in the training set, for each syndrome in the second data set, several symptoms with the highest contribution rate are selected, their coding values are retained, and then the coding values of other unselected symptoms are set to 0. If the coding values of the same symptom in all syndromes are 0, the symptom data is deleted.
[0059] The improved BP model refers to optimizing the basic model using the LM algorithm on the basis of the standard BP model to alleviate the shortcomings of the BP neural network such as local minima, slow convergence speed, and high dependence on initial weights; and then optimizing the weights and bias assignments of the BP model using the GA algorithm. Those skilled in the art can know that the core of the GA algorithm is to select individuals from the old population to the new population with a certain probability, and its specific operations include: crossover operation: select an individual from the population, select a point in the chromosome for mutation to produce a better individual; mutation operation: select an individual from the population, select a point in the chromosome for mutation to produce a better individual; in some preferred embodiments, consider using population fitness to select individuals, specifically including:
[0060] Calculate the population fitness after each training: Among them, p is the number of training samples, y α , o α are the true output and predicted output of the αth training sample respectively;
[0061] Since there is no gap between the distances of syndrome category prediction errors, consider adding conditions before calculating the fitness function:
[0062]
[0063] Individual selection is performed according to the fitness of the population. The greater the fitness, the greater the corresponding probability.
[0064] The population size and maximum number of iterations in the GA model parameters are set, and the crossover rate and mutation rate are set to conventional values of 0.6 and 0.08 respectively. The individuals selected for mutation are judged based on the mutation probability whether to continue to mutate, and the cycle continues until the optimal individual is found. Finally, the optimized weights and biases are assigned to the neural network model.
[0065] S4. Use the trained improved BP model to classify the newly collected data of idiopathic pulmonary fibrosis patients into TCM syndrome types.
[0066] Example 2
[0067] This embodiment is developed on the basis of the above-mentioned embodiment 1. This embodiment provides an example of the whole process of the technical solution of the present invention in combination with actual data.
[0068] 1. Data collection: A total of 468 medical records of famous old Chinese medicine doctors treating IPF were extracted from CNKI. A data set was established based on qualitative indicators (symptoms and syndrome types) of Chinese medicine. The data set includes 22 main symptoms of patients, including wheezing, worsening with movement, dry cough, sputum, weak cough, cough, sputum, spitting saliva, dyspnea, shortness of breath, shortness of breath, yellow sputum, white sputum, gray sputum, thick sputum, foamy sputum, thin sputum, stringy sputum, blood in sputum, chest tightness, worsening at night, and relief by rest; 127 concomitant symptoms, including fatigue, poor appetite, dry mouth, sore waist and knees, poor sleep, cyanosis of the lips, dry stool, and dry throat; 35 tongue and pulse symptoms, including dark tongue, red tongue, sublingual stasis, thin fur, greasy fur, yellow fur, white fur, stringy pulse, slippery pulse, deep pulse, and thin pulse, for a total of 184 symptom characteristics. The data set contains 14 artificial standardized syndromes, including lung qi deficiency with phlegm dampness and blood stasis syndrome, lung and kidney qi deficiency with phlegm dampness and blood stasis syndrome, lung qi deficiency syndrome, and lung and kidney qi deficiency syndrome.
[0069] 2. Classification coding: For the main symptoms and concomitant symptoms, the code for having the symptom is 1, the code for not having the symptom is 0, and the code for symptom reduction or alleviation is 0.5. For ordered multi-category variables such as cough and dry cough, the symptoms are divided into mild, moderate and severe, and are coded as 0-3 respectively; for concomitant symptoms, classified and quantitatively coded, the symptoms of the same category are coded from 0 until all symptoms of the same category are coded. For unordered multi-category variables such as tongue and pulse, there are multiple types, and they are coded from 0 until all types of tongue or pulse are coded. After adopting this coding rule, the data set contains a total of 86 feature dimensions, and some of the coding results are as follows in Tables 1-3:
[0070]
[0071] Table 1 Coding results of some main symptoms
[0072]
[0073]
[0074] Table 2 Coding results of some comorbid symptoms
[0075]
[0076] Table 3 Coding results of some tongue and pulse symptoms
[0077] The first dataset after encoding is Figure 2 shown.
[0078] 3. Artificial Standardized Syndrome Types: There are 14 original artificial standardized syndrome types, and the distribution of the number of syndrome type cases is shown in Table 5 below:
[0079]
[0080]
[0081] Table 5 Artificial standard syndrome type table
[0082] 4. Dimensionality reduction of data set: Process high-dimensional input symptoms, delete symptoms with normal records such as "normal bowel movements", "good sleep", "good appetite" and so on in the concomitant symptoms, count the frequency of main symptoms, tongue and pulse symptoms, and concomitant symptoms respectively and arrange them from high to low, and remove some low-frequency symptoms based on clinical experience for the main symptoms and tongue and pulse symptoms, such as main symptoms: stringy phlegm, relief after rest, and finally include 20 main symptoms in the clustering experiment; tongue and pulse symptoms: tongue cracks, tongue tooth marks, thin tongue, dry tongue coating, moist tongue coating, black tongue coating, floating pulse, tight pulse, knotted pulse, intermittent pulse, and moist pulse, and finally include 24 tongue and pulse symptoms in the clustering experiment; select the top 39 symptoms for concomitant symptoms to complete the subsequent experiment. The frequency distribution of concomitant symptoms of 468 case data is shown in Table 6 below:
[0083]
[0084]
[0085] Table 6 Statistical table of the frequency distribution of concurrent symptoms in the first data set
[0086] 5. Clustering: The SOM algorithm was used to cluster the symptoms to remind TCM practitioners to pay attention to the data that did not match the computer results and the expert results, and a second syndrome differentiation was performed to confirm the final syndrome type. The 83-dimensional symptoms screened out above were included in the cluster analysis, and the original 468 data were clustered by the SOM algorithm. According to the results of the parameter adjustment experiment, the output layer matrix X=3, Y=2 was finally set to 6 categories. The high-frequency symptoms of each category of data were counted as the main discriminant information for determining the syndrome type, and the names of each category of syndrome type were obtained by clinical syndrome differentiation of TCM. Among them, category 1 and category 3 were both judged to be Yin deficiency and lung dryness syndrome, so these two categories were merged into the same category. The final clustering result was 5 categories, namely lung-kidney qi deficiency and blood stasis syndrome, lung qi deficiency and blood stasis syndrome, lung qi deficiency syndrome, lung qi deficiency and phlegm dampness syndrome, and Yin deficiency and lung dryness syndrome.
[0087] 6. Manual syndrome differentiation: The data of each category were restored to 468 original cases, and the main symptoms were compared between the computer model results and the manual syndrome differentiation results. There were 237 pieces of data that matched, with a consistency of 50.6%. Since some symptoms that were not reflected may be included in the standardization, some symptoms may not be recorded during the syndrome differentiation, or the symptoms may be alleviated or reduced during the second and third diagnoses but still diagnosed as the same syndrome, among the 49.4% of the data, there are data that are more appropriate by computer clustering and data that are more appropriate by manual standardization. Therefore, it is necessary to prompt manual selection of a more reasonable syndrome again. Therefore, the remaining 49.4% of the data were manually differentiated for a second time to determine the syndrome name in order to improve the accuracy and scientificity of the syndrome. By manually comparing the syndrome results, we finally obtained 14 syndrome types, namely, lung qi deficiency with phlegm dampness and blood stasis syndrome, lung qi deficiency syndrome, lung and kidney qi deficiency with phlegm dampness and blood stasis syndrome, lung qi deficiency with phlegm dampness syndrome, lung and kidney qi deficiency syndrome, yin deficiency and lung dryness syndrome, etc. A total of 360 cases with a syndrome frequency greater than 50 were selected and divided into 4 categories, which were encoded as 1000, 0100, 0010, and 0001 in the form of a unique hot code and converted into vector data to prepare for the subsequent syndrome classification prediction experiment; the number of cases of each syndrome type is shown in Table 7 below:
[0088]
[0089] Table 7 Statistics of the number of cases of each syndrome type after manual syndrome differentiation
[0090] After the syndrome screening, the columns with all symptom characteristics of 0 were deleted, and a total of 80 symptom characteristic dimensions were included as the second data set. The second data set is coded as follows: Figure 3 shown.
[0091] 7. Obtain training set: Construct an influencing factor matrix based on the symptoms and their codes in the second data set, where:
[0092] The behavioral symptoms of the influencing factor matrix are listed as symptom codes; the influencing factor matrix is used as the input of the conventional BP neural network to complete the training of the conventional BP neural network; the influencing factor matrix is increased or decreased by 10% to obtain the second influencing factor matrix and the third influencing factor matrix, which are respectively input into the trained conventional BP neural network to obtain the first output variable Y1 and the second output variable Y2; the influence change value of each influencing factor on the dialectical result is respectively calculated Among them, i is the influencing factor number, m is the number of input samples; calculate the contribution of each influencing factor separately Among them, n is the total number of influencing factors. For each syndrome type, only the symptom with the highest contribution rate is taken as the coding value, and the other symptom codes are set to 0. If the codes of a symptom of the four syndrome types are all 0, the symptom column is deleted, and the symptoms are screened and analyzed. The final processed data set is used as the input of the neural network model. The MIV value and contribution rate of the corresponding symptoms of each syndrome type are shown in Figure 4 shown.
[0093] 8. Construct an improved BP model: Use the LM algorithm to optimize to alleviate the shortcomings of the BP neural network, such as local minima, slow convergence, and high dependence on initial weights; set network training parameters, set the number of training epochs to 1000; the learning rate lr is 0.1; the training target minimum error goal is 1e-5; the additional momentum factor mc is 0.9, etc. Generate an initialized population and calculate the chromosome length. The formula is ms+s+ns+n, where m represents the number of input vector dimensions, s represents the number of hidden layer neurons, and n represents the number of output vector dimensions. The inverse of the error obtained from the BP neural network training is used as the fitness evaluation function, and individuals are selected according to the fitness value: Calculate the fitness function of the previous population. The calculation formula is Where p is the number of training samples, y α , o α are the true output and predicted output of the αth training sample respectively. Since there is no distance gap between the prediction errors of syndrome categories, a conditional formula is added before calculating the fitness function. Individuals are selected from the old population to the new population with a certain probability. The greater the fitness, the greater the corresponding probability, and the easier it is to be selected; crossover operation: select an individual from the population, select a point in the chromosome to mutate to produce a better individual; mutation operation: select an individual from the population, select a point in the chromosome to mutate to produce a better individual; set relevant parameters in the genetic algorithm calculation process: set the GA parameter population size to 100, the maximum number of iterations to 60, the crossover rate and mutation rate to 0.6 and 0.08 respectively, the individual selected for mutation determines whether the individual continues to mutate based on the mutation probability, and the cycle continues until the optimal individual is found, and finally the optimized weights and biases are assigned to the BP model.
[0094] Experimental Example 1
[0095] Model 1: LM-BP model, using the standard BP neural network optimized by LM algorithm;
[0096] Model 2: GA-LM-BP model, using the standard BP neural network optimized by LM algorithm and GA algorithm;
[0097] Model 3: Improved BP model, that is, the prediction model provided by the present invention.
[0098] Experimental data: experimental data obtained from the above Example 2.
[0099] The above models are simulated based on the platform MATLAB R2022a, and the results are as follows Figure 5 As shown, the accuracy of IPF syndrome classification obtained by optimizing the standard BP neural network with the LM algorithm was 45.99%, and the mean square error between the true value and the predicted value was 0.48871; the accuracy of IPF syndrome classification obtained by optimizing the standard BP neural network with the GA-LM algorithm was 61.69%, and the mean square error between the true value and the predicted value was 0.11965; the accuracy of IPF syndrome classification obtained by the model proposed in the present invention was 90.77%, and the mean square error between the true value and the predicted value was 0.0622.
[0100] This experimental example shows that the present invention has higher accuracy and reliability for TCM syndrome differentiation of idiopathic pulmonary fibrosis than traditional prediction methods.
[0101] Experimental Example 2
[0102] Dataset 1: The second dataset coded using the traditional single-item coding method (considering all single symptoms);
[0103] Dataset 2: The second data set encoded using the classification encoding method of the present invention (considering the classified symptoms);
[0104] Experimental model: the improved BP model proposed in this invention;
[0105] The experimental results are as follows Figure 6 As shown, during the experiment, symptoms with a frequency of less than 5 were screened out. After comparing the results, the classification coding method adopted by the present invention makes the prediction effect of the model better. After removing duplicate data, the experiment still shows high accuracy and excellence.
[0106] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. Classification method of TCM syndrome types of idiopathic pulmonary fibrosis based on machine learning, It is characterized in that The following steps are involved: The symptoms, syndrome types and their mutual mapping relationship data of several patients with idiopathic pulmonary fibrosis are collected to construct a first data set; the symptoms include main symptoms, concomitant symptoms and tongue and pulse symptoms; the syndrome types are artificial standardized syndrome types; Classify, encode and cluster the symptom data in the first data set, determine the syndrome type results corresponding to the high-frequency symptoms in each category, and compare them with the mapping relationship in the first data set, perform manual syndrome differentiation on the unmatched syndrome type determination results, and obtain a corrected second data set; Selecting several symptoms with the highest contribution rate in each syndrome type from the second data set as a training set to complete the training of the improved BP model; The trained improved BP model was used to classify the TCM syndrome types of newly collected idiopathic pulmonary fibrosis patient data; The classification coding method includes: For ordered multi-category symptoms, the symptom was coded starting from 0 until all symptoms in the same category were coded; For disordered multi-category symptoms, they were first broken down into several sub-items, and then 0 and 1 were used to encode the presence or absence of the sub-item symptoms respectively; The clustering method comprises: The symptom data in the first data set are coded individually: for single-category symptoms, 0 and 1 are used to code the absence and presence of the symptom respectively, and 0.5 is used to code the alleviation or relief of the symptom; for multi-category symptoms, the symptom is coded starting from 0 until all symptoms of the same category are coded; The symptom data after single-item coding are clustered using the SOM model, and the output layer matrix of the SOM model is determined through the results of the parameter adjustment experiment; The method of selecting the symptoms with the highest contribution rate of each syndrome type from the second data set as the training set is: Constructing an influencing factor matrix according to the symptoms and their codes in the second data set, wherein the behavioral symptoms in the influencing factor matrix are listed as symptom codes; The influencing factor matrix is used as the input of the conventional BP neural network to complete the training of the conventional BP neural network; Increase or decrease the influencing factor matrix by 10% respectively to obtain the second influencing factor matrix and the third influencing factor matrix, and input them into the trained conventional BP neural network respectively to obtain the first output variable Y1 and the second output variable Y2; Calculate the change value of each influencing factor on the dialectical result Among them, i is the influencing factor number, and m is the number of input samples; Calculate the contribution of each influencing factor separately Where n is the total number of influencing factors.
2. The method for classifying TCM syndrome types of idiopathic pulmonary fibrosis based on machine learning as claimed in claim 1, It is characterized in that The classification coding method also includes: deleting symptoms recorded as normal in the concurrent symptoms; sorting the symptoms by frequency, and deleting low-frequency symptoms based on clinical experience.
3. The method for classifying TCM syndrome types of idiopathic pulmonary fibrosis based on machine learning as claimed in claim 1, It is characterized in that The improved BP model includes: Use LM algorithm to optimize the initial BP model; The GA algorithm is used to optimize the weight and bias assignment of the BP model, including the following steps: Calculate the population fitness after each training: Among them, p is the number of training samples, y α , o α are the true output and predicted output of the αth training sample respectively; Individual selection operations are performed according to the fitness size of the population.
