Nutrition evaluation and prediction method and system based on big data
Through the nutritional evaluation and prediction method based on big data, using a variety of data-driven models and optimization algorithms, a personalized and dynamically optimized nutrition management solution was generated, which solved the problem that it was difficult to meet individual diversified nutritional needs in the existing technology, and realized the problem of Higher evaluation accuracy and personalization of the program.
Patent Information
- Application Number
- CN202411565637.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-05
- Publication Date
- 2025-02-11
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing nutrition management and evaluation methods are difficult to meet individuals' diverse and refined nutritional needs, lack of integration of individual multi-dimensional health data, data collection is incomplete and low quality, resulting in large errors in the evaluation results and the inability to effectively capture characteristics. complex associations and lack dynamic prediction mechanisms.
Using a nutritional assessment and prediction method based on big data, the user's multi-source data is collected, pre-processed, feature extraction and dimensionality reduction is performed, and the daily nutritional needs are evaluated using multivariable linear regression, Bayesian network and causal inference model. Predict future needs through long-term memory networks and Markov decision-making processes, and generate personalized nutritional plans in combination with linear programming and genetic algorithms.
A personalized and dynamically optimized nutrition management plan is realized, which can more accurately reflect the user's true health status, improve the scientificity and accuracy of nutrition assessment, meet the changes in users' long-term nutritional needs, and optimize the diet plan to meet the user's health. Goals and personal preferences.
Smart Images

Figure CN119418862A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of nutrition and health management, and in particular to a nutrition assessment and prediction method and system based on big data. Background Art
[0002] In modern society, with the improvement of people's living standards and the enhancement of health awareness, personalized nutrition management has become an important means to achieve comprehensive health. However, existing nutrition management and assessment methods have many defects and are difficult to meet the diverse and refined nutritional needs of individuals. Traditional nutrition assessments are mostly based on static data, usually by manually recording the user's diet, weight and other information, and then calculating with standardized nutrition formulas. These methods lack consideration of individual diversity and dynamic changes, and therefore it is difficult to provide targeted dietary recommendations.
[0003] Existing technologies mainly rely on data collection methods from a single source and lack the integration of multi-dimensional health data of users, which makes the evaluation results unable to fully reflect the true health status of users. In addition, the incompleteness and low quality of data collection lead to large errors in the analysis results, especially when there are missing values or outliers in the data. The existing methods lack effective data processing methods, which further reduces the scientificity and accuracy of nutritional assessment. For the characteristics of different individuals, traditional evaluation methods cannot effectively capture the complex associations between characteristics, especially when there are implicit dependencies between characteristics, simple statistical analysis is difficult to reveal these deep causal relationships.
[0004] In addition, most existing nutrition assessment tools are based on static user information and lack a dynamic prediction mechanism for users' future nutritional needs, which makes dietary recommendations lack foresight in practical applications and cannot be adjusted according to changes in users' long-term needs. At the same time, the generation of personalized plans usually adopts a rule-based or experience-based approach, without optimizing the user's individual data, resulting in the generated dietary plans being difficult to meet the user's health goals and personal preferences. Summary of the invention
[0005] In view of the shortcomings of the prior art, the present invention provides a nutrition assessment and prediction method and system based on big data. Based on the user's multi-source data, through evaluation and prediction models, a personalized and dynamically optimized nutrition management plan is generated to meet the user's ever-changing nutritional needs and health goals.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: a nutrition assessment and prediction method based on big data, comprising the following steps: Collect users' physiological data, dietary records, and activity data, and perform preprocessing; Perform feature extraction and dimension reduction on the preprocessed data to generate key feature data of the user; Based on the key characteristic data of users, a nutritional demand assessment model is used to assess the daily nutritional needs of users; Based on the assessed nutritional needs, a future demand prediction model is used to predict the nutritional needs of users in the future; Combine the daily nutritional needs assessment results with the nutritional needs forecast results for a period of time in the future to generate the optimal personalized nutrition plan.
[0007] Preferably, the data collection includes acquiring user data from multiple data sources, and the data sources include data collected by a smart wearable device, data recorded by a diet record application, and data manually entered by a user.
[0008] Preferably, the feature extraction and dimensionality reduction step uses principal component analysis to reduce the dimensionality of high-dimensional features to extract main features that are highly relevant to nutritional requirements.
[0009] Preferably, the step of evaluating the user's daily nutritional needs by using a nutritional needs evaluation model based on the user's key feature data comprises: A multivariate linear regression model is constructed based on the key characteristic data of the user, wherein the key characteristic data includes the user's age, gender, BMI, and activity level. The multivariate linear regression model is used to quantitatively estimate the nutritional needs of the user's physiological characteristics. The multivariate linear regression model is:
[0010] in, For the Nutritional needs of each user, is the intercept term, is the regression coefficient, For the User's eigenvalues, is the error term; Based on the quantitative estimation of the multivariate linear regression model, a Bayesian network model is constructed, which regards the key feature data of the user as the conditional probability input to capture the implicit dependency of each key feature on nutritional needs. The Bayesian network model models the joint probability distribution of the user's daily nutritional needs. The conditional probability formula of the Bayesian network model is:
[0011] in, represents the conditional probability of nutritional demand N under evidence E, is the likelihood function of evidence E under nutritional requirement N, P(N) is the prior probability of nutritional requirement N, and the Bayesian network model calculates the conditional probability of each key feature for nutritional requirement based on the joint probability distribution in the training data; The causal inference model is used to evaluate the impact of users' dietary behaviors on nutritional needs, and the double difference method is used to analyze the differences in nutritional needs of users under different dietary behaviors. The calculation formula of the double difference method is:
[0012] in, The causal effect of dietary behavior on nutritional needs, represents the nutritional requirement value of the treatment group at the tth time point, represents the nutritional requirement value of the control group at the tth time point, represents the nutritional requirement value of the treatment group at the t-1th time point, Represents the nutritional requirement value of the control group at the t-1th time point.
[0013] Preferably, the step of using a future demand prediction model to predict the user's nutritional needs for a period of time in the future based on the assessed nutritional needs includes: Collect users’ historical nutrition data, including their daily nutrition intake, weight, activity data, and health indicators, and construct a time series dataset as model input; Using a long short-term memory network model to perform time series modeling on the user's historical data, the long short-term memory network model includes an input gate, a forget gate, and an output gate to capture the long-term trend and short-term fluctuation of the user's nutritional needs; Based on the output results of the long short-term memory network model, the user's nutritional needs in the future, including the intake needs of macronutrients and micronutrients, are predicted, providing data support for the generation of future personalized nutrition plans.
[0014] Preferably, the step of predicting the user's nutritional needs for a period of time in the future based on the assessed nutritional needs using a future demand prediction model further includes: Use the Markov decision process to model the user's daily nutritional needs. Treat the user's dietary choices as the state transition process of the Markov decision process. With the goal of minimizing the user's nutritional gap, construct a state transition matrix. The state, action and reward function are defined in the Markov decision process model, where the state represents the user's current nutritional needs, the action represents the user's dietary choices, and the reward function is used to measure whether the diet selected by the user meets the nutritional needs; The following value iteration formula is used to solve the Markov decision process model and determine the optimal action strategy in each state:
[0015] in, Status The value function of For the status Next action Instant rewards, is the discount factor, Indicates that an action is being performed Back from state Transfer to state probability; Based on the solution results of the Markov decision process model, a forecast of the user's future nutritional needs is generated, including the prediction of the user's possible nutritional status and nutrient gap in a specific time period, providing input basis for generating the optimal nutritional plan.
[0016] Preferably, the step of combining the daily nutritional needs assessment results with the nutritional needs prediction results for a period of time in the future to generate the optimal personalized nutritional plan includes: Based on the daily nutritional needs assessment results and the nutritional needs forecast results for a period of time in the future, a linear programming model is established, wherein the linear programming model takes minimizing the nutritional gap as the optimization goal to ensure that the nutrients consumed by the user daily meet their physiological needs; Determine the objective function of the linear programming model, which is:
[0017] in, represents the total amount of nutritional gap, represents the weight of nutrient gap, Indicates the amount of food you eat; Constraints are set to ensure that daily nutritional requirements are met, the constraints being:
[0018] in, Indicates Nutrients in food The content of Indicates the user's preference for nutrients The minimum demand, The number of nutrients is to ensure that the intake of each nutrient is not less than the set value; The simplex method is used to solve the linear programming model to obtain the optimal personalized dietary plan, including the recommended intake of each food, ensuring daily calorie balance and balance of macro- and micronutrients.
[0019] Preferably, the step of generating an optimal personalized nutrition plan by combining the daily nutrition demand assessment results and the nutrition demand prediction results for a period of time in the future also includes: Combined with the results of linear programming, the personalized dietary plan is further optimized using genetic algorithms, which are used to solve multi-objective optimization problems to ensure that the plan meets the user's health goals and dietary preferences while meeting nutritional needs; Individually encode the dietary plan, encode the intake of each food into individuals in the genetic algorithm, and use the fitness function to measure the degree to which the individual meets the nutritional needs and health goals. The fitness function includes calorie intake, nutritional balance and user preferences. Genetic operations, including selection, crossover, and mutation, are performed to simulate the process of biological evolution, generate a new generation of individuals, and improve the fitness of the dietary plan through multiple generations of iterations. The optimization objective functions include: Minimize daily nutrient gaps; Maximize user's meal satisfaction; When the fitness function converges, the final optimal dietary plan is outputted, which includes the amount of each type of food that the user should consume, ensuring that the user's dietary preferences and overall satisfaction are optimized on the basis of meeting the user's personalized nutritional needs and health goals.
[0020] The present invention also provides a nutrition assessment and prediction system based on big data, comprising: Data collection module, used to collect the user's physiological data, diet records and activity data, and perform pre-processing; Feature extraction module, used to extract key features related to nutritional requirements from the data; Nutritional needs assessment module, used to assess the user's daily nutritional needs; Future nutritional demand prediction module, used to predict the changing trend of users' future nutritional demand; The optimal nutrition plan generation module is used to generate a nutrition plan that meets the user's personalized needs.
[0021] The present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the above method is implemented.
[0022] The present invention also provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the method described above is implemented.
[0023] The present invention provides a nutrition assessment and prediction method and system based on big data, which has the following beneficial effects: 1. The present invention uses multivariate linear regression and Bayesian network models to evaluate the nutritional needs of users, and introduces causal inference methods to analyze the impact of dietary behavior on nutritional needs, making the nutritional assessment both comprehensive and personalized. The Bayesian network further captures the implicit dependencies between features, and causal inference provides verification support for the scientific nature of behavioral changes, thereby generating evaluation results that are more in line with the actual situation of users.
[0024] 2. The present invention uses a long short-term memory network to perform time series prediction on the user's nutritional needs, which can effectively capture the user's long-term trends and short-term changes, thereby making the prediction of future needs more accurate and forward-looking. The Markov decision process is used to dynamically optimize the user's daily nutritional needs, so that the system's prediction is not limited to static evaluation, but can also provide support for dynamic personalized nutrition plans.
[0025] 3. The present invention combines linear programming and genetic algorithms to achieve multi-objective optimization of users' nutritional needs and dietary preferences. Linear programming ensures that users' daily nutritional intake meets their needs as much as possible, while genetic algorithms further optimize dietary plans on this basis to make them consistent with users' personal preferences and health goals, thereby improving user acceptance and practical application effects.
[0026] 4. The present invention provides users with dynamic nutrition management through data-driven nutrition demand assessment and prediction, as well as personalized program generation. The program is not only based on the current health status, but also takes into account future demand changes, so as to better adapt to the user's lifestyle and goals, making nutrition management more flexible and effective, thereby improving the user's overall health level and quality of life. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 It is a schematic diagram of the method flow of the present invention; Figure 2 It is a schematic diagram of the system architecture of the present invention; Figure 3 It is a schematic diagram of the system structure of the present invention; Figure 4 It is a schematic diagram of the computer device structure of the present invention.
[0028] Among them, 100, data acquisition module; 200, feature extraction module; 300, nutritional demand assessment module; 400, future nutritional demand prediction module; 500, optimal nutritional plan generation module; 40, computer equipment; 41, processor; 42, memory; 43, storage medium. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the specification of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0030] Please refer to the attached Figure 1 -Attached Figure 2 The embodiment of the present invention provides a nutrition assessment and prediction method based on big data, comprising the following steps: S1. Collect the user's physiological data, diet records and activity data, and perform preprocessing The goal of this step is to collect multi-source data from users, including physiological data, dietary records, and activity data, and perform necessary preprocessing to form a structured and standardized data set. Through comprehensive data collection and processing, the quality of input data is ensured, thus providing a data basis for subsequent feature extraction and predictive analysis.
[0031] In this embodiment, the data collection process includes collecting the user's physiological data, dietary records, and activity data from multiple data sources in order to fully describe the user's health status and dietary habits. Specifically: 1. Physiological data collection: The user's physiological data mainly includes weight, height, age, gender, blood sugar, blood pressure and other indicators. This type of data can be collected in the following ways: Smart wearable devices: Use wearable devices (such as smart bracelets, blood glucose monitors, etc.) to obtain users’ physiological data in real time. Smart devices can automatically and continuously collect data to ensure the real-time and continuity of data.
[0032] Manual entry: Users can manually enter some physiological data, especially data that cannot be collected by smart devices, such as blood pressure readings and body fat percentage at a specific time.
[0033] 2. Diet record collection: Users’ daily diet records are an important part of nutritional assessment. Specific data include food types, intake, calories and nutrients.
[0034] Manual Input and App Recording: Users can manually input their daily food intake through the mobile app. The app has an embedded food database, including the nutritional content and caloric information of the food, from which users can select specific foods and enter the corresponding intake.
[0035] Image recognition technology: In order to reduce the burden of manual input, this embodiment also uses image recognition technology. By taking pictures of food, the food is identified using computer vision algorithms, and the nutrients and calories are automatically calculated to form a diet record.
[0036] 3. Activity data collection: The user's activity level has an important impact on their daily nutritional needs, so the user's activity data is collected, including daily steps, exercise types, exercise time and exercise intensity.
[0037] Wearable devices: Use smart bracelets, sports watches and other devices to collect users' exercise data. These devices can track users' exercise types (such as walking, running), exercise time, heart rate and other information to help assess users' daily energy consumption.
[0038] In this embodiment, after data collection is completed, necessary data preprocessing is performed to ensure the quality and consistency of the data. The specific steps of preprocessing are as follows: 1. Missing value filling: Due to various reasons, the collected data may contain missing values. This embodiment uses Multiple Imputation by Chained Equations (MICE) to handle missing values. The MICE method uses multiple iterations of interpolation, each time using different conditional distributions to generate replacement values for missing values, and uses the results of the previous round in chain iterations to update the next round of interpolation, so as to finally obtain a more reasonable and complete data set. The MICE method ensures data integrity, so that the data can be fully utilized in the subsequent modeling process without causing model instability due to missing values.
[0039] 2. Outlier detection and processing: There may be extreme data points in the collected data. These data points may be caused by equipment failure, user misoperation or special circumstances, which may have an adverse effect on model training. This embodiment uses Mahalanobis distance to detect and process outliers. Mahalanobis distance determines whether the sample point is abnormal by measuring the distance between the sample point and the sample mean. The calculation formula is:
[0040] in, Represents sample points To the mean The Mahalanobis distance, is the covariance matrix. By setting the distance threshold, abnormal data points can be effectively identified and removed.
[0041] 3. Data standardization: In order to compare and calculate data from different sources under the same standard, this embodiment standardizes all feature data. The purpose of standardization is to convert data of different dimensions into a normal distribution with a mean of 0 and a standard deviation of 1, using the standardization formula:
[0042] in, is the standardized data, is the original data, is the mean of the data, is the standard deviation of the data. Through standardization, the data values of different features are kept in the same range, avoiding the impact of the magnitude difference between features on model training.
[0043] The data collection and preprocessing steps in this embodiment form the basis for subsequent modeling. Through comprehensive data collection, scientific missing value filling, outlier detection and standardization processing, the integrity, accuracy and consistency of the data are guaranteed. This provides reliable data support for feature extraction, nutritional demand assessment, future demand prediction and the generation of optimal dietary plans.
[0044] S2. Perform feature extraction and dimension reduction on the preprocessed data to generate key feature data of the user The purpose of this step is to extract key features that are highly relevant to nutritional needs from high-dimensional, multi-source data sets to reduce data dimensions, remove redundant information, and improve the computational efficiency and prediction accuracy of subsequent models. Through this step, the training quality of the model can be effectively improved, making it better adapted to personalized nutritional assessment and prediction needs.
[0045] In this embodiment, the goal of feature extraction is to select features that are highly relevant to nutritional requirements from the preprocessed data set and simplify the data structure through dimensionality reduction technology, thereby improving the computational efficiency and accuracy of the model. The specific technical steps include feature extraction and feature dimensionality reduction.
[0046] 1. Feature extraction In this embodiment, the feature extraction step first extracts features that have a greater impact on the nutritional needs assessment from the preprocessed data set. These features include but are not limited to the user's age, gender, weight, height, BMI (body mass index), daily activity level, dietary habits, etc.
[0047] Basis for feature selection: This embodiment determines a set of features related to nutritional needs based on relevant research in the field of nutrition and statistical analysis. The selection of these features takes into account a variety of factors, such as: Age and gender: These two characteristics directly affect an individual's metabolic rate and nutritional needs. For example, increasing age is often accompanied by changes in basal metabolic rate, while gender determines the physiological characteristics of the body.
[0048] BMI and weight: Weight and BMI are key variables in determining daily energy expenditure and nutritional needs. Different BMI values correspond to different nutritional recommendations, especially in terms of calorie and fat intake.
[0049] Activity level: The user's daily activity level (such as walking time, exercise intensity, etc.) has a direct impact on nutritional needs. The greater the activity, the greater the demand for energy and protein.
[0050] This embodiment reduces redundant information through feature selection, so that the model only uses valid information for nutritional needs assessment in subsequent training, avoiding interference from irrelevant data.
[0051] 2. Feature Dimensionality Reduction In this embodiment, in order to further improve the data processing efficiency, the extracted feature data is subjected to dimensionality reduction processing. The purpose of dimensionality reduction is to reduce the complexity of the data while retaining important information of the data, thereby speeding up the calculation speed and improving the stability of the model.
[0052] Principal Component Analysis (PCA): This embodiment uses the principal component analysis method to reduce the dimension of feature data. PCA projects high-dimensional features into a new low-dimensional space through linear transformation, so that as much of the original data variance as possible is retained in a few new features (principal components).
[0053] The steps include: 1. Covariance matrix calculation: Calculate the covariance matrix of the standardized features to describe the correlation between the features. The covariance matrix is defined as:
[0054] in, is the covariance matrix, For the data samples.
[0055] 2. Eigenvalue decomposition: covariance matrix Perform eigenvalue decomposition to obtain eigenvalues and corresponding eigenvectors. The eigenvalues represent the variance in the direction of the principal component, while the eigenvectors represent the corresponding principal component directions.
[0056] 3. Select the principal component: Sort the eigenvectors by eigenvalue from large to small, and select the first The eigenvectors are used as the benchmark after dimensionality reduction to generate the dimensionality reduction matrix .
[0057] 4. Dimensionality reduction calculation: The original feature matrix Projected into the new feature space, the reduced-dimensional data is represented as:
[0058] in, is the original feature matrix, is the dimension reduction matrix containing the principal components, is the feature matrix after dimensionality reduction.
[0059] Feature selection after dimensionality reduction: The principal components selected by PCA have high information content and can effectively represent the health and nutritional status of users. These principal components are used as input in subsequent nutritional needs assessment, reducing the impact of data dimensions on the model and ensuring a balance between computational efficiency and accuracy of the nutritional needs model.
[0060] In this embodiment, the PCA dimensionality reduction method is used to remove data redundancy while retaining the effective information of the data to the maximum extent, thereby improving the processing efficiency and stability of subsequent evaluation and prediction models.
[0061] In this embodiment, the feature extraction and dimensionality reduction steps provide high-quality data input for subsequent nutritional assessment and demand forecasting. Through feature selection and dimensionality reduction, the noise and redundant information that may be brought by high-dimensional data are avoided, ensuring the training efficiency and prediction performance of the model. Feature extraction extracts the main factors related to nutritional needs, and PCA dimensionality reduction reduces the computational complexity while retaining the amount of information, making the model lighter and more efficient.
[0062] S3. Based on the key characteristic data of users, a nutritional demand assessment model is used to assess the daily nutritional needs of users. The goal of this step is to accurately quantify the nutritional needs of users based on their key characteristics. The establishment of a nutritional needs assessment model provides a scientific basis for personalized nutritional management and is the basis for subsequent future demand forecasting and personalized program generation. In this step, this embodiment uses a variety of data-driven models, including multivariate linear regression, Bayesian networks, and causal inference methods, combined with a variety of characteristic variables to assess nutritional needs.
[0063] In this embodiment, the nutritional needs assessment model is based on the user's key feature data and uses multivariate linear regression, Bayesian network and causal inference technology to quantitatively analyze the user's daily nutritional needs to comprehensively assess the user's nutritional status.
[0064] 1. Multivariate Linear Regression Model In this embodiment, a multivariate linear regression model is first used to quantitatively estimate the nutritional needs of the user. Multivariate regression is a statistical method that predicts and evaluates a target variable by combining multiple input features. In the present invention, multivariate regression is used to estimate the daily macronutrient (such as protein, fat, carbohydrate, etc.) needs of the user.
[0065] Construction of regression model: In the regression model, the user's age, gender, weight, BMI, activity level, etc. are used as input variables, and nutritional needs are used as output variables. Using these features, a linear regression model is used to calculate the user's nutritional needs. For example, users with high activity levels will be evaluated as needing more protein.
[0066] The mathematical expression of the multivariate regression model is:
[0067] in: : No. Nutritional needs of each user.
[0068] : The intercept term in the regression model.
[0069] : No. The regression coefficient of a feature.
[0070] : No. User's feature values.
[0071] : Error term, usually assumed to obey normal distribution, that is .
[0072] In this formula, the system will substitute the user's characteristics (such as weight and activity level) and then calculate a result based on the model. , indicating the amount of nutrition required by the user.
[0073] This embodiment uses the least squares method (OLS, Ordinary Least Squares) to determine the regression coefficient , that is, minimizing the residual sum of squares, so that the model has a good fitting effect on the historical data, thus being able to make a preliminary assessment of the user's nutritional needs quantitatively.
[0074] 2. Bayesian Network Model In this embodiment, based on the results of the multivariate regression model, a Bayesian network model is further used to perform a refined assessment of nutritional needs. A Bayesian network is a probabilistic graphical model used to describe the causal relationship between variables. By modeling the dependency relationship between features, it is possible to more finely describe the influencing factors of the user's nutritional needs.
[0075] Bayesian network structure construction: Bayesian network consists of nodes and directed edges, where nodes represent user feature variables (such as age, weight, activity level, etc.), and directed edges represent the dependencies between these features. For example, the relationship between weight and activity level will affect the user's calorie needs.
[0076] Conditional probability calculation: Bayesian networks quantify the relationship between variables through conditional probability. The user's daily nutritional needs are taken as a random variable, and its conditional probability is calculated using the following Bayesian formula:
[0077] in: : The conditional probability of nutritional demand N under evidence E (user feature value).
[0078] : The likelihood function of evidence E given a nutritional requirement N.
[0079] : Prior probability of nutritional requirement N.
[0080] Here, the system calculates the probability of nutritional needs under different combinations of characteristics. For example, when a young man exercises more, his protein needs may be higher.
[0081] This embodiment performs parameter learning and structure learning on the Bayesian network and utilizes the correlation and causal relationship in the historical data set to obtain the user's personalized nutritional needs assessment results, especially to quantify the impact between features with implicit dependencies.
[0082] 3. Causal Inference Model In this embodiment, in order to evaluate the actual impact of specific dietary behaviors on the nutritional needs of users, causal inference methods are used to perform causal effect analysis. Causal inference aims to determine the causal impact of changes in specific variables (such as dietary behaviors) on target results (such as nutritional needs), thereby providing a scientific basis for personalized nutritional recommendations. This step analyzes how changes in users' eating habits affect their health. It is like making a before-and-after comparison to see what kind of nutritional impact certain changes in dietary behaviors will bring.
[0083] First, users were divided into two groups: one who made a specific dietary change (such as increasing their vegetable intake) and one who did not.
[0084] Difference in Differences (DID): The difference in differences (DID) method is used in causal inference to analyze the differences in nutritional needs of users under different behavioral states to eliminate the interference effects of time factors and samples. The difference in differences method is used to analyze the impact of changes in dietary behavior, and to make a before-and-after comparison to see how the nutritional needs of users have changed after the introduction of a new diet. The formula is:
[0085] in: : Causal effects of dietary behavior on nutritional requirements.
[0086] , : Nutritional requirement values of the treatment group and the control group at the tth time point.
[0087] , : Nutritional requirement values of the treatment group and the control group at the t-1th time point.
[0088] This embodiment can quantitatively evaluate the impact of changes in user eating behavior on nutritional needs through the double difference method, clarify the causal relationship between individualized eating habits and nutritional needs, and thus provide a scientific basis for generating a dietary plan that better meets the actual needs of users.
[0089] In general, the process of this step is as follows: 1) Collect user characteristic data: First, collect basic information about the user, such as age, gender, weight, and activity level.
[0090] 2) Multivariate linear regression to assess nutritional needs: Use a multivariate linear regression model to estimate the user's approximate nutritional needs based on these characteristics, such as daily protein, fat, carbohydrates, etc.
[0091] 3) Bayesian network evaluation of feature relationships: In order to make the evaluation more accurate, the Bayesian network is used to further analyze the relationship between these features to obtain more detailed nutritional needs assessment results.
[0092] 4) Causal inference analysis of dietary impacts: Finally, causal inference is used to study how changes in users’ dietary behavior affect nutritional needs, thereby providing a basis for generating personalized dietary recommendations.
[0093] The nutritional needs assessment model combines multiple analytical methods to quantify in detail the nutrients that users need every day. This is not just a simple estimate, it also takes into account the interactions between the user's various characteristics and behaviors, as well as the impact of specific changes in eating habits on health. Through these methods, the system can accurately calculate the various nutrients required for users every day, providing a scientific and personalized basis for subsequent predictions and the formulation of nutritional plans.
[0094] S4. Based on the assessed nutritional needs, use the future demand prediction model to predict the user's nutritional needs for a period of time in the future The goal of this step is to predict the trend of nutritional needs in the future based on the current nutritional needs obtained through evaluation and combined with the user's historical behavior data. This step provides forward-looking data support for personalized dietary planning, making the formulation of the plan closer to the actual needs of users. This embodiment uses long short-term memory network (LSTM) and Markov decision process (MDP) to achieve dynamic prediction and optimization of future needs.
[0095] In this embodiment, the future nutritional demand prediction model includes two main parts: a long short-term memory network (LSTM) and a Markov decision process (MDP), which are used to process the time series prediction of user nutritional demand and nutritional decision optimization respectively, and the specific implementation is as follows.
[0096] 1. Long Short-Term Memory (LSTM) Model In this embodiment, long short-term memory (LSTM) network is first used to perform time series prediction of the user's nutritional needs. LSTM is a deep learning model suitable for processing time series data, which can capture the long-term trend and short-term fluctuation of the user's nutritional needs. Its design features are suitable for processing the continuous changes of the user's dietary and health data, thereby providing a scientific basis for future dietary planning.
[0097] Collect users' historical nutritional intake data, including daily intake of calories, protein, fat, carbohydrates and other micronutrients. These data are organized into time series in chronological order as input for the model.
[0098] LSTM structure design: The long short-term memory network consists of an input gate, a forget gate, and an output gate. Each gate controls different information flows to capture long-term dependencies and short-term changes in nutritional needs: Input gate: determines the impact of current input information on future states.
[0099] Forget gate: determines the extent to which past information is forgotten.
[0100] Output gate: controls how to output information about the current cell state.
[0101] LSTM model formula:
[0102]
[0103]
[0104]
[0105]
[0106]
[0107] in, , , are the outputs of the forget gate, input gate, and output gate respectively. is the current unit status, is the hidden state, and are sigmoid and tanh activation functions respectively, and are weight and bias respectively.
[0108] Prediction result output: The LSTM model is used to predict the user's nutritional needs in the future, including the changing trends in the demand for macronutrients and micronutrients.
[0109] The LSTM model predicts the amount of nutrients that users may need in the future by learning from their past dietary and health data. This way, users can know in advance how much protein, carbohydrates and other nutrients they need to consume in the next few days or weeks.
[0110] 2. Markov Decision Process (MDP) Model In this embodiment, in order to make better dietary choices for users while predicting future needs, a Markov decision process (MDP) model is introduced. MDP is suitable for dealing with multi-stage decision optimization problems, which means that the user's daily nutritional choices can be modeled as a series of state transition processes. In this way, users can be provided with daily dietary recommendations to achieve long-term health goals.
[0111] Definition of states, actions and rewards: State: Each state represents the user’s current nutritional status, including current nutritional intake, health indicators, etc.
[0112] Action: An action represents the user's dietary choice in that state, such as choosing to eat a certain food.
[0113] Reward: The reward function is used to measure whether a dietary choice meets the user's nutritional needs. The higher the reward value, the more beneficial the choice is to the user's health.
[0114] State transfer and optimization: MDP model through state transfer function To describe the state transition process after the user makes a meal choice, the specific formula is as follows:
[0115] in: :state The value function represents the health value of the user in this state.
[0116] : In state Next action Instant rewards.
[0117] : Discount factor, measuring the importance of future rewards.
[0118] : When performing an action Back from state Transfer to state probability.
[0119] Solving and decision-making: Use dynamic programming or reinforcement learning methods to solve the MDP and obtain the optimal dietary selection strategy under each state. The system continuously adjusts dietary recommendations based on the user's current state to achieve the minimum gap in the user's nutritional needs.
[0120] The MDP model can give the best dietary recommendations based on the user's daily nutritional intake, and will be adjusted every day to ensure that the user can make the best nutritional choices at every stage in the future.
[0121] In general, the process of this step is as follows: 1) Collect user historical nutrition data: First, collect users’ historical nutrition intake information to form continuous time series data.
[0122] 2) LSTM for time series prediction: Use the LSTM model to learn the user's past nutritional data, predict future nutritional demand trends, and derive the demand curve for the next few days or weeks.
[0123] 3) MDP optimizes dietary choices: Based on the prediction results of LSTM, the MDP model is used to generate daily optimal dietary choice recommendations, and the user's dietary choices are optimized through state transfer and reward mechanisms.
[0124] The role of the future nutritional needs prediction model is to scientifically predict the user's future nutritional needs and formulate the best dietary recommendations based on this prediction. The LSTM model predicts the future by learning the user's historical data, while the MDP model helps users choose the best food every day based on these prediction results. In this way, users can not only know what they will need in the future, but also get a set of specific action guidelines to make dietary choices more scientific, reasonable and personalized.
[0125] S5. Combine the daily nutritional needs assessment results with the nutritional needs forecast results for a period of time in the future to generate the best personalized nutritional plan The goal of this step is to combine the user's daily nutritional needs assessment and future nutritional needs forecast results to generate a scientific and personalized nutritional plan. While meeting the user's nutritional needs, the plan also takes into account the user's health goals and personal dietary preferences. To this end, this embodiment uses multi-objective optimization techniques such as linear programming and genetic algorithms (GA) to ensure that the recommended plan finds the optimal balance between nutritional balance and personalization.
[0126] In this embodiment, the generation of personalized nutrition plan includes two main parts: linear programming (LP) is used to preliminarily determine the user's optimal daily nutrition intake, and genetic algorithm (GA) is used to further optimize the dietary plan so that it not only meets the nutritional needs but also meets the user's personalized preferences. The specific implementation is as follows.
[0127] 1. Linear programming model In this embodiment, a linear programming (LP) model is first used to preliminarily optimize the user's daily dietary plan. Linear programming is a mathematical optimization method that finds the optimal combination of variables under specific objective functions and constraints. In the present invention, linear programming is used to minimize the user's daily nutritional gap, thereby ensuring that the user's intake meets his or her assessed nutritional needs as much as possible.
[0128] Determine the objective function: The objective function is to minimize the user's daily nutrient gap to ensure that the user obtains sufficient protein, fat, carbohydrates and other micronutrients. The objective function can be expressed as:
[0129] in: Represents the total nutritional gap.
[0130] Indicates The weight of a certain nutrient gap in a food.
[0131] Indicates The intake of food.
[0132] Definition of constraints: During the optimization process, it is necessary to impose certain constraints on the dietary intake to ensure that the dietary plan is reasonable and meets nutritional standards. The constraint condition is expressed as:
[0133] in: Indicates Nutrients in food The content.
[0134] Indicates the user's preference for nutrients minimum demand.
[0135] Indicates the number of nutrients.
[0136] Model solution: The above objective function and constraints are solved by the simplex method or other linear programming algorithms to obtain a daily dietary plan, including the recommended intake of each food.
[0137] The linear programming model takes into account the nutritional content of various foods based on the user's nutritional needs and calculates how many types of food should be eaten each day to minimize nutritional gaps.
[0138] 2. Genetic Algorithm (GA) Model In this embodiment, in order to further personalize the dietary plan and ensure that the plan not only meets the nutritional needs of the user but also meets the user's dietary preferences, a genetic algorithm (GA) is used for multi-objective optimization. A genetic algorithm is an optimization algorithm based on natural selection and genetic mechanisms, which gradually finds the optimal solution by simulating the biological evolution process.
[0139] Individual coding: Encode the dietary plan and encode the intake of each food as an individual in the genetic algorithm. For example, the gene fragments of an individual can represent the intake of different types of food, and the encoding result of the individual is a complete daily dietary plan.
[0140] Definition of fitness function: The fitness function is used to measure the quality of a dietary plan. In this embodiment, the fitness function not only considers whether the nutrient intake meets the demand, but also considers the user's dietary preferences (such as preference or taboo for certain foods) and health goals (such as weight control, lowering blood lipids, etc.).
[0141] Genetic Operations: Selection: Select individuals with higher fitness from the current population to participate in mating to ensure that excellent solutions are retained first.
[0142] Crossover: Perform a crossover operation on selected individuals to generate new dietary plans through gene exchange, thereby increasing the diversity of the plans.
[0143] Mutation: Randomly mutate certain gene fragments of individuals to further increase the diversity of the population and avoid falling into a local optimal solution.
[0144] Iteration and optimization: After multiple generations of iterations, when the fitness function converges, the optimal dietary plan is output to ensure that the nutritional needs are met while meeting the user's personalized needs to the greatest extent.
[0145] The genetic algorithm gradually evolves the optimal dietary plan suitable for the user by continuously improving the initial dietary plan, which not only ensures adequate nutrition but also maximizes the user's taste and health goals.
[0146] In general, the process of this step is as follows: 1) Input nutritional needs assessment and prediction results: The user’s daily nutritional needs and future predicted changes in needs are taken as input.
[0147] 2) Linear programming to initially optimize dietary plans: Use linear programming methods to calculate dietary combinations that meet users’ daily nutritional needs and minimize nutritional gaps.
[0148] 3) Genetic algorithm further optimizes the plan: Based on the preliminary plan, iterative optimization is performed through genetic algorithm to ensure that the dietary plan not only meets nutritional needs but also conforms to the user's personalized dietary preferences and health goals.
[0149] The process of generating a personalized nutrition plan of the present invention first calculates a basic diet plan that meets nutritional needs through linear programming. This plan is like a "basic combination" to ensure that what the user eats every day contains enough nutrition. Then this basic plan is repeatedly improved through a genetic algorithm, just like constantly adjusting the proportion and combination of ingredients, and finally a set of diet plans that are both nutritious and in line with the user's taste are obtained. In this way, the user eats healthily every day and in line with his or her own eating habits and preferences.
[0150] The present invention generates high-quality key feature data by collecting and preprocessing multi-source data, combining the user's physiological, dietary and activity data, and using feature extraction and dimensionality reduction technology. The user's daily nutritional needs are refined by using multivariate linear regression, Bayesian network and causal inference models, and the future trend of nutritional needs is predicted by long-short-term memory network and Markov decision process. Finally, a personalized dietary plan that meets individual nutritional needs and health goals is generated by combining linear programming and genetic algorithms.
[0151] The nutrition assessment and prediction system based on big data described below and the nutrition assessment and prediction method based on big data described above can be referenced to each other.
[0152] Please refer to the attached Figure 3 The present invention also provides a nutrition assessment and prediction system based on big data, comprising: The data collection module 100 is used to collect the user's physiological data, diet records and activity data, and perform pre-processing; A feature extraction module 200 is used to extract key features related to nutritional requirements from the data; The nutritional needs assessment module 300 is used to assess the daily nutritional needs of the user; The future nutritional demand prediction module 400 is used to predict the future nutritional demand change trend of the user; The optimal nutrition plan generation module 500 is used to generate a nutrition plan that meets the user's personalized needs.
[0153] The system of this embodiment can be used to execute the above method embodiments, and its principles and technical effects are similar, which will not be repeated here.
[0154] Please refer to the attached Figure 4 The present invention further provides a computer device 40, comprising: a processor 41 and a memory 42, wherein the memory 42 stores a computer program executable by the processor, and when the computer program is executed by the processor, the above method is executed.
[0155] The present invention further provides a storage medium 43 on which a computer program is stored. When the computer program is run by the processor 41, the above method is executed.
[0156] Among them, the storage medium 43 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable red-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, disk or optical disk.
[0157] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A nutrition assessment and prediction method based on big data, characterized in that: The following steps are involved: Collect users' physiological data, dietary records, and activity data, and perform preprocessing; Perform feature extraction and dimension reduction on the preprocessed data to generate key feature data of the user; Based on the key characteristic data of users, a nutritional demand assessment model is used to assess the daily nutritional needs of users; Based on the assessed nutritional needs, a future demand prediction model is used to predict the nutritional needs of users in the future; Combine the daily nutritional needs assessment results with the nutritional needs forecast results for a period of time in the future to generate the optimal personalized nutrition plan.
2. The method for nutrition assessment and prediction based on big data according to claim 1, characterized in that: The data collection includes acquiring user data from multiple data sources, wherein the data sources include data collected by a smart wearable device, data recorded by a diet record application, and data manually entered by a user.
3. The nutrition assessment and prediction method based on big data according to claim 1, characterized in that: The feature extraction and dimension reduction step uses principal component analysis to reduce the dimension of high-dimensional features to extract main features that are highly relevant to nutritional requirements.
4. The method for nutrition assessment and prediction based on big data according to claim 1, characterized in that: The step of evaluating the user's daily nutritional needs by using a nutritional needs evaluation model based on the user's key feature data includes: A multivariate linear regression model is constructed based on the key characteristic data of the user, wherein the key characteristic data includes the user's age, gender, BMI, and activity level. The multivariate linear regression model is used to quantitatively estimate the nutritional needs of the user's physiological characteristics. The multivariate linear regression model is: in, For the Nutritional needs of each user, is the intercept term, is the regression coefficient, For the User's eigenvalues, is the error term; Based on the quantitative estimation of the multivariate linear regression model, a Bayesian network model is constructed, which regards the key feature data of the user as the conditional probability input to capture the implicit dependency of each key feature on nutritional needs. The Bayesian network model models the joint probability distribution of the user's daily nutritional needs. The conditional probability formula of the Bayesian network model is: in, represents the conditional probability of nutritional demand N under evidence E, is the likelihood function of evidence E under nutritional requirement N, P(N) is the prior probability of nutritional requirement N, and the Bayesian network model calculates the conditional probability of each key feature for nutritional requirement based on the joint probability distribution in the training data; The causal inference model is used to evaluate the impact of users' dietary behaviors on nutritional needs, and the double difference method is used to analyze the differences in nutritional needs of users under different dietary behaviors. The calculation formula of the double difference method is: in, The causal effect of dietary behavior on nutritional needs, represents the nutritional requirement value of the treatment group at the tth time point, represents the nutritional requirement value of the control group at the tth time point, represents the nutritional requirement value of the treatment group at the t-1th time point, Represents the nutritional requirement value of the control group at the t-1th time point.
5. The method for nutrition assessment and prediction based on big data according to claim 1, characterized in that: The step of using a future demand prediction model to predict the user's nutritional needs for a period of time in the future based on the assessed nutritional needs includes: Collect users’ historical nutrition data, including their daily nutrition intake, weight, activity data, and health indicators, and construct a time series dataset as model input; Using a long short-term memory network model to perform time series modeling on the user's historical data, the long short-term memory network model includes an input gate, a forget gate, and an output gate to capture the long-term trend and short-term fluctuation of the user's nutritional needs; Based on the output results of the long short-term memory network model, the user's nutritional needs in the future, including the intake needs of macronutrients and micronutrients, are predicted, providing data support for the generation of future personalized nutrition plans.
6. The method for nutrition assessment and prediction based on big data according to claim 5, characterized in that: The step of using a future demand prediction model to predict the user's nutritional needs for a period of time in the future based on the assessed nutritional needs also includes: Use the Markov decision process to model the user's daily nutritional needs. Treat the user's dietary choices as the state transition process of the Markov decision process. With the goal of minimizing the user's nutritional gap, construct a state transition matrix. The state, action and reward function are defined in the Markov decision process model, where the state represents the user's current nutritional needs, the action represents the user's dietary choices, and the reward function is used to measure whether the diet selected by the user meets the nutritional needs; The following value iteration formula is used to solve the Markov decision process model and determine the optimal action strategy in each state: in, Status The value function of For the status Next action Instant rewards, is the discount factor, Indicates that an action is being performed Back from state Transfer to state The probability of Based on the solution results of the Markov decision process model, a forecast of the user's future nutritional needs is generated, including the prediction of the user's possible nutritional status and nutrient gap in a specific time period, providing input basis for generating the optimal nutritional plan.
7. The method for nutrition assessment and prediction based on big data according to claim 1, characterized in that: The step of combining the daily nutritional needs assessment results with the nutritional needs prediction results for a period of time in the future to generate the optimal personalized nutritional plan includes: Based on the daily nutritional needs assessment results and the nutritional needs forecast results for a period of time in the future, a linear programming model is established, wherein the linear programming model takes minimizing the nutritional gap as the optimization goal to ensure that the nutrients consumed by the user daily meet their physiological needs; Determine the objective function of the linear programming model, which is: in, represents the total amount of nutritional gap, represents the weight of nutrient gap, Indicates the amount of food you eat; Constraints are set to ensure that daily nutritional requirements are met, the constraints being: in, Indicates Nutrients in food The content of Indicates the user's preference for nutrients The minimum demand, The number of nutrients is to ensure that the intake of each nutrient is not less than the set value; The simplex method is used to solve the linear programming model to obtain the optimal personalized dietary plan, including the recommended intake of each food, ensuring daily calorie balance and balance of macro- and micronutrients.
8. The method for nutrition assessment and prediction based on big data according to claim 7, characterized in that: The step of combining the daily nutritional needs assessment results and the nutritional needs prediction results for a period of time in the future to generate the optimal personalized nutritional plan also includes: Combined with the results of linear programming, the personalized dietary plan is further optimized using genetic algorithms, which are used to solve multi-objective optimization problems to ensure that the plan meets the user's health goals and dietary preferences while meeting nutritional needs; Individually encode the dietary plan, encode the intake of each food into individuals in the genetic algorithm, and use the fitness function to measure the degree to which the individual meets the nutritional needs and health goals. The fitness function includes calorie intake, nutritional balance and user preferences. Genetic operations, including selection, crossover, and mutation, are performed to simulate the process of biological evolution, generate a new generation of individuals, and improve the fitness of the dietary plan through multiple generations of iterations. The optimization objective functions include: Minimize daily nutrient gaps; Maximize user's meal satisfaction; When the fitness function converges, the final optimal dietary plan is outputted, which includes the amount of each type of food that the user should consume, ensuring that the user's dietary preferences and overall satisfaction are optimized on the basis of meeting the user's personalized nutritional needs and health goals.
9. A nutrition assessment and prediction system based on big data, applied to the nutrition assessment and prediction method based on big data as claimed in any one of claims 1 to 8, characterized in that: include: Data collection module, used to collect the user's physiological data, diet records and activity data, and perform pre-processing; Feature extraction module, used to extract key features related to nutritional requirements from the data; Nutritional needs assessment module, used to assess the user's daily nutritional needs; Future nutritional demand prediction module, used to predict the changing trend of users' future nutritional demand; The optimal nutrition plan generation module is used to generate a nutrition plan that meets the user's personalized needs.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the big data-based nutrition assessment and prediction method as described in any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Multi-food material nutrition proportioning method based on genetic algorithm
CN112069382A
Automated method and system for generating personalized dietary and health advice or recommendations for individual users
CN113196407A
Nutrition balance evaluation method and system of multi-label neural network for children
CN117133407A
Personalized intelligent recipe recommendation system based on personal diet record
CN118248285A
Cited By
Personalized intelligent catering method and system based on user condition
CN119851876A
A personalized intelligent meal distribution method and system based on user conditions
CN119851876B
Neural network-based postoperative diet intake nutrition evaluation system for weight loss surgery
CN120032808A
Personalized diet and exercise health management system fused with large model analysis capability
CN120260833A
Multi-modal data driven tourism demand causal inference method and system oriented to active policy making
CN120706636A