Pu'er tea polyphenol content prediction method and system
By sampling and analysis of the soil of Pu'er tea planting site, using logistic regression and LASSO regression models to screen out key factors and create a nomogram model for prediction, it solves the problem of poor prediction accuracy of Pu'er tea polyphenol content in traditional methods, and achieves higher prediction accuracy and intuitiveness.
Patent Information
- Application Number
- CN202411474550.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-22
- Publication Date
- 2025-03-14
AI Technical Summary
Traditional methods have poor accuracy when predicting the polyphenol content of Pu'er tea, and it is difficult to effectively optimize the planting environment to improve the polyphenol content of tea.
By sampling the soil of Pu'er tea planting site, analyzing soil composition and altitude as influencing factors, a data set was constructed and sample expansion operations were performed. Then, the key modeling factors were screened out using logistic regression and LASSO regression models, a nomogram model was created, and performance and stability evaluation was performed through the ROC curve and calibration curve, and finally predictions were made through the visual interface.
It significantly improves the accuracy of predicting polyphenol content of Pu'er tea, and displays the results in an intuitive chart form, simplifying the model construction and prediction process.
Smart Images

Figure CN119622654A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of Pu'er tea planting and management, and in particular to a method and system for predicting the content of Pu'er tea polyphenols. Background Art
[0002] Soil is the matrix for the growth of tea trees. Soil fertility, as a comprehensive reflection of soil indicators, determines the growth of tea trees. Soil nutrients are crucial to soil fertility and have a significant impact on the quality and yield of tea.
[0003] Sun-dried raw tea is the raw material for making Pu'er tea. The main tea flavor components include tea polyphenols, catechins, caffeine and free amino acids. Tea polyphenols is the general term for polyphenol compounds in tea. It tastes bitter and is the main source of the taste of tea soup. Tea polyphenols is a polyphenol compound, a natural antioxidant, preservative and food additive. In order to increase the production of tea polyphenols, there is a need to predict the content of Pu'er tea polyphenols (tea polyphenols in Pu'er tea) in order to optimize the planting environment and continuously improve the content of Pu'er tea polyphenols.
[0004] However, since many factors affect the content of tea polyphenols in fresh tea leaves, the traditional method of predicting the content of Pu'er tea polyphenols based on planting experience often has unsatisfactory prediction accuracy. Therefore, how to provide a method and system for predicting the content of Pu'er tea polyphenols to improve the accuracy of the prediction of Pu'er tea polyphenols content has become a technical problem that needs to be solved urgently. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a method and system for predicting the content of Pu'er tea polyphenols, so as to improve the accuracy of the prediction of the content of Pu'er tea polyphenols.
[0006] In a first aspect, the present invention provides a method for predicting the content of Pu'er tea polyphenols, comprising the following steps:
[0007] Step S1, sampling the soil of the Pu'er tea planting area to obtain a plurality of soil samples, recording the altitude at which each soil sample was sampled, analyzing the soil components of each soil sample respectively, and taking the soil components and the altitude as influencing factors;
[0008] Step S2: labeling each of the influencing factors to construct a data set, and performing a sample expansion operation on the data set;
[0009] Step S3, performing univariate regression analysis on the data set using a logistic regression model to preliminarily screen each of the influencing factors;
[0010] Step S4, performing regression analysis on the data set by using a LASSO regression model to perform secondary screening on each of the influencing factors to obtain a number of modeling factors;
[0011] Step S5, creating a nomogram model for predicting the content of Pu'er tea polyphenols based on each of the modeling factors;
[0012] Step S6, respectively performing performance evaluation and stability evaluation on the nomogram model through ROC curve and calibration curve, and deploying the nomogram model that passes the evaluation;
[0013] Step S7, obtaining soil data to be predicted through a visualization interface, inputting the soil data into a nomogram model in real time, and outputting a prediction result of the Pu'er tea polyphenol content, wherein the visualization interface displays the prediction result of the Pu'er tea polyphenol content in the form of a chart.
[0014] Furthermore, the step S1 is specifically as follows:
[0015] For the sunny and shady slopes of the Pu'er tea planting site, soil sampling is carried out at sampling points at the top, middle and bottom of the slope to obtain several soil samples, and the altitude of each soil sample is recorded;
[0016] The 21 soil components of each soil sample, including arsenic content, chromium content, lead content, nickel content, mercury content, effective cadmium content, effective chromium content, effective nickel content, pH value, zinc content, copper content, organic matter content, nitrogen content, phosphorus content, potassium content, effective potassium content, effective phosphorus content, alkaline hydrolyzed nitrogen content, magnesium content, fluoride content and cation content, were analyzed separately, and each soil component and altitude were taken as influencing factors.
[0017] Furthermore, the step S2 is specifically as follows:
[0018] The Pu'er tea polyphenol content of each of the influencing factors is annotated to construct a data set, and a sample expansion operation is performed on the data set using the Bootstrap method.
[0019] Furthermore, the step S3 is specifically as follows:
[0020] The data set is randomly divided into a training set and a validation set, and a univariate regression analysis is performed on the training set using a logistic regression model, so as to perform a preliminary screening of each of the influencing factors based on their correlation with the content of Pu'er tea polyphenols, and the screening results of the preliminary screening are verified based on the validation set.
[0021] Furthermore, the step S4 is specifically as follows:
[0022] Performing regression analysis on the data set by using a LASSO regression model, and screening out several modeling factors significantly correlated with the content of Pu'er tea polyphenols from the influencing factors;
[0023] The loss function of the LASSO regression model is:
[0024]
[0025] Among them, J(θ) represents the loss value of the loss function; θ represents the sample number variable; m represents the number of samples; h θ represents the actual value of the i-th sample; x (i) represents the i-th sample; y (i) represents the predicted value of the i-th sample; λ represents the regularization parameter; n represents the number of features; θ j Represents the regression coefficient of the LASSO regression model;
[0026] The step S6 is specifically as follows:
[0027] The performance of the nomogram model is evaluated by the AUC value of the ROC curve, and the nomogram model is fitted by a calibration curve to perform stability evaluation. The nomogram model that passes the evaluation is then deployed, and an API interface called by the nomogram model is set.
[0028] In a second aspect, the present invention provides a Pu'er tea polyphenol content prediction system, comprising the following modules:
[0029] The influencing factor collection module is used to obtain several soil samples by sampling the soil of the Pu'er tea planting area, record the altitude at which each soil sample is sampled, analyze the soil composition of each soil sample respectively, and use the soil composition and altitude as influencing factors;
[0030] A data set construction module, used to annotate each of the influencing factors to construct a data set, and perform a sample expansion operation on the data set;
[0031] A logistic regression module, used to perform univariate regression analysis on the data set through a logistic regression model to preliminarily screen each of the influencing factors;
[0032] A LASSO regression module is used to perform regression analysis on the data set through a LASSO regression model to perform secondary screening on each of the influencing factors to obtain a number of modeling factors;
[0033] A nomogram model creation module, used to create a nomogram model for predicting the content of Pu'er tea polyphenols based on each of the modeling factors;
[0034] A model evaluation module, used to perform performance evaluation and stability evaluation on the nomogram model through ROC curve and calibration curve respectively, and deploy the nomogram model that passes the evaluation;
[0035] The tea polyphenol content prediction module is used to obtain soil data to be predicted through a visual interface, input the soil data into a nomogram model in real time, and output the Pu'er tea polyphenol content prediction result. The visual interface displays the Pu'er tea polyphenol content prediction result in the form of a chart.
[0036] Furthermore, the influencing factor collection module is specifically used for:
[0037] For the sunny slope and the shady slope of the Pu'er tea planting site, soil sampling is carried out at the sampling points at the top, the middle and the bottom of the slope to obtain several soil samples, and the altitude of each soil sample is recorded;
[0038] The 21 soil components of each soil sample, including arsenic content, chromium content, lead content, nickel content, mercury content, effective cadmium content, effective chromium content, effective nickel content, pH value, zinc content, copper content, organic matter content, nitrogen content, phosphorus content, potassium content, effective potassium content, effective phosphorus content, alkaline hydrolyzed nitrogen content, magnesium content, fluoride content and cation content, were analyzed separately, and each soil component and altitude were taken as influencing factors.
[0039] Furthermore, the data set construction module is specifically used for:
[0040] The Pu'er tea polyphenol content of each of the influencing factors is annotated to construct a data set, and a sample expansion operation is performed on the data set using the Bootstrap method.
[0041] Furthermore, the logistic regression module is specifically used for:
[0042] The data set is randomly divided into a training set and a validation set, and a univariate regression analysis is performed on the training set using a logistic regression model, so as to perform a preliminary screening of each of the influencing factors based on their correlation with the content of Pu'er tea polyphenols, and the screening results of the preliminary screening are verified based on the validation set.
[0043] Furthermore, the LASSO regression module is specifically used for:
[0044] Performing regression analysis on the data set by using a LASSO regression model, and screening out several modeling factors significantly correlated with the content of Pu'er tea polyphenols from the influencing factors;
[0045] The loss function of the LASSO regression model is:
[0046]
[0047] Among them, J(θ) represents the loss value of the loss function; θ represents the sample number variable; m represents the number of samples; h θ represents the actual value of the i-th sample; x(i) represents the i-th sample; y (i) represents the predicted value of the i-th sample; λ represents the regularization parameter; n represents the number of features; θ j Represents the regression coefficient of the LASSO regression model;
[0048] The model evaluation module is specifically used for:
[0049] The performance of the nomogram model is evaluated by the AUC value of the ROC curve, and the nomogram model is fitted by a calibration curve to perform a stability evaluation. The nomogram model that passes the evaluation is then deployed, and an API interface called by the nomogram model is set.
[0050] The advantages of the present invention are:
[0051] 1. Several soil samples were obtained by soil sampling at the Pu'er tea planting site, and the altitude of each soil sample was recorded. The soil components of each soil sample were analyzed respectively, and each soil component and altitude were used as influencing factors. Then, each influencing factor was annotated to construct a data set, and the data set was expanded by sample. Then, a univariate regression analysis was performed on the data set through a logistic regression model to preliminarily screen each influencing factor, and a regression analysis was performed on the data set through a LASSO regression model to perform a secondary screening of each influencing factor to obtain several modeling factors. Then, a nomogram model for predicting the content of Pu'er tea polyphenols was created based on each modeling factor, and the performance and stability of the nomogram model were evaluated by ROC curve and calibration curve respectively. The nomogram model that passed the evaluation was evaluated. The graph model is deployed, and finally the soil data to be predicted is obtained through the visualization interface and input into the nomogram model, and the prediction result of Pu'er tea polyphenols content is output. The visualization interface displays the prediction result of Pu'er tea polyphenols content in the form of a chart; that is, soil sampling and analysis are carried out in the Pu'er tea planting area to obtain the soil composition of each soil sample, and the soil composition and altitude are taken as influencing factors. Through the logistic regression model and LASSO regression model, the influencing factors most relevant to the Pu'er tea polyphenols content are screened out from the influencing factors as modeling factors, and a nomogram model is created based on each modeling factor. After the performance and stability evaluation of the nomogram model, the nomogram model is used to predict the Pu'er tea polyphenols content. This method combines machine learning and statistics, and ultimately greatly improves the accuracy of the prediction of Pu'er tea polyphenols content.
[0052] 2. The nomogram model is used to predict the polyphenol content of Pu'er tea. Since the nomogram model is a very intuitive mathematical model, it can combine multiple factors to predict specific results. Compared with other prediction models, the nomogram model usually displays its results in the form of charts, which greatly improves the intuitiveness of the prediction results. In addition, the nomogram model does not require a large amount of training data sets, which greatly improves the construction speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The present invention will be further described below in conjunction with embodiments with reference to the accompanying drawings.
[0054] Figure 1 The present invention is a flowchart of a method for predicting the content of polyphenols in Pu'er tea.
[0055] Figure 2 It is a structural schematic diagram of a Pu'er tea polyphenol content prediction system of the present invention. DETAILED DESCRIPTION
[0056] The technical solution in the embodiments of the present application has the following overall idea: soil sampling and analysis are carried out on the Pu'er tea planting site to obtain the soil composition of each soil sample, and the soil composition and altitude are taken as influencing factors. Through the logistic regression model and the LASSO regression model, the influencing factors most relevant to the Pu'er tea polyphenol content are screened out from the influencing factors as modeling factors, and a nomogram model is created based on each modeling factor. After the performance and stability of the nomogram model are evaluated, the nomogram model is used to predict the Pu'er tea polyphenol content, combining machine learning and statistics to improve the accuracy of the prediction of the Pu'er tea polyphenol content.
[0057] Please refer to Figure 1 to Figure 2 As shown, a preferred embodiment of a method for predicting the content of Pu'er tea polyphenols of the present invention comprises the following steps:
[0058] Step S1, sampling the soil of the Pu'er tea planting area to obtain a plurality of soil samples, recording the altitude at which each soil sample was sampled, analyzing the soil components of each soil sample respectively, and taking the soil components and the altitude as influencing factors;
[0059] Step S2: labeling each of the influencing factors to construct a data set, and performing a sample expansion operation on the data set;
[0060] Step S3, performing univariate regression analysis on the data set through a logistic regression model to preliminarily screen the influencing factors; by screening the influencing factors, the complexity of the nomogram model is effectively reduced, thereby obtaining better performance parameters and avoiding overfitting;
[0061] Step S4, performing regression analysis on the data set by using a LASSO regression model to perform secondary screening on each of the influencing factors to obtain a number of modeling factors;
[0062] Step S5, creating a nomogram model for predicting the content of Pu'er tea polyphenols based on each of the modeling factors;
[0063] The nomogram model is based on multi-factor regression analysis, integrating multiple modeling factors, and using line segments with scale lines to draw in proportion on the same plane to express the relationship between the modeling factors. By analyzing the size of the regression coefficient in the nomogram model, the influence of each modeling factor on the prediction of Pu'er tea polyphenol content can be obtained, and the corresponding score is assigned to the value of each dependent variable. The function conversion relationship between the total score and the Pu'er tea polyphenol content is used to calculate the prediction probability of Pu'er tea polyphenol content.
[0064] Step S6, respectively performing performance evaluation and stability evaluation on the nomogram model through ROC curve and calibration curve, and deploying the nomogram model that passes the evaluation;
[0065] Step S7, obtaining soil data to be predicted through a visualization interface, inputting the soil data into a nomogram model in real time, and outputting a prediction result of the Pu'er tea polyphenol content, wherein the visualization interface displays the prediction result of the Pu'er tea polyphenol content in the form of a chart.
[0066] The step S1 is specifically as follows:
[0067] For the sunny and shady slopes of the Pu'er tea planting site, soil sampling was carried out at the sampling points at the top, middle and bottom of the slope to obtain several soil samples, and the altitude of each soil sample was recorded; in specific implementation, each sampling point was sampled 3 times, and each time the sampling was carried out, the consistency of the sampling position, sampling depth and sampling weight must be ensured;
[0068] The 21 soil components of each soil sample, including arsenic content, chromium content, lead content, nickel content, mercury content, effective cadmium content, effective chromium content, effective nickel content, pH value, zinc content, copper content, organic matter content, nitrogen content, phosphorus content, potassium content, effective potassium content, effective phosphorus content, alkaline hydrolyzed nitrogen content, magnesium content, fluoride content and cation content, were analyzed separately, and each soil component and altitude were taken as influencing factors.
[0069] During specific implementation, the contents of copper, zinc, chromium, nickel and lead are determined by flame atomic absorption spectrophotometry, the total phosphorus is determined by alkali fusion-molybdenum antimony counterspectrophotometry, the effective phosphorus is determined by sodium bicarbonate extraction-molybdenum antimony counterspectrophotometry, the effective potassium is determined by combined extraction-colorimetry, the total nitrogen is determined by Kjeldahl method, the fluoride is determined by ion selective electrode method, the cation exchange capacity is determined by hexaamminecobalt trichloride extraction-spectrophotometry, the pH value is determined by potentiometric method, the arsenic and mercury contents are determined by atomic fluorescence method, the organic matter content is determined by potassium dichromate oxidation-spectrophotometry, and the organic carbon content is determined by multiplying the constant 1.724.
[0070] The description table of the soil composition is as follows:
[0071]
[0072]
[0073] The step S2 is specifically as follows:
[0074] The Pu'er tea polyphenol content of each of the influencing factors is annotated to construct a data set, and a sample expansion operation is performed on the data set using the Bootstrap method.
[0075] The basic idea of the Bootstrap method is to extract several samples from the data set, conduct repeated experiments, construct multiple different data sets, and finally use the sample empirical distribution to replace the overall distribution; use the random replacement sampling method to perform corresponding operations, extract a certain number of samples from the data set, and then calculate the estimated statistics based on the extracted samples, and calculate the variance and distribution based on the calculation results. In the specific implementation, the content of Pu'er tea polyphenols was determined by the Folin phenol colorimetric method.
[0076] The step S3 is specifically as follows:
[0077] The data set is randomly divided into a training set and a validation set, and a univariate regression analysis is performed on the training set using a logistic regression model, so as to perform a preliminary screening of each of the influencing factors based on their correlation with the content of Pu'er tea polyphenols, and the screening results of the preliminary screening are verified based on the validation set.
[0078] Logistic regression analysis is a generalized linear regression analysis model. Its derivation and calculation process is similar to the regression process. It is mainly used to solve binary classification or multi-class classification problems. The logistic regression model is trained using a given training set, and after training, one or more validation sets are classified. The main idea is to establish a relevant regression formula as the classification boundary based on the existing data, and then perform classification. Logistic regression analysis is a posterior probability distribution. From a probability perspective, it has better robustness to abnormal data than the perceptron model. Compared with general linear regression, logistic regression analysis has an S-shaped function, which is usually considered to be a threshold function in neural networks.
[0079] The step S4 is specifically as follows:
[0080] The data set is subjected to regression analysis by using a LASSO (Least Absolute Shrinkage and Selection Operator) regression model, and several modeling factors significantly correlated with the content of Pu'er tea polyphenols are screened out from the influencing factors;
[0081] The loss function of the LASSO regression model is:
[0082]
[0083] Among them, J(θ) represents the loss value of the loss function; θ represents the sample number variable; m represents the number of samples; h θ represents the actual value of the i-th sample; x (i) represents the i-th sample; y (i) represents the predicted value of the i-th sample; λ represents the regularization parameter. The larger the λ value is, the fewer variables (modeling factors) are finally screened out by the LASSO regression model; n represents the number of features; θ j Represents the regression coefficient of the LASSO regression model;
[0084] The LASSO regression model is a biased estimation method for processing data with complex collinearity by reducing the variable set and constructing a penalty function to compress the variable coefficients and make some regression coefficients zero, and retains the advantages of subset shrinkage.
[0085] In the coefficient distribution diagram of LASSO regression, as the horizontal axis (penalty coefficient) increases, the vertical axis (variable coefficient) will gradually be affected by the penalty term and compressed until it is finally compressed to 0 and stops changing. In order to reduce the risk of overfitting, the present invention selects the λ value at twice the standard error level for LASSO regression analysis.
[0086] The step S6 is specifically as follows:
[0087] The performance of the nomogram model is evaluated by the AUC value of the ROC curve, and the nomogram model is fitted by a calibration curve to evaluate stability. The nomogram model that passes the evaluation is then deployed, and an API interface called by the nomogram model is set.
[0088] The ROC curve is used to evaluate the generalization performance of the model. It was originally used to detect radar signals in wars. It is currently mainly used to evaluate the performance of models generated by machine learning. The ROC curve can be used to comprehensively evaluate the advantages and disadvantages of different models, and the closer the curve is to the upper left, the better the prediction results. The ROC curve divides the final results into positive and negative. When the model accuracy is finally evaluated, the actual situation is divided into True Positive (TP), False Negative (FN), False Positive (FP), and True Negative (TN). When the predicted value is exactly the same as the true value, it is called True Positive or True Negative; when the predicted value is different from the true value, it is called False Negative or False Positive. The ordinate of the ROC curve is True Positive Chance (TPR). The larger the value, the more accurate the prediction. TRP = TP / (TP+FN). The abscissa of the ROC curve is False Positive Chance (FPR). The smaller the value, the more accurate the prediction. FRP = FP / (FP+TN).
[0089] Since the ROC curve cannot quantitatively evaluate the model performance, the model performance is evaluated by calculating the area under the curve (AUC). The AUC value represents the area under the ROC curve. The larger the AUC value, the stronger its classification ability.
[0090] The calibration curve is a tool to evaluate the degree of fit between the model prediction results and the actual situation, and can be used to evaluate the degree of fit between the nomogram and the changes in Pu'er tea polyphenols content under abiotic stress.
[0091] The calibration curve is essentially a scatter plot that can be used to evaluate the consistency between the predicted and actual Pu'er tea polyphenol content. The calibration curve is a visualization of the Hosmer–Lemeshow goodness of fit test, comparing the predicted content with the actual content to determine if there is a significant difference. In the process of drawing the calibration curve, the predicted probabilities need to be binned under the guidance of uniformity and quantiles. Uniformity means that the width of each bin is the same, and quantile means that the number of data points in each bin is equal. Then the average of all sample predictions in each bin and the probability of a true positive in each bin are calculated respectively as the abscissa and ordinate of the scatter plot, and the calibration curve is created after connecting the points of the scatter plot. The long dashed line (ideal) of the calibration curve represents the ideal situation of the nomogram model, and the predicted value is exactly the same as the actual value.
[0092] Logistic calibration represents the performance of the nomogram model corrected by the bootstrap method, while nonparametric represents the apparent accuracy of the nomogram model. If the predicted value is equal to the true outcome, the logistic calibration and nonparametric curves completely coincide; if the estimated value is higher than the true value, the nonparametric curve is below the logistic calibration; otherwise, the nonparametric curve is above the logistic calibration.
[0093] A preferred embodiment of a Pu'er tea polyphenol content prediction system of the present invention comprises the following modules:
[0094] The influencing factor collection module is used to obtain several soil samples by sampling the soil of the Pu'er tea planting area, record the altitude at which each soil sample is sampled, analyze the soil composition of each soil sample respectively, and use the soil composition and altitude as influencing factors;
[0095] A data set construction module, used to annotate each of the influencing factors to construct a data set, and perform a sample expansion operation on the data set;
[0096] A logistic regression module is used to perform a univariate regression analysis on the data set through a logistic regression model to preliminarily screen the influencing factors; by screening the influencing factors, the complexity of the nomogram model is effectively reduced, thereby obtaining better performance parameters and avoiding overfitting;
[0097] A LASSO regression module is used to perform regression analysis on the data set through a LASSO regression model to perform secondary screening on each of the influencing factors to obtain a number of modeling factors;
[0098] A nomogram model creation module, used to create a nomogram model for predicting the content of Pu'er tea polyphenols based on each of the modeling factors;
[0099] The nomogram model is based on multi-factor regression analysis, integrating multiple modeling factors, and using line segments with scale lines to draw in proportion on the same plane to express the relationship between the modeling factors. By analyzing the size of the regression coefficient in the nomogram model, the influence of each modeling factor on the prediction of Pu'er tea polyphenol content can be obtained, and the corresponding score is assigned to the value of each dependent variable. The function conversion relationship between the total score and the Pu'er tea polyphenol content is used to calculate the prediction probability of Pu'er tea polyphenol content.
[0100] A model evaluation module, used to perform performance evaluation and stability evaluation on the nomogram model through ROC curve and calibration curve respectively, and deploy the nomogram model that passes the evaluation;
[0101] The tea polyphenol content prediction module is used to obtain soil data to be predicted through a visual interface, input the soil data into a nomogram model in real time, and output the Pu'er tea polyphenol content prediction result. The visual interface displays the Pu'er tea polyphenol content prediction result in the form of a chart.
[0102] The influencing factor acquisition module is specifically used for:
[0103] For the sunny and shady slopes of the Pu'er tea planting site, soil sampling was carried out at the sampling points at the top, middle and bottom of the slope to obtain several soil samples, and the altitude of each soil sample was recorded; in specific implementation, each sampling point was sampled 3 times, and each time the sampling was carried out, the consistency of the sampling position, sampling depth and sampling weight must be ensured;
[0104] The 21 soil components of each soil sample, including arsenic content, chromium content, lead content, nickel content, mercury content, effective cadmium content, effective chromium content, effective nickel content, pH value, zinc content, copper content, organic matter content, nitrogen content, phosphorus content, potassium content, effective potassium content, effective phosphorus content, alkaline hydrolyzed nitrogen content, magnesium content, fluoride content and cation content, were analyzed separately, and each soil component and altitude were taken as influencing factors.
[0105] During specific implementation, the contents of copper, zinc, chromium, nickel and lead are determined by flame atomic absorption spectrophotometry, the total phosphorus is determined by alkali fusion-molybdenum antimony counterspectrophotometry, the effective phosphorus is determined by sodium bicarbonate extraction-molybdenum antimony counterspectrophotometry, the effective potassium is determined by combined extraction-colorimetry, the total nitrogen is determined by Kjeldahl method, the fluoride is determined by ion selective electrode method, the cation exchange capacity is determined by hexaamminecobalt trichloride extraction-spectrophotometry, the pH value is determined by potentiometric method, the arsenic and mercury contents are determined by atomic fluorescence method, the organic matter content is determined by potassium dichromate oxidation-spectrophotometry, and the organic carbon content is determined by multiplying the constant 1.724.
[0106] The description table of the soil composition is as follows:
[0107]
[0108]
[0109] The data set construction module is specifically used for:
[0110] The Pu'er tea polyphenol content of each of the influencing factors is annotated to construct a data set, and a sample expansion operation is performed on the data set using the Bootstrap method.
[0111] The basic idea of the Bootstrap method is to extract several samples from the data set, conduct repeated experiments, construct multiple different data sets, and finally use the sample empirical distribution to replace the overall distribution; use the random replacement sampling method to perform corresponding operations, extract a certain number of samples from the data set, and then calculate the estimated statistics based on the extracted samples, and calculate the variance and distribution based on the calculation results. In the specific implementation, the content of Pu'er tea polyphenols was determined by the Folin phenol colorimetric method.
[0112] The logistic regression module is specifically used for:
[0113] The data set is randomly divided into a training set and a validation set, and a univariate regression analysis is performed on the training set using a logistic regression model, so as to perform a preliminary screening of each of the influencing factors based on their correlation with the content of Pu'er tea polyphenols, and the screening results of the preliminary screening are verified based on the validation set.
[0114] Logistic regression analysis is a generalized linear regression analysis model. Its derivation and calculation process is similar to the regression process. It is mainly used to solve binary classification or multi-class classification problems. The logistic regression model is trained using a given training set, and after training, one or more validation sets are classified. The main idea is to establish a relevant regression formula as the classification boundary based on the existing data, and then perform classification. Logistic regression analysis is a posterior probability distribution. From a probability perspective, it has better robustness to abnormal data than the perceptron model. Compared with general linear regression, logistic regression analysis has an S-shaped function, which is usually considered to be a threshold function in neural networks.
[0115] The LASSO regression module is specifically used for:
[0116] The data set is subjected to regression analysis by using a LASSO (Least Absolute Shrinkage and Selection Operator) regression model, and several modeling factors significantly correlated with the content of Pu'er tea polyphenols are screened out from the influencing factors;
[0117] The loss function of the LASSO regression model is:
[0118]
[0119] Among them, J(θ) represents the loss value of the loss function; θ represents the sample number variable; m represents the number of samples; h θ represents the actual value of the i-th sample; x (i) represents the i-th sample; y (i)represents the predicted value of the i-th sample; λ represents the regularization parameter. The larger the λ value, the fewer variables (modeling factors) are finally screened out by the LASSO regression model; n represents the number of features; θ j Represents the regression coefficient of the LASSO regression model;
[0120] The LASSO regression model is a biased estimation method for processing data with complex collinearity by reducing the variable set and constructing a penalty function to compress the variable coefficients and make some regression coefficients zero, and retains the advantages of subset shrinkage.
[0121] In the coefficient distribution diagram of LASSO regression, as the horizontal axis (penalty coefficient) increases, the vertical axis (variable coefficient) will gradually be affected by the penalty term and compressed until it is finally compressed to 0 and stops changing. In order to reduce the risk of overfitting, the present invention selects the λ value at twice the standard error level for LASSO regression analysis.
[0122] The model evaluation module is specifically used for:
[0123] The performance of the nomogram model is evaluated by the AUC value of the ROC curve, and the nomogram model is fitted by a calibration curve to evaluate stability. The nomogram model that passes the evaluation is then deployed, and an API interface called by the nomogram model is set.
[0124] The ROC curve is used to evaluate the generalization performance of the model. It was originally used to detect radar signals in wars. It is currently mainly used to evaluate the performance of models generated by machine learning. The ROC curve can be used to comprehensively evaluate the advantages and disadvantages of different models, and the closer the curve is to the upper left, the better the prediction results. The ROC curve divides the final results into positive and negative. When the model accuracy is finally evaluated, the actual situation is divided into True Positive (TP), False Negative (FN), False Positive (FP), and True Negative (TN). When the predicted value is exactly the same as the true value, it is called True Positive or True Negative; when the predicted value is different from the true value, it is called False Negative or False Positive. The ordinate of the ROC curve is True Positive Chance (TPR). The larger the value, the more accurate the prediction. TRP = TP / (TP+FN). The abscissa of the ROC curve is False Positive Chance (FPR). The smaller the value, the more accurate the prediction. FRP = FP / (FP+TN).
[0125] Since the ROC curve cannot quantitatively evaluate the model performance, the model performance is evaluated by calculating the area under the curve (AUC). The AUC value represents the area under the ROC curve. The larger the AUC value, the stronger its classification ability.
[0126] The calibration curve is a tool to evaluate the degree of fit between the model prediction results and the actual situation, and can be used to evaluate the degree of fit between the nomogram and the changes in Pu'er tea polyphenols content under abiotic stress.
[0127] The calibration curve is essentially a scatter plot that can be used to evaluate the consistency between the predicted and actual Pu'er tea polyphenol content. The calibration curve is a visualization of the Hosmer–Lemeshow goodness of fit test, comparing the predicted content with the actual content to determine if there is a significant difference. In the process of drawing the calibration curve, the predicted probabilities need to be binned under the guidance of uniformity and quantiles. Uniformity means that the width of each bin is the same, and quantile means that the number of data points in each bin is equal. Then the average of all sample predictions in each bin and the probability of a true positive in each bin are calculated respectively as the abscissa and ordinate of the scatter plot, and the calibration curve is created after connecting the points of the scatter plot. The long dashed line (ideal) of the calibration curve represents the ideal situation of the nomogram model, and the predicted value is exactly the same as the actual value.
[0128] Logistic calibration represents the performance of the nomogram model corrected by the bootstrap method, while nonparametric represents the apparent accuracy of the nomogram model. If the predicted value is equal to the true outcome, the logistic calibration and nonparametric curves completely coincide; if the estimated value is higher than the true value, the nonparametric curve is below the logistic calibration; otherwise, the nonparametric curve is above the logistic calibration.
[0129] In summary, the advantages of the present invention are:
[0130] 1. Several soil samples were obtained by soil sampling at the Pu'er tea planting site, and the altitude of each soil sample was recorded. The soil components of each soil sample were analyzed respectively, and each soil component and altitude were used as influencing factors. Then, each influencing factor was annotated to construct a data set, and the data set was expanded by sample. Then, a univariate regression analysis was performed on the data set through a logistic regression model to preliminarily screen each influencing factor, and a regression analysis was performed on the data set through a LASSO regression model to perform a secondary screening of each influencing factor to obtain several modeling factors. Then, a nomogram model for predicting the content of Pu'er tea polyphenols was created based on each modeling factor, and the performance and stability of the nomogram model were evaluated by ROC curve and calibration curve respectively. The nomogram model that passed the evaluation was evaluated. The graph model is deployed, and finally the soil data to be predicted is obtained through the visualization interface and input into the nomogram model, and the prediction result of Pu'er tea polyphenols content is output. The visualization interface displays the prediction result of Pu'er tea polyphenols content in the form of a chart; that is, soil sampling and analysis are carried out in the Pu'er tea planting area to obtain the soil composition of each soil sample, and the soil composition and altitude are taken as influencing factors. Through the logistic regression model and LASSO regression model, the influencing factors most relevant to the Pu'er tea polyphenols content are screened out from the influencing factors as modeling factors, and a nomogram model is created based on each modeling factor. After the performance and stability evaluation of the nomogram model, the nomogram model is used to predict the Pu'er tea polyphenols content. This method combines machine learning and statistics, and ultimately greatly improves the accuracy of the prediction of Pu'er tea polyphenols content.
[0131] 2. The nomogram model is used to predict the polyphenol content of Pu'er tea. Since the nomogram model is a very intuitive mathematical model, it can combine multiple factors to predict specific results. Compared with other prediction models, the nomogram model usually displays its results in the form of charts, which greatly improves the intuitiveness of the prediction results. In addition, the nomogram model does not require a large amount of training data sets, which greatly improves the construction speed.
[0132] Although the specific implementation modes of the present invention are described above, those skilled in the art should understand that the specific implementation modes described are only illustrative and are not intended to limit the scope of the present invention. Equivalent modifications and changes made by those skilled in the art in accordance with the spirit of the present invention should be included in the scope of protection of the claims of the present invention.
Claims
1. A method for predicting the content of Pu'er tea polyphenols, characterized in that: The steps include: Step S1, sampling the soil of the Pu'er tea planting area to obtain a plurality of soil samples, recording the altitude at which each soil sample was sampled, analyzing the soil components of each soil sample respectively, and taking the soil components and the altitude as influencing factors; Step S2: labeling each of the influencing factors to construct a data set, and performing a sample expansion operation on the data set; Step S3, performing univariate regression analysis on the data set using a logistic regression model to preliminarily screen each of the influencing factors; Step S4, performing regression analysis on the data set by using a LASSO regression model to perform secondary screening on each of the influencing factors to obtain a number of modeling factors; Step S5, creating a nomogram model for predicting the content of Pu'er tea polyphenols based on each of the modeling factors; Step S6, respectively performing performance evaluation and stability evaluation on the nomogram model through ROC curve and calibration curve, and deploying the nomogram model that passes the evaluation; Step S7, obtaining soil data to be predicted through a visualization interface, inputting the soil data into a nomogram model in real time, and outputting a prediction result of the Pu'er tea polyphenol content, wherein the visualization interface displays the prediction result of the Pu'er tea polyphenol content in the form of a chart.
2. A method for predicting the content of Pu'er tea polyphenols as claimed in claim 1, characterized in that: The step S1 is specifically as follows: For the sunny slope and the shady slope of the Pu'er tea planting site, soil sampling is carried out at the sampling points at the top, the middle and the bottom of the slope to obtain several soil samples, and the altitude of each soil sample is recorded; The 21 soil components of each soil sample, including arsenic content, chromium content, lead content, nickel content, mercury content, effective cadmium content, effective chromium content, effective nickel content, pH value, zinc content, copper content, organic matter content, nitrogen content, phosphorus content, potassium content, effective potassium content, effective phosphorus content, alkaline hydrolyzed nitrogen content, magnesium content, fluoride content and cation content, were analyzed separately, and each soil component and altitude were taken as influencing factors.
3. A method for predicting the content of Pu'er tea polyphenols as claimed in claim 1, characterized in that: The step S2 is specifically as follows: The Pu'er tea polyphenol content of each of the influencing factors is annotated to construct a data set, and a sample expansion operation is performed on the data set using the Bootstrap method.
4. A method for predicting the content of Pu'er tea polyphenols as claimed in claim 1, characterized in that: The step S3 is specifically as follows: The data set is randomly divided into a training set and a validation set, and a univariate regression analysis is performed on the training set using a logistic regression model, so as to perform a preliminary screening of each of the influencing factors based on their correlation with the content of Pu'er tea polyphenols, and the screening results of the preliminary screening are verified based on the validation set.
5. The method for predicting the content of Pu'er tea polyphenols according to claim 1, characterized in that: The step S4 is specifically as follows: Performing regression analysis on the data set by using a LASSO regression model, and screening out several modeling factors significantly correlated with the content of Pu'er tea polyphenols from the influencing factors; The loss function of the LASSO regression model is: Among them, J(θ) represents the loss value of the loss function; θ represents the sample number variable; m represents the number of samples; h θ represents the actual value of the i-th sample; x (i) represents the i-th sample; y (i) represents the predicted value of the i-th sample; λ represents the regularization parameter; n represents the number of features; θ j Represents the regression coefficient of the LASSO regression model; The step S6 is specifically as follows: The performance of the nomogram model is evaluated by the AUC value of the ROC curve, and the nomogram model is fitted by a calibration curve to perform a stability evaluation. The nomogram model that passes the evaluation is then deployed, and an API interface called by the nomogram model is set.
6. A Pu'er tea polyphenol content prediction system, characterized by: Includes the following modules: The influencing factor collection module is used to obtain several soil samples by sampling the soil of the Pu'er tea planting area, record the altitude at which each soil sample is sampled, analyze the soil composition of each soil sample respectively, and use the soil composition and altitude as influencing factors; A data set construction module, used to annotate each of the influencing factors to construct a data set, and perform a sample expansion operation on the data set; A logistic regression module, used to perform univariate regression analysis on the data set through a logistic regression model to preliminarily screen each of the influencing factors; A LASSO regression module is used to perform regression analysis on the data set through a LASSO regression model to perform secondary screening on each of the influencing factors to obtain a number of modeling factors; A nomogram model creation module, used to create a nomogram model for predicting the content of Pu'er tea polyphenols based on each of the modeling factors; A model evaluation module, used to perform performance evaluation and stability evaluation on the nomogram model through ROC curve and calibration curve respectively, and deploy the nomogram model that passes the evaluation; The tea polyphenol content prediction module is used to obtain soil data to be predicted through a visual interface, input the soil data into a nomogram model in real time, and output the Pu'er tea polyphenol content prediction result. The visual interface displays the Pu'er tea polyphenol content prediction result in the form of a chart.
7. A Pu'er tea polyphenol content prediction system as claimed in claim 6, characterized in that: The influencing factor acquisition module is specifically used for: For the sunny slope and the shady slope of the Pu'er tea planting site, soil sampling is carried out at the sampling points at the top, the middle and the bottom of the slope to obtain several soil samples, and the altitude of each soil sample is recorded; The 21 soil components of each soil sample, including arsenic content, chromium content, lead content, nickel content, mercury content, effective cadmium content, effective chromium content, effective nickel content, pH value, zinc content, copper content, organic matter content, nitrogen content, phosphorus content, potassium content, effective potassium content, effective phosphorus content, alkaline hydrolyzed nitrogen content, magnesium content, fluoride content and cation content, were analyzed separately, and each soil component and altitude were taken as influencing factors.
8. A Pu'er tea polyphenol content prediction system as claimed in claim 6, characterized in that: The data set construction module is specifically used for: The Pu'er tea polyphenol content of each of the influencing factors is annotated to construct a data set, and a sample expansion operation is performed on the data set using the Bootstrap method.
9. A Pu'er tea polyphenol content prediction system as claimed in claim 6, characterized in that: The logistic regression module is specifically used for: The data set is randomly divided into a training set and a validation set, and a univariate regression analysis is performed on the training set using a logistic regression model, so as to perform a preliminary screening of each of the influencing factors based on their correlation with the content of Pu'er tea polyphenols, and the screening results of the preliminary screening are verified based on the validation set.
10. A Pu'er tea polyphenol content prediction system as claimed in claim 6, characterized in that: The LASSO regression module is specifically used for: Performing regression analysis on the data set by using a LASSO regression model, and screening out several modeling factors significantly correlated with the content of Pu'er tea polyphenols from the influencing factors; The loss function of the LASSO regression model is: Among them, J(θ) represents the loss value of the loss function; θ represents the sample number variable; m represents the number of samples; h θ represents the actual value of the i-th sample; x (i) represents the i-th sample; y (i) represents the predicted value of the i-th sample; λ represents the regularization parameter; n represents the number of features; θ j Represents the regression coefficient of the LASSO regression model; The model evaluation module is specifically used for: The performance of the nomogram model is evaluated by the AUC value of the ROC curve, and the nomogram model is fitted by a calibration curve to perform a stability evaluation. The nomogram model that passes the evaluation is then deployed, and an API interface called by the nomogram model is set.
Citation Information
Patent Citations
Clinical prediction model construction method for distinguishing lesions based on logistic regression
CN118398197A