Nutritional requirement evaluation and customized intervention method and system based on user characteristics
By improving technical means such as the chi-square test algorithm and Bayesian algorithm, a nutritional needs assessment model based on individual characteristics was established, which solved the problem of model relying on artificial experience and poor interpretation in the existing technology, and achieved more accurate and personalized nutritional needs assessment and dietary intervention.
Patent Information
- Application Number
- CN202411553084.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-01
- Publication Date
- 2025-03-07
AI Technical Summary
When fitting the potential relationship between individual information and demand, the existing nutritional needs assessment scheme relies on too many prior conditions to complete the automatic basis function selection, resulting in the model being overly reliant on human subjective experience, poor interpretability, and large deviations in the prediction results.
By obtaining individual information, establishing a sample set of feature vectors and nutritional requirements, using the improved chi-square test algorithm to screen important individual information, updating the feature vectors, calculating the approximate curvature value to screen the baseline model, combining the Bayesian algorithm to establish a nutritional needs assessment model, and dietary matching is performed through the improved decision tree model.
It improves the accuracy and interpretability of the nutritional needs assessment model, reduces the dependence of human subjective experience, provides a personalized and scientific nutritional diet plan, and improves the reliability and automation of interventions.
Smart Images

Figure CN119581013A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of health management technology, and in particular to a method and system for evaluating nutritional needs and customized intervention based on user characteristics. Background Art
[0002] At present, the dietary and nutritional guidance for Chinese residents is based on the regularly updated "Dietary Guidelines for Chinese Residents", which provides general dietary recommendations. However, this population-based "one-size-fits-all" nutritional program is not suitable for everyone and cannot effectively reduce the threat of nutrition-related diet and lifestyle diseases (such as obesity, hypertension, diabetes, gout, etc.).
[0003] With the rapid development of society and the continuous improvement of economic level, people's nutritional health has been significantly improved, dietary quality and physical fitness have been significantly improved, and malnutrition and anemia have shown a downward trend year by year. However, the change in lifestyle has also brought some nutritional problems. For example, a healthy lifestyle has not been fully popularized, the dietary structure is still not particularly reasonable, and chronic diseases such as hypertension and gout are also posing an increasingly serious threat to health. Balanced nutritional intake is of great significance to maintaining individual health and the harmonious development of society. The country has also issued a series of documents to guide and intervene in the dietary structure and content of the population. These documents have improved the dietary status of residents to a certain extent, but because they target groups, they cannot provide precise guidance and suggestions based on the characteristics and needs of each person.
[0004] Precision nutrition / personalized nutrition (PN) is a method of providing more preventive and practical nutrition programs based on specific information of individuals or subgroups, which has been proven to help promote behavioral changes and positively affect health outcomes. When designing such a nutrition program, it is necessary to consider multiple factors such as individual sociodemographic information, anthropometric measurements, physical health status, diet, genes, intestinal microorganisms, and lifestyle in traditional population-based nutrition assessments, apply big data and artificial intelligence technologies to more finely stratify the nutritional needs of individuals or subgroups, and provide targeted dietary and lifestyle recommendations to promote behavioral changes and health improvements.
[0005] However, existing nutritional needs assessment schemes often rely on too many prior conditions when fitting the potential correlation between individual information and demand, and are unable to complete automated basis function selection. This results in the model used to predict nutritional needs being overly dependent on human subjective experience, with poor interpretability and unable to truly reflect the correlation implied by the data itself, resulting in large deviations in the prediction results. Summary of the invention
[0006] In order to solve the technical problems that the prior art often relies on too many prior conditions and cannot complete the automatic selection of basis functions when fitting the potential correlation between individual information and demand, which leads to the model for predicting nutritional needs being overly dependent on human subjective experience, poorly interpretable and unable to truly reflect the correlation implied by the data itself, and resulting in large deviations in the prediction results, the present invention provides a nutritional needs assessment and customized intervention method and system based on user characteristics.
[0007] The technical solution provided by the embodiment of the present invention is as follows:
[0008] First aspect
[0009] The embodiment of the present invention provides a method and system for evaluating nutritional needs and customized intervention based on user characteristics, including:
[0010] S1: Obtain individual information and establish a sample set with the individual information as the feature vector and the nutritional requirement corresponding to the individual information as the label;
[0011] S2: Individual information is screened based on the improved chi-square test algorithm combined with conditional mutual information, and important individual information whose significance value is greater than the preset significance value under the null hypothesis is retained;
[0012] S3: updating the feature vector based on the important individual information to obtain an updated sample set, wherein the updated sample set includes the updated feature vector and the corresponding label;
[0013] S4: Calculate the approximate curvature value of the sample point, and select the baseline model according to the approximate curvature value, wherein the sample point is a data pair consisting of an updated feature vector and a label corresponding to the updated feature vector;
[0014] S5: According to the updated sample set, a nutritional demand assessment model based on the baseline model is established in combination with the Bayesian algorithm;
[0015] S6: Obtaining information of the individual to be evaluated, and inputting the information of the individual to be evaluated into a nutritional demand evaluation model, and outputting a nutritional demand evaluation value;
[0016] S7: construct an improved decision tree model with individual preference influencing factors, wherein the top layer of the improved decision tree model is a preference screening layer established based on the individual preference influencing factors;
[0017] S8: Input the nutritional requirement assessment value into the improved decision tree model, output the dietary matching plan, and use the dietary matching plan to intervene in the corresponding individuals to be assessed.
[0018] Second aspect
[0019] The embodiment of the present invention provides a nutritional needs assessment and customized intervention system based on user characteristics, including:
[0020] processor;
[0021] A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the nutritional needs assessment and customized intervention method based on user characteristics as described in the first aspect is implemented.
[0022] The third aspect
[0023] An embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the nutritional needs assessment and customized intervention method based on user characteristics as described in the first aspect is implemented.
[0024] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0025] In the present invention, based on the sample set, an improved chi-square test algorithm with conditional mutual information is used to evaluate the importance of each individual information and the individual information that only reflects the influencing effect when the individual information coexists, and the important individual information is accurately screened out, so as to avoid the introduction of individual information irrelevant to nutritional needs into the model establishment process, and avoid the screening of coexisting related individual information, thereby increasing the accuracy and reliability of model establishment. Then, based on the established updated sample set, the baseline model is automatically screened using the curvature value, and the screened baseline model has a high degree of overlap with the law of the sample point itself, and a nutritional demand assessment model is established on the basis of the baseline model using the Bayesian algorithm, and the likelihood function of the Bayesian algorithm can be used to gradually approximate the optimal parameter value of the model, with a high degree of automation, strong interpretability, and accurate nutritional demand prediction results. Finally, based on the nutritional demand assessment value predicted by the model, a dietary matching is performed using an improved decision tree model with individual preference influencing factors, and the preference screening layer is placed at the front top layer, so as to provide users with a personalized dietary plan that meets nutritional needs, and the intervention effect is more accurate and reliable, with a high degree of automation. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 A flowchart of a method for nutritional needs assessment and customized intervention based on user characteristics provided by an embodiment of the present invention;
[0028] Figure 2 A structural schematic diagram of a nutritional needs assessment and customized intervention system based on user characteristics provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The technical solution of the present invention is described below in conjunction with the accompanying drawings.
[0030] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.
[0031] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.
[0032] In the embodiments of the present invention, sometimes a subscript such as W1 may be in a non-subscript form such as W1. When the difference is not emphasized, the meanings to be expressed are consistent.
[0033] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.
[0034] Reference Manual Attached Figure 1 , showing a flow chart of a method for nutritional needs assessment and customized intervention based on user characteristics provided in an embodiment of the present invention.
[0035] The embodiment of the present invention provides a method for evaluating nutritional needs and customized intervention based on user characteristics, which can be implemented by a device for evaluating nutritional needs and customized intervention based on user characteristics, which can be a terminal or a server. The processing flow of the method for evaluating nutritional needs and customized intervention based on user characteristics can include the following steps:
[0036] S1: Obtain individual information and establish a sample set with the individual information as the feature vector and the nutritional requirement corresponding to the individual information as the label.
[0037] Among them, nutritional requirements include energy requirements and various vitamin requirements. Individual information includes all indicators in physical examinations and other test items, including but not limited to age, gender and weight. This step is the basis for creating a data model, which aims to accurately associate individual characteristics with their nutritional requirements and provide necessary input data for subsequent data analysis and model training.
[0038] In a possible implementation, the individual information includes age, gender, weight, height, body mass index, blood test index, genes, intestinal microorganisms and health status, wherein the health status is a disease binary variable, wherein when the disease binary variable is 1, it indicates that the disease exists, otherwise it indicates that the disease does not exist. Nutritional requirements include energy requirements and various vitamin requirements.
[0039] It is understandable that by collecting detailed information about individuals including age, gender, weight, height, body mass index, blood test index, genes, intestinal microorganisms, and specific health status, the nutritional needs assessment model can be made more accurate and personalized. The use of binary disease variables not only simplifies the model processing process, but also accurately identifies the health status of the subjects, thereby providing tailored nutritional advice for each individual, ensuring the pertinence and practicality of the advice. Such detailed data processing helps to improve the accuracy of the assessment and make the nutritional plan more in line with the actual health needs of the individual.
[0040] S2: Individual information is screened based on the improved chi-square test algorithm combined with conditional mutual information, and important individual information whose significance value is greater than the preset significance value under the null hypothesis state is retained.
[0041] Among them, the significance value is a very important concept used in hypothesis testing to help us decide whether to reject the null hypothesis about the data. It measures the probability of the observed statistical results (or more extreme results) when the null hypothesis is true. If the value is small, it indicates that the probability of obtaining experimental data, that is, a specific target variable (or more extreme data) when the null hypothesis is true is very low, which is interpreted as the data providing enough evidence to reject the null hypothesis. If the p-value is large, there is not enough evidence to reject the null hypothesis, which means that the observed effect may have occurred simply by chance. Conditional mutual information is a measure in information theory that quantifies the amount of mutual information between two random variables when a third random variable is known. The chi-square test is a method used in statistics to test the assumption of independence of two categorical variables. In data analysis, it is used to determine whether the deviation between the observed data and the expected data is large enough to not be attributed to chance alone.
[0042] Specifically, the collected individual information (features) are screened using an improved chi-square test algorithm based on conditional mutual information. This step determines which features are important by evaluating whether the relationship between each feature and nutritional requirements (labels) is statistically significant. Only those features whose significance values are greater than the preset significance values under the null hypothesis are retained. Not only the univariate effects between features are considered, but also the interactions and dependencies between features, which can more comprehensively capture the potential associations in the data. This method reduces the risk of overfitting of the model, increases the generalization ability of the model, and makes the predictions of the model in practical applications more reliable and accurate. In addition, this screening process also helps to reduce the complexity of the model and simplify subsequent calculations and analysis, thereby improving the operating efficiency and practicality of the algorithm.
[0043] It should be noted that those skilled in the art can set the size of the preset significance value according to actual needs, and the present invention is not limited here.
[0044] In a possible implementation, S2 specifically includes:
[0045] S201: Calculate the correlation between each type of feature in the individual information and the target variable, i.e., the nutritional requirement:
[0046]
[0047]
[0048] in, represents the observed frequency of the combination of the i-th feature and the j-th target variable, represents the expected frequency under the null hypothesis, that is, under the assumption that feature i is independent of target variable j. represents the chi-square statistic used to measure the difference between the observed frequency and the expected frequency, and They respectively represent the total number of data points of the i-th feature and the j-th target variable in the sample set, and s represents the total number of combination pairs obtained by combining the i-th feature and the j-th target variable in the sample set, that is, the total number of sample points.
[0049] in, It represents the observed frequency of the combination of the i-th feature and the j-th target variable, that is, the number of data points actually observed in the combination of the i-th feature and the j-th target variable.
[0050] S202: Calculate the mutual information value of each pair of features under different target variables:
[0051]
[0052] in, Represents the conditional mutual information value between feature X and feature Y under the determination of target variable Z, represents the joint probability distribution of X, Y, and Z, that is, the probability of X taking the value x, Y taking the value y, and Z taking the value z, represents the joint conditional probability distribution of X, Y, and Z, that is, the probability that X and Y take the values of x and y respectively under the condition that Z takes the value of z. represents the marginal conditional probability distribution about X and Z, that is, the probability that X takes the value x under the condition that Z takes the value z, It represents the marginal conditional probability distribution about Y and Z, that is, the probability that Y takes the value y under the condition that Z takes the value z, and log represents the logarithmic function.
[0053] The mutual information value indicates the mutual dependence between X and Y given that Z is known. , which means that X and Y are independent given Z. If It means that when Z is known, there is information sharing between X and Y, that is, they are not completely independent. Through this method, we can explore and quantify the dependence and interaction between other variables under the control of certain variables, and then evaluate the dependence between a feature and the target variable under the condition of one or more other features. This method can capture the feature interaction effect in the conditional dependency. It avoids the disadvantage of the traditional chi-square test that independently evaluates the relationship between each feature and the target variable, but it does not consider the possible interaction between features. It can find that the relationship between a single feature and the target variable may not be obvious, but multiple features may have strong predictive power when they work together.
[0054] S203: Combining logarithmic transformation and product operation, calculating the significance value of each type of individual information according to the chi-square statistic and the mutual information value, and retaining the individual information greater than the preset significance value as important individual information:
[0055]
[0056] in, Represents the significance value.
[0057] Specifically, based on the idea of combining two independent statistics, namely the results of the chi-square test and the conditional mutual information, through logarithmic transformation and product operation, the problem of numerical stability is dealt with to ensure that calculations can be performed even when the input value is zero. In addition, the product form emphasizes that the composite measure, namely the significance value U, is significant only when both measures are significant at the same time. This helps to identify features that are significant in multiple dimensions, thereby increasing the accuracy and reliability of feature analysis.
[0058] It should be noted that this method can avoid screening out features that have no effect on the target variable alone but have an effect on the target variable when combined with other features, so that the features screened out and retained are the features that can more accurately reflect the impact of the target variable, thereby providing an accurate training set for subsequent model learning, enhancing the training effect of subsequent models and the accuracy of nutritional needs assessment.
[0059] It should be noted that those skilled in the art can set the size of the preset significance value according to actual needs, and the present invention is not limited here. Specifically, the proportion of the extracted significance value in the total significance value can be determined by dividing the ratio, for example, if the proportion of the non-significant value is 1%, or more, then the proportion of the significance value is smaller, and then the number of extracted features is adjusted.
[0060] S3: Update the feature vector based on the important individual information to obtain an updated sample set.
[0061] Wherein, updating the sample set includes updating the feature vector and the corresponding label.
[0062] The feature vector is obtained by combining the information of each important individual. Specifically, the features retained after screening are first integrated into the feature vector V of the target user: V={v1, v2, v3, v4, v5, …v n}, where n is the number of feature types reserved, v1, v2, v3, v4, v5, ... v n Corresponding feature numbers Then the eigenvector V is preprocessed to generate dimensionless factors , the calculation method is:
[0063]
[0064] in, Represents the factor corresponding to the i-th feature, represents the i-th feature, represents the preset minimum value of the feature, Represents the preset maximum value of the feature.
[0065] It should be noted that integrating and standardizing the selected important features helps reduce the sensitivity of the model to different dimensions of features during training and prediction. By converting the feature values into factors without physical dimensions, this method improves the consistency and comparability of the data, allowing the machine learning algorithm to process the data more effectively, reducing the deviation caused by the scale difference between features, and thus optimizing the performance and accuracy of the model. This normalization process also helps to accelerate the convergence of the learning algorithm and improve the operating efficiency of the algorithm.
[0066] S4: Calculate the approximate curvature value of the sample point and select the baseline model according to the approximate curvature value.
[0067] Among them, the sample point is a data pair consisting of an updated feature vector and a label corresponding to the updated feature vector.
[0068] It should be noted that by calculating the approximate curvature values of sample points and screening baseline models based on these values, an automated method is implemented to match the intrinsic geometric characteristics of the data with the structure of the model, which can ensure that the selected model is highly consistent with the actual change characteristics of the data, thereby enhancing the explanatory power and prediction accuracy of the model. By analyzing the curvature, we can more accurately capture the nonlinear trends and complex patterns in the data, and further improve the model's adaptability and responsiveness to complex data behaviors. In addition, using curvature as a screening criterion also helps reduce the subjectivity in the model selection process, making model selection more objective and data-driven.
[0069] In a possible implementation, S4 specifically includes:
[0070] S401: Fitting the sample points by using a cubic spline with a smoothing parameter to obtain a fitting curve.
[0071] In a possible implementation, S401 specifically includes:
[0072] S4011: Introduce smoothing parameters and define the fitting curve objective function that minimizes the weighted sum of the residual squares and the smoothing terms:
[0073]
[0074] in, represents the eigenvalue of the i-th sample point of the fitting curve g(x), , n represents the total number of sample points, express The corresponding i-th label value, min means taking the minimum value, represents the smoothing parameter, Represents the second derivative of the fitted curve based on the eigenvalue x.
[0075] S4012: Establish a matrix form to solve the equation based on the objective function:
[0076]
[0077] in, represents the jth basis function about the eigenvalue x, , m represents the total number of basis functions, represents the coefficient of the jth basis function, B represents the basis function evaluation matrix, represents the penalty matrix, c represents the coefficient vector, Represents a vector of label values.
[0078] S4013: Solve the equation in matrix form to find the coefficient vector and obtain the fitting curve.
[0079] It should be noted that a smoothing parameter is introduced and an objective function is defined, which aims to minimize the weighted sum of the residual sum of squares and the smoothing term. This method effectively balances the fitting accuracy and the smoothness of the curve. By converting the fitting problem into a matrix form, the step further simplifies the solution process, so that the coefficients of the curve can be efficiently calculated using a modern numerical linear algebra library. This method not only improves the computational efficiency, but also controls overfitting by adjusting the smoothing parameter, thereby finding a good balance between the accurate representation of complex data and preventing the model from being overly sensitive to noise. Ultimately, the fitting curve can more realistically reflect the underlying trend of the data, providing a model building process that is both accurate and robust.
[0080] S402: Calculate the approximate curvature value of the fitting curve:
[0081]
[0082] in, Indicates that the fitting curve g(x) is at the i-th sample point The approximate curvature value at and represent the first-order derivative and the second-order derivative of the fitting curve, respectively. Indicates taking the absolute value.
[0083] S403: Calculate the degree of coincidence between the curvature of each function in the function database and the approximate curvature value, wherein the function database includes linear functions, nonlinear functions and polynomial functions:
[0084]
[0085] in, Indicates that the u-th function in the function library is at the i-th data point That is, the curvature value of the i-th sample point, , n represents the total number of sample points, M represents the mean square error between the approximate curvature value and the curvature values of each function in the function database, and S represents the degree of overlap.
[0086] S404: Select the function with the highest overlap as the baseline model.
[0087] Specifically, by calculating the approximate curvature values of these fitting curves, this step further extracts the geometric characteristics of the data and converts this subtle nonlinear change into a quantifiable measure. Subsequently, the system evaluates which function best matches the behavior of the actual data by comparing these curvature values with the curvature of functions in a predefined function library (including linear, nonlinear, and polynomial functions). By calculating the mean square error between the curvature values, the best matching model is determined, and the model with the highest overlap is selected as the baseline model. This data-driven approach not only enhances the objectivity of model selection, but also improves the model's adaptability to data characteristics and the accuracy of prediction, so that the final model can provide more reliable and effective nutritional recommendations in practical applications.
[0088] S5: Based on the updated sample set, a nutritional needs assessment model based on the baseline model is established in combination with the Bayesian algorithm.
[0089] It should be noted that the nutritional needs assessment model based on the baseline model combined with the Bayesian algorithm provides a significant advantage, namely, the ability to integrate prior knowledge with information learned from the data in the form of probability. The Bayesian method allows the model to dynamically update its estimates after taking into account previous experience and new evidence, which improves the flexibility and adaptability of the model and can provide a quantitative assessment of prediction uncertainty, making nutritional needs assessment more accurate and reliable. Through the Bayesian algorithm, the model can effectively handle the complexity and variability of various data, gradually approach the optimal parameter configuration, and significantly improve the accuracy of predictions and the effect of practical applications.
[0090] In a possible implementation, S5 specifically includes:
[0091] S501: Establish an objective function regarding the baseline model prediction error, wherein the independent variable of the objective function is the baseline model coefficient, and the dependent variable of the objective function is the baseline model prediction error.
[0092] S502: Determine the prior distribution of the independent variable of the objective function.
[0093] S503: Input the updated sample set into the objective function, and generate the posterior distribution of the independent variable based on the prior distribution of the independent variable:
[0094]
[0095] in, represents the independent variable, represents the posterior distribution of the independent variable under the observed data set D, Indicates that the independent variable The probability of the target function value y under known conditions is the likelihood function of the Bayesian algorithm. , represents the prior distribution of the independent variable, Indicates that when the independent variable is The objective function value at , i represents the number of samples.
[0096] Among them, the formula for the posterior distribution of the independent variable describes how to combine the observed data with prior knowledge through the likelihood function to update our understanding of the parameter θ. It integrates data evidence into the prior distribution through the likelihood function to obtain the posterior distribution.
[0097] S504: Based on the posterior distribution of the independent variable, the objective function is reconstructed through a Gaussian process:
[0098]
[0099] in, represents the objective function, represents the mean function of the objective function value when the independent variable is θ, Represents any two independent variables and Kernel function, where the kernel function describes the independent variable and The covariance of the objective function value under represents a Gaussian process.
[0100] Specifically, through the posterior distribution, new input points, i.e., independent variables, can be predicted. This prediction includes not only a point prediction (i.e., an estimate of the function value), but also the uncertainty of the prediction (for example, expressed through a confidence interval. The predicted mean and variance are given by the mean and covariance of the posterior distribution. As new data are continuously added, the posterior distribution of the Gaussian process will gradually approach the true target function. This process can be regarded as "reconstructing" the target function, that is, gradually building a function model that accurately reflects the underlying pattern in the data. In this process, the Gaussian process can adapt to various complex relationships very flexibly without explicitly assuming the specific form of the target function.
[0101] S505: Update the independent variable, i.e., update the baseline model coefficient, by using the candidate point whose expected improvement is greater than the preset expected improvement:
[0102]
[0103] in, represents the expectation operator, Indicates candidate points The objective function value of For the evaluated set of independent variables The current minimum objective function value, max means taking the maximum value, Indicates candidate points The amount of improvement.
[0104] It should be noted that those skilled in the art can set the size of the preset expected improvement amount according to actual needs, and the present invention is not limited thereto.
[0105] S506: Substitute the updated baseline model coefficients into the objective function, and update the objective function and the observation data set.
[0106] S507: Return to step S503, and increase the number of iterations by 1 until the number of iterations is greater than the preset number of iterations.
[0107] S508: Select the optimal independent variable that minimizes the objective function to determine the baseline model coefficients and obtain the baseline model.
[0108] Specifically, first, an objective function is established to quantify the prediction error of the baseline model and set the prior distribution for the model parameters. Then, the probability distribution of the parameters is updated using data by inputting the updated sample set into the objective function and combining the prior distribution to generate the posterior distribution of the parameters. Thereafter, the objective function is reconstructed using a Gaussian process, which not only provides a point estimate of the parameters but also evaluates the uncertainty of the prediction. Subsequently, the model parameters are iteratively updated by optimization calculations until the preset number of iterations is met, and the optimal model parameters are finally determined. This series of steps allows the model to continuously approach the true distribution of the data in each iteration and optimize the prediction performance. In this process, the model is allowed to continuously integrate new data information during the learning process, so that the model prediction is not only based on historical data, but also can dynamically adapt to new data changes. Secondly, through the application of Gaussian processes, the model can not only provide prediction values, but also give prediction uncertainties. In addition, the iterative optimization process provided by this method enables the model to minimize prediction errors at each step and improve the overall prediction accuracy and reliability. Finally, this method does not rely on assumptions about the specific form of the objective function, which enables it to flexibly cope with various complex model forms and greatly expands its scope of application.
[0109] S6: Obtain information of the individual to be evaluated, input the information of the individual to be evaluated into a nutritional requirement evaluation model, and output a nutritional requirement evaluation value.
[0110] S7: Construct an improved decision tree model with individual preference influencing factors.
[0111] Among them, the top layer of the improved decision tree model is a preference screening layer established based on individual preference influencing factors.
[0112] It should be noted that by introducing a screening layer based on individual preferences at the top level of the decision tree model, the model can first consider the specific preferences and needs of individuals when analyzing nutritional needs and dietary recommendations. This method significantly improves the personalization level of the model, making the dietary recommendations provided more in line with the actual situation and preferences of individuals, thereby increasing user acceptance and satisfaction, and effectively improving the actual effect and continuous compliance rate of intervention measures. In addition, the application of the preference screening layer helps to optimize the decision path, reduce unnecessary calculations, and improve the efficiency and accuracy of the decision tree.
[0113] In a possible implementation, S7 specifically includes:
[0114] S701: Obtain the nutritional content of various foods and build a dietary database.
[0115] S702: Obtain the dietary preferences of the individual to be evaluated.
[0116] S703: Convert the dietary preferences of the individual to be evaluated into feature weights of the corresponding foods to generate a preference screening layer.
[0117] S704: Placing the preference screening layer at the top level of the decision tree model, and taking the nutritional content of each type of food as a leaf node, to obtain an improved decision tree model.
[0118] Specifically, first, by building a detailed database containing the nutritional content of various foods, the comprehensiveness and scientificity of nutritional recommendations are ensured. Then, by obtaining and converting individual dietary preferences into characteristic weights of specific foods, this step significantly enhances the personalization ability of the model, enabling the model to prioritize according to individual preferences. Using these preferences as the top-level screening layer of the decision tree model directly affects the decision path, ensuring that the final dietary plan not only meets nutritional needs but also meets individual preferences. This approach effectively combines nutrition science and consumer behavior, improves the acceptance and compliance rate of dietary plans, and enhances the actual effect of personalized nutritional interventions.
[0119] S8: Input the nutritional requirement assessment value into the improved decision tree model, output the dietary matching plan, and use the dietary matching plan to intervene in the corresponding individuals to be assessed.
[0120] In a possible implementation, it further includes:
[0121] The accuracy of the nutritional requirement assessment value is collected at preset time intervals, and when the accuracy is lower than the preset accuracy, the nutritional requirement assessment model is updated.
[0122] It should be noted that by regularly monitoring the accuracy of the model and comparing it with the preset standards, problems with deteriorating model performance can be identified in a timely manner. If the accuracy is lower than the preset level, the model update process will be triggered, which ensures that the model can always reflect the latest data and trends, thereby maintaining its predictive efficiency and accuracy. This dynamic update strategy improves the reliability and effectiveness of the model in practical applications, making nutritional intervention more precise and personalized. In addition, it helps to adapt to the nutritional needs of individuals that change over time, ensuring the most appropriate nutritional advice in the long term.
[0123] It should be noted that those skilled in the art can set the preset time length and the preset accuracy rate according to actual needs, and the present invention is not limited thereto.
[0124] It should be noted that this program uses an improved chi-square test combined with conditional mutual information to accurately screen individual information that is significantly related to nutritional needs, thereby ensuring the high relevance and accuracy of the model. The baseline model is screened using the sample curvature value to enhance the consistency between the model and the data, ensuring that the selected model best fits the data characteristics. The Bayesian algorithm is combined to further optimize the model parameters, improve the accuracy and automation of the prediction, and ultimately provide a personalized and scientific nutritional diet plan by combining the improved decision tree model with individual preferences. It effectively combines data-driven accuracy with the satisfaction of user individual needs, significantly improving the acceptability and actual effect of the intervention. This method of comprehensive use of data analysis and machine learning technology not only improves the accuracy of nutritional assessment, but also optimizes the personalized service of meal planning, making it more practical and scientific.
[0125] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0126] In the present invention, based on the sample set, an improved chi-square test algorithm with conditional mutual information is used to evaluate the importance of each individual information and the individual information that only reflects the influencing effect when the individual information coexists, and the important individual information is accurately screened out, so as to avoid the introduction of individual information irrelevant to nutritional needs into the model establishment process, and avoid the screening of coexisting related individual information, thereby increasing the accuracy and reliability of model establishment. Then, based on the established updated sample set, the baseline model is automatically screened using the curvature value, and the screened baseline model has a high degree of overlap with the law of the sample point itself, and a nutritional demand assessment model is established on the basis of the baseline model using the Bayesian algorithm, and the likelihood function of the Bayesian algorithm can be used to gradually approximate the optimal parameter value of the model, with a high degree of automation, strong interpretability, and accurate nutritional demand prediction results. Finally, based on the nutritional demand assessment value predicted by the model, a dietary matching is performed using an improved decision tree model with individual preference influencing factors, and the preference screening layer is placed at the front top layer, so as to provide users with a personalized dietary plan that meets nutritional needs, and the intervention effect is more accurate and reliable, with a high degree of automation.
[0127] Reference Manual Attached Figure 2 , showing a structural schematic diagram of a user characteristic-based nutritional needs assessment and customized intervention system provided by the present invention.
[0128] The present invention further provides a user-characteristic-based nutritional needs assessment and customized intervention system 20, which is applied to the above-mentioned user-characteristic-based nutritional needs assessment and customized intervention method, including:
[0129] Processor 201.
[0130] The memory 202 stores computer-readable instructions. When the computer-readable instructions are executed by the processor 201, the nutritional needs assessment and customized intervention method based on user characteristics as in the method embodiment is implemented.
[0131] The user characteristics-based nutritional needs assessment and customized intervention system 20 provided in the present invention can execute the above-mentioned user characteristics-based nutritional needs assessment and customized intervention method, and achieve the same or similar technical effects. To avoid repetition, the present invention will not go into details.
[0132] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0133] In the present invention, based on the sample set, an improved chi-square test algorithm with conditional mutual information is used to evaluate the importance of each individual information and the individual information that only reflects the influencing effect when the individual information coexists, and the important individual information is accurately screened out, so as to avoid the introduction of individual information irrelevant to nutritional needs into the model establishment process, and avoid the screening of coexisting related individual information, thereby increasing the accuracy and reliability of model establishment. Then, based on the established updated sample set, the baseline model is automatically screened using the curvature value, and the screened baseline model has a high degree of overlap with the law of the sample point itself, and a nutritional demand assessment model is established on the basis of the baseline model using the Bayesian algorithm, and the likelihood function of the Bayesian algorithm can be used to gradually approximate the optimal parameter value of the model, with a high degree of automation, strong interpretability, and accurate nutritional demand prediction results. Finally, based on the nutritional demand assessment value predicted by the model, a dietary matching is performed using an improved decision tree model with individual preference influencing factors, and the preference screening layer is placed at the front top layer, so as to provide users with a personalized dietary plan that meets nutritional needs, and the intervention effect is more accurate and reliable, with a high degree of automation.
[0134] It should be understood that the processor in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0135] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).
[0136] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.
[0137] It should be understood that the term "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.
[0138] In the present invention, "at least one" means one or more, and "plurality" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0139] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0140] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0141] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0142] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0143] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0144] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0145] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.
[0146] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the method for nutritional needs assessment and customized intervention based on user characteristics as described in the method embodiment is implemented.
[0147] A computer-readable storage medium provided by the present invention can implement the steps and effects of the nutritional needs assessment based on user characteristics and customized intervention method of the above method embodiment. To avoid repetition, the present invention will not go into details.
[0148] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:
[0149] In the present invention, based on the sample set, an improved chi-square test algorithm with conditional mutual information is used to evaluate the importance of each individual information and the individual information that only reflects the influencing effect when the individual information coexists, and the important individual information is accurately screened out, so as to avoid the introduction of individual information irrelevant to nutritional needs into the model establishment process, and avoid the screening of coexisting related individual information, thereby increasing the accuracy and reliability of model establishment. Then, based on the established updated sample set, the baseline model is automatically screened using the curvature value, and the screened baseline model has a high degree of overlap with the law of the sample point itself, and a nutritional demand assessment model is established on the basis of the baseline model using the Bayesian algorithm, and the likelihood function of the Bayesian algorithm can be used to gradually approximate the optimal parameter value of the model, with a high degree of automation, strong interpretability, and accurate nutritional demand prediction results. Finally, based on the nutritional demand assessment value predicted by the model, a dietary matching is performed using an improved decision tree model with individual preference influencing factors, and the preference screening layer is placed at the front top layer, so as to provide users with a personalized dietary plan that meets nutritional needs, and the intervention effect is more accurate and reliable, with a high degree of automation.
[0150] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
[0151] There are a few points to note:
[0152] (1) The drawings of the embodiments of the present invention only relate to the structures related to the embodiments of the present invention. Other structures may refer to the general design.
[0153] (2) For the sake of clarity, in the drawings used to describe the embodiments of the present invention, the thickness of layers or regions is exaggerated or reduced, that is, these drawings are not drawn according to the actual scale. It is understood that when an element such as a layer, film, region or substrate is referred to as being "on" or "under" another element, the element may be "directly" "on" or "under" the other element or there may be intermediate elements.
[0154] (3) In the absence of conflict, the embodiments of the present invention and the features therein may be combined with each other to obtain new embodiments.
[0155] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. The protection scope of the present invention shall be based on the protection scope of the claims.
Claims
1. A method for nutritional needs assessment and customized intervention based on user characteristics, characterized in that: include: S1: Obtain individual information, and establish a sample set with the individual information as a feature vector and the nutritional requirement corresponding to the individual information as a label; S2: Screening the individual information based on an improved chi-square test algorithm combined with conditional mutual information, retaining important individual information whose significance value is greater than a preset significance value under the null hypothesis state; S3: updating the feature vector based on the important individual information to obtain an updated sample set, wherein the updated sample set includes an updated feature vector and a corresponding label; S4: Calculate the approximate curvature value of the sample point, and select the baseline model according to the approximate curvature value, wherein the sample point is a data pair consisting of the updated feature vector and the label corresponding to the updated feature vector; S5: establishing a nutritional demand assessment model based on the baseline model in combination with a Bayesian algorithm according to the updated sample set; S6: Acquire the information of the individual to be evaluated, input the information of the individual to be evaluated into the nutritional requirement evaluation model, and output the nutritional requirement evaluation value; S7: constructing an improved decision tree model with individual preference influencing factors, wherein the top layer of the improved decision tree model is a preference screening layer established based on the individual preference influencing factors; S8: Input the nutritional requirement assessment value into the improved decision tree model, output a dietary matching plan, and use the dietary matching plan to intervene in the corresponding individual to be assessed.
2. The method for nutritional needs assessment and customized intervention based on user characteristics according to claim 1, characterized in that: The individual information includes age, gender, weight, height, body mass index, genes, intestinal microorganisms, blood test index and health status, wherein the health status is a disease binary variable, wherein when the disease binary variable is 1, it indicates that the disease exists, otherwise it indicates that the disease does not exist; the nutritional requirements include energy requirements and various vitamin requirements.
3. The method for nutritional needs assessment and customized intervention based on user characteristics according to claim 1, characterized in that: The S2 specifically includes: S201: Calculate the correlation between each type of feature in the individual information and the target variable, i.e., the nutritional requirement: ; ; in, represents the observed frequency of the combination of the i-th feature and the j-th target variable, represents the expected frequency under the null hypothesis, that is, under the assumption that feature i is independent of target variable j. represents the chi-square statistic used to measure the difference between the observed frequency and the expected frequency, and They represent the total number of data points of the i-th feature and the j-th target variable in the sample set, respectively. s represents the total number of combinations of the i-th feature and the j-th target variable in the sample set, i.e., the total number of sample points. S202: Calculate the mutual information value of each pair of features under different target variables: ; in, Represents the conditional mutual information value between feature X and feature Y under the determination of target variable Z, represents the joint probability distribution of X, Y, and Z, that is, the probability of X taking the value x, Y taking the value y, and Z taking the value z, represents the joint conditional probability distribution of X, Y, and Z, that is, the probability that X and Y take the values of x and y respectively under the condition that Z takes the value of z. represents the marginal conditional probability distribution about X and Z, that is, the probability that X takes the value x under the condition that Z takes the value z, represents the marginal conditional probability distribution about Y and Z, that is, the probability that Y takes the value y under the condition that Z takes the value z, and log represents the logarithmic function; S203: Combining logarithmic transformation and product operation, calculating the significance value of each type of individual information according to the chi-square statistic and the mutual information value, and retaining individual information greater than the preset significance value as important individual information: ; in, Represents the significance value.
4. The method for nutritional needs assessment and customized intervention based on user characteristics according to claim 1, characterized in that: The S4 specifically includes: S401: fitting the sample points by using a cubic spline with a smoothing parameter to obtain a fitting curve; S402: Calculate the approximate curvature value of the fitting curve: ; in, Indicates that the fitting curve g(x) is at the i-th sample point The approximate curvature value at and represent the first-order derivative and the second-order derivative of the fitting curve, respectively. Indicates taking the absolute value; S403: Calculate the degree of coincidence between the curvature of each function in the function database and the approximate curvature value, wherein the function database includes linear functions, nonlinear functions and polynomial functions: ; in, Indicates that the u-th function in the function library is at the i-th data point That is, the curvature value of the i-th sample point, , n represents the total number of sample points, M represents the mean square error between the approximate curvature value and the curvature value of each function in the function database, and S represents the degree of coincidence; S404: Select the function with the highest overlap as the baseline model.
5. The method for nutritional needs assessment and customized intervention based on user characteristics according to claim 4, characterized in that: The S401 specifically includes: S4011: Introduce smoothing parameters and define the fitting curve objective function that minimizes the weighted sum of the residual squares and the smoothing terms: ; in, represents the eigenvalue of the i-th sample point of the fitting curve g(x), , n represents the total number of sample points, express The corresponding i-th label value, min means taking the minimum value, represents the smoothing parameter, represents the second-order derivative of the fitted curve based on the eigenvalue x; S4012: Establish a matrix form solution equation based on the objective function: ; in, represents the jth basis function about the eigenvalue x, , m represents the total number of basis functions, represents the coefficient of the jth basis function, B represents the basis function evaluation matrix, represents the penalty matrix, c represents the coefficient vector, represents a label value vector; S4013: Solve the coefficient vector according to the matrix form equation to obtain the fitting curve.
6. The method for nutritional needs assessment and customized intervention based on user characteristics according to claim 1, characterized in that: The S5 specifically includes: S501: Establishing an objective function regarding a baseline model prediction error, wherein the independent variable of the objective function is a baseline model coefficient, and the dependent variable of the objective function is the baseline model prediction error; S502: Determine a priori distribution of the independent variable of the objective function; S503: Input the updated sample set into the objective function, and generate the posterior distribution of the independent variable based on the prior distribution of the independent variable: ; in, represents the independent variable, represents the posterior distribution of the independent variable under the observed data set D, Indicates that the independent variable The probability of the target function value y under known conditions is the likelihood function of the Bayesian algorithm. , represents the prior distribution of the independent variable, Indicates that when the independent variable is The objective function value at time , i represents the number of samples; S504: Based on the posterior distribution of the independent variable, reconstruct the objective function through a Gaussian process: ; in, represents the objective function, represents the mean function of the objective function value when the independent variable is θ, Represents any two independent variables and Kernel function, where the kernel function describes the independent variable and The covariance of the objective function value under represents a Gaussian process; S505: updating the independent variable, that is, updating the baseline model coefficient, through the candidate point whose expected improvement amount is greater than the preset expected improvement amount: ; in, represents the expectation operator, Indicates candidate points The objective function value of For the evaluated set of independent variables The current minimum objective function value, max means taking the maximum value, Indicates candidate points The amount of improvement; S506: Substituting the updated baseline model coefficients into the objective function, and updating the objective function and the observation data set; S507: Return to step S503, and increase the number of iterations by 1 until the number of iterations is greater than the preset number of iterations; S508: Select the optimal independent variable that minimizes the objective function to determine the baseline model coefficients and obtain the baseline model.
7. The method for nutritional needs assessment and customized intervention based on user characteristics according to claim 1, characterized in that: The S7 specifically includes: S701: Obtain the nutritional content of various foods and build a dietary database; S702: Obtaining dietary preferences of the individual to be evaluated; S703: Convert the dietary preferences of the individual to be evaluated into feature weights of corresponding foods to generate the preference screening layer; S704: Placing the preference screening layer at the top layer of the decision tree model, and taking the nutritional content of each type of food as a leaf node, to obtain the improved decision tree model.
8. The method for nutritional needs assessment and customized intervention based on user characteristics according to claim 1, characterized in that: Also includes: The accuracy of the nutritional requirement assessment value is collected at preset time intervals, and when the accuracy is lower than a preset accuracy, the nutritional requirement assessment model is updated.
9. A nutritional needs assessment and customized intervention system based on user characteristics, characterized in that: include: processor; A memory having computer-readable instructions stored thereon, wherein when the computer-readable instructions are executed by the processor, the nutritional needs assessment and customized intervention method based on user characteristics as described in any one of claims 1 to 8 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, it implements the nutritional needs assessment and customized intervention method based on user characteristics as described in any one of claims 1 to 8.